internal void LoadList(Mediator mediator, SplitterPanel parent) { parent.FindForm().UseWaitCursor = true; parent.SuspendLayout(); RemovePreviousControl(); LoadListInternal(mediator, parent); parent.ResumeLayout(); parent.FindForm().UseWaitCursor = false; }
/// <summary> /// called in ContentViewManager when a ContentViewer is attached /// </summary> public void AttachViewer(IVidget viewer, Action onShowAction) { if (viewer == null) { return; } var backend = viewer.Backend; if (backend == null) { return; } var control = backend.ToSwf(); var currentDisplayBackend = this.Frontend.CurrentDisplay.ToSwf(); SplitterPanel panel = null; if (currentDisplayBackend != control) { if (SplitContainer.Panel1.Controls.Cast <Control>().Contains(currentDisplayBackend)) { panel = SplitContainer.Panel2; } else if (SplitContainer.Panel2.Controls.Cast <Control>().Contains(currentDisplayBackend)) { panel = SplitContainer.Panel1; } } else { Trace.WriteLine("SplitViewBackend.AttachBackend: currentDisplayBackend == control"); return; } if (panel != null && !panel.Controls.Cast <Control>().Contains(control)) { panel.SuspendLayout(); panel.Controls.Clear(); panel.Controls.Add(control); control.Dock = DockStyle.Fill; panel.ResumeLayout(); } if (onShowAction != null) { onShowAction(); } }
public override bool Initialize(IPluginHost host) { this.pluginHost = host; var m_richEntryView = FindControl <RichTextBox>("m_richEntryView"); SplitContainer parent = (SplitContainer)m_richEntryView.Parent.Parent; SplitterPanel splitterPanel = parent.Panel2; splitterPanel.SuspendLayout(); splitterPanel.Controls.Remove(m_richEntryView); CustomSplitContainerEx additionalSplitter = new KeePass.UI.CustomSplitContainerEx(); additionalSplitter.Panel1.SuspendLayout(); additionalSplitter.Panel2.SuspendLayout(); additionalSplitter.SuspendLayout(); Label label = new Label { Text = "This is a test!" }; label.Dock = DockStyle.Fill; label.Anchor = AnchorStyles.Top | AnchorStyles.Left; label.Location = new System.Drawing.Point(0, 0); label.Size = new System.Drawing.Size(96, 96); additionalSplitter.Dock = DockStyle.Fill; additionalSplitter.Location = new System.Drawing.Point(0, 0); additionalSplitter.Name = "m_splitHorizontal"; additionalSplitter.Orientation = Orientation.Vertical; additionalSplitter.Panel1.Controls.Add(label); additionalSplitter.Panel2.Controls.Add(m_richEntryView); additionalSplitter.Size = new System.Drawing.Size(654, 96); additionalSplitter.SplitterDistance = 96; additionalSplitter.TabIndex = 2; additionalSplitter.TabStop = false; splitterPanel.Controls.Add(additionalSplitter); additionalSplitter.Panel1.ResumeLayout(false); additionalSplitter.Panel2.ResumeLayout(false); additionalSplitter.ResumeLayout(); splitterPanel.ResumeLayout(); return(true); }
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(); }
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; }
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]; }