Changeset 9920


Ignore:
Timestamp:
09/02/13 12:25:39 (8 years ago)
Author:
ascheibe
Message:

#2100 moved help system from View to ViewHost

Location:
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewHost.Designer.cs

    r9456 r9920  
    5151      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    5252      this.configurationLabel = new System.Windows.Forms.Label();
     53      this.helpLabel = new System.Windows.Forms.Label();
    5354      this.SuspendLayout();
    5455      //
     
    7374      this.viewsLabel.Size = new System.Drawing.Size(16, 16);
    7475      this.viewsLabel.TabIndex = 0;
    75       this.toolTip.SetToolTip(this.viewsLabel,
    76         "Double-click to open a new window of the current view." + System.Environment.NewLine +
    77         "Right-click to change current view." + System.Environment.NewLine +
    78         "Drag icon to copy or link content to another view.");
     76      this.toolTip.SetToolTip(this.viewsLabel, "Double-click to open a new window of the current view.\r\nRight-click to change cur" +
     77        "rent view.\r\nDrag icon to copy or link content to another view.");
    7978      this.viewsLabel.DoubleClick += new System.EventHandler(this.viewsLabel_DoubleClick);
    8079      this.viewsLabel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.viewsLabel_MouseDown);
     
    102101      this.configurationLabel.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.configurationLabel_DoubleClick);
    103102      //
     103      // helpLabel
     104      //
     105      this.helpLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     106      this.helpLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Help;
     107      this.helpLabel.Location = new System.Drawing.Point(211, 44);
     108      this.helpLabel.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
     109      this.helpLabel.Name = "helpLabel";
     110      this.helpLabel.Size = new System.Drawing.Size(16, 16);
     111      this.helpLabel.TabIndex = 3;
     112      this.toolTip.SetToolTip(this.helpLabel, "Double-click to open help.");
     113      this.helpLabel.Visible = false;
     114      this.helpLabel.DoubleClick += new System.EventHandler(this.helpLabel_DoubleClick);
     115      //
    104116      // ViewHost
    105117      //
    106118      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    107119      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
     120      this.Controls.Add(this.helpLabel);
    108121      this.Controls.Add(this.viewsLabel);
    109122      this.Controls.Add(this.configurationLabel);
     
    121134    private HeuristicLab.MainForm.WindowsForms.ViewContextMenuStrip viewContextMenuStrip;
    122135    private System.Windows.Forms.Label configurationLabel;
     136    private System.Windows.Forms.Label helpLabel;
    123137
    124138  }
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewHost.cs

    r9456 r9920  
    103103          configurationLabel.Visible = activeView is IConfigureableView;
    104104          configurationLabel.Enabled = activeView != null && !activeView.Locked;
     105
     106          if (activeView != null && ViewAttribute.HasHelpResourcePath(activeView.GetType())) {
     107            if (configurationLabel.Visible) {
     108              helpLabel.Top = 44;
     109            } else {
     110              helpLabel.Top = 22;
     111            }
     112            helpLabel.Visible = true;
     113          } else {
     114            helpLabel.Visible = false;
     115            helpLabel.Top = 44;
     116          }
    105117        }
    106118      }
     
    302314      ((IConfigureableView)ActiveView).ShowConfiguration();
    303315    }
     316
     317    private void helpLabel_DoubleClick(object sender, EventArgs e) {
     318      using (InfoBox dialog = new InfoBox("Help for " + ViewAttribute.GetViewName(ActiveView.GetType()), ViewAttribute.GetHelpResourcePath(ActiveView.GetType()), ActiveView)) {
     319        dialog.ShowDialog(this);
     320      }
     321    }
    304322    #endregion
    305323  }
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Views/View.Designer.cs

    r9915 r9920  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       this.components = new System.ComponentModel.Container();
    48       this.helpLabel = new System.Windows.Forms.Label();
    49       this.helpToolTip = new System.Windows.Forms.ToolTip(this.components);
    5047      this.SuspendLayout();
    5148      //
    52       // helpLabel
     49      // ViewBase
    5350      //
    54       this.helpLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    55       this.helpLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Help;
    56       this.helpLabel.Location = new System.Drawing.Point(131, 0);
    57       this.helpLabel.Name = "helpLabel";
    58       this.helpLabel.Size = new System.Drawing.Size(16, 16);
    59       this.helpLabel.TabIndex = 0;
    60       this.helpToolTip.SetToolTip(this.helpLabel, "Double Click to Show Help");
    61       this.helpLabel.Visible = false;
    62       this.helpLabel.DoubleClick += new System.EventHandler(this.helpLabel_DoubleClick);
    63       //
    64       // View
    65       //
     51      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    6652      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    67       this.Controls.Add(this.helpLabel);
    68       this.Name = "View";
     53      this.Name = "ViewBase";
    6954      this.Load += new System.EventHandler(this.View_Load);
    7055      this.ResumeLayout(false);
     
    7358
    7459    #endregion
    75 
    76     protected System.Windows.Forms.Label helpLabel;
    77     protected System.Windows.Forms.ToolTip helpToolTip;
    78 
    7960  }
    8061}
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Views/View.cs

    r9915 r9920  
    3838      else
    3939        this.Caption = "View";
    40 
    41       if (ViewAttribute.HasHelpResourcePath((this.GetType())))
    42         helpLabel.Visible = true;
    4340    }
    4441
     
    264261        ((Control)this).ResumeRepaint(refresh);
    265262    }
    266 
    267     protected void helpLabel_DoubleClick(object sender, EventArgs e) {
    268       using (InfoBox dialog = new InfoBox("Help for " + ViewAttribute.GetViewName(this.GetType()), ViewAttribute.GetHelpResourcePath(this.GetType()), this)) {
    269         dialog.ShowDialog(this);
    270       }
    271     }
    272263  }
    273264}
Note: See TracChangeset for help on using the changeset viewer.