Changeset 1611 for trunk/sources
- Timestamp:
- 04/20/09 15:21:05 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Persistence.GUI/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence.GUI/3.3/PersistenceConfigurationForm.Designer.cs
r1530 r1611 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 System.Windows.Forms.Button updateButton;26 this.updateButton = new System.Windows.Forms.Button(); 27 27 this.configurationTabs = new System.Windows.Forms.TabControl(); 28 updateButton = new System.Windows.Forms.Button(); 28 this.buttonPanel = new System.Windows.Forms.TableLayoutPanel(); 29 this.resetButton = new System.Windows.Forms.Button(); 30 this.buttonPanel.SuspendLayout(); 29 31 this.SuspendLayout(); 30 32 // 31 33 // updateButton 32 34 // 33 updateButton.Dock = System.Windows.Forms.DockStyle.Bottom;34 updateButton.Location = new System.Drawing.Point(0, 555);35 updateButton.Name = "updateButton";36 updateButton.Size = new System.Drawing.Size(597, 25);37 updateButton.TabIndex = 1;38 updateButton.Text = "Define Configuration";39 updateButton.UseVisualStyleBackColor = true;40 updateButton.Click += new System.EventHandler(this.updateButton_Click);35 this.updateButton.Dock = System.Windows.Forms.DockStyle.Fill; 36 this.updateButton.Location = new System.Drawing.Point(296, 6); 37 this.updateButton.Name = "updateButton"; 38 this.updateButton.Size = new System.Drawing.Size(282, 25); 39 this.updateButton.TabIndex = 1; 40 this.updateButton.Text = "&Define"; 41 this.updateButton.UseVisualStyleBackColor = true; 42 this.updateButton.Click += new System.EventHandler(this.updateButton_Click); 41 43 // 42 44 // configurationTabs 43 45 // 44 this.configurationTabs.Dock = System.Windows.Forms.DockStyle.Fill; 45 this.configurationTabs.Location = new System.Drawing.Point(0, 0); 46 this.configurationTabs.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 47 | System.Windows.Forms.AnchorStyles.Left) 48 | System.Windows.Forms.AnchorStyles.Right))); 49 this.configurationTabs.Location = new System.Drawing.Point(0, -1); 46 50 this.configurationTabs.Name = "configurationTabs"; 47 51 this.configurationTabs.SelectedIndex = 0; 48 this.configurationTabs.Size = new System.Drawing.Size(5 97, 580);52 this.configurationTabs.Size = new System.Drawing.Size(584, 573); 49 53 this.configurationTabs.TabIndex = 0; 54 // 55 // buttonPanel 56 // 57 this.buttonPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 58 | System.Windows.Forms.AnchorStyles.Right))); 59 this.buttonPanel.AutoSize = true; 60 this.buttonPanel.CausesValidation = false; 61 this.buttonPanel.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.InsetDouble; 62 this.buttonPanel.ColumnCount = 2; 63 this.buttonPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); 64 this.buttonPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); 65 this.buttonPanel.Controls.Add(this.updateButton, 1, 0); 66 this.buttonPanel.Controls.Add(this.resetButton, 0, 0); 67 this.buttonPanel.Location = new System.Drawing.Point(0, 572); 68 this.buttonPanel.Name = "buttonPanel"; 69 this.buttonPanel.RowCount = 1; 70 this.buttonPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); 71 this.buttonPanel.Size = new System.Drawing.Size(584, 37); 72 this.buttonPanel.TabIndex = 2; 73 // 74 // resetButton 75 // 76 this.resetButton.Dock = System.Windows.Forms.DockStyle.Fill; 77 this.resetButton.Location = new System.Drawing.Point(6, 6); 78 this.resetButton.Name = "resetButton"; 79 this.resetButton.Size = new System.Drawing.Size(281, 25); 80 this.resetButton.TabIndex = 2; 81 this.resetButton.Text = "&Reset All"; 82 this.resetButton.UseVisualStyleBackColor = true; 83 this.resetButton.Click += new System.EventHandler(this.resetButton_Click); 50 84 // 51 85 // PersistenceConfigurationForm … … 53 87 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 54 88 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 55 this.ClientSize = new System.Drawing.Size(5 97, 580);56 this.Controls.Add( updateButton);89 this.ClientSize = new System.Drawing.Size(582, 609); 90 this.Controls.Add(this.buttonPanel); 57 91 this.Controls.Add(this.configurationTabs); 58 92 this.Name = "PersistenceConfigurationForm"; 59 this.Text = "PersistenceConfigurationForm"; 93 this.Text = "PersistenceConfigurationForm"; 94 this.buttonPanel.ResumeLayout(false); 60 95 this.ResumeLayout(false); 96 this.PerformLayout(); 61 97 62 98 } … … 65 101 66 102 private System.Windows.Forms.TabControl configurationTabs; 103 private System.Windows.Forms.TableLayoutPanel buttonPanel; 104 private System.Windows.Forms.Button resetButton; 105 private System.Windows.Forms.Button updateButton; 67 106 } 68 107 } -
trunk/sources/HeuristicLab.Persistence.GUI/3.3/PersistenceConfigurationForm.cs
r1566 r1611 20 20 private readonly Dictionary<string, Type> typeNameTable; 21 21 private readonly Dictionary<Type, string> reverseTypeNameTable; 22 private bool underConstruction; 22 23 23 24 public PersistenceConfigurationForm() { … … 28 29 typeNameTable = new Dictionary<string, Type>(); 29 30 reverseTypeNameTable = new Dictionary<Type, string>(); 31 underConstruction = true; 32 InitializeTooltips(); 30 33 InitializeNameTables(); 31 34 initializeConfigPages(); 32 35 UpdateFromConfigurationService(); 36 underConstruction = false; 37 UpdatePreview(); 38 } 39 40 private void InitializeTooltips() { 41 ToolTip tooltip = new ToolTip() { 42 AutoPopDelay = 5000, 43 InitialDelay = 1000, 44 ReshowDelay = 500, 45 ShowAlways = true 46 }; 47 tooltip.SetToolTip(resetButton, 48 "Clear all custom configurations from memory.\r\n" + 49 "The saved configuration will still be used next\r\n" + 50 "time if you don't save (define) this change."); 51 tooltip.SetToolTip(updateButton, 52 "Define configuration for currently active format\r\n" + 53 "and save to disk."); 33 54 } 34 55 … … 112 133 Name = "CheckBox", 113 134 Dock = DockStyle.Fill, 114 Enabled = false,115 135 }; 116 136 horizontalSplit.Panel2.Controls.Add(checkBox); … … 246 266 } 247 267 268 private void UpdatePreview() { 269 if (underConstruction) 270 return; 271 ListBox checkBox = (ListBox)GetActiveControl("CheckBox"); 272 IFormat activeFormat = (IFormat)configurationTabs.SelectedTab.Tag; 273 if (activeFormat != null && checkBox != null) { 274 checkBox.Items.Clear(); 275 Configuration activeConfig = GetActiveConfiguration(); 276 foreach (var formatter in activeConfig.Formatters) { 277 checkBox.Items.Add(formatter.GetType().Name + " (F)"); 278 } 279 foreach (var decomposer in activeConfig.Decomposers) 280 checkBox.Items.Add(decomposer.GetType().Name + " (D)"); 281 } 282 } 283 284 248 285 void gridView_CellValueChanged(object sender, DataGridViewCellEventArgs e) { 249 286 UpdatePreview(); … … 292 329 } 293 330 294 private void UpdatePreview() {295 ListBox checkBox = (ListBox)GetActiveControl("CheckBox");296 IFormat activeFormat = (IFormat)configurationTabs.SelectedTab.Tag;297 if (activeFormat != null && checkBox != null) {298 checkBox.Items.Clear();299 Configuration activeConfig = GetActiveConfiguration();300 foreach (var formatter in activeConfig.Formatters) {301 checkBox.Items.Add(formatter.GetType().Name + " (F)");302 }303 foreach (var decomposer in activeConfig.Decomposers)304 checkBox.Items.Add(decomposer.GetType().Name + " (D)");305 }306 }307 331 308 332 private void decomposerList_ItemChecked(object sender, ItemCheckedEventArgs e) { … … 370 394 } 371 395 396 private void resetButton_Click(object sender, EventArgs e) { 397 ConfigurationService.Instance.Reset(); 398 underConstruction = true; 399 UpdateFromConfigurationService(); 400 underConstruction = false; 401 UpdatePreview(); 402 } 403 372 404 } 373 405 -
trunk/sources/HeuristicLab.Persistence.GUI/3.3/PersistenceConfigurationForm.resx
r1530 r1611 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <metadata name="updateButton.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">121 <value>False</value>122 </metadata>123 120 </root>
Note: See TracChangeset
for help on using the changeset viewer.