Changeset 1237 for trunk/sources/HeuristicLab.Visualization/Options
- Timestamp:
- 03/02/09 17:12:35 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Visualization/Options
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/Options
-
Property
svn:ignore
set to
*.bak
-
Property
svn:ignore
set to
-
trunk/sources/HeuristicLab.Visualization/Options/OptionsDialog.Designer.cs
r1195 r1237 37 37 this.label3 = new System.Windows.Forms.Label(); 38 38 this.tabPage2 = new System.Windows.Forms.TabPage(); 39 this.labelposition = new System.Windows.Forms.Label(); 39 40 this.cbLabelPosition = new System.Windows.Forms.ComboBox(); 40 41 this.OptionsDialogCancelButton = new System.Windows.Forms.Button(); 41 42 this.OptionsDialogOkButton = new System.Windows.Forms.Button(); 42 this. labelposition = new System.Windows.Forms.Label();43 this.OptionsDialogApplyBtn = new System.Windows.Forms.Button(); 43 44 this.Optionstabs.SuspendLayout(); 44 45 this.tabPage1.SuspendLayout(); … … 82 83 this.OptionsDialogSelectColorBt.Text = "Select"; 83 84 this.OptionsDialogSelectColorBt.UseVisualStyleBackColor = true; 84 this.OptionsDialogSelectColorBt.Click += new System.EventHandler(this. button1_Click);85 this.OptionsDialogSelectColorBt.Click += new System.EventHandler(this.OptionsDialogSelectColorBtn_Click); 85 86 // 86 87 // ColorPreviewTB … … 103 104 // LinestyleCB 104 105 // 106 this.LinestyleCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 105 107 this.LinestyleCB.FormattingEnabled = true; 106 108 this.LinestyleCB.Location = new System.Drawing.Point(146, 73); … … 120 122 // LineSelectCB 121 123 // 124 this.LineSelectCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 122 125 this.LineSelectCB.FormattingEnabled = true; 123 126 this.LineSelectCB.Location = new System.Drawing.Point(146, 30); … … 150 153 // LineThicknessCB 151 154 // 155 this.LineThicknessCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 152 156 this.LineThicknessCB.FormattingEnabled = true; 153 157 this.LineThicknessCB.Location = new System.Drawing.Point(142, 46); … … 177 181 this.tabPage2.UseVisualStyleBackColor = true; 178 182 // 183 // labelposition 184 // 185 this.labelposition.AutoSize = true; 186 this.labelposition.Location = new System.Drawing.Point(8, 38); 187 this.labelposition.Name = "labelposition"; 188 this.labelposition.Size = new System.Drawing.Size(72, 13); 189 this.labelposition.TabIndex = 1; 190 this.labelposition.Text = "Labelposition:"; 191 // 179 192 // cbLabelPosition 180 193 // 194 this.cbLabelPosition.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 181 195 this.cbLabelPosition.FormattingEnabled = true; 182 196 this.cbLabelPosition.Items.AddRange(new object[] { … … 202 216 // OptionsDialogOkButton 203 217 // 204 this.OptionsDialogOkButton.Location = new System.Drawing.Point( 132, 232);218 this.OptionsDialogOkButton.Location = new System.Drawing.Point(43, 232); 205 219 this.OptionsDialogOkButton.Name = "OptionsDialogOkButton"; 206 220 this.OptionsDialogOkButton.Size = new System.Drawing.Size(75, 23); … … 210 224 this.OptionsDialogOkButton.Click += new System.EventHandler(this.OptionsDialogOkButton_Click); 211 225 // 212 // labelposition 213 // 214 this.labelposition.AutoSize = true; 215 this.labelposition.Location = new System.Drawing.Point(8, 38); 216 this.labelposition.Name = "labelposition"; 217 this.labelposition.Size = new System.Drawing.Size(72, 13); 218 this.labelposition.TabIndex = 1; 219 this.labelposition.Text = "Labelposition:"; 226 // OptionsDialogApplyBtn 227 // 228 this.OptionsDialogApplyBtn.Location = new System.Drawing.Point(128, 231); 229 this.OptionsDialogApplyBtn.Name = "OptionsDialogApplyBtn"; 230 this.OptionsDialogApplyBtn.Size = new System.Drawing.Size(75, 23); 231 this.OptionsDialogApplyBtn.TabIndex = 3; 232 this.OptionsDialogApplyBtn.Text = "Apply"; 233 this.OptionsDialogApplyBtn.UseVisualStyleBackColor = true; 234 this.OptionsDialogApplyBtn.Click += new System.EventHandler(this.OptionsDialogApplyBtn_Click); 220 235 // 221 236 // OptionsDialog … … 224 239 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 225 240 this.ClientSize = new System.Drawing.Size(292, 266); 241 this.Controls.Add(this.OptionsDialogApplyBtn); 226 242 this.Controls.Add(this.OptionsDialogOkButton); 227 243 this.Controls.Add(this.OptionsDialogCancelButton); … … 262 278 private System.Windows.Forms.ComboBox cbLabelPosition; 263 279 private System.Windows.Forms.Label labelposition; 280 private System.Windows.Forms.Button OptionsDialogApplyBtn; 264 281 } 265 282 } -
trunk/sources/HeuristicLab.Visualization/Options/OptionsDialog.cs
r1233 r1237 5 5 namespace HeuristicLab.Visualization.Options { 6 6 public partial class OptionsDialog : Form { 7 private LineChart lc;7 private readonly LineChart lc; 8 8 9 9 public OptionsDialog(LineChart lc) { … … 12 12 } 13 13 14 private void button1_Click(object sender, EventArgs e) {14 private void OptionsDialogSelectColorBtn_Click(object sender, EventArgs e) { 15 15 ColorDialog dlg = new ColorDialog(); 16 16 dlg.ShowDialog(); 17 this.ColorPreviewTB.BackColor = dlg.Color;17 ColorPreviewTB.BackColor = dlg.Color; 18 18 } 19 19 20 20 public IList<int> GetThicknesses() { 21 return new List<int> (){0, 1, 2, 3, 4, 5, 6, 7, 8};21 return new List<int> {0, 1, 2, 3, 4, 5, 6, 7, 8}; 22 22 } 23 23 24 24 public IList<DrawingStyle> GetStyles() { 25 return new List<DrawingStyle> (){DrawingStyle.Solid, DrawingStyle.Dashed};25 return new List<DrawingStyle> {DrawingStyle.Solid, DrawingStyle.Dashed}; 26 26 } 27 27 28 28 private void OptionsDialog_Load(object sender, EventArgs e) { 29 this.LineSelectCB.DataSource = lc.GetRows(); 30 this.LineSelectCB.DisplayMember = "Label"; 29 if (lc.GetRows().Count != 0) { 30 LineSelectCB.DataSource = lc.GetRows(); 31 LineSelectCB.DisplayMember = "Label"; 31 32 32 LineThicknessCB.DataSource = GetThicknesses(); 33 LinestyleCB.DataSource = GetStyles(); 34 LineSelectCB.SelectedIndex = 0; 35 LineSelectCB_SelectedIndexChanged(this, null); 33 LineThicknessCB.DataSource = GetThicknesses(); 34 LinestyleCB.DataSource = GetStyles(); 35 LineSelectCB.SelectedIndex = 0; 36 LineSelectCB_SelectedIndexChanged(this, null); 37 } 36 38 } 37 39 38 40 private void LineSelectCB_SelectedIndexChanged(object sender, EventArgs e) { 39 IDataRow datarow = (IDataRow)this.LineSelectCB.SelectedValue; 40 41 int index = this.LineThicknessCB.FindStringExact(datarow.Thickness.ToString()); 42 this.LineThicknessCB.SelectedIndex = index; 43 index = this.LinestyleCB.FindStringExact(datarow.Style.ToString()); 44 LinestyleCB.SelectedIndex = index; 45 this.ColorPreviewTB.BackColor = datarow.Color; 41 if (LineSelectCB.SelectedValue != null) { 42 int index = 43 LineThicknessCB.FindStringExact(((IDataRow) LineSelectCB.SelectedValue).Thickness.ToString()); 44 LineThicknessCB.SelectedIndex = index; 45 index = LinestyleCB.FindStringExact(((IDataRow) LineSelectCB.SelectedValue).Style.ToString()); 46 LinestyleCB.SelectedIndex = index; 47 ColorPreviewTB.BackColor = ((IDataRow) LineSelectCB.SelectedValue).Color; 48 } 46 49 } 47 50 48 51 private void OptionsDialogCancelButton_Click(object sender, EventArgs e) { 49 this.Close();52 Close(); 50 53 } 51 54 52 55 private void OptionsDialogOkButton_Click(object sender, EventArgs e) { 53 IDataRow datarow = (IDataRow)this.LineSelectCB.SelectedValue; 56 if (LineSelectCB.SelectedValue != null) { 57 ((IDataRow) LineSelectCB.SelectedValue).Thickness = (int) LineThicknessCB.SelectedItem; 58 ((IDataRow) LineSelectCB.SelectedValue).Color = ColorPreviewTB.BackColor; 59 ((IDataRow) LineSelectCB.SelectedValue).Style = (DrawingStyle) LinestyleCB.SelectedItem; 60 } 61 Close(); 62 } 54 63 55 datarow.Thickness = (int)this.LineThicknessCB.SelectedItem;56 datarow.Color = this.ColorPreviewTB.BackColor;57 datarow.Style = (DrawingStyle)this.LineThicknessCB.SelectedItem;58 59 this.lc.ApplyChangesToRow(datarow);60 this.Close();64 private void OptionsDialogApplyBtn_Click(object sender, EventArgs e) { 65 if (LineSelectCB.SelectedValue != null) { 66 ((IDataRow) LineSelectCB.SelectedValue).Thickness = (int) LineThicknessCB.SelectedItem; 67 ((IDataRow) LineSelectCB.SelectedValue).Color = ColorPreviewTB.BackColor; 68 ((IDataRow) LineSelectCB.SelectedValue).Style = (DrawingStyle) LinestyleCB.SelectedItem; 69 } 61 70 } 62 71 }
Note: See TracChangeset
for help on using the changeset viewer.