Changeset 1586


Ignore:
Timestamp:
04/16/09 22:41:35 (12 years ago)
Author:
bspisic
Message:

Changed OptionsDialog to an UserControl (#584)

Location:
trunk/sources/HeuristicLab.Visualization/3.2
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization/3.2/HeuristicLab.Visualization-3.2.csproj

    r1559 r1586  
    113113    <Compile Include="MaxAggregator.cs" />
    114114    <Compile Include="MinAggregator.cs" />
     115    <Compile Include="Options\Options.cs">
     116      <SubType>UserControl</SubType>
     117    </Compile>
     118    <Compile Include="Options\Options.Designer.cs">
     119      <DependentUpon>Options.cs</DependentUpon>
     120    </Compile>
    115121    <Compile Include="Options\OptionsDialog.cs">
    116122      <SubType>Form</SubType>
     
    174180      <DependentUpon>LineChart.cs</DependentUpon>
    175181      <SubType>Designer</SubType>
     182    </EmbeddedResource>
     183    <EmbeddedResource Include="Options\Options.resx">
     184      <DependentUpon>Options.cs</DependentUpon>
    176185    </EmbeddedResource>
    177186    <EmbeddedResource Include="Options\OptionsDialog.resx">
  • trunk/sources/HeuristicLab.Visualization/3.2/Options/OptionsDialog.Designer.cs

    r1561 r1586  
    2424    /// </summary>
    2525    private void InitializeComponent() {
     26      HeuristicLab.Visualization.ChartDataRowsModel chartDataRowsModel1 = new HeuristicLab.Visualization.ChartDataRowsModel();
     27      HeuristicLab.Visualization.Options.ViewSettings viewSettings1 = new HeuristicLab.Visualization.Options.ViewSettings();
     28      HeuristicLab.Visualization.LabelProvider.ContinuousLabelProvider continuousLabelProvider1 = new HeuristicLab.Visualization.LabelProvider.ContinuousLabelProvider();
    2629      this.OptionsDialogCancelButton = new System.Windows.Forms.Button();
    2730      this.OptionsDialogOkButton = new System.Windows.Forms.Button();
    2831      this.fdFont = new System.Windows.Forms.FontDialog();
    29       this.tpTitle = new System.Windows.Forms.TabPage();
    30       this.btnChangeTitleFont = new System.Windows.Forms.Button();
    31       this.tabPage2 = new System.Windows.Forms.TabPage();
    32       this.btnChangeLegendFont = new System.Windows.Forms.Button();
    33       this.legendposition = new System.Windows.Forms.Label();
    34       this.cbLegendPosition = new System.Windows.Forms.ComboBox();
    35       this.tabPage1 = new System.Windows.Forms.TabPage();
    36       this.OptionsDialogSelectColorBt = new System.Windows.Forms.Button();
    37       this.ColorPreviewTB = new System.Windows.Forms.TextBox();
    38       this.label2 = new System.Windows.Forms.Label();
    39       this.LinestyleCB = new System.Windows.Forms.ComboBox();
    40       this.label1 = new System.Windows.Forms.Label();
    41       this.LineSelectCB = new System.Windows.Forms.ComboBox();
    42       this.groupBox1 = new System.Windows.Forms.GroupBox();
    43       this.label4 = new System.Windows.Forms.Label();
    44       this.LineThicknessCB = new System.Windows.Forms.ComboBox();
    45       this.label3 = new System.Windows.Forms.Label();
    46       this.Optionstabs = new System.Windows.Forms.TabControl();
    47       this.tpXAxis = new System.Windows.Forms.TabPage();
    48       this.btnChangeXAxisFont = new System.Windows.Forms.Button();
    49       this.tpYAxes = new System.Windows.Forms.TabPage();
    50       this.gbxYAxisClipChangeable = new System.Windows.Forms.GroupBox();
    51       this.flpYAxisClipChangeable = new System.Windows.Forms.FlowLayoutPanel();
    52       this.gbxShowYAxis = new System.Windows.Forms.GroupBox();
    53       this.flpShowYAxis = new System.Windows.Forms.FlowLayoutPanel();
    54       this.MarkercheckBox = new System.Windows.Forms.CheckBox();
    55       this.tpTitle.SuspendLayout();
    56       this.tabPage2.SuspendLayout();
    57       this.tabPage1.SuspendLayout();
    58       this.groupBox1.SuspendLayout();
    59       this.Optionstabs.SuspendLayout();
    60       this.tpXAxis.SuspendLayout();
    61       this.tpYAxes.SuspendLayout();
    62       this.gbxYAxisClipChangeable.SuspendLayout();
    63       this.gbxShowYAxis.SuspendLayout();
     32      this.options = new HeuristicLab.Visualization.Options.Options();
    6433      this.SuspendLayout();
    6534      //
    6635      // OptionsDialogCancelButton
    6736      //
    68       this.OptionsDialogCancelButton.Location = new System.Drawing.Point(213, 232);
     37      this.OptionsDialogCancelButton.Location = new System.Drawing.Point(225, 241);
    6938      this.OptionsDialogCancelButton.Name = "OptionsDialogCancelButton";
    7039      this.OptionsDialogCancelButton.Size = new System.Drawing.Size(75, 23);
     
    7645      // OptionsDialogOkButton
    7746      //
    78       this.OptionsDialogOkButton.Location = new System.Drawing.Point(132, 232);
     47      this.OptionsDialogOkButton.Location = new System.Drawing.Point(132, 241);
    7948      this.OptionsDialogOkButton.Name = "OptionsDialogOkButton";
    8049      this.OptionsDialogOkButton.Size = new System.Drawing.Size(75, 23);
     
    8857      this.fdFont.ShowColor = true;
    8958      //
    90       // tpTitle
     59      // options
    9160      //
    92       this.tpTitle.Controls.Add(this.btnChangeTitleFont);
    93       this.tpTitle.Location = new System.Drawing.Point(4, 22);
    94       this.tpTitle.Name = "tpTitle";
    95       this.tpTitle.Size = new System.Drawing.Size(284, 199);
    96       this.tpTitle.TabIndex = 2;
    97       this.tpTitle.Text = "Title";
    98       this.tpTitle.UseVisualStyleBackColor = true;
    99       //
    100       // btnChangeTitleFont
    101       //
    102       this.btnChangeTitleFont.Location = new System.Drawing.Point(3, 3);
    103       this.btnChangeTitleFont.Name = "btnChangeTitleFont";
    104       this.btnChangeTitleFont.Size = new System.Drawing.Size(94, 23);
    105       this.btnChangeTitleFont.TabIndex = 1;
    106       this.btnChangeTitleFont.Text = "Change Font";
    107       this.btnChangeTitleFont.UseVisualStyleBackColor = true;
    108       this.btnChangeTitleFont.Click += new System.EventHandler(this.btnChangeTitleFont_Click);
    109       //
    110       // tabPage2
    111       //
    112       this.tabPage2.Controls.Add(this.btnChangeLegendFont);
    113       this.tabPage2.Controls.Add(this.legendposition);
    114       this.tabPage2.Controls.Add(this.cbLegendPosition);
    115       this.tabPage2.Location = new System.Drawing.Point(4, 22);
    116       this.tabPage2.Name = "tabPage2";
    117       this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
    118       this.tabPage2.Size = new System.Drawing.Size(284, 199);
    119       this.tabPage2.TabIndex = 1;
    120       this.tabPage2.Text = "Legend";
    121       this.tabPage2.UseVisualStyleBackColor = true;
    122       //
    123       // btnChangeLegendFont
    124       //
    125       this.btnChangeLegendFont.Location = new System.Drawing.Point(3, 6);
    126       this.btnChangeLegendFont.Name = "btnChangeLegendFont";
    127       this.btnChangeLegendFont.Size = new System.Drawing.Size(94, 23);
    128       this.btnChangeLegendFont.TabIndex = 2;
    129       this.btnChangeLegendFont.Text = "Change Font";
    130       this.btnChangeLegendFont.UseVisualStyleBackColor = true;
    131       this.btnChangeLegendFont.Click += new System.EventHandler(this.btnChangeLegendFont_Click);
    132       //
    133       // legendposition
    134       //
    135       this.legendposition.AutoSize = true;
    136       this.legendposition.Location = new System.Drawing.Point(8, 38);
    137       this.legendposition.Name = "legendposition";
    138       this.legendposition.Size = new System.Drawing.Size(82, 13);
    139       this.legendposition.TabIndex = 1;
    140       this.legendposition.Text = "Legendposition:";
    141       //
    142       // cbLegendPosition
    143       //
    144       this.cbLegendPosition.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    145       this.cbLegendPosition.FormattingEnabled = true;
    146       this.cbLegendPosition.Location = new System.Drawing.Point(96, 35);
    147       this.cbLegendPosition.Name = "cbLegendPosition";
    148       this.cbLegendPosition.Size = new System.Drawing.Size(121, 21);
    149       this.cbLegendPosition.TabIndex = 0;
    150       this.cbLegendPosition.SelectedIndexChanged += new System.EventHandler(this.cbLegendPosition_SelectedIndexChanged);
    151       //
    152       // tabPage1
    153       //
    154       this.tabPage1.Controls.Add(this.OptionsDialogSelectColorBt);
    155       this.tabPage1.Controls.Add(this.ColorPreviewTB);
    156       this.tabPage1.Controls.Add(this.label2);
    157       this.tabPage1.Controls.Add(this.LinestyleCB);
    158       this.tabPage1.Controls.Add(this.label1);
    159       this.tabPage1.Controls.Add(this.LineSelectCB);
    160       this.tabPage1.Controls.Add(this.groupBox1);
    161       this.tabPage1.Location = new System.Drawing.Point(4, 22);
    162       this.tabPage1.Name = "tabPage1";
    163       this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
    164       this.tabPage1.Size = new System.Drawing.Size(284, 199);
    165       this.tabPage1.TabIndex = 0;
    166       this.tabPage1.Text = "Linestyle";
    167       this.tabPage1.UseVisualStyleBackColor = true;
    168       //
    169       // OptionsDialogSelectColorBt
    170       //
    171       this.OptionsDialogSelectColorBt.Location = new System.Drawing.Point(217, 126);
    172       this.OptionsDialogSelectColorBt.Name = "OptionsDialogSelectColorBt";
    173       this.OptionsDialogSelectColorBt.Size = new System.Drawing.Size(50, 23);
    174       this.OptionsDialogSelectColorBt.TabIndex = 7;
    175       this.OptionsDialogSelectColorBt.Text = "Select";
    176       this.OptionsDialogSelectColorBt.UseVisualStyleBackColor = true;
    177       this.OptionsDialogSelectColorBt.Click += new System.EventHandler(this.OptionsDialogSelectColorBtn_Click);
    178       //
    179       // ColorPreviewTB
    180       //
    181       this.ColorPreviewTB.Location = new System.Drawing.Point(146, 127);
    182       this.ColorPreviewTB.Name = "ColorPreviewTB";
    183       this.ColorPreviewTB.ReadOnly = true;
    184       this.ColorPreviewTB.Size = new System.Drawing.Size(64, 20);
    185       this.ColorPreviewTB.TabIndex = 6;
    186       //
    187       // label2
    188       //
    189       this.label2.AutoSize = true;
    190       this.label2.Location = new System.Drawing.Point(36, 80);
    191       this.label2.Name = "label2";
    192       this.label2.Size = new System.Drawing.Size(30, 13);
    193       this.label2.TabIndex = 3;
    194       this.label2.Text = "Style";
    195       //
    196       // LinestyleCB
    197       //
    198       this.LinestyleCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    199       this.LinestyleCB.FormattingEnabled = true;
    200       this.LinestyleCB.Location = new System.Drawing.Point(146, 73);
    201       this.LinestyleCB.Name = "LinestyleCB";
    202       this.LinestyleCB.Size = new System.Drawing.Size(121, 21);
    203       this.LinestyleCB.TabIndex = 2;
    204       this.LinestyleCB.SelectedIndexChanged += new System.EventHandler(this.LinestyleCB_SelectedIndexChanged);
    205       //
    206       // label1
    207       //
    208       this.label1.AutoSize = true;
    209       this.label1.Location = new System.Drawing.Point(7, 37);
    210       this.label1.Name = "label1";
    211       this.label1.Size = new System.Drawing.Size(72, 13);
    212       this.label1.TabIndex = 1;
    213       this.label1.Text = "Selected Line";
    214       //
    215       // LineSelectCB
    216       //
    217       this.LineSelectCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    218       this.LineSelectCB.FormattingEnabled = true;
    219       this.LineSelectCB.Location = new System.Drawing.Point(146, 30);
    220       this.LineSelectCB.Name = "LineSelectCB";
    221       this.LineSelectCB.Size = new System.Drawing.Size(121, 21);
    222       this.LineSelectCB.TabIndex = 0;
    223       this.LineSelectCB.SelectedIndexChanged += new System.EventHandler(this.LineSelectCB_SelectedIndexChanged);
    224       //
    225       // groupBox1
    226       //
    227       this.groupBox1.Controls.Add(this.MarkercheckBox);
    228       this.groupBox1.Controls.Add(this.label4);
    229       this.groupBox1.Controls.Add(this.LineThicknessCB);
    230       this.groupBox1.Controls.Add(this.label3);
    231       this.groupBox1.Location = new System.Drawing.Point(4, 54);
    232       this.groupBox1.Name = "groupBox1";
    233       this.groupBox1.Size = new System.Drawing.Size(274, 129);
    234       this.groupBox1.TabIndex = 9;
    235       this.groupBox1.TabStop = false;
    236       this.groupBox1.Text = "Details";
    237       //
    238       // label4
    239       //
    240       this.label4.AutoSize = true;
    241       this.label4.Location = new System.Drawing.Point(33, 77);
    242       this.label4.Name = "label4";
    243       this.label4.Size = new System.Drawing.Size(31, 13);
    244       this.label4.TabIndex = 8;
    245       this.label4.Text = "Color";
    246       //
    247       // LineThicknessCB
    248       //
    249       this.LineThicknessCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    250       this.LineThicknessCB.FormattingEnabled = true;
    251       this.LineThicknessCB.Location = new System.Drawing.Point(142, 46);
    252       this.LineThicknessCB.Name = "LineThicknessCB";
    253       this.LineThicknessCB.Size = new System.Drawing.Size(121, 21);
    254       this.LineThicknessCB.TabIndex = 4;
    255       this.LineThicknessCB.SelectedIndexChanged += new System.EventHandler(this.LineThicknessCB_SelectedIndexChanged);
    256       //
    257       // label3
    258       //
    259       this.label3.AutoSize = true;
    260       this.label3.Location = new System.Drawing.Point(32, 52);
    261       this.label3.Name = "label3";
    262       this.label3.Size = new System.Drawing.Size(56, 13);
    263       this.label3.TabIndex = 5;
    264       this.label3.Text = "Thickness";
    265       //
    266       // Optionstabs
    267       //
    268       this.Optionstabs.Controls.Add(this.tabPage1);
    269       this.Optionstabs.Controls.Add(this.tabPage2);
    270       this.Optionstabs.Controls.Add(this.tpTitle);
    271       this.Optionstabs.Controls.Add(this.tpXAxis);
    272       this.Optionstabs.Controls.Add(this.tpYAxes);
    273       this.Optionstabs.Location = new System.Drawing.Point(0, 1);
    274       this.Optionstabs.Name = "Optionstabs";
    275       this.Optionstabs.SelectedIndex = 0;
    276       this.Optionstabs.Size = new System.Drawing.Size(292, 225);
    277       this.Optionstabs.TabIndex = 0;
    278       //
    279       // tpXAxis
    280       //
    281       this.tpXAxis.Controls.Add(this.btnChangeXAxisFont);
    282       this.tpXAxis.Location = new System.Drawing.Point(4, 22);
    283       this.tpXAxis.Name = "tpXAxis";
    284       this.tpXAxis.Size = new System.Drawing.Size(284, 199);
    285       this.tpXAxis.TabIndex = 3;
    286       this.tpXAxis.Text = "X-Axis";
    287       this.tpXAxis.UseVisualStyleBackColor = true;
    288       //
    289       // btnChangeXAxisFont
    290       //
    291       this.btnChangeXAxisFont.Location = new System.Drawing.Point(3, 3);
    292       this.btnChangeXAxisFont.Name = "btnChangeXAxisFont";
    293       this.btnChangeXAxisFont.Size = new System.Drawing.Size(94, 23);
    294       this.btnChangeXAxisFont.TabIndex = 2;
    295       this.btnChangeXAxisFont.Text = "Change Font";
    296       this.btnChangeXAxisFont.UseVisualStyleBackColor = true;
    297       this.btnChangeXAxisFont.Click += new System.EventHandler(this.btnChangeXAxisFont_Click);
    298       //
    299       // tpYAxes
    300       //
    301       this.tpYAxes.Controls.Add(this.gbxYAxisClipChangeable);
    302       this.tpYAxes.Controls.Add(this.gbxShowYAxis);
    303       this.tpYAxes.Location = new System.Drawing.Point(4, 22);
    304       this.tpYAxes.Name = "tpYAxes";
    305       this.tpYAxes.Padding = new System.Windows.Forms.Padding(3);
    306       this.tpYAxes.Size = new System.Drawing.Size(284, 199);
    307       this.tpYAxes.TabIndex = 4;
    308       this.tpYAxes.Text = "Y-Axes";
    309       this.tpYAxes.UseVisualStyleBackColor = true;
    310       //
    311       // gbxYAxisClipChangeable
    312       //
    313       this.gbxYAxisClipChangeable.AutoSize = true;
    314       this.gbxYAxisClipChangeable.Controls.Add(this.flpYAxisClipChangeable);
    315       this.gbxYAxisClipChangeable.Location = new System.Drawing.Point(0, 82);
    316       this.gbxYAxisClipChangeable.Name = "gbxYAxisClipChangeable";
    317       this.gbxYAxisClipChangeable.Size = new System.Drawing.Size(281, 76);
    318       this.gbxYAxisClipChangeable.TabIndex = 1;
    319       this.gbxYAxisClipChangeable.TabStop = false;
    320       this.gbxYAxisClipChangeable.Text = "Y-Axis-Clip changeable";
    321       //
    322       // flpYAxisClipChangeable
    323       //
    324       this.flpYAxisClipChangeable.AutoSize = true;
    325       this.flpYAxisClipChangeable.Dock = System.Windows.Forms.DockStyle.Fill;
    326       this.flpYAxisClipChangeable.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
    327       this.flpYAxisClipChangeable.Location = new System.Drawing.Point(3, 16);
    328       this.flpYAxisClipChangeable.Name = "flpYAxisClipChangeable";
    329       this.flpYAxisClipChangeable.Size = new System.Drawing.Size(275, 57);
    330       this.flpYAxisClipChangeable.TabIndex = 0;
    331       //
    332       // gbxShowYAxis
    333       //
    334       this.gbxShowYAxis.AutoSize = true;
    335       this.gbxShowYAxis.Controls.Add(this.flpShowYAxis);
    336       this.gbxShowYAxis.Location = new System.Drawing.Point(0, 0);
    337       this.gbxShowYAxis.Name = "gbxShowYAxis";
    338       this.gbxShowYAxis.Size = new System.Drawing.Size(281, 76);
    339       this.gbxShowYAxis.TabIndex = 0;
    340       this.gbxShowYAxis.TabStop = false;
    341       this.gbxShowYAxis.Text = "Show Y-Axis";
    342       //
    343       // flpShowYAxis
    344       //
    345       this.flpShowYAxis.AutoSize = true;
    346       this.flpShowYAxis.Dock = System.Windows.Forms.DockStyle.Fill;
    347       this.flpShowYAxis.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
    348       this.flpShowYAxis.Location = new System.Drawing.Point(3, 16);
    349       this.flpShowYAxis.Name = "flpShowYAxis";
    350       this.flpShowYAxis.Size = new System.Drawing.Size(275, 57);
    351       this.flpShowYAxis.TabIndex = 0;
    352       //
    353       // MarkercheckBox
    354       //
    355       this.MarkercheckBox.AutoSize = true;
    356       this.MarkercheckBox.Location = new System.Drawing.Point(142, 106);
    357       this.MarkercheckBox.Name = "MarkercheckBox";
    358       this.MarkercheckBox.Size = new System.Drawing.Size(59, 17);
    359       this.MarkercheckBox.TabIndex = 9;
    360       this.MarkercheckBox.Text = "Marker";
    361       this.MarkercheckBox.UseVisualStyleBackColor = true;
    362       this.MarkercheckBox.CheckedChanged += new System.EventHandler(this.MarkercheckBox_CheckedChanged);
     61      this.options.Location = new System.Drawing.Point(2, 3);
     62      chartDataRowsModel1.ShowXAxisLabel = true;
     63      chartDataRowsModel1.Title = "Title";
     64      viewSettings1.LegendColor = System.Drawing.Color.Blue;
     65      viewSettings1.LegendFont = new System.Drawing.Font("Arial", 8F);
     66      viewSettings1.LegendPosition = HeuristicLab.Visualization.Legend.LegendPosition.Bottom;
     67      viewSettings1.TitleColor = System.Drawing.Color.Blue;
     68      viewSettings1.TitleFont = new System.Drawing.Font("Arial", 8F);
     69      viewSettings1.XAxisColor = System.Drawing.Color.Blue;
     70      viewSettings1.XAxisFont = new System.Drawing.Font("Arial", 8F);
     71      chartDataRowsModel1.ViewSettings = viewSettings1;
     72      chartDataRowsModel1.XAxisLabel = "";
     73      chartDataRowsModel1.XAxisLabelProvider = continuousLabelProvider1;
     74      this.options.Model = chartDataRowsModel1;
     75      this.options.Name = "options";
     76      this.options.Size = new System.Drawing.Size(298, 232);
     77      this.options.TabIndex = 3;
    36378      //
    36479      // OptionsDialog
     
    36681      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    36782      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    368       this.ClientSize = new System.Drawing.Size(292, 266);
     83      this.ClientSize = new System.Drawing.Size(302, 270);
     84      this.Controls.Add(this.options);
    36985      this.Controls.Add(this.OptionsDialogOkButton);
    37086      this.Controls.Add(this.OptionsDialogCancelButton);
    371       this.Controls.Add(this.Optionstabs);
    37287      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
    37388      this.MaximizeBox = false;
    37489      this.Name = "OptionsDialog";
    37590      this.Text = "OptionsDialog";
    376       this.Load += new System.EventHandler(this.OptionsDialog_Load);
    377       this.tpTitle.ResumeLayout(false);
    378       this.tabPage2.ResumeLayout(false);
    379       this.tabPage2.PerformLayout();
    380       this.tabPage1.ResumeLayout(false);
    381       this.tabPage1.PerformLayout();
    382       this.groupBox1.ResumeLayout(false);
    383       this.groupBox1.PerformLayout();
    384       this.Optionstabs.ResumeLayout(false);
    385       this.tpXAxis.ResumeLayout(false);
    386       this.tpYAxes.ResumeLayout(false);
    387       this.tpYAxes.PerformLayout();
    388       this.gbxYAxisClipChangeable.ResumeLayout(false);
    389       this.gbxYAxisClipChangeable.PerformLayout();
    390       this.gbxShowYAxis.ResumeLayout(false);
    391       this.gbxShowYAxis.PerformLayout();
    39291      this.ResumeLayout(false);
    39392
     
    39998    private System.Windows.Forms.Button OptionsDialogOkButton;
    40099    private System.Windows.Forms.FontDialog fdFont;
    401     private System.Windows.Forms.TabPage tpTitle;
    402     private System.Windows.Forms.Button btnChangeTitleFont;
    403     private System.Windows.Forms.TabPage tabPage2;
    404     private System.Windows.Forms.TabPage tabPage1;
    405     private System.Windows.Forms.Button OptionsDialogSelectColorBt;
    406     private System.Windows.Forms.TextBox ColorPreviewTB;
    407     private System.Windows.Forms.Label label2;
    408     private System.Windows.Forms.ComboBox LinestyleCB;
    409     private System.Windows.Forms.Label label1;
    410     private System.Windows.Forms.ComboBox LineSelectCB;
    411     private System.Windows.Forms.GroupBox groupBox1;
    412     private System.Windows.Forms.Label label4;
    413     private System.Windows.Forms.ComboBox cbLegendPosition;
    414     private System.Windows.Forms.Label legendposition;
    415     private System.Windows.Forms.ComboBox LineThicknessCB;
    416     private System.Windows.Forms.Label label3;
    417     private System.Windows.Forms.TabControl Optionstabs;
    418     private System.Windows.Forms.Button btnChangeLegendFont;
    419     private System.Windows.Forms.TabPage tpXAxis;
    420     private System.Windows.Forms.Button btnChangeXAxisFont;
    421     private System.Windows.Forms.TabPage tpYAxes;
    422     private System.Windows.Forms.GroupBox gbxShowYAxis;
    423     private System.Windows.Forms.GroupBox gbxYAxisClipChangeable;
    424     private System.Windows.Forms.FlowLayoutPanel flpYAxisClipChangeable;
    425     private System.Windows.Forms.FlowLayoutPanel flpShowYAxis;
    426     private System.Windows.Forms.CheckBox MarkercheckBox;
     100    private Options options;
    427101  }
    428102}
  • trunk/sources/HeuristicLab.Visualization/3.2/Options/OptionsDialog.cs

    r1561 r1586  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Drawing;
    42using System.Windows.Forms;
    5 using HeuristicLab.Visualization.Legend;
    63
    74namespace HeuristicLab.Visualization.Options {
    85  public partial class OptionsDialog : Form {
    9     private readonly IChartDataRowsModel model;
    10     private readonly ViewSettings viewSettings;
    11     private readonly ViewSettings oldViewSettings;
    12     private LineParams[] oldLineParams;
    13     private Dictionary<CheckBox,bool> ShowYAxisBoxes;
    14     private Dictionary<CheckBox,bool> yAxisClipChangeableBoxes;
    15 
    16     internal class LineParams {
    17       string Label { get; set; }
    18       Color Color { get; set; }
    19       bool ShowMarkers { get; set; }
    20       int Thickness { get; set; }
    21       DrawingStyle Style { get; set; }
    22       private readonly IDataRow row;
    23 
    24       public LineParams(IDataRow row) {
    25         Label = row.Label;
    26         Color = row.Color;
    27         Thickness = row.Thickness;
    28         Style = row.Style;
    29         this.row = row;
    30         this.ShowMarkers = row.ShowMarkers;
    31       }
    32 
    33       public void applySettings() {
    34         row.Label = Label;
    35         row.Color = Color;
    36         row.Thickness = Thickness;
    37         row.Style = Style;
    38         row.ShowMarkers = this.ShowMarkers;
    39       }
    40     }
    41 
    426    public OptionsDialog(IChartDataRowsModel model) {
    437      InitializeComponent();
    448
    45       this.model = model;
    46       viewSettings = model.ViewSettings;
    47       oldViewSettings = new ViewSettings(model.ViewSettings);
    48 
    49       cbLegendPosition.Items.Add(LegendPosition.Top);
    50       cbLegendPosition.Items.Add(LegendPosition.Bottom);
    51       cbLegendPosition.Items.Add(LegendPosition.Left);
    52       cbLegendPosition.Items.Add(LegendPosition.Right);
    53 
    54       cbLegendPosition.SelectedItem = viewSettings.LegendPosition;
     9      options.Model = model;
    5510    }
    5611
    57     private void OptionsDialogSelectColorBtn_Click(object sender, EventArgs e) {
    58       ColorDialog dlg = new ColorDialog();
    59       dlg.ShowDialog();
    60       ColorPreviewTB.BackColor = dlg.Color;
    61       ((IDataRow)LineSelectCB.SelectedValue).Color = dlg.Color;
    62     }
    63 
    64     public IList<int> GetThicknesses() {
    65       return new List<int>(new int[] {1, 2, 3, 4, 5, 6, 7, 8});
    66     }
    67 
    68     public IList<DrawingStyle> GetStyles() {
    69       return new List<DrawingStyle>(new DrawingStyle[] {DrawingStyle.Solid, DrawingStyle.Dashed});
    70     }
    71 
    72     private void OptionsDialog_Load(object sender, EventArgs e) {
    73       InitTabPageLines();
    74       InitTabPageYAxes();
    75     }
    76 
    77     private void InitTabPageLines() {
    78       if (model.Rows.Count != 0) {
    79         int index = 0;
    80         oldLineParams = new LineParams[model.Rows.Count];
    81         foreach (var row in model.Rows) {
    82           oldLineParams[index++]= new LineParams(row);
    83         }
    84         LineThicknessCB.DataSource = GetThicknesses();
    85         LinestyleCB.DataSource = GetStyles();
    86         LinestyleCB.SelectedItem = model.Rows[0].Style;
    87         LineThicknessCB.SelectedItem = model.Rows[0].Thickness;
    88         MarkercheckBox.Checked = model.Rows[0].ShowMarkers;
    89 
    90         LineSelectCB.DataSource = model.Rows;
    91         LineSelectCB.DisplayMember = "Label";
    92 
    93        
    94         LineSelectCB.SelectedIndex = 0;
    95         LineSelectCB_SelectedIndexChanged(this, null);
    96        
    97       }
    98     }
    99 
    100     private void InitTabPageYAxes() {
    101       ShowYAxisBoxes = new Dictionary<CheckBox, bool>();
    102       yAxisClipChangeableBoxes = new Dictionary<CheckBox, bool>();
    103 
    104       for (int i = 0; i < model.YAxes.Count; i++) {
    105         YAxisDescriptor yAxisDescriptor = model.YAxes[i];
    106 
    107         CheckBox cbxShowYAxis = new CheckBox();
    108         cbxShowYAxis.Text = yAxisDescriptor.Label;
    109         cbxShowYAxis.Checked = yAxisDescriptor.ShowYAxis;
    110         ShowYAxisBoxes[cbxShowYAxis] = yAxisDescriptor.ShowYAxis;
    111         cbxShowYAxis.CheckedChanged += delegate { yAxisDescriptor.ShowYAxis = cbxShowYAxis.Checked; };
    112        
    113         flpShowYAxis.Controls.Add(cbxShowYAxis);
    114 
    115         CheckBox cbxClipChangeable = new CheckBox();
    116         cbxClipChangeable.Text = yAxisDescriptor.Label;
    117         cbxClipChangeable.Checked = yAxisDescriptor.ClipChangeable;
    118         yAxisClipChangeableBoxes[cbxClipChangeable] = yAxisDescriptor.ClipChangeable;
    119         cbxClipChangeable.CheckedChanged += delegate { yAxisDescriptor.ClipChangeable = cbxClipChangeable.Checked; };
    120 
    121         flpYAxisClipChangeable.Controls.Add(cbxClipChangeable);
    122       }
    123     }
    124 
    125     private void LineSelectCB_SelectedIndexChanged(object sender, EventArgs e) {
    126       if (LineSelectCB.SelectedValue != null) {
    127       /*  int index =
    128           LineThicknessCB.FindStringExact(((IDataRow)LineSelectCB.SelectedValue).Thickness.ToString());
    129         LineThicknessCB.SelectedIndex = index;
    130         index = LinestyleCB.FindStringExact(((IDataRow)LineSelectCB.SelectedValue).Style.ToString());
    131         LinestyleCB.SelectedIndex = index;  */
    132         LineThicknessCB.SelectedItem = ((IDataRow) LineSelectCB.SelectedValue).Thickness;
    133         LinestyleCB.SelectedItem = ((IDataRow)LineSelectCB.SelectedValue).Style;
    134         ColorPreviewTB.BackColor = ((IDataRow)LineSelectCB.SelectedValue).Color;
    135         MarkercheckBox.Checked = ((IDataRow) LineSelectCB.SelectedValue).ShowMarkers;
    136       }
    137     }
    138 
    139    
    14012    private void OptionsDialogOkButton_Click(object sender, EventArgs e) {
    14113      Close();
    14214    }
    143    
    144     private void cbLegendPosition_SelectedIndexChanged(object sender, EventArgs e) {
    145       viewSettings.LegendPosition = (LegendPosition)cbLegendPosition.SelectedItem;
    146       viewSettings.UpdateView();
    147     }
    148 
    149     private void btnChangeTitleFont_Click(object sender, EventArgs e) {
    150       fdFont.Font = viewSettings.TitleFont;
    151       fdFont.Color = viewSettings.TitleColor;
    152 
    153       DialogResult dr = fdFont.ShowDialog();
    154 
    155       if(dr == DialogResult.OK) {
    156         viewSettings.TitleFont = fdFont.Font;
    157         viewSettings.TitleColor = fdFont.Color;
    158 
    159         viewSettings.UpdateView();
    160       }
    161     }
    162 
    163     private void btnChangeLegendFont_Click(object sender, EventArgs e) {
    164       fdFont.Font = viewSettings.LegendFont;
    165       fdFont.Color = viewSettings.LegendColor;
    166 
    167       DialogResult dr = fdFont.ShowDialog();
    168 
    169       if (dr == DialogResult.OK) {
    170         viewSettings.LegendFont = fdFont.Font;
    171         viewSettings.LegendColor = fdFont.Color;
    172 
    173         viewSettings.UpdateView();
    174       }
    175     }
    176 
    177     private void btnChangeXAxisFont_Click(object sender, EventArgs e) {
    178       fdFont.Font = viewSettings.XAxisFont;
    179       fdFont.Color = viewSettings.XAxisColor;
    180 
    181       DialogResult dr = fdFont.ShowDialog();
    182 
    183       if (dr == DialogResult.OK) {
    184         viewSettings.XAxisFont = fdFont.Font;
    185         viewSettings.XAxisColor = fdFont.Color;
    186 
    187         viewSettings.UpdateView();
    188       }
    189     }
    19015
    19116    private void OptionsDialogResetButton_Click(object sender, EventArgs e) {
    192       foreach (var param in oldLineParams) {
    193         param.applySettings();
    194       }
    195 
    196       foreach (var box in ShowYAxisBoxes) {
    197         box.Key.Checked = box.Value;
    198       }
    199 
    200       foreach (KeyValuePair<CheckBox, bool> box in yAxisClipChangeableBoxes) {
    201         box.Key.Checked = box.Value;
    202       }
    203 
    204       viewSettings.LegendColor = oldViewSettings.LegendColor;
    205       viewSettings.LegendPosition = oldViewSettings.LegendPosition;
    206       viewSettings.LegendFont = oldViewSettings.LegendFont;
    207       viewSettings.TitleColor = oldViewSettings.TitleColor;
    208       viewSettings.TitleFont = oldViewSettings.TitleFont;
    209       viewSettings.XAxisColor = oldViewSettings.LegendColor;
    210       viewSettings.XAxisFont = oldViewSettings.XAxisFont;
    211       viewSettings.UpdateView();
    212       cbLegendPosition.SelectedItem = viewSettings.LegendPosition;
    213       this.LineSelectCB_SelectedIndexChanged(this,null);
     17      options.ResetSettings();
    21418    }
    215 
    216     private void LinestyleCB_SelectedIndexChanged(object sender, EventArgs e) {
    217       if (LineSelectCB.SelectedValue != null)
    218         ((IDataRow)LineSelectCB.SelectedValue).Style = (DrawingStyle)LinestyleCB.SelectedItem;
    219     }
    220 
    221     private void LineThicknessCB_SelectedIndexChanged(object sender, EventArgs e) {
    222       if (LineSelectCB.SelectedValue != null)
    223         ((IDataRow)LineSelectCB.SelectedValue).Thickness = (int)LineThicknessCB.SelectedItem;
    224     }
    225 
    226     private void MarkercheckBox_CheckedChanged(object sender, EventArgs e) {
    227       if (LineSelectCB.SelectedValue != null)
    228         ((IDataRow) LineSelectCB.SelectedValue).ShowMarkers = MarkercheckBox.Checked;
    229     }
    230 
    231 
    23219  }
    23320}
Note: See TracChangeset for help on using the changeset viewer.