Changeset 5012


Ignore:
Timestamp:
12/02/10 23:12:17 (11 years ago)
Author:
mkommend
Message:

Added possibility to hide the ViewHost icon (ticket #1312).

File:
1 edited

Legend:

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

    r4521 r5012  
    4040      messageLabel.Visible = false;
    4141      viewsLabel.Visible = false;
     42      viewsLabelVisible = true;
     43    }
     44
     45    private bool viewsLabelVisible;
     46    public bool ViewsLabelVisible {
     47      get { return viewsLabelVisible; }
     48      set {
     49        if (viewsLabelVisible != value) {
     50          viewsLabelVisible = value;
     51          viewsLabel.Visible = value;
     52          View view = activeView as View;
     53          if (view != null) view.Dock = viewsLabelVisible ? DockStyle.None : DockStyle.Fill;
     54        }
     55      }
    4256    }
    4357
     
    8195              view.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
    8296              view.Size = new Size(Width - this.viewsLabel.Width - this.viewsLabel.Margin.Left - this.viewsLabel.Margin.Right, this.Height);
     97              view.Dock = viewsLabelVisible ? DockStyle.None : DockStyle.Fill;
    8398              view.OnShown(new ViewShownEventArgs(view, false));
    8499              if (!Controls.Contains((view))) Controls.Add(view);
     
    133148      if (Content != null && viewContextMenuStrip.Items.Count > 0) {
    134149        messageLabel.Visible = false;
    135         viewsLabel.Visible = true;
     150        viewsLabel.Visible = viewsLabelVisible;
    136151      } else if (Content != null) {
    137152        messageLabel.Visible = true;
Note: See TracChangeset for help on using the changeset viewer.