Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/28/12 01:59:10 (12 years ago)
Author:
abeham
Message:

#1985:

  • Removed .resx file
  • Fixed bugs
Location:
branches/RuntimeOptimizer/HeuristicLab.Optimization.Views/3.3
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • branches/RuntimeOptimizer/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj

    r8955 r8956  
    398398    </ProjectReference>
    399399  </ItemGroup>
    400   <ItemGroup>
    401     <EmbeddedResource Include="TimeLimitRunView.resx">
    402       <DependentUpon>TimeLimitRunView.cs</DependentUpon>
    403     </EmbeddedResource>
    404   </ItemGroup>
    405400  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    406401  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/RuntimeOptimizer/HeuristicLab.Optimization.Views/3.3/TimeLimitRunView.Designer.cs

    r8955 r8956  
    5050      this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView();
    5151      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
     52      this.snapshotButton = new System.Windows.Forms.Button();
    5253      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5354      this.tabControl.SuspendLayout();
     
    109110      this.timeLimitTextBox.Size = new System.Drawing.Size(338, 20);
    110111      this.timeLimitTextBox.TabIndex = 17;
    111       this.timeLimitTextBox.Leave += new System.EventHandler(this.timeLimitTextBox_Leave);
    112112      this.timeLimitTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeLimitTextBox_Validating);
    113113      //
     
    127127      this.snapShotsTextBox.Location = new System.Drawing.Point(69, 52);
    128128      this.snapShotsTextBox.Name = "snapShotsTextBox";
    129       this.snapShotsTextBox.Size = new System.Drawing.Size(148, 20);
     129      this.snapShotsTextBox.Size = new System.Drawing.Size(142, 20);
    130130      this.snapShotsTextBox.TabIndex = 17;
    131131      //
     
    266266      this.openFileDialog.Title = "Open Optimizer";
    267267      //
     268      // snapshotButton
     269      //
     270      this.snapshotButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     271      this.snapshotButton.Location = new System.Drawing.Point(120, 440);
     272      this.snapshotButton.Name = "snapshotButton";
     273      this.snapshotButton.Size = new System.Drawing.Size(24, 24);
     274      this.snapshotButton.TabIndex = 20;
     275      this.snapshotButton.Text = "Snapshot";
     276      this.snapshotButton.UseVisualStyleBackColor = true;
     277      this.snapshotButton.Click += new System.EventHandler(this.snapshotButton_Click);
     278      //
    268279      // TimeLimitRunView
    269280      //
    270       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    271       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     281      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
     282      this.Controls.Add(this.snapshotButton);
    272283      this.Controls.Add(this.tabControl);
    273284      this.Controls.Add(this.timeLimitTextBox);
     
    283294      this.Controls.SetChildIndex(this.timeLimitLabel, 0);
    284295      this.Controls.SetChildIndex(this.timeLimitTextBox, 0);
     296      this.Controls.SetChildIndex(this.tabControl, 0);
    285297      this.Controls.SetChildIndex(this.nameLabel, 0);
    286298      this.Controls.SetChildIndex(this.nameTextBox, 0);
     
    292304      this.Controls.SetChildIndex(this.executionTimeTextBox, 0);
    293305      this.Controls.SetChildIndex(this.startButton, 0);
    294       this.Controls.SetChildIndex(this.tabControl, 0);
     306      this.Controls.SetChildIndex(this.snapshotButton, 0);
    295307      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    296308      this.tabControl.ResumeLayout(false);
     
    320332    private RunCollectionView runsView;
    321333    private System.Windows.Forms.OpenFileDialog openFileDialog;
     334    private System.Windows.Forms.Button snapshotButton;
    322335  }
    323336}
  • branches/RuntimeOptimizer/HeuristicLab.Optimization.Views/3.3/TimeLimitRunView.cs

    r8955 r8956  
    2525using System.Windows.Forms;
    2626using HeuristicLab.Common;
     27using HeuristicLab.Common.Resources;
    2728using HeuristicLab.Core;
    2829using HeuristicLab.Core.Views;
     
    4546    public TimeLimitRunView() {
    4647      InitializeComponent();
     48      snapshotButton.Text = String.Empty;
     49      snapshotButton.Image = VSImageLibrary.Breakpoint;
    4750    }
    4851
     
    6972      try {
    7073        if (Content == null) {
    71           timeLimitTextBox.Tag = TimeSpan.FromSeconds(60);
    72           timeLimitTextBox.Text = FormatTimeSpan((TimeSpan)timeLimitTextBox.Tag);
     74          timeLimitTextBox.Text = FormatTimeSpan(TimeSpan.FromSeconds(60));
    7375          snapShotsTextBox.Text = String.Empty;
    7476          storeAlgorithmInEachSnapshotCheckBox.Checked = false;
     
    7779          runsView.Content = null;
    7880        } else {
    79           timeLimitTextBox.Tag = Content.MaximumExecutionTime;
    8081          timeLimitTextBox.Text = FormatTimeSpan(Content.MaximumExecutionTime);
    8182          snapShotsTextBox.Text = String.Join(" ; ", Content.SnapshotTimes);
     
    8788      } finally { SuppressEvents = false; }
    8889    }
     90
    8991    protected override void SetEnabledStateOfControls() {
    9092      base.SetEnabledStateOfControls();
     
    99101    }
    100102
     103    protected override void SetEnabledStateOfExecutableButtons() {
     104      base.SetEnabledStateOfExecutableButtons();
     105      snapshotButton.Enabled = Content != null && (Content.ExecutionState == ExecutionState.Started || Content.ExecutionState == ExecutionState.Paused);
     106    }
     107
    101108    protected override void OnClosed(FormClosedEventArgs e) {
    102109      if ((Content != null) && (Content.ExecutionState == ExecutionState.Started)) {
     
    151158
    152159    #region Control events
    153     private void timeLimitTextBox_Leave(object sender, EventArgs e) {
    154       if (SuppressEvents) return;
    155       SuppressEvents = true;
    156       try {
    157         timeLimitTextBox.Text = FormatTimeSpan((TimeSpan)timeLimitTextBox.Tag);
    158       } finally { SuppressEvents = false; }
    159     }
    160 
    161160    private void timeLimitTextBox_Validating(object sender, CancelEventArgs e) {
    162161      if (SuppressEvents) return;
     
    179178          ts = GetTimeSpanFromFormat(value, text.Substring(length - 1, text.Length - (length - 1)).TrimStart());
    180179        } else ts = TimeSpan.FromSeconds(value);
    181         timeLimitTextBox.Tag = ts;
     180        Content.MaximumExecutionTime = ts;
    182181        e.Cancel = false;
    183182        errorProvider.SetError(timeLimitTextBox, String.Empty);
     
    252251      }
    253252    }
     253
     254    private void snapshotButton_Click(object sender, EventArgs e) {
     255      Content.Snapshot();
     256    }
    254257    #endregion
    255258    #endregion
Note: See TracChangeset for help on using the changeset viewer.