public SimpleGuiCanvasPanel(SplitterPanel splitterPanel) : base(splitterPanel) { // set thisForm's properties and event handlers thisForm = this.Parent.ParentForm as SimpleGuiForm; thisForm.KeyPreview = true; thisForm.KeyDown += thisForm_KeyDown; thisForm.KeyUp += thisForm_KeyUp; thisForm.Deactivate += thisForm_Deactivate; thisForm.Activated += thisForm_Activated; thisForm.FormClosing += (o, e) => this.Stop(); // set panel properties and event handlers Panel.BackColor = Color.White; Panel.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic) .SetValue(Panel, true, null); // make panel double buffered to remove flicker Panel.MouseClick += splitterPanel_MouseClick; Panel.MouseMove += splitterPanel_MouseMove; Panel.Paint += Panel_Paint; // set the canvas and frame rate canvas = new Canvas() { BackgroundColor = Color.Black, Owner = splitterPanel, Size = new Size(480, 360), }; this.TargetFrameRate = 30; downKeys = new System.Collections.Generic.HashSet<Keys>(); }
private void TestRoom_Load(object sender, EventArgs e) { pictureContainer = pictureLogSplit.Panel1; pictureContainer.Resize += pictureContainer_Resize; pictureContainer.Paint += pictureContainer_Paint; UpdateListView(); }
public MainForm() { InitializeComponent(); this.Game = new GoGame(); this.gamePanel = this.mainSplitContainer.Panel1; }
public static void SaveDesignForm(System.Windows.Forms.SplitterPanel ctr) { UIMessage.DBEngine.exec("FormLayout_Save", "@FormName", ctr.FindForm().Name, "@ControlName", ctr.Name, "@SystemType", string.Format("{0},{1}", ctr.GetType().FullName, ctr.GetType().Namespace), "@LocationX", ctr.Location.X, "@LocationY", ctr.Location.Y, "@Height", ctr.Size.Height, "@Width", ctr.Size.Width); }
public void ToSinglePanel(SplitterPanel panelToMaximize) { if (panelToMaximize == this.Panel1) { this.Panel2Collapsed = true; this.OnPanelCollapsedChanged(new SplitPanelEventArgs(this.Panel2, true)); } else if (panelToMaximize == this.Panel2) { this.Panel1Collapsed = true; this.OnPanelCollapsedChanged(new SplitPanelEventArgs(this.Panel1, true)); } }
public SplitContainer() { panel1 = new SplitterPanel(this); panel2 = new SplitterPanel(this); Controls.Add(panel1); Controls.Add(panel2); UpdateSplitter(); Application.UpdateEvent += ApplicationOnUpdateEvent; MouseHook.MouseUp += MouseHookOnMouseUp; }
public override void MsdnNamePropertyTest() { SplitContainer splitContainer = new SplitContainer(); SplitterPanel splitterPanel = new SplitterPanel(splitContainer); AutomationElement child = GetAutomationElementFromControl(splitterPanel); Assert.AreEqual(splitterPanel.Name, child.GetCurrentPropertyValue(AutomationElementIdentifiers.NameProperty, true), "NameProperty"); splitterPanel.Name = "Unhappy splitterPanel"; Assert.AreEqual(splitterPanel.Name, child.GetCurrentPropertyValue(AutomationElementIdentifiers.NameProperty, true), "NameProperty"); }
/// <summary> /// Abre un Use Control y lo coloca en una SplitterPanel. /// </summary> /// <param name="use">Instancia del Use Control que se desea abrir.</param> /// <param name="myPanel">SplitterPanel donde se desea alojar el Use Control.</param> /// <param name="pDock">Estilo de Llenado.</param> public static void AbrirFormulario(UserControl use, SplitterPanel myPanel, DockStyle pDock) { //Dim wB As Boolean = False //Dim p As TabPage = BuscarFormulario(CType(myPanel.Parent.Parent.Parent.Parent, frmPrincipalForm).tbc, "ArbolDirectorios") //If Not p Is Nothing Then // If Not TypeOf (use) Is useArbolDirectorios Then // CType(p.Controls(0), Form).Close() // CType(myPanel.Parent.Parent.Parent.Parent, frmPrincipalForm).tbc.Controls.Remove(p) // Else // wB = True // End If //End If //If Not wB Then myPanel.Controls.Clear(); use.Dock = pDock; myPanel.Controls.Add(use); //End If }
private static void SetPanelSize(SplitContainer cont, SplitterPanel panel, int size) { if (cont.Orientation == Orientation.Vertical) { var width = cont.ClientSize.Width - cont.SplitterWidth; if (panel == cont.Panel1) cont.SplitterDistance = size; else cont.SplitterDistance = width - size; } else { var height = cont.ClientSize.Height - cont.SplitterWidth; if (panel == cont.Panel1) cont.SplitterDistance = size; else cont.SplitterDistance = height - size; } }
public void CrearComponente(SplitterPanel host, int columna, int fila, int indice, Sucursal tmpSucursal) { _hostForm = host; Index = indice; Col = columna; Row = fila; SucursalAsignada = tmpSucursal; //Botones = new Button[2]; Etiqueta = AgregarEtiqueta(tmpSucursal.ClaveSucursal); VideoEnLinea = new PictureBox(); _hostForm.Controls.Add(VideoEnLinea); VideoEnLinea.Top = _posTopLabel[Row]; VideoEnLinea.Left = _posLeftElem1[Col]; VideoEnLinea.Tag = Index; VideoEnLinea.Size = new Size(100, 100); VideoEnLinea.BorderStyle = BorderStyle.FixedSingle; //VideoEnLinea = AgregarVideoSnapshot(); //Botones[0] = AgregarBoton("Cam.", ClickVideo, 1); //Botones[0] = AgregarBoton("Aud.", ClickAudio, 2); AgregarVideoSnapshot(urlcam, puerto, root, pass); }
protected override Control GetControl() { SplitContainer splitContainer = new SplitContainer(); SplitterPanel splitterPanel = new SplitterPanel(splitContainer); splitterPanel.Name = "I'm a happy SWF splitterPanel :)"; return splitterPanel; }
public SplitContainer () { SetStyle (ControlStyles.SupportsTransparentBackColor, true); SetStyle (ControlStyles.OptimizedDoubleBuffer, true); fixed_panel = FixedPanel.None; orientation = Orientation.Vertical; splitter_rectangle = new Rectangle (50, 0, 4, this.Height); splitter_increment = 1; splitter_prev_move = -1; restore_cursor = null; splitter_fixed = false; panel1_collapsed = false; panel2_collapsed = false; panel1_min_size = 25; panel2_min_size = 25; panel1 = new SplitterPanel (this); panel2 = new SplitterPanel (this); panel1.Size = new Size (50, 50); UpdateSplitter (); this.Controls.Add (panel2); this.Controls.Add (panel1); }
private void SetPanelBorderState(SplitterPanel splitterPanel, bool paintBorder) { if (paintBorder) { // save a copy of the current padding if (splitterPanel == split.Panel1) p1 = splitterPanel.Padding; else p2 = splitterPanel.Padding; // adjust the padding to accommodate the border var p = splitterPanel.Padding; splitterPanel.Padding = new Padding(Math.Max(p.Left, 1), Math.Min(p.Top, 1), Math.Min(p.Right, 1), Math.Min(p.Bottom, 1)); // hook the paint event handler splitterPanel.Paint += splitPanel_Paint; } else { // restore the original padding and then unhook the paint event handler splitterPanel.Padding = (split.Panel1 == splitterPanel ? p1 : p2); splitterPanel.Paint -= splitPanel_Paint; } splitterPanel.Invalidate(); }
public SplitContainer() { this.panel1 = new SplitterPanel(this); this.panel2 = new SplitterPanel(this); this.splitterRect = new Rectangle(); base.SetStyle(ControlStyles.SupportsTransparentBackColor, true); base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); ((WindowsFormsUtils.TypedControlCollection) this.Controls).AddInternal(this.panel1); ((WindowsFormsUtils.TypedControlCollection) this.Controls).AddInternal(this.panel2); this.UpdateSplitter(); }
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]; }
public SimpleGuiControlsPanel(SplitterPanel splitterPanel) : base(splitterPanel) { this.Form = this.Parent.ParentForm as SimpleGuiForm; }
private void SetControls(SplitterPanel panelA, bool shouldCollapse, UserControl minControl, SplitterPanel panelB, Control otherMainControl) { if (shouldCollapse) { ResetControl(panelA, minControl); // May need to reset the SplitterDistance so the minControl is the right width. if (minControl.Width != kCollapsedSize) { int potentialSplitterDistance = kCollapsedSize; if (minControl == m_secondIconControl) { int adjustMainDim = (Orientation == Orientation.Vertical) ? Width : Height; potentialSplitterDistance = (adjustMainDim - SplitterWidth - kCollapsedSize); } if (SplitterDistance != potentialSplitterDistance) SplitterDistance = potentialSplitterDistance; } m_restoreSplitterPosition = m_previousSplitterPosition; if (Panel1 == panelA && FixedPanel == FixedPanel.Panel2) FixedPanel = FixedPanel.Panel1; else if (Panel2 == panelA && FixedPanel == FixedPanel.Panel1) FixedPanel = FixedPanel.Panel2; } else if (FixedPanel != FixedPanel.Panel1) { FixedPanel = FixedPanel.Panel1; } ResetControl(panelB, otherMainControl); }
protected virtual void LoadListInternal(Mediator mediator, SplitterPanel parent) { }
public override void Initialize(IComponent component) { base.Initialize(component); this.splitterPanel = (SplitterPanel) component; this.designerHost = (IDesignerHost) component.Site.GetService(typeof(IDesignerHost)); this.splitContainerDesigner = (SplitContainerDesigner) this.designerHost.GetDesigner(this.splitterPanel.Parent); IComponentChangeService service = (IComponentChangeService) this.GetService(typeof(IComponentChangeService)); if (service != null) { service.ComponentChanged += new ComponentChangedEventHandler(this.OnComponentChanged); } PropertyDescriptor descriptor = TypeDescriptor.GetProperties(component)["Locked"]; if ((descriptor != null) && (this.splitterPanel.Parent is SplitContainer)) { descriptor.SetValue(component, true); } }
// // Constructor // /// <include file='doc\SplitContainer.uex' path='docs/doc[@for="SplitContainer.SplitContainer"]/*' /> public SplitContainer() { // either the left or top panel - LTR // either the right or top panel - RTL panel1 = new SplitterPanel(this); // either the right or bottom panel - LTR // either the left or bottom panel - RTL panel2 = new SplitterPanel(this); splitterRect = new Rectangle(); SetStyle(ControlStyles.SupportsTransparentBackColor, true); SetStyle(ControlStyles.OptimizedDoubleBuffer, true); ((WindowsFormsUtils.TypedControlCollection)this.Controls).AddInternal(panel1); ((WindowsFormsUtils.TypedControlCollection)this.Controls).AddInternal(panel2); UpdateSplitter(); }
public SplitPanelEventArgs(SplitterPanel panel, Boolean isCollapsed) { this.Panel = panel; this.IsCollapsed = isCollapsed; }
protected override void LoadListInternal(Mediator mediator, SplitterPanel parent) { // Add the new browse view, if available in the config node. if (m_configurationNode.HasChildNodes) { RecordBrowseView browseView = new RecordBrowseView(); browseView.SuspendLayout(); browseView.Dock = DockStyle.Fill; m_currentControl = browseView; parent.Controls.Add(browseView); browseView.Init(mediator, m_configurationNode.SelectSingleNode("parameters")); mediator.RemoveColleague(browseView); browseView.BringToFront(); browseView.ResumeLayout(); m_mediator.AddColleague(this); } base.LoadListInternal(mediator, parent); }
public TreeTabScreen() { InitializeComponent(); ContentPanel = Splitter.Panel2; Load += new System.EventHandler(TreeTabScreen_Load); }
public GameLoop(Game game, SplitterPanel table) { this.game = game; this.table = table; this.Elapsed += new ElapsedEventHandler(OnTimedEvent); }
internal void LoadList(Mediator mediator, SplitterPanel parent) { parent.FindForm().UseWaitCursor = true; parent.SuspendLayout(); RemovePreviousControl(); LoadListInternal(mediator, parent); parent.ResumeLayout(); parent.FindForm().UseWaitCursor = false; }
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 static void DoPaint(IGraphics g, SplitterPanel container) { DoPaint(g, container as Control); }
public void DockToPanel(SplitterPanel formPanel) { if (Settings.Instance.EnableLogger) Logger.Debug("Docking window: {0}", FullName); Docked = true; _hwndStyle = NativeMethods.GetWindowLong(_hwnd, NativeMethods.GwlStyle); NativeMethods.SetWindowLong(_hwnd, NativeMethods.GwlStyle, (_hwndStyle & ~NativeMethods.WithoutTitleAndBorder)); _hwndOriginalParent = NativeMethods.SetParent(_hwnd, formPanel.Handle); }
/// <summary>Initializes a new instance of the <see cref="SimpleGuiPanel"/> class.</summary> /// <param name="panel">The panel to which this <see cref="SimpleGuiPanel"/> is bound.</param> internal SimpleGuiPanel(SplitterPanel panel) { this.panel = panel; this.split = (SplitContainer)((Control)panel).Parent; this.isPanel1 = split.Panel1.Equals(panel); }
public override void Initialize(IComponent component) { base.Initialize(component); base.AutoResizeHandles = true; this.splitContainer = component as SplitContainer; this.splitterPanel1 = this.splitContainer.Panel1; this.splitterPanel2 = this.splitContainer.Panel2; base.EnableDesignMode(this.splitContainer.Panel1, "Panel1"); base.EnableDesignMode(this.splitContainer.Panel2, "Panel2"); this.designerHost = (IDesignerHost) component.Site.GetService(typeof(IDesignerHost)); if (this.selectedPanel == null) { this.Selected = this.splitterPanel1; } this.splitContainer.MouseDown += new MouseEventHandler(this.OnSplitContainer); this.splitContainer.SplitterMoved += new SplitterEventHandler(this.OnSplitterMoved); this.splitContainer.SplitterMoving += new SplitterCancelEventHandler(this.OnSplitterMoving); this.splitContainer.DoubleClick += new EventHandler(this.OnSplitContainerDoubleClick); ISelectionService service = (ISelectionService) this.GetService(typeof(ISelectionService)); if (service != null) { service.SelectionChanged += new EventHandler(this.OnSelectionChanged); } }
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; }
///<devdoc> /// Collapses or restores the given panel ///</devdoc> private void CollapsePanel(SplitterPanel p, bool collapsing) { p.Collapsed = collapsing; if (collapsing) { p.Visible = false; } else { // restore panel p.Visible = true; } UpdateSplitter(); }
/// <summary> /// Returns an observable sequence wrapping the TabStopChanged event on the SplitterPanel instance. /// </summary> /// <param name="instance">The SplitterPanel instance to observe.</param> /// <returns>An observable sequence wrapping the TabStopChanged event on the SplitterPanel instance.</returns> public static IObservable <EventPattern <EventArgs> > TabStopChangedObservable(this SplitterPanel instance) { return(Observable.FromEventPattern <EventHandler, EventArgs>( handler => instance.TabStopChanged += handler, handler => instance.TabStopChanged -= handler)); }