Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3638


Ignore:
Timestamp:
05/05/10 15:36:28 (15 years ago)
Author:
mkommend
Message:

corrected behavior auf RunCollectionBubbleChart and added color to RunView (ticket #970)

Location:
trunk/sources/HeuristicLab.Optimization.Views/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs

    r3632 r3638  
    6868      this.chart.ChartAreas[0].CursorY.Interval = 0;
    6969      this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = !this.isSelecting;
    70       this.chart.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;
    7170      this.chart.ChartAreas[0].AxisY.ScaleView.Zoomable = !this.isSelecting;
    72       this.chart.ChartAreas[0].AxisY.IntervalAutoMode = IntervalAutoMode.VariableCount;
    7371    }
    7472
     
    341339          }
    342340        }
    343         this.chart.ChartAreas[0].CursorX.SetSelectionPosition(double.NaN, double.NaN);
    344         this.chart.ChartAreas[0].CursorY.SetSelectionPosition(double.NaN, double.NaN);
     341        this.chart.ChartAreas[0].CursorX.SelectionStart = this.chart.ChartAreas[0].CursorX.SelectionEnd;
     342        this.chart.ChartAreas[0].CursorY.SelectionStart = this.chart.ChartAreas[0].CursorY.SelectionEnd;
    345343      }
    346344    }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunView.Designer.cs

    r3300 r3638  
    4646    private void InitializeComponent() {
    4747      this.components = new System.ComponentModel.Container();
    48       System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Results", System.Windows.Forms.HorizontalAlignment.Left);
    49       System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Parameters", System.Windows.Forms.HorizontalAlignment.Left);
     48      System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("Results", System.Windows.Forms.HorizontalAlignment.Left);
     49      System.Windows.Forms.ListViewGroup listViewGroup4 = new System.Windows.Forms.ListViewGroup("Parameters", System.Windows.Forms.HorizontalAlignment.Left);
    5050      this.parametersResultsGroupBox = new System.Windows.Forms.GroupBox();
    5151      this.splitContainer = new System.Windows.Forms.SplitContainer();
     
    5757      this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    5858      this.showAlgorithmButton = new System.Windows.Forms.Button();
     59      this.changeColorButton = new System.Windows.Forms.Button();
     60      this.colorLabel = new System.Windows.Forms.Label();
     61      this.colorPictureBox = new System.Windows.Forms.PictureBox();
     62      this.colorDialog = new System.Windows.Forms.ColorDialog();
    5963      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    6064      this.parametersResultsGroupBox.SuspendLayout();
     
    6367      this.splitContainer.SuspendLayout();
    6468      this.detailsGroupBox.SuspendLayout();
     69      ((System.ComponentModel.ISupportInitialize)(this.colorPictureBox)).BeginInit();
    6570      this.SuspendLayout();
    6671      //
     
    8186                  | System.Windows.Forms.AnchorStyles.Right)));
    8287      this.parametersResultsGroupBox.Controls.Add(this.splitContainer);
    83       this.parametersResultsGroupBox.Location = new System.Drawing.Point(0, 52);
     88      this.parametersResultsGroupBox.Location = new System.Drawing.Point(0, 79);
    8489      this.parametersResultsGroupBox.Name = "parametersResultsGroupBox";
    85       this.parametersResultsGroupBox.Size = new System.Drawing.Size(495, 272);
     90      this.parametersResultsGroupBox.Size = new System.Drawing.Size(495, 245);
    8691      this.parametersResultsGroupBox.TabIndex = 4;
    8792      this.parametersResultsGroupBox.TabStop = false;
     
    101106      //
    102107      this.splitContainer.Panel2.Controls.Add(this.detailsGroupBox);
    103       this.splitContainer.Size = new System.Drawing.Size(489, 253);
     108      this.splitContainer.Size = new System.Drawing.Size(489, 226);
    104109      this.splitContainer.SplitterDistance = 177;
    105110      this.splitContainer.TabIndex = 0;
     
    114119            this.valueColumnHeader});
    115120      this.listView.FullRowSelect = true;
    116       listViewGroup1.Header = "Results";
    117       listViewGroup1.Name = "resultsGroup";
    118       listViewGroup2.Header = "Parameters";
    119       listViewGroup2.Name = "parametersGroup";
     121      listViewGroup3.Header = "Results";
     122      listViewGroup3.Name = "resultsGroup";
     123      listViewGroup4.Header = "Parameters";
     124      listViewGroup4.Name = "parametersGroup";
    120125      this.listView.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] {
    121             listViewGroup1,
    122             listViewGroup2});
     126            listViewGroup3,
     127            listViewGroup4});
    123128      this.listView.HideSelection = false;
    124129      this.listView.Location = new System.Drawing.Point(3, 3);
     
    126131      this.listView.Name = "listView";
    127132      this.listView.ShowItemToolTips = true;
    128       this.listView.Size = new System.Drawing.Size(171, 247);
     133      this.listView.Size = new System.Drawing.Size(171, 220);
    129134      this.listView.SmallImageList = this.imageList;
    130135      this.listView.Sorting = System.Windows.Forms.SortOrder.Ascending;
     
    158163      this.detailsGroupBox.Location = new System.Drawing.Point(3, 3);
    159164      this.detailsGroupBox.Name = "detailsGroupBox";
    160       this.detailsGroupBox.Size = new System.Drawing.Size(302, 247);
     165      this.detailsGroupBox.Size = new System.Drawing.Size(302, 220);
    161166      this.detailsGroupBox.TabIndex = 0;
    162167      this.detailsGroupBox.TabStop = false;
     
    168173                  | System.Windows.Forms.AnchorStyles.Left)
    169174                  | System.Windows.Forms.AnchorStyles.Right)));
     175      this.viewHost.Caption = null;
    170176      this.viewHost.Content = null;
    171177      this.viewHost.Location = new System.Drawing.Point(6, 19);
    172178      this.viewHost.Name = "viewHost";
    173       this.viewHost.Size = new System.Drawing.Size(290, 222);
     179      this.viewHost.ReadOnly = false;
     180      this.viewHost.Size = new System.Drawing.Size(290, 195);
    174181      this.viewHost.TabIndex = 0;
    175182      this.viewHost.ViewType = null;
     
    188195      this.showAlgorithmButton.Click += new System.EventHandler(this.showAlgorithmButton_Click);
    189196      //
     197      // changeColorButton
     198      //
     199      this.changeColorButton.Enabled = false;
     200      this.changeColorButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     201      this.changeColorButton.Location = new System.Drawing.Point(94, 52);
     202      this.changeColorButton.Name = "changeColorButton";
     203      this.changeColorButton.Size = new System.Drawing.Size(64, 21);
     204      this.changeColorButton.TabIndex = 21;
     205      this.changeColorButton.Text = "Change";
     206      this.changeColorButton.UseVisualStyleBackColor = true;
     207      this.changeColorButton.Click += new System.EventHandler(this.changeColorButton_Click);
     208      //
     209      // colorLabel
     210      //
     211      this.colorLabel.AutoSize = true;
     212      this.colorLabel.Location = new System.Drawing.Point(3, 56);
     213      this.colorLabel.Name = "colorLabel";
     214      this.colorLabel.Size = new System.Drawing.Size(34, 13);
     215      this.colorLabel.TabIndex = 22;
     216      this.colorLabel.Text = "Color:";
     217      //
     218      // colorPictureBox
     219      //
     220      this.colorPictureBox.Location = new System.Drawing.Point(73, 54);
     221      this.colorPictureBox.Name = "colorPictureBox";
     222      this.colorPictureBox.Size = new System.Drawing.Size(17, 17);
     223      this.colorPictureBox.TabIndex = 23;
     224      this.colorPictureBox.TabStop = false;
     225      //
    190226      // RunView
    191227      //
    192228      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    193229      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     230      this.Controls.Add(this.colorPictureBox);
     231      this.Controls.Add(this.colorLabel);
     232      this.Controls.Add(this.changeColorButton);
    194233      this.Controls.Add(this.parametersResultsGroupBox);
    195234      this.Controls.Add(this.showAlgorithmButton);
     
    202241      this.Controls.SetChildIndex(this.nameTextBox, 0);
    203242      this.Controls.SetChildIndex(this.nameLabel, 0);
     243      this.Controls.SetChildIndex(this.changeColorButton, 0);
     244      this.Controls.SetChildIndex(this.colorLabel, 0);
     245      this.Controls.SetChildIndex(this.colorPictureBox, 0);
    204246      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    205247      this.parametersResultsGroupBox.ResumeLayout(false);
     
    208250      this.splitContainer.ResumeLayout(false);
    209251      this.detailsGroupBox.ResumeLayout(false);
     252      ((System.ComponentModel.ISupportInitialize)(this.colorPictureBox)).EndInit();
    210253      this.ResumeLayout(false);
    211254      this.PerformLayout();
     
    224267    private System.Windows.Forms.ImageList imageList;
    225268    private System.Windows.Forms.Button showAlgorithmButton;
     269    private System.Windows.Forms.Label colorLabel;
     270    private System.Windows.Forms.Button changeColorButton;
     271    private System.Windows.Forms.PictureBox colorPictureBox;
     272    private System.Windows.Forms.ColorDialog colorDialog;
    226273
    227274  }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunView.cs

    r3566 r3638  
    2626using HeuristicLab.Core.Views;
    2727using HeuristicLab.MainForm;
     28using System.Drawing;
    2829
    2930namespace HeuristicLab.Optimization.Views {
     
    5859    }
    5960
     61    protected override void RegisterContentEvents() {
     62      base.RegisterContentEvents();
     63      Content.Changed += new EventHandler(Content_Changed);
     64    }
     65    protected override void DeregisterContentEvents() {
     66      base.DeregisterContentEvents();
     67      Content.Changed -= new EventHandler(Content_Changed);
     68    }
     69    private void Content_Changed(object sender, EventArgs e) {
     70      if (InvokeRequired)
     71        this.Invoke(new EventHandler(Content_Changed), sender, e);
     72      else
     73        UpdateColorPictureBox();
     74    }
     75
    6076    protected override void OnContentChanged() {
    6177      base.OnContentChanged();
     
    6581      if (Content == null)
    6682        Caption = "Run";
    67       else
     83      else {
    6884        Caption = Content.Name + " (" + Content.GetType().Name + ")";
     85        UpdateColorPictureBox();
     86      }
    6987      SetEnabledStateOfControls();
    7088    }
     
    8098      listView.Enabled = Content != null;
    8199      viewHost.Enabled = Content != null;
     100      changeColorButton.Enabled = Content != null;
    82101      showAlgorithmButton.Enabled = Content != null && !Locked;
     102    }
     103
     104    private void changeColorButton_Click(object sender, EventArgs e) {
     105      if (colorDialog.ShowDialog(this) == DialogResult.OK) {
     106        this.Content.Color = this.colorDialog.Color;
     107      }
     108    }
     109    private void UpdateColorPictureBox() {
     110      this.colorDialog.Color = this.Content.Color;
     111      this.colorPictureBox.Image = this.GenerateImage(colorPictureBox.Width, colorPictureBox.Height, this.Content.Color);
     112    }
     113    private Image GenerateImage(int width, int height, Color fillColor) {
     114      Image colorImage = new Bitmap(width, height);
     115      using (Graphics gfx = Graphics.FromImage(colorImage)) {
     116        using (SolidBrush brush = new SolidBrush(fillColor)) {
     117          gfx.FillRectangle(brush, 0, 0, width, height);
     118        }
     119      }
     120      return colorImage;
    83121    }
    84122
Note: See TracChangeset for help on using the changeset viewer.