Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3655 for trunk


Ignore:
Timestamp:
05/05/10 23:08:02 (15 years ago)
Author:
mkommend
Message:

corrected resizing behavior in ViewHost (ticket #972)

Location:
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3
Files:
2 edited

Legend:

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

    r3572 r3655  
    4747      this.components = new System.ComponentModel.Container();
    4848      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ViewHost));
    49       this.viewPanel = new ViewHostPanel();
     49      this.viewPanel = new HeuristicLab.MainForm.WindowsForms.ViewHostPanel();
    5050      this.messageLabel = new System.Windows.Forms.Label();
    5151      this.viewsLabel = new System.Windows.Forms.Label();
     
    6363      this.viewPanel.Size = new System.Drawing.Size(205, 184);
    6464      this.viewPanel.TabIndex = 1;
     65      this.viewPanel.Resize += new System.EventHandler(this.viewPanel_Resize);
    6566      //
    6667      // messageLabel
     
    7879      this.viewsLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    7980      this.viewsLabel.ContextMenuStrip = this.viewContextMenuStrip;
    80       this.viewsLabel.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Windows;
     81      this.viewsLabel.Image = ((System.Drawing.Image)(resources.GetObject("viewsLabel.Image")));
    8182      this.viewsLabel.Location = new System.Drawing.Point(211, 0);
    8283      this.viewsLabel.Name = "viewsLabel";
     
    9192      // viewContextMenuStrip
    9293      //
     94      this.viewContextMenuStrip.IgnoredViewTypes = ((System.Collections.Generic.IEnumerable<System.Type>)(resources.GetObject("viewContextMenuStrip.IgnoredViewTypes")));
    9395      this.viewContextMenuStrip.Item = null;
    9496      this.viewContextMenuStrip.Name = "viewContextMenuStrip";
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/ViewHost.cs

    r3646 r3655  
    4141    }
    4242
     43    private bool viewShown;
    4344    private Dictionary<Type, IContentView> cachedViews;
    4445    public IEnumerable<IContentView> Views {
     
    138139        throw new InvalidOperationException(string.Format("View \"{0}\" cannot display content \"{1}\".",
    139140                                                          viewType, Content.GetType()));
    140       if (viewPanel.Height <= 10 || viewPanel.Width <= 10)
     141      if (viewPanel.Height <= 10 || viewPanel.Width <= 10) {
     142        viewShown = false;
    141143        return;
    142 
     144      }
     145
     146      viewShown = true;
    143147      UpdateActiveMenuItem();
    144148      IContentView view;
     
    159163    }
    160164
     165    private void viewPanel_Resize(object sender, EventArgs e) {
     166      if (!viewShown)
     167        this.OnViewTypeChanged();
     168    }
     169
    161170    private void RegisterActiveViewEvents() {
    162171      activeView.Changed += new EventHandler(activeView_Changed);
Note: See TracChangeset for help on using the changeset viewer.