private void UpdateSplitter() { if (Orientation == Orientation.Vertical) { splitterDistance = MathHelper.Clamp(splitterDistance, panel1MinSize, Width - panel2MinSize - splitterWidth); } else if (Orientation == Orientation.Horizontal) { splitterDistance = MathHelper.Clamp(splitterDistance, panel1MinSize, Height - panel2MinSize - splitterWidth); } panel1.SuspendLayout(); panel2.SuspendLayout(); if (Panel1Collapsed == false && Panel2Collapsed == false) { if (Orientation == Orientation.Vertical) { panel1.Location = new Point(); panel1.Size = new Size(splitterDistance, Height); panel2.Location = new Point(splitterDistance + splitterWidth, 0); panel2.Size = new Size(Width - splitterDistance - splitterWidth, Height); } else { panel1.Location = new Point(); panel1.Size = new Size(Width, splitterDistance); panel2.Location = new Point(0, splitterDistance + splitterWidth); panel2.Size = new Size(Width, Height - splitterDistance - splitterWidth); } } else { if (Panel1Collapsed) { panel2.Location = new Point(); panel2.Size = Size; } else if (Panel2Collapsed) { panel1.Location = new Point(); panel1.Size = Size; } } panel1.ResumeLayout(); panel2.ResumeLayout(); }
private void ResetControl(SplitterPanel panel, Control newControl) { panel.SuspendLayout(); if (!panel.Controls.Contains(newControl)) panel.Controls.Add(newControl); newControl.BringToFront(); if (Panel1 == panel) m_firstFrontedControl = newControl; else m_secondFrontedControl = newControl; panel.ResumeLayout(); }
protected override void LoadListInternal(Mediator mediator, SplitterPanel parent) { parent.FindForm().UseWaitCursor = true; parent.SuspendLayout(); RemovePreviousControl(); TreeView tv = new TreeView(); tv.SuspendLayout(); tv.Dock = DockStyle.Fill; AddPossibilities(tv.Nodes, m_possibilityList.PossibilitiesOS); tv.AfterSelect += new TreeViewEventHandler(tv_AfterSelect); m_currentControl = tv; tv.HideSelection = false; parent.Controls.Add(tv); tv.BringToFront(); tv.ResumeLayout(); parent.ResumeLayout(); parent.FindForm().UseWaitCursor = false; base.LoadListInternal(mediator, parent); tv.SelectedNode = tv.Nodes[0]; }
internal void LoadList(SplitterPanel parent, ICmObject mainObject) { parent.FindForm().UseWaitCursor = true; parent.SuspendLayout(); m_mediator.RemoveColleague(this); if (m_currentControl != null) { m_currentControl.SuspendLayout(); m_currentControl.Parent.Controls.Remove(m_currentControl); m_currentControl.Dispose(); m_currentControl = null; } // Add the new browse view, if available in the config node. if (m_configurationNode.HasChildNodes) { XmlNode parms = m_configurationNode.SelectSingleNode("parameters"); if (mainObject != null) { RecordClerk clerk = (RecordClerk)m_mediator.PropertyTable.GetValue("RecordClerk-" + parms.Attributes["clerk"].Value); if (clerk == null) clerk = RecordClerkFactory.CreateClerk(m_mediator, parms); clerk.OwningObject = mainObject; } RecordBrowseView browseView = new RecordBrowseView(); browseView.SuspendLayout(); browseView.Dock = DockStyle.Fill; m_currentControl = browseView; parent.Controls.Add(browseView); browseView.Init(m_mediator, parms); m_mediator.RemoveColleague(browseView); browseView.BringToFront(); browseView.ResumeLayout(); m_mediator.AddColleague(this); } parent.ResumeLayout(); parent.FindForm().UseWaitCursor = false; }
internal void LoadList(Mediator mediator, SplitterPanel parent) { parent.FindForm().UseWaitCursor = true; parent.SuspendLayout(); RemovePreviousControl(); LoadListInternal(mediator, parent); parent.ResumeLayout(); parent.FindForm().UseWaitCursor = false; }