Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12203


Ignore:
Timestamp:
03/16/15 14:36:54 (9 years ago)
Author:
pfleck
Message:

#2025

  • Collapse tree per default when opening.
  • Added Plugin and Version textboxes.
  • Moved expand/collapse-all buttons.
Location:
branches/NewItemDialog/HeuristicLab.Optimizer/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/NewItemDialog/HeuristicLab.Optimizer/3.3/NewItemDialog.Designer.cs

    r12202 r12203  
    5252      this.searchLabel = new System.Windows.Forms.Label();
    5353      this.splitContainer = new System.Windows.Forms.SplitContainer();
    54       this.expandAllButton = new System.Windows.Forms.Button();
    55       this.collapseAllButton = new System.Windows.Forms.Button();
     54      this.availableItemsGroupBox = new System.Windows.Forms.GroupBox();
    5655      this.searchTextBox = new System.Windows.Forms.TextBox();
    5756      this.typesTreeView = new System.Windows.Forms.TreeView();
    5857      this.imageList = new System.Windows.Forms.ImageList(this.components);
     58      this.descriptionGroupBox = new System.Windows.Forms.GroupBox();
     59      this.versionTextBox = new System.Windows.Forms.TextBox();
     60      this.pluginTextBox = new System.Windows.Forms.TextBox();
    5961      this.descriptionTextBox = new System.Windows.Forms.TextBox();
     62      this.expandAllButton = new System.Windows.Forms.Button();
     63      this.collapseAllButton = new System.Windows.Forms.Button();
    6064      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
    6165      this.splitContainer.Panel1.SuspendLayout();
    6266      this.splitContainer.Panel2.SuspendLayout();
    6367      this.splitContainer.SuspendLayout();
     68      this.availableItemsGroupBox.SuspendLayout();
     69      this.descriptionGroupBox.SuspendLayout();
    6470      this.SuspendLayout();
    6571      //
     
    7278      this.okButton.Name = "okButton";
    7379      this.okButton.Size = new System.Drawing.Size(75, 23);
    74       this.okButton.TabIndex = 2;
     80      this.okButton.TabIndex = 1;
    7581      this.okButton.Text = "&OK";
    7682      this.okButton.UseVisualStyleBackColor = true;
     
    8490      this.cancelButton.Name = "cancelButton";
    8591      this.cancelButton.Size = new System.Drawing.Size(75, 23);
    86       this.cancelButton.TabIndex = 3;
     92      this.cancelButton.TabIndex = 2;
    8793      this.cancelButton.Text = "&Cancel";
    8894      this.cancelButton.UseVisualStyleBackColor = true;
     
    9197      //
    9298      this.searchLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Zoom;
    93       this.searchLabel.Location = new System.Drawing.Point(57, 5);
     99      this.searchLabel.Location = new System.Drawing.Point(6, 17);
    94100      this.searchLabel.Name = "searchLabel";
    95101      this.searchLabel.Size = new System.Drawing.Size(20, 20);
     
    102108            | System.Windows.Forms.AnchorStyles.Left)
    103109            | System.Windows.Forms.AnchorStyles.Right)));
     110      this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
    104111      this.splitContainer.Location = new System.Drawing.Point(12, 12);
    105112      this.splitContainer.Name = "splitContainer";
     
    108115      // splitContainer.Panel1
    109116      //
    110       this.splitContainer.Panel1.Controls.Add(this.expandAllButton);
    111       this.splitContainer.Panel1.Controls.Add(this.collapseAllButton);
    112       this.splitContainer.Panel1.Controls.Add(this.searchLabel);
    113       this.splitContainer.Panel1.Controls.Add(this.searchTextBox);
    114       this.splitContainer.Panel1.Controls.Add(this.typesTreeView);
     117      this.splitContainer.Panel1.Controls.Add(this.availableItemsGroupBox);
    115118      //
    116119      // splitContainer.Panel2
    117120      //
    118       this.splitContainer.Panel2.Controls.Add(this.descriptionTextBox);
     121      this.splitContainer.Panel2.Controls.Add(this.descriptionGroupBox);
    119122      this.splitContainer.Size = new System.Drawing.Size(600, 391);
    120       this.splitContainer.SplitterDistance = 292;
     123      this.splitContainer.SplitterDistance = 258;
    121124      this.splitContainer.TabIndex = 0;
    122       //
    123       // expandAllButton
    124       //
    125       this.expandAllButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.ZoomIn;
    126       this.expandAllButton.Location = new System.Drawing.Point(3, 3);
    127       this.expandAllButton.Name = "expandAllButton";
    128       this.expandAllButton.Size = new System.Drawing.Size(23, 23);
    129       this.expandAllButton.TabIndex = 1;
    130       this.expandAllButton.UseVisualStyleBackColor = true;
    131       this.expandAllButton.Click += new System.EventHandler(this.expandAllButton_Click);
    132       //
    133       // collapseAllButton
    134       //
    135       this.collapseAllButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.ZoomOut;
    136       this.collapseAllButton.Location = new System.Drawing.Point(26, 3);
    137       this.collapseAllButton.Name = "collapseAllButton";
    138       this.collapseAllButton.Size = new System.Drawing.Size(23, 23);
    139       this.collapseAllButton.TabIndex = 2;
    140       this.collapseAllButton.UseVisualStyleBackColor = true;
    141       this.collapseAllButton.Click += new System.EventHandler(this.collapseAllButton_Click);
     125      this.splitContainer.TabStop = false;
     126      //
     127      // availableItemsGroupBox
     128      //
     129      this.availableItemsGroupBox.Controls.Add(this.searchLabel);
     130      this.availableItemsGroupBox.Controls.Add(this.searchTextBox);
     131      this.availableItemsGroupBox.Controls.Add(this.typesTreeView);
     132      this.availableItemsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
     133      this.availableItemsGroupBox.Location = new System.Drawing.Point(0, 0);
     134      this.availableItemsGroupBox.Name = "availableItemsGroupBox";
     135      this.availableItemsGroupBox.Padding = new System.Windows.Forms.Padding(3, 15, 3, 3);
     136      this.availableItemsGroupBox.Size = new System.Drawing.Size(600, 258);
     137      this.availableItemsGroupBox.TabIndex = 5;
     138      this.availableItemsGroupBox.TabStop = false;
     139      this.availableItemsGroupBox.Text = "Available Items";
    142140      //
    143141      // searchTextBox
    144142      //
    145       this.searchTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    146             | System.Windows.Forms.AnchorStyles.Right)));
    147       this.searchTextBox.Location = new System.Drawing.Point(83, 5);
     143      this.searchTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     144            | System.Windows.Forms.AnchorStyles.Left)
     145            | System.Windows.Forms.AnchorStyles.Right)));
     146      this.searchTextBox.Location = new System.Drawing.Point(32, 17);
    148147      this.searchTextBox.Name = "searchTextBox";
    149       this.searchTextBox.Size = new System.Drawing.Size(514, 20);
    150       this.searchTextBox.TabIndex = 3;
     148      this.searchTextBox.Size = new System.Drawing.Size(562, 20);
     149      this.searchTextBox.TabIndex = 1;
    151150      this.searchTextBox.TextChanged += new System.EventHandler(this.searchTextBox_TextChanged);
    152151      //
     
    159158      this.typesTreeView.ImageIndex = 0;
    160159      this.typesTreeView.ImageList = this.imageList;
    161       this.typesTreeView.Location = new System.Drawing.Point(3, 29);
     160      this.typesTreeView.Location = new System.Drawing.Point(6, 41);
    162161      this.typesTreeView.Name = "typesTreeView";
    163162      this.typesTreeView.SelectedImageIndex = 0;
    164163      this.typesTreeView.ShowNodeToolTips = true;
    165       this.typesTreeView.Size = new System.Drawing.Size(594, 260);
    166       this.typesTreeView.TabIndex = 4;
     164      this.typesTreeView.Size = new System.Drawing.Size(588, 211);
     165      this.typesTreeView.TabIndex = 2;
    167166      this.typesTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.itemsTreeView_AfterSelect);
    168167      this.typesTreeView.VisibleChanged += new System.EventHandler(this.itemsTreeView_VisibleChanged);
     
    175174      this.imageList.TransparentColor = System.Drawing.Color.Transparent;
    176175      //
     176      // descriptionGroupBox
     177      //
     178      this.descriptionGroupBox.Controls.Add(this.versionTextBox);
     179      this.descriptionGroupBox.Controls.Add(this.pluginTextBox);
     180      this.descriptionGroupBox.Controls.Add(this.descriptionTextBox);
     181      this.descriptionGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
     182      this.descriptionGroupBox.Location = new System.Drawing.Point(0, 0);
     183      this.descriptionGroupBox.Name = "descriptionGroupBox";
     184      this.descriptionGroupBox.Size = new System.Drawing.Size(600, 129);
     185      this.descriptionGroupBox.TabIndex = 1;
     186      this.descriptionGroupBox.TabStop = false;
     187      this.descriptionGroupBox.Text = "Description";
     188      //
     189      // versionTextBox
     190      //
     191      this.versionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     192      this.versionTextBox.Location = new System.Drawing.Point(444, 20);
     193      this.versionTextBox.Name = "versionTextBox";
     194      this.versionTextBox.ReadOnly = true;
     195      this.versionTextBox.Size = new System.Drawing.Size(150, 20);
     196      this.versionTextBox.TabIndex = 0;
     197      this.versionTextBox.TabStop = false;
     198      //
     199      // pluginTextBox
     200      //
     201      this.pluginTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     202            | System.Windows.Forms.AnchorStyles.Right)));
     203      this.pluginTextBox.Location = new System.Drawing.Point(6, 20);
     204      this.pluginTextBox.Name = "pluginTextBox";
     205      this.pluginTextBox.ReadOnly = true;
     206      this.pluginTextBox.Size = new System.Drawing.Size(432, 20);
     207      this.pluginTextBox.TabIndex = 0;
     208      this.pluginTextBox.TabStop = false;
     209      //
    177210      // descriptionTextBox
    178211      //
     212      this.descriptionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     213            | System.Windows.Forms.AnchorStyles.Left)
     214            | System.Windows.Forms.AnchorStyles.Right)));
    179215      this.descriptionTextBox.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
    180       this.descriptionTextBox.Location = new System.Drawing.Point(3, 3);
     216      this.descriptionTextBox.Location = new System.Drawing.Point(6, 46);
    181217      this.descriptionTextBox.Multiline = true;
    182218      this.descriptionTextBox.Name = "descriptionTextBox";
    183219      this.descriptionTextBox.ReadOnly = true;
    184220      this.descriptionTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
    185       this.descriptionTextBox.Size = new System.Drawing.Size(594, 89);
     221      this.descriptionTextBox.Size = new System.Drawing.Size(588, 77);
    186222      this.descriptionTextBox.TabIndex = 0;
     223      this.descriptionTextBox.TabStop = false;
     224      //
     225      // expandAllButton
     226      //
     227      this.expandAllButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     228      this.expandAllButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.ZoomIn;
     229      this.expandAllButton.Location = new System.Drawing.Point(12, 409);
     230      this.expandAllButton.Name = "expandAllButton";
     231      this.expandAllButton.Size = new System.Drawing.Size(23, 23);
     232      this.expandAllButton.TabIndex = 0;
     233      this.expandAllButton.TabStop = false;
     234      this.expandAllButton.UseVisualStyleBackColor = true;
     235      this.expandAllButton.Click += new System.EventHandler(this.expandAllButton_Click);
     236      //
     237      // collapseAllButton
     238      //
     239      this.collapseAllButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     240      this.collapseAllButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.ZoomOut;
     241      this.collapseAllButton.Location = new System.Drawing.Point(41, 409);
     242      this.collapseAllButton.Name = "collapseAllButton";
     243      this.collapseAllButton.Size = new System.Drawing.Size(23, 23);
     244      this.collapseAllButton.TabIndex = 0;
     245      this.collapseAllButton.TabStop = false;
     246      this.collapseAllButton.UseVisualStyleBackColor = true;
     247      this.collapseAllButton.Click += new System.EventHandler(this.collapseAllButton_Click);
    187248      //
    188249      // NewItemDialog
     
    195256      this.Controls.Add(this.cancelButton);
    196257      this.Controls.Add(this.okButton);
     258      this.Controls.Add(this.expandAllButton);
     259      this.Controls.Add(this.collapseAllButton);
    197260      this.MaximizeBox = false;
    198261      this.MinimizeBox = false;
     
    206269      this.Shown += new System.EventHandler(this.NewItemDialog_Shown);
    207270      this.splitContainer.Panel1.ResumeLayout(false);
    208       this.splitContainer.Panel1.PerformLayout();
    209271      this.splitContainer.Panel2.ResumeLayout(false);
    210       this.splitContainer.Panel2.PerformLayout();
    211272      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
    212273      this.splitContainer.ResumeLayout(false);
     274      this.availableItemsGroupBox.ResumeLayout(false);
     275      this.availableItemsGroupBox.PerformLayout();
     276      this.descriptionGroupBox.ResumeLayout(false);
     277      this.descriptionGroupBox.PerformLayout();
    213278      this.ResumeLayout(false);
    214279
     
    228293    private System.Windows.Forms.Button expandAllButton;
    229294    private System.Windows.Forms.Button collapseAllButton;
     295    private System.Windows.Forms.GroupBox availableItemsGroupBox;
     296    private System.Windows.Forms.GroupBox descriptionGroupBox;
     297    private System.Windows.Forms.TextBox versionTextBox;
     298    private System.Windows.Forms.TextBox pluginTextBox;
    230299  }
    231300}
  • branches/NewItemDialog/HeuristicLab.Optimizer/3.3/NewItemDialog.cs

    r12202 r12203  
    3030  internal partial class NewItemDialog : Form {
    3131    private bool isInitialized;
    32     private bool firstShown = true;
    3332
    3433    private List<TreeNode> treeNodes;
     
    113112    private void NewItemDialog_Shown(object sender, EventArgs e) {
    114113      SelectedType = null;
    115       if (firstShown) {
    116         searchTextBox.Focus();
    117         firstShown = false;
    118       }
    119114    }
    120115
     
    183178        if (category != null) {
    184179          descriptionTextBox.Text = category;
     180          pluginTextBox.Text = string.Empty;
     181          versionTextBox.Text = string.Empty;
    185182        }
    186183        Type type = typesTreeView.SelectedNode.Tag as Type;
    187184        if (type != null) {
    188185          string description = ItemAttribute.GetDescription(type);
     186          var version = ItemAttribute.GetVersion(type);
     187          var plugin = ApplicationManager.Manager.GetDeclaringPlugin(type);
    189188          if (description != null)
    190189            descriptionTextBox.Text = description;
     190          if (plugin != null)
     191            pluginTextBox.Text = plugin.Name;
     192          if (version != null)
     193            versionTextBox.Text = version.ToString();
    191194        }
    192195      } else if (typesTreeView.Nodes.Count == 0) {
    193196        descriptionTextBox.Text = "No types found";
     197        pluginTextBox.Text = string.Empty;
     198        versionTextBox.Text = string.Empty;
    194199      }
    195200    }
     
    233238    }
    234239    private void SetTreeNodeVisibility() {
    235       typesTreeView.ExpandAll();
    236240      TreeNode selectedNode = typesTreeView.SelectedNode;
    237       if (selectedNode != null) {
    238         typesTreeView.SelectedNode = selectedNode;
    239         selectedNode.EnsureVisible();
    240       } else if (string.IsNullOrEmpty(currentSearchString) && typesTreeView.Nodes.Count > 1) {
    241         typesTreeView.Nodes[0].EnsureVisible();
    242       }
     241      if (string.IsNullOrEmpty(currentSearchString) && (typesTreeView.Nodes.Count > 1)) {
     242        typesTreeView.CollapseAll();
     243        if (selectedNode != null) typesTreeView.SelectedNode = selectedNode;
     244      } else {
     245        typesTreeView.ExpandAll();
     246      }
     247      if (selectedNode != null) selectedNode.EnsureVisible();
    243248    }
    244249    #endregion
Note: See TracChangeset for help on using the changeset viewer.