Changeset 1885
- Timestamp:
- 05/23/09 11:08:42 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization.Test/3.2/LineChartTests.cs
r1884 r1885 79 79 IDataRow row3 = new DataRow(); 80 80 81 model.XAxis.Label = "X Axis"; 82 model.XAxis.ShowLabel = true; 83 model.XAxis.ShowGrid = true; 84 model.XAxis.GridColor = Color.Blue; 85 81 86 YAxisDescriptor yaxis1 = model.DefaultYAxis; 82 87 YAxisDescriptor yaxis2 = new YAxisDescriptor(); 83 84 model.XAxis.Label = "X Axis";85 model.XAxis.ShowLabel = true;86 88 87 89 yaxis1.Label = "Y-Axis 1"; … … 130 132 }; 131 133 132 f.ShowDialog();133 }134 135 [Test]136 public void TestGridX() {137 LineChartTestForm f = new LineChartTestForm(model);138 IDataRow row1 = new DataRow();139 model.AddDataRow(row1);140 141 model.XAxis.ShowGrid = false;142 143 Random rand = new Random(42);144 for (int i = 0; i < 10; i++) {145 row1.AddValue(rand.NextDouble() * 10);146 }147 134 f.ShowDialog(); 148 135 } -
trunk/sources/HeuristicLab.Visualization/3.2/HeuristicLab.Visualization-3.2.csproj
r1883 r1885 115 115 <Compile Include="LabelProvider\ContinuousLabelProvider.cs" /> 116 116 <Compile Include="LabelProvider\DiscreteLabelProvider.cs" /> 117 <Compile Include="Options\ColorSelection.cs"> 118 <SubType>UserControl</SubType> 119 </Compile> 120 <Compile Include="Options\ColorSelection.Designer.cs"> 121 <DependentUpon>ColorSelection.cs</DependentUpon> 122 </Compile> 117 123 <Compile Include="XAxisDescriptor.cs" /> 118 124 <Compile Include="YAxisGrid.cs" /> … … 197 203 <SubType>Designer</SubType> 198 204 </EmbeddedResource> 205 <EmbeddedResource Include="Options\ColorSelection.resx"> 206 <DependentUpon>ColorSelection.cs</DependentUpon> 207 </EmbeddedResource> 199 208 <EmbeddedResource Include="Options\Options.resx"> 200 209 <DependentUpon>Options.cs</DependentUpon> -
trunk/sources/HeuristicLab.Visualization/3.2/LineChart.cs
r1883 r1885 101 101 102 102 if (model.XAxis.ShowGrid) { 103 xAxisGrid.Color = model.XAxis.GridColor; 103 104 canvas.AddShape(xAxisGrid); 104 105 } -
trunk/sources/HeuristicLab.Visualization/3.2/Options/Options.Designer.cs
r1876 r1885 26 26 this.Optionstabs = new System.Windows.Forms.TabControl(); 27 27 this.tabPage1 = new System.Windows.Forms.TabPage(); 28 this.OptionsDialogSelectColorBtn = new System.Windows.Forms.Button();29 this.ColorPreviewTB = new System.Windows.Forms.TextBox();30 28 this.label2 = new System.Windows.Forms.Label(); 31 29 this.LinestyleCB = new System.Windows.Forms.ComboBox(); … … 46 44 this.btnChangeTitleFont = new System.Windows.Forms.Button(); 47 45 this.tpXAxis = new System.Windows.Forms.TabPage(); 46 this.chkShowXAxisGrid = new System.Windows.Forms.CheckBox(); 48 47 this.btnChangeXAxisFont = new System.Windows.Forms.Button(); 49 48 this.tpYAxes = new System.Windows.Forms.TabPage(); … … 53 52 this.flpShowYAxis = new System.Windows.Forms.FlowLayoutPanel(); 54 53 this.fdFont = new System.Windows.Forms.FontDialog(); 55 this.chkShowXAxisGrid = new System.Windows.Forms.CheckBox(); 54 this.label6 = new System.Windows.Forms.Label(); 55 this.groupBox2 = new System.Windows.Forms.GroupBox(); 56 this.selectedLineColorSelection = new HeuristicLab.Visualization.Options.ColorSelection(); 57 this.xAxisGridColorSelection = new HeuristicLab.Visualization.Options.ColorSelection(); 56 58 this.Optionstabs.SuspendLayout(); 57 59 this.tabPage1.SuspendLayout(); … … 63 65 this.gbxYAxisClipChangeable.SuspendLayout(); 64 66 this.gbxShowYAxis.SuspendLayout(); 67 this.groupBox2.SuspendLayout(); 65 68 this.SuspendLayout(); 66 69 // … … 81 84 // tabPage1 82 85 // 83 this.tabPage1.Controls.Add(this.OptionsDialogSelectColorBtn);84 this.tabPage1.Controls.Add(this.ColorPreviewTB);85 86 this.tabPage1.Controls.Add(this.label2); 86 87 this.tabPage1.Controls.Add(this.LinestyleCB); … … 96 97 this.tabPage1.UseVisualStyleBackColor = true; 97 98 // 98 // OptionsDialogSelectColorBtn99 //100 this.OptionsDialogSelectColorBtn.Location = new System.Drawing.Point(217, 126);101 this.OptionsDialogSelectColorBtn.Name = "OptionsDialogSelectColorBtn";102 this.OptionsDialogSelectColorBtn.Size = new System.Drawing.Size(50, 23);103 this.OptionsDialogSelectColorBtn.TabIndex = 7;104 this.OptionsDialogSelectColorBtn.Text = "Select";105 this.OptionsDialogSelectColorBtn.UseVisualStyleBackColor = true;106 this.OptionsDialogSelectColorBtn.Click += new System.EventHandler(this.OptionsDialogSelectColorBtn_Click);107 //108 // ColorPreviewTB109 //110 this.ColorPreviewTB.Location = new System.Drawing.Point(146, 127);111 this.ColorPreviewTB.Name = "ColorPreviewTB";112 this.ColorPreviewTB.ReadOnly = true;113 this.ColorPreviewTB.Size = new System.Drawing.Size(64, 20);114 this.ColorPreviewTB.TabIndex = 6;115 //116 99 // label2 117 100 // … … 154 137 // groupBox1 155 138 // 139 this.groupBox1.Controls.Add(this.selectedLineColorSelection); 156 140 this.groupBox1.Controls.Add(this.MarkercheckBox); 157 141 this.groupBox1.Controls.Add(this.label4); … … 287 271 // tpXAxis 288 272 // 289 this.tpXAxis.Controls.Add(this. chkShowXAxisGrid);273 this.tpXAxis.Controls.Add(this.groupBox2); 290 274 this.tpXAxis.Controls.Add(this.btnChangeXAxisFont); 291 275 this.tpXAxis.Location = new System.Drawing.Point(4, 22); … … 295 279 this.tpXAxis.Text = "X-Axis"; 296 280 this.tpXAxis.UseVisualStyleBackColor = true; 281 // 282 // chkShowXAxisGrid 283 // 284 this.chkShowXAxisGrid.AutoSize = true; 285 this.chkShowXAxisGrid.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; 286 this.chkShowXAxisGrid.Location = new System.Drawing.Point(20, 28); 287 this.chkShowXAxisGrid.Name = "chkShowXAxisGrid"; 288 this.chkShowXAxisGrid.Size = new System.Drawing.Size(56, 17); 289 this.chkShowXAxisGrid.TabIndex = 3; 290 this.chkShowXAxisGrid.Text = "Visible"; 291 this.chkShowXAxisGrid.UseVisualStyleBackColor = true; 292 this.chkShowXAxisGrid.CheckedChanged += new System.EventHandler(this.chkShowXAxisGrid_CheckedChanged); 297 293 // 298 294 // btnChangeXAxisFont … … 360 356 this.flpShowYAxis.TabIndex = 0; 361 357 // 362 // chkShowXAxisGrid 363 // 364 this.chkShowXAxisGrid.AutoSize = true; 365 this.chkShowXAxisGrid.Location = new System.Drawing.Point(3, 32); 366 this.chkShowXAxisGrid.Name = "chkShowXAxisGrid"; 367 this.chkShowXAxisGrid.Size = new System.Drawing.Size(107, 17); 368 this.chkShowXAxisGrid.TabIndex = 3; 369 this.chkShowXAxisGrid.Text = "Show X-Axis Grid"; 370 this.chkShowXAxisGrid.UseVisualStyleBackColor = true; 371 this.chkShowXAxisGrid.CheckedChanged += new System.EventHandler(this.chkShowXAxisGrid_CheckedChanged); 358 // label6 359 // 360 this.label6.AutoSize = true; 361 this.label6.Location = new System.Drawing.Point(20, 55); 362 this.label6.Name = "label6"; 363 this.label6.Size = new System.Drawing.Size(31, 13); 364 this.label6.TabIndex = 5; 365 this.label6.Text = "Color"; 366 // 367 // groupBox2 368 // 369 this.groupBox2.Controls.Add(this.label6); 370 this.groupBox2.Controls.Add(this.xAxisGridColorSelection); 371 this.groupBox2.Controls.Add(this.chkShowXAxisGrid); 372 this.groupBox2.Location = new System.Drawing.Point(8, 42); 373 this.groupBox2.Name = "groupBox2"; 374 this.groupBox2.Size = new System.Drawing.Size(205, 94); 375 this.groupBox2.TabIndex = 6; 376 this.groupBox2.TabStop = false; 377 this.groupBox2.Text = "Grid"; 378 // 379 // selectedLineColorSelection 380 // 381 this.selectedLineColorSelection.Color = System.Drawing.SystemColors.Control; 382 this.selectedLineColorSelection.Location = new System.Drawing.Point(142, 73); 383 this.selectedLineColorSelection.Name = "selectedLineColorSelection"; 384 this.selectedLineColorSelection.Size = new System.Drawing.Size(121, 25); 385 this.selectedLineColorSelection.TabIndex = 10; 386 this.selectedLineColorSelection.ColorChanged += new HeuristicLab.Visualization.Options.ColorChangedHandler(this.selectedLineColorSelection_ColorChanged); 387 // 388 // xAxisGridColorSelection 389 // 390 this.xAxisGridColorSelection.Color = System.Drawing.SystemColors.Control; 391 this.xAxisGridColorSelection.Location = new System.Drawing.Point(54, 49); 392 this.xAxisGridColorSelection.Name = "xAxisGridColorSelection"; 393 this.xAxisGridColorSelection.Size = new System.Drawing.Size(126, 25); 394 this.xAxisGridColorSelection.TabIndex = 4; 395 this.xAxisGridColorSelection.ColorChanged += new HeuristicLab.Visualization.Options.ColorChangedHandler(this.xAxisGridColorSelection_ColorChanged); 372 396 // 373 397 // Options … … 389 413 this.tpTitle.PerformLayout(); 390 414 this.tpXAxis.ResumeLayout(false); 391 this.tpXAxis.PerformLayout();392 415 this.tpYAxes.ResumeLayout(false); 393 416 this.tpYAxes.PerformLayout(); … … 396 419 this.gbxShowYAxis.ResumeLayout(false); 397 420 this.gbxShowYAxis.PerformLayout(); 421 this.groupBox2.ResumeLayout(false); 422 this.groupBox2.PerformLayout(); 398 423 this.ResumeLayout(false); 399 424 … … 404 429 private System.Windows.Forms.TabControl Optionstabs; 405 430 private System.Windows.Forms.TabPage tabPage1; 406 private System.Windows.Forms.Button OptionsDialogSelectColorBtn;407 private System.Windows.Forms.TextBox ColorPreviewTB;408 431 private System.Windows.Forms.Label label2; 409 432 private System.Windows.Forms.ComboBox LinestyleCB; … … 432 455 private System.Windows.Forms.TextBox tbxTitle; 433 456 private System.Windows.Forms.Label label5; 457 private ColorSelection selectedLineColorSelection; 458 private System.Windows.Forms.GroupBox groupBox2; 459 private System.Windows.Forms.Label label6; 460 private ColorSelection xAxisGridColorSelection; 434 461 } 435 462 } -
trunk/sources/HeuristicLab.Visualization/3.2/Options/Options.cs
r1881 r1885 14 14 private Dictionary<CheckBox, bool> ShowYAxisBoxes; 15 15 private bool oldShowXAxisGrid; 16 private Color oldXAxisGridColor; 16 17 private Dictionary<CheckBox, bool> yAxisClipChangeableBoxes; 17 18 … … 67 68 public void ResetSettings() { 68 69 model.XAxis.ShowGrid = oldShowXAxisGrid; 70 chkShowXAxisGrid.Checked = oldShowXAxisGrid; 71 72 model.XAxis.GridColor = oldXAxisGridColor; 73 xAxisGridColorSelection.Color = oldXAxisGridColor; 69 74 70 75 foreach (var param in oldLineParams) { … … 95 100 } 96 101 97 private void OptionsDialogSelectColorBtn_Click(object sender, EventArgs e) {98 ColorDialog dlg = new ColorDialog();99 dlg.ShowDialog();100 ColorPreviewTB.BackColor = dlg.Color;101 ((IDataRow)LineSelectCB.SelectedValue).Color = dlg.Color;102 }103 104 102 private static IList<int> GetThicknesses() { 105 103 return new List<int>(new[] {1, 2, 3, 4, 5, 6, 7, 8}); … … 155 153 oldShowXAxisGrid = model.XAxis.ShowGrid; 156 154 chkShowXAxisGrid.Checked = model.XAxis.ShowGrid; 155 156 oldXAxisGridColor = model.XAxis.GridColor; 157 xAxisGridColorSelection.Color = model.XAxis.GridColor; 157 158 158 159 InitTabPageLines(); … … 216 217 LineThicknessCB.SelectedItem = ((IDataRow)LineSelectCB.SelectedValue).Thickness; 217 218 LinestyleCB.SelectedItem = ((IDataRow)LineSelectCB.SelectedValue).Style; 218 ColorPreviewTB.BackColor = ((IDataRow)LineSelectCB.SelectedValue).Color;219 selectedLineColorSelection.Color = ((IDataRow)LineSelectCB.SelectedValue).Color; 219 220 MarkercheckBox.Checked = ((IDataRow)LineSelectCB.SelectedValue).ShowMarkers; 220 221 } … … 252 253 model.ViewSettings.UpdateView(); 253 254 } 255 256 private void selectedLineColorSelection_ColorChanged(ColorSelection sender) { 257 ((IDataRow)LineSelectCB.SelectedValue).Color = selectedLineColorSelection.Color; 258 } 259 260 private void xAxisGridColorSelection_ColorChanged(ColorSelection sender) { 261 model.XAxis.GridColor = xAxisGridColorSelection.Color; 262 } 254 263 } 255 264 } -
trunk/sources/HeuristicLab.Visualization/3.2/XAxisDescriptor.cs
r1881 r1885 1 using System.Drawing; 1 2 using HeuristicLab.Visualization.LabelProvider; 2 3 … … 8 9 private bool showLabel = true; 9 10 private bool showGrid = true; 11 private Color gridColor = Color.LightBlue; 10 12 private ILabelProvider labelProvider = new ContinuousLabelProvider("0.##"); 11 13 … … 44 46 } 45 47 48 public Color GridColor { 49 get { return this.gridColor; } 50 set { 51 this.gridColor = value; 52 FireXAxisDescriptorChanged(); 53 } 54 } 55 46 56 private void FireXAxisDescriptorChanged() { 47 57 if (XAxisDescriptorChanged != null)
Note: See TracChangeset
for help on using the changeset viewer.