Free cookie consent management tool by TermsFeed Policy Generator

Changeset 18154


Ignore:
Timestamp:
12/17/21 15:26:14 (3 years ago)
Author:
dpiringe
Message:

#3136

  • overwrote the method SetEnabledStateOfControls for StructureTemplateView
  • fixed the wrong usage of infoLabel in StructureTemplateView -> added a new label errorLabel for textual output
  • deleted the resource file for StructureTemplateView
Location:
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj

    r18146 r18154  
    334334      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    335335    </EmbeddedResource>
    336     <EmbeddedResource Include="StructureTemplate\StructureTemplateView.resx">
    337       <DependentUpon>StructureTemplateView.cs</DependentUpon>
    338     </EmbeddedResource>
    339336  </ItemGroup>
    340337  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/StructureTemplate/StructureTemplateView.Designer.cs

    r18134 r18154  
    2323      this.splitContainer = new System.Windows.Forms.SplitContainer();
    2424      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     25      this.errorLabel = new System.Windows.Forms.Label();
    2526      this.detailsGroupBox.SuspendLayout();
    2627      this.templateStructureGroupBox.SuspendLayout();
     
    5859      // templateStructureGroupBox
    5960      //
     61      this.templateStructureGroupBox.Controls.Add(this.errorLabel);
    6062      this.templateStructureGroupBox.Controls.Add(this.linearScalingCheckBox);
    6163      this.templateStructureGroupBox.Controls.Add(this.infoLabel);
     
    8688      this.infoLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    8789      this.infoLabel.BackColor = System.Drawing.Color.White;
    88       this.infoLabel.Image = ((System.Drawing.Image)(resources.GetObject("infoLabel.Image")));
     90      this.infoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
    8991      this.infoLabel.Location = new System.Drawing.Point(275, 22);
    9092      this.infoLabel.Name = "infoLabel";
     
    9395      this.infoLabel.Text = "    ";
    9496      this.toolTip.SetToolTip(this.infoLabel, "Double-click to open description.");
    95       this.infoLabel.DoubleClick += new System.EventHandler(this.helpButton_DoubleClick);
     97      this.infoLabel.DoubleClick += new System.EventHandler(this.HelpButtonDoubleClick);
    9698      //
    9799      // treeChart
     
    157159      this.splitContainer.TabIndex = 10;
    158160      //
     161      // errorLabel
     162      //
     163      this.errorLabel.AutoSize = true;
     164      this.errorLabel.BackColor = System.Drawing.Color.White;
     165      this.errorLabel.Location = new System.Drawing.Point(3, 74);
     166      this.errorLabel.Name = "errorLabel";
     167      this.errorLabel.Size = new System.Drawing.Size(0, 13);
     168      this.errorLabel.TabIndex = 9;
     169      //
    159170      // StructureTemplateView
    160171      //
     
    187198    private System.ComponentModel.IContainer components;
    188199    private ToolTip toolTip;
     200    private Label errorLabel;
    189201  }
    190202}
  • branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/StructureTemplate/StructureTemplateView.cs

    r18151 r18154  
    2525    public StructureTemplateView() {
    2626      InitializeComponent();
    27       infoLabel.Text = "";
     27      errorLabel.Text = "";
    2828      this.Resize += StructureTemplateViewResize;
    2929      splitContainer.SplitterMoved += SplitContainerSplitterMoved;
     
    5050    }
    5151
     52    protected override void SetEnabledStateOfControls() {
     53      base.SetEnabledStateOfControls();
     54      parseButton.Enabled = Content != null && !Locked && !ReadOnly;
     55      linearScalingCheckBox.Enabled = Content != null && !Locked && !ReadOnly;
     56      expressionInput.Enabled = Content != null && !Locked && !ReadOnly;
     57    }
     58
    5259    protected override void OnContentChanged() {
    5360      base.OnContentChanged();
     
    5663      linearScalingCheckBox.Checked = Content.ApplyLinearScaling;
    5764      PaintTree();
    58       infoLabel.Text = "";
     65      errorLabel.Text = "";
    5966    }
    6067
     
    6471
    6572    private void ExpressionInputTextChanged(object sender, EventArgs e) {
    66       infoLabel.Text = "Unparsed changes! Press parse button to save changes.";
    67       infoLabel.ForeColor = Color.DarkOrange;
     73      errorLabel.Text = "Unparsed changes! Press parse button to save changes.";
     74      errorLabel.ForeColor = Color.DarkOrange;
    6875    }
    6976
     
    93100          Content.Template = expressionInput.Text;
    94101          PaintTree();
    95           infoLabel.Text = "Template structure successfully parsed.";
    96           infoLabel.ForeColor = Color.DarkGreen;
     102          errorLabel.Text = "Template structure successfully parsed.";
     103          errorLabel.ForeColor = Color.DarkGreen;
    97104        } catch (AggregateException ex) {
    98           infoLabel.Text = string.Join("\n", ex.InnerExceptions.Select(x => x.Message));
    99           infoLabel.ForeColor = Color.DarkRed;
     105          errorLabel.Text = string.Join("\n", ex.InnerExceptions.Select(x => x.Message));
     106          errorLabel.ForeColor = Color.DarkRed;
    100107        } catch (Exception ex) {
    101           infoLabel.Text = ex.Message;
    102           infoLabel.ForeColor = Color.DarkRed;
     108          errorLabel.Text = ex.Message;
     109          errorLabel.ForeColor = Color.DarkRed;
    103110        }
    104111      }
     
    110117    }
    111118
    112     private void helpButton_DoubleClick(object sender, EventArgs e) {
     119    private void HelpButtonDoubleClick(object sender, EventArgs e) {
    113120      using (InfoBox dialog = new InfoBox("Help for structure template",
    114121        "HeuristicLab.Problems.DataAnalysis.Symbolic.Views.Resources.structureTemplateHelp.rtf",
Note: See TracChangeset for help on using the changeset viewer.