Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/23/13 17:52:50 (11 years ago)
Author:
ascheibe
Message:

#1042

  • the size of the ProgressView is now adjusted if the Cancel button is not shown
  • replaced the progress bar of the start page with the ProgressView
Location:
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Controls
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.cs

    r9894 r9907  
    2525namespace HeuristicLab.MainForm.WindowsForms {
    2626  internal sealed partial class ProgressView : UserControl {
     27    private const int defaultControlHeight = 88;
     28    private const int collapsedControlHeight = 55;
     29
    2730    private readonly Control control;
    2831    public Control Control {
     
    8083        return;
    8184      }
     85      int height = Content.CanBeCanceled ? Height : collapsedControlHeight;
     86
    8287      Left = (Control.ClientRectangle.Width / 2) - (Width / 2);
    83       Top = (Control.ClientRectangle.Height / 2) - (Height / 2);
     88      Top = (Control.ClientRectangle.Height / 2) - (height / 2);
    8489      Anchor = AnchorStyles.None;
    8590
     
    127132      cancelButton.Visible = content != null && content.CanBeCanceled;
    128133      cancelButton.Enabled = content != null && content.CanBeCanceled;
     134
     135      if (content != null && content.CanBeCanceled) {
     136        Height = defaultControlHeight;
     137      } else if (content != null && !content.CanBeCanceled) {
     138        Height = collapsedControlHeight;
     139      }
    129140    }
    130141
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.designer.cs

    r9894 r9907  
    3535    /// </summary>
    3636    private void InitializeComponent() {
    37       this.components = new System.ComponentModel.Container();
    3837      this.progressBar = new System.Windows.Forms.ProgressBar();
    3938      this.statusLabel = new System.Windows.Forms.Label();
     
    4544      // progressBar
    4645      //
    47       this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    48                   | System.Windows.Forms.AnchorStyles.Right)));
     46      this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     47            | System.Windows.Forms.AnchorStyles.Right)));
    4948      this.progressBar.Location = new System.Drawing.Point(3, 3);
    5049      this.progressBar.Name = "progressBar";
     
    5554      // statusLabel
    5655      //
    57       this.statusLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    58                   | System.Windows.Forms.AnchorStyles.Right)));
     56      this.statusLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     57            | System.Windows.Forms.AnchorStyles.Right)));
    5958      this.statusLabel.Location = new System.Drawing.Point(3, 33);
    6059      this.statusLabel.Name = "statusLabel";
     
    7574      // panel
    7675      //
    77       this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    78                   | System.Windows.Forms.AnchorStyles.Right)));
     76      this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     77            | System.Windows.Forms.AnchorStyles.Left)
     78            | System.Windows.Forms.AnchorStyles.Right)));
    7979      this.panel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
    8080      this.panel.Controls.Add(this.progressBar);
     
    9494      this.panel.ResumeLayout(false);
    9595      this.ResumeLayout(false);
     96
    9697    }
    9798
Note: See TracChangeset for help on using the changeset viewer.