Changeset 12203 for branches/NewItemDialog
- Timestamp:
- 03/16/15 14:36:54 (10 years ago)
- 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 52 52 this.searchLabel = new System.Windows.Forms.Label(); 53 53 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(); 56 55 this.searchTextBox = new System.Windows.Forms.TextBox(); 57 56 this.typesTreeView = new System.Windows.Forms.TreeView(); 58 57 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(); 59 61 this.descriptionTextBox = new System.Windows.Forms.TextBox(); 62 this.expandAllButton = new System.Windows.Forms.Button(); 63 this.collapseAllButton = new System.Windows.Forms.Button(); 60 64 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 61 65 this.splitContainer.Panel1.SuspendLayout(); 62 66 this.splitContainer.Panel2.SuspendLayout(); 63 67 this.splitContainer.SuspendLayout(); 68 this.availableItemsGroupBox.SuspendLayout(); 69 this.descriptionGroupBox.SuspendLayout(); 64 70 this.SuspendLayout(); 65 71 // … … 72 78 this.okButton.Name = "okButton"; 73 79 this.okButton.Size = new System.Drawing.Size(75, 23); 74 this.okButton.TabIndex = 2;80 this.okButton.TabIndex = 1; 75 81 this.okButton.Text = "&OK"; 76 82 this.okButton.UseVisualStyleBackColor = true; … … 84 90 this.cancelButton.Name = "cancelButton"; 85 91 this.cancelButton.Size = new System.Drawing.Size(75, 23); 86 this.cancelButton.TabIndex = 3;92 this.cancelButton.TabIndex = 2; 87 93 this.cancelButton.Text = "&Cancel"; 88 94 this.cancelButton.UseVisualStyleBackColor = true; … … 91 97 // 92 98 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); 94 100 this.searchLabel.Name = "searchLabel"; 95 101 this.searchLabel.Size = new System.Drawing.Size(20, 20); … … 102 108 | System.Windows.Forms.AnchorStyles.Left) 103 109 | System.Windows.Forms.AnchorStyles.Right))); 110 this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; 104 111 this.splitContainer.Location = new System.Drawing.Point(12, 12); 105 112 this.splitContainer.Name = "splitContainer"; … … 108 115 // splitContainer.Panel1 109 116 // 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); 115 118 // 116 119 // splitContainer.Panel2 117 120 // 118 this.splitContainer.Panel2.Controls.Add(this.description TextBox);121 this.splitContainer.Panel2.Controls.Add(this.descriptionGroupBox); 119 122 this.splitContainer.Size = new System.Drawing.Size(600, 391); 120 this.splitContainer.SplitterDistance = 2 92;123 this.splitContainer.SplitterDistance = 258; 121 124 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"; 142 140 // 143 141 // searchTextBox 144 142 // 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); 148 147 this.searchTextBox.Name = "searchTextBox"; 149 this.searchTextBox.Size = new System.Drawing.Size(5 14, 20);150 this.searchTextBox.TabIndex = 3;148 this.searchTextBox.Size = new System.Drawing.Size(562, 20); 149 this.searchTextBox.TabIndex = 1; 151 150 this.searchTextBox.TextChanged += new System.EventHandler(this.searchTextBox_TextChanged); 152 151 // … … 159 158 this.typesTreeView.ImageIndex = 0; 160 159 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); 162 161 this.typesTreeView.Name = "typesTreeView"; 163 162 this.typesTreeView.SelectedImageIndex = 0; 164 163 this.typesTreeView.ShowNodeToolTips = true; 165 this.typesTreeView.Size = new System.Drawing.Size(5 94, 260);166 this.typesTreeView.TabIndex = 4;164 this.typesTreeView.Size = new System.Drawing.Size(588, 211); 165 this.typesTreeView.TabIndex = 2; 167 166 this.typesTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.itemsTreeView_AfterSelect); 168 167 this.typesTreeView.VisibleChanged += new System.EventHandler(this.itemsTreeView_VisibleChanged); … … 175 174 this.imageList.TransparentColor = System.Drawing.Color.Transparent; 176 175 // 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 // 177 210 // descriptionTextBox 178 211 // 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))); 179 215 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); 181 217 this.descriptionTextBox.Multiline = true; 182 218 this.descriptionTextBox.Name = "descriptionTextBox"; 183 219 this.descriptionTextBox.ReadOnly = true; 184 220 this.descriptionTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; 185 this.descriptionTextBox.Size = new System.Drawing.Size(5 94, 89);221 this.descriptionTextBox.Size = new System.Drawing.Size(588, 77); 186 222 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); 187 248 // 188 249 // NewItemDialog … … 195 256 this.Controls.Add(this.cancelButton); 196 257 this.Controls.Add(this.okButton); 258 this.Controls.Add(this.expandAllButton); 259 this.Controls.Add(this.collapseAllButton); 197 260 this.MaximizeBox = false; 198 261 this.MinimizeBox = false; … … 206 269 this.Shown += new System.EventHandler(this.NewItemDialog_Shown); 207 270 this.splitContainer.Panel1.ResumeLayout(false); 208 this.splitContainer.Panel1.PerformLayout();209 271 this.splitContainer.Panel2.ResumeLayout(false); 210 this.splitContainer.Panel2.PerformLayout();211 272 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 212 273 this.splitContainer.ResumeLayout(false); 274 this.availableItemsGroupBox.ResumeLayout(false); 275 this.availableItemsGroupBox.PerformLayout(); 276 this.descriptionGroupBox.ResumeLayout(false); 277 this.descriptionGroupBox.PerformLayout(); 213 278 this.ResumeLayout(false); 214 279 … … 228 293 private System.Windows.Forms.Button expandAllButton; 229 294 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; 230 299 } 231 300 } -
branches/NewItemDialog/HeuristicLab.Optimizer/3.3/NewItemDialog.cs
r12202 r12203 30 30 internal partial class NewItemDialog : Form { 31 31 private bool isInitialized; 32 private bool firstShown = true;33 32 34 33 private List<TreeNode> treeNodes; … … 113 112 private void NewItemDialog_Shown(object sender, EventArgs e) { 114 113 SelectedType = null; 115 if (firstShown) {116 searchTextBox.Focus();117 firstShown = false;118 }119 114 } 120 115 … … 183 178 if (category != null) { 184 179 descriptionTextBox.Text = category; 180 pluginTextBox.Text = string.Empty; 181 versionTextBox.Text = string.Empty; 185 182 } 186 183 Type type = typesTreeView.SelectedNode.Tag as Type; 187 184 if (type != null) { 188 185 string description = ItemAttribute.GetDescription(type); 186 var version = ItemAttribute.GetVersion(type); 187 var plugin = ApplicationManager.Manager.GetDeclaringPlugin(type); 189 188 if (description != null) 190 189 descriptionTextBox.Text = description; 190 if (plugin != null) 191 pluginTextBox.Text = plugin.Name; 192 if (version != null) 193 versionTextBox.Text = version.ToString(); 191 194 } 192 195 } else if (typesTreeView.Nodes.Count == 0) { 193 196 descriptionTextBox.Text = "No types found"; 197 pluginTextBox.Text = string.Empty; 198 versionTextBox.Text = string.Empty; 194 199 } 195 200 } … … 233 238 } 234 239 private void SetTreeNodeVisibility() { 235 typesTreeView.ExpandAll();236 240 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(); 243 248 } 244 249 #endregion
Note: See TracChangeset
for help on using the changeset viewer.