Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/25/11 17:18:58 (13 years ago)
Author:
swagner
Message:

Moved description from textbox to icon in NamedItemView and adapted all derived views (#1416)

Location:
trunk/sources/HeuristicLab.Core.Views/3.3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/NamedItemView.Designer.cs

    r5445 r5832  
    4848      this.nameLabel = new System.Windows.Forms.Label();
    4949      this.nameTextBox = new System.Windows.Forms.TextBox();
    50       this.descriptionLabel = new System.Windows.Forms.Label();
    51       this.descriptionTextBox = new System.Windows.Forms.TextBox();
    5250      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
    5351      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     52      this.infoLabel = new System.Windows.Forms.Label();
    5453      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5554      this.SuspendLayout();
     
    6867      this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    6968                  | System.Windows.Forms.AnchorStyles.Right)));
    70       this.nameTextBox.Location = new System.Drawing.Point(72, 0);
     69      this.nameTextBox.Location = new System.Drawing.Point(58, 0);
    7170      this.nameTextBox.Name = "nameTextBox";
    72       this.nameTextBox.Size = new System.Drawing.Size(279, 20);
     71      this.nameTextBox.Size = new System.Drawing.Size(268, 20);
    7372      this.nameTextBox.TabIndex = 1;
    74       this.nameTextBox.Validated += new System.EventHandler(this.nameTextBox_Validated);
    7573      this.nameTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.nameTextBox_KeyDown);
    7674      this.nameTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.nameTextBox_Validating);
    77       //
    78       // descriptionLabel
    79       //
    80       this.descriptionLabel.AutoSize = true;
    81       this.descriptionLabel.Location = new System.Drawing.Point(3, 29);
    82       this.descriptionLabel.Name = "descriptionLabel";
    83       this.descriptionLabel.Size = new System.Drawing.Size(63, 13);
    84       this.descriptionLabel.TabIndex = 2;
    85       this.descriptionLabel.Text = "&Description:";
    86       //
    87       // descriptionTextBox
    88       //
    89       this.descriptionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    90                   | System.Windows.Forms.AnchorStyles.Right)));
    91       this.descriptionTextBox.Location = new System.Drawing.Point(72, 26);
    92       this.descriptionTextBox.Name = "descriptionTextBox";
    93       this.descriptionTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
    94       this.descriptionTextBox.Size = new System.Drawing.Size(279, 20);
    95       this.descriptionTextBox.TabIndex = 3;
    96       this.descriptionTextBox.DoubleClick += new System.EventHandler(this.descriptionTextBox_DoubleClick);
    97       this.descriptionTextBox.Validated += new System.EventHandler(this.descriptionTextBox_Validated);
     75      this.nameTextBox.Validated += new System.EventHandler(this.nameTextBox_Validated);
    9876      //
    9977      // errorProvider
     
    10280      this.errorProvider.ContainerControl = this;
    10381      //
     82      // infoLabel
     83      //
     84      this.infoLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     85      this.infoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
     86      this.infoLabel.Location = new System.Drawing.Point(332, 3);
     87      this.infoLabel.Name = "infoLabel";
     88      this.infoLabel.Size = new System.Drawing.Size(16, 16);
     89      this.infoLabel.TabIndex = 2;
     90      this.toolTip.SetToolTip(this.infoLabel, "Double-click to open description editor.");
     91      this.infoLabel.DoubleClick += new System.EventHandler(this.infoLabel_DoubleClick);
     92      //
    10493      // NamedItemView
    10594      //
    10695      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    10796      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    108       this.Controls.Add(this.descriptionTextBox);
     97      this.Controls.Add(this.infoLabel);
    10998      this.Controls.Add(this.nameTextBox);
    110       this.Controls.Add(this.descriptionLabel);
    11199      this.Controls.Add(this.nameLabel);
    112100      this.Name = "NamedItemView";
    113       this.Size = new System.Drawing.Size(351, 52);
     101      this.Size = new System.Drawing.Size(351, 28);
    114102      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    115103      this.ResumeLayout(false);
     
    122110    protected System.Windows.Forms.TextBox nameTextBox;
    123111    protected System.Windows.Forms.Label nameLabel;
    124     protected System.Windows.Forms.Label descriptionLabel;
    125     protected System.Windows.Forms.TextBox descriptionTextBox;
    126112    protected System.Windows.Forms.ErrorProvider errorProvider;
    127113    protected System.Windows.Forms.ToolTip toolTip;
     114    protected System.Windows.Forms.Label infoLabel;
    128115  }
    129116}
  • trunk/sources/HeuristicLab.Core.Views/3.3/NamedItemView.cs

    r5445 r5832  
    3333  [Content(typeof(INamedItem), false)]
    3434  public partial class NamedItemView : ItemView {
     35    private readonly string nl = Environment.NewLine;
     36    private const string infoLabelToolTipSuffix = "Double-click to open description editor.";
     37
    3538    public new INamedItem Content {
    3639      get { return (INamedItem)base.Content; }
     
    5962      if (Content == null) {
    6063        nameTextBox.Text = string.Empty;
    61         descriptionTextBox.Text = string.Empty;
    62         toolTip.SetToolTip(descriptionTextBox, string.Empty);
     64        toolTip.SetToolTip(infoLabel, string.Empty);
    6365        if (ViewAttribute.HasViewAttribute(this.GetType()))
    6466          this.Caption = ViewAttribute.GetViewName(this.GetType());
     
    6769      } else {
    6870        nameTextBox.Text = Content.Name;
    69         descriptionTextBox.Text = Content.Description;
    70         toolTip.SetToolTip(descriptionTextBox, Content.Description);
     71        toolTip.SetToolTip(infoLabel, string.IsNullOrEmpty(Content.Description) ? infoLabelToolTipSuffix : Content.Description + nl + nl + infoLabelToolTipSuffix);
    7172        Caption = Content.Name;
    7273      }
     
    7778      if (Content == null) {
    7879        nameTextBox.Enabled = false;
    79         descriptionTextBox.Enabled = false;
     80        infoLabel.Enabled = false;
    8081      } else {
    8182        nameTextBox.Enabled = true;
    82         nameTextBox.ReadOnly = ReadOnly || !Content.CanChangeName; ;
    83         descriptionTextBox.Enabled = true;
    84         descriptionTextBox.ReadOnly = ReadOnly || !Content.CanChangeDescription;
     83        nameTextBox.ReadOnly = ReadOnly || !Content.CanChangeName;
     84        infoLabel.Enabled = true;
    8585      }
    8686    }
     
    9898        Invoke(new EventHandler(Content_DescriptionChanged), sender, e);
    9999      else {
    100         descriptionTextBox.Text = Content.Description;
    101         toolTip.SetToolTip(descriptionTextBox, Content.Description);
     100        toolTip.SetToolTip(infoLabel, string.IsNullOrEmpty(Content.Description) ? infoLabelToolTipSuffix : Content.Description + nl + nl + infoLabelToolTipSuffix);
    102101      }
    103102    }
     
    131130      }
    132131    }
    133     protected virtual void descriptionTextBox_Validated(object sender, EventArgs e) {
    134       if (Content.CanChangeDescription)
    135         Content.Description = descriptionTextBox.Text;
    136     }
    137 
    138     protected void descriptionTextBox_DoubleClick(object sender, EventArgs e) {
    139       using (TextDialog dialog = new TextDialog("Description of " + Content.Name, descriptionTextBox.Text, ReadOnly || !Content.CanChangeDescription)) {
     132    protected virtual void infoLabel_DoubleClick(object sender, EventArgs e) {
     133      using (TextDialog dialog = new TextDialog("Description of " + Content.Name, Content.Description, ReadOnly || !Content.CanChangeDescription)) {
    140134        if (dialog.ShowDialog(this) == DialogResult.OK)
    141135          Content.Description = dialog.Content;
  • trunk/sources/HeuristicLab.Core.Views/3.3/ParameterizedNamedItemView.Designer.cs

    r5445 r5832  
    5353      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    5454      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    55       this.nameTextBox.Size = new System.Drawing.Size(418, 20);
     55      this.nameTextBox.Location = new System.Drawing.Point(59, 0);
     56      this.nameTextBox.Size = new System.Drawing.Size(406, 20);
    5657      //
    57       // descriptionTextBox
     58      // infoLabel
    5859      //
    59       this.descriptionTextBox.Size = new System.Drawing.Size(418, 20);
     60      this.infoLabel.Location = new System.Drawing.Point(471, 3);
    6061      //
    6162      // parameterCollectionView
     
    6465                  | System.Windows.Forms.AnchorStyles.Left)
    6566                  | System.Windows.Forms.AnchorStyles.Right)));
     67      this.parameterCollectionView.Caption = "ParameterCollection View";
    6668      this.parameterCollectionView.Content = null;
    67       this.parameterCollectionView.Location = new System.Drawing.Point(0, 52);
     69      this.parameterCollectionView.Location = new System.Drawing.Point(0, 26);
    6870      this.parameterCollectionView.Name = "parameterCollectionView";
    69       this.parameterCollectionView.Size = new System.Drawing.Size(490, 301);
    70       this.parameterCollectionView.TabIndex = 4;
     71      this.parameterCollectionView.ReadOnly = false;
     72      this.parameterCollectionView.Size = new System.Drawing.Size(490, 327);
     73      this.parameterCollectionView.TabIndex = 3;
    7174      //
    7275      // ParameterizedNamedItemView
     
    7780      this.Name = "ParameterizedNamedItemView";
    7881      this.Size = new System.Drawing.Size(490, 353);
     82      this.Controls.SetChildIndex(this.infoLabel, 0);
    7983      this.Controls.SetChildIndex(this.nameTextBox, 0);
    8084      this.Controls.SetChildIndex(this.nameLabel, 0);
    81       this.Controls.SetChildIndex(this.descriptionLabel, 0);
    82       this.Controls.SetChildIndex(this.descriptionTextBox, 0);
    8385      this.Controls.SetChildIndex(this.parameterCollectionView, 0);
    8486      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
  • trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.Designer.cs

    r5445 r5832  
    5050      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    5151      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    52       this.nameTextBox.Size = new System.Drawing.Size(287, 20);
     52      this.nameTextBox.Location = new System.Drawing.Point(69, 0);
     53      this.nameTextBox.Size = new System.Drawing.Size(265, 20);
    5354      //
    54       // descriptionTextBox
     55      // infoLabel
    5556      //
    56       this.descriptionTextBox.Size = new System.Drawing.Size(287, 20);
     57      this.infoLabel.Location = new System.Drawing.Point(340, 3);
    5758      //
    5859      // dataTypeLabel
    5960      //
    6061      this.dataTypeLabel.AutoSize = true;
    61       this.dataTypeLabel.Location = new System.Drawing.Point(3, 55);
     62      this.dataTypeLabel.Location = new System.Drawing.Point(3, 29);
    6263      this.dataTypeLabel.Name = "dataTypeLabel";
    6364      this.dataTypeLabel.Size = new System.Drawing.Size(60, 13);
    64       this.dataTypeLabel.TabIndex = 4;
     65      this.dataTypeLabel.TabIndex = 3;
    6566      this.dataTypeLabel.Text = "Data &Type:";
    6667      //
     
    6970      this.dataTypeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    7071                  | System.Windows.Forms.AnchorStyles.Right)));
    71       this.dataTypeTextBox.Location = new System.Drawing.Point(72, 52);
     72      this.dataTypeTextBox.Location = new System.Drawing.Point(69, 26);
    7273      this.dataTypeTextBox.Name = "dataTypeTextBox";
    7374      this.dataTypeTextBox.ReadOnly = true;
    74       this.dataTypeTextBox.Size = new System.Drawing.Size(287, 20);
    75       this.dataTypeTextBox.TabIndex = 5;
     75      this.dataTypeTextBox.Size = new System.Drawing.Size(290, 20);
     76      this.dataTypeTextBox.TabIndex = 4;
    7677      //
    7778      // valueGroupBox
     
    8384      this.valueGroupBox.Controls.Add(this.clearValueButton);
    8485      this.valueGroupBox.Controls.Add(this.setValueButton);
    85       this.valueGroupBox.Location = new System.Drawing.Point(0, 78);
     86      this.valueGroupBox.Location = new System.Drawing.Point(0, 52);
    8687      this.valueGroupBox.Name = "valueGroupBox";
    87       this.valueGroupBox.Size = new System.Drawing.Size(359, 196);
    88       this.valueGroupBox.TabIndex = 7;
     88      this.valueGroupBox.Size = new System.Drawing.Size(359, 222);
     89      this.valueGroupBox.TabIndex = 5;
    8990      this.valueGroupBox.TabStop = false;
    9091      this.valueGroupBox.Text = "Value";
     
    99100      this.valuePanel.Location = new System.Drawing.Point(6, 49);
    100101      this.valuePanel.Name = "valuePanel";
    101       this.valuePanel.Size = new System.Drawing.Size(347, 141);
     102      this.valuePanel.Size = new System.Drawing.Size(347, 167);
    102103      this.valuePanel.TabIndex = 2;
    103       this.valuePanel.DragOver += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver);
    104104      this.valuePanel.DragDrop += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragDrop);
    105105      this.valuePanel.DragEnter += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver);
     106      this.valuePanel.DragOver += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver);
    106107      //
    107108      // viewHost
    108109      //
     110      this.viewHost.Caption = "View";
    109111      this.viewHost.Content = null;
    110112      this.viewHost.Dock = System.Windows.Forms.DockStyle.Fill;
     113      this.viewHost.Enabled = false;
    111114      this.viewHost.Location = new System.Drawing.Point(0, 0);
    112115      this.viewHost.Name = "viewHost";
    113       this.viewHost.Size = new System.Drawing.Size(347, 141);
     116      this.viewHost.ReadOnly = false;
     117      this.viewHost.Size = new System.Drawing.Size(347, 167);
    114118      this.viewHost.TabIndex = 0;
     119      this.viewHost.ViewsLabelVisible = true;
    115120      this.viewHost.ViewType = null;
    116121      //
     
    132137      this.setValueButton.Name = "setValueButton";
    133138      this.setValueButton.Size = new System.Drawing.Size(24, 24);
    134       this.setValueButton.TabIndex = 1;
     139      this.setValueButton.TabIndex = 0;
    135140      this.toolTip.SetToolTip(this.setValueButton, "Set Value");
    136141      this.setValueButton.UseVisualStyleBackColor = true;
     
    146151      this.Name = "VariableView";
    147152      this.Size = new System.Drawing.Size(359, 274);
    148       this.Controls.SetChildIndex(this.descriptionLabel, 0);
     153      this.Controls.SetChildIndex(this.infoLabel, 0);
    149154      this.Controls.SetChildIndex(this.dataTypeTextBox, 0);
    150155      this.Controls.SetChildIndex(this.dataTypeLabel, 0);
    151       this.Controls.SetChildIndex(this.descriptionTextBox, 0);
    152156      this.Controls.SetChildIndex(this.nameTextBox, 0);
    153157      this.Controls.SetChildIndex(this.nameLabel, 0);
Note: See TracChangeset for help on using the changeset viewer.