public static bool IsDockStateValid(DockState dockState, DockAreas dockableAreas) { if (((dockableAreas & DockAreas.Float) == 0) && (dockState == DockState.Float)) { return(false); } if (((dockableAreas & DockAreas.Document) == 0) && (dockState == DockState.Document)) { return(false); } if (((dockableAreas & DockAreas.DockLeft) == 0) && (dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide)) { return(false); } if (((dockableAreas & DockAreas.DockRight) == 0) && (dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide)) { return(false); } if (((dockableAreas & DockAreas.DockTop) == 0) && (dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide)) { return(false); } if (((dockableAreas & DockAreas.DockBottom) == 0) && (dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide)) { return(false); } return(true); }
private void InitDocking() { DockAreas dockingAllowed = DockAreas.Document | DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockTop | DockAreas.DockBottom | DockAreas.Float; panelDockMain = new DockPanel(); panelDockMain.Theme = dockMainPanel.Theme; panelDockMain.Theme.Measures.DockPadding = 0; panelDockMain.BorderStyle = BorderStyle.None; panelDockMain.Padding = new Padding(0); panelDockMain.Margin = new Padding(0); panelDockMain.ShowDocumentIcon = false; panelDockMain.Parent = this; panelDockMain.Dock = DockStyle.Fill; panelDockMain.DocumentStyle = DocumentStyle.DockingWindow; panelDockMain.BringToFront(); aryDockContent.Add("GeomRoute", AddDockContent(panelDockMain, panelGeometryRouting, dockingAllowed, "Geometry Routing")); aryDockContent.Add("UniDat", AddDockContent(panelDockMain.ActivePane, DockAlignment.Bottom, 0.8, panelUniformsValues, dockingAllowed, "Uniform Data")); aryDockContent.Add("UniRoute", AddDockContent(panelDockMain.ActivePane, DockAlignment.Bottom, 0.6, panelUniformsRouting, dockingAllowed, "Uniform Routing")); aryDockContent.Add("Events", AddDockContent(panelDockMain.ActivePane, DockAlignment.Bottom, 0.5, panelEvents, dockingAllowed, "Events")); aryDockContent.Add("Console", AddDockContent(panelDockMain.ActivePane, DockAlignment.Bottom, 0.5, panelEventsConsole, dockingAllowed, "Console")); aryDockContent["Console"].DockState = DockState.DockBottomAutoHide; }
public static bool IsDockStateValid(DockState dockState, DockAreas dockableAreas) { if (((dockableAreas & DockAreas.Float) == 0) && (dockState == DockState.Float)) { return false; } if (((dockableAreas & DockAreas.Document) == 0) && (dockState == DockState.Document)) { return false; } if (((dockableAreas & DockAreas.DockLeft) == 0) && (dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide)) { return false; } if (((dockableAreas & DockAreas.DockRight) == 0) && (dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide)) { return false; } if (((dockableAreas & DockAreas.DockTop) == 0) && (dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide)) { return false; } if (((dockableAreas & DockAreas.DockBottom) == 0) && (dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide)) { return false; } return true; }
internal IDockableWindow[] Select(DockAreas stateFilter) { if (DockPane != null) { throw new InvalidOperationException(); } int count = 0; foreach (IDockableWindow c in this) { if (DockHelper.IsDockStateValid(c.DockHandler.DockState, stateFilter)) { count++; } } IDockableWindow[] contents = new IDockableWindow[count]; count = 0; foreach (IDockableWindow c in this) { if (DockHelper.IsDockStateValid(c.DockHandler.DockState, stateFilter)) { contents[count++] = c; } } return(contents); }
public void SetStates(IWindowsFormsEditorService edSvc, DockAreas dockAreas) { m_edSvc = edSvc; m_oldDockAreas = dockAreas; if ((dockAreas & DockAreas.DockLeft) != 0) { checkBoxDockLeft.Checked = true; } if ((dockAreas & DockAreas.DockRight) != 0) { checkBoxDockRight.Checked = true; } if ((dockAreas & DockAreas.DockTop) != 0) { checkBoxDockTop.Checked = true; } if ((dockAreas & DockAreas.DockTop) != 0) { checkBoxDockTop.Checked = true; } if ((dockAreas & DockAreas.DockBottom) != 0) { checkBoxDockBottom.Checked = true; } if ((dockAreas & DockAreas.Document) != 0) { checkBoxDockFill.Checked = true; } if ((dockAreas & DockAreas.Float) != 0) { checkBoxFloat.Checked = true; } }
internal DockContent[] Select(DockAreas stateFilter) { if (DockPane != null) { throw new InvalidOperationException(); } int count = 0; foreach (DockContent c in this) { if (DockHelper.IsDockStateValid(c.DockState, stateFilter)) { count++; } } DockContent[] contents = new DockContent[count]; count = 0; foreach (DockContent c in this) { if (DockHelper.IsDockStateValid(c.DockState, stateFilter)) { contents[count++] = c; } } return(contents); }
public void SetStates(DockAreas dockAreas) { m_oldDockAreas = dockAreas; if ((dockAreas & DockAreas.DockLeft) != 0) { checkBoxDockLeft.Checked = true; } if ((dockAreas & DockAreas.DockRight) != 0) { checkBoxDockRight.Checked = true; } if ((dockAreas & DockAreas.DockTop) != 0) { checkBoxDockTop.Checked = true; } if ((dockAreas & DockAreas.DockTop) != 0) { checkBoxDockTop.Checked = true; } if ((dockAreas & DockAreas.DockBottom) != 0) { checkBoxDockBottom.Checked = true; } if ((dockAreas & DockAreas.Document) != 0) { checkBoxDockFill.Checked = true; } if ((dockAreas & DockAreas.Float) != 0) { checkBoxFloat.Checked = true; } }
private static DockContent AddDockContent(DockPanel panel, Control control, DockAreas areas, string caption) { DockContent contentNew = NewDockContent(caption, areas); DockControlToContentPanel(control, contentNew); contentNew.Show(panel); return(contentNew); }
private static bool EstimateDockFloat(DockState dockState, DockAreas dockableAreas) { if (((dockableAreas & DockAreas.Float) == 0) && (dockState == DockState.Float)) { return(false); } return(EstimateDockDocument(dockState, dockableAreas)); }
private static bool EstimateDockLeft(DockState dockState, DockAreas dockableAreas) { if (((dockableAreas & DockAreas.DockLeft) == 0) && ((dockState == DockState.DockLeft) || (dockState == DockState.DockLeftAutoHide))) { return(false); } return(EstimateDockRight(dockState, dockableAreas)); }
private static bool EstimateDockTop(DockState dockState, DockAreas dockableAreas) { if (((dockableAreas & DockAreas.DockTop) == 0) && ((dockState == DockState.DockTop) || (dockState == DockState.DockTopAutoHide))) { return(false); } return(EstimateDockBottom(dockState, dockableAreas)); }
public UserControlDockContent(string title, UserControl control, DockAreas dockAreas = DockAreas.Document) { InitializeComponent(); Text = title.EscapeAmpersand(); control.Dock = DockStyle.Fill; Controls.Add(control); Content = control as IDocumentControl; // disable floating windows DockAreas = dockAreas; }
public void AddDockContent(string name, string title, uint group, Icon icon, DockAreas areas, DockState state, bool can_close, Control control) { var content = new DockContentEx(this, name, title, group, icon, areas, state, can_close, control); dock_contents_.Add(content); if (show_contents_) { content.Show(this, state); } }
private void AddDefaultContentToTarget(DockAreas target) { DockPanel panel = this.Control as DockPanel; if (panel == null) return; DockContent content = new DockContent(); content.DockAreas = target; panel.AddContent(content); content.Show(panel); content.DockAreas = DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockBottom; }
private static DockContent NewDockContent(string caption, DockAreas areas) { DockContent contentRet = new DockContent(); contentRet.Text = caption; contentRet.FormBorderStyle = FormBorderStyle.None; contentRet.ControlBox = false; contentRet.CloseButton = false; contentRet.CloseButtonVisible = false; contentRet.ShowInTaskbar = false; contentRet.DockAreas = areas; return(contentRet); }
private void AddDefaultContentToTarget(DockAreas target) { DockPanel panel = this.Control as DockPanel; if (panel == null) { return; } DockContent content = new DockContent(); content.DockAreas = target; panel.AddContent(content); content.Show(panel); content.DockAreas = DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockBottom; }
public DockContentHandler(System.Windows.Forms.Form form, GetPersistStringCallback getPersistStringCallback) { this.m_previousActive = null; this.m_nextActive = null; this.m_allowEndUserDocking = true; this.m_autoHidePortion = 0.25; this.m_closeButton = true; this.m_allowedAreas = DockAreas.Document | DockAreas.DockBottom | DockAreas.DockTop | DockAreas.DockRight | DockAreas.DockLeft | DockAreas.Float; this.m_dockState = DockState.Unknown; this.m_dockPanel = null; this.m_isHidden = true; this.m_tabText = null; this.m_visibleState = DockState.Unknown; this.m_isFloat = false; this.m_panelPane = null; this.m_floatPane = null; this.m_countSetDockState = 0; this.m_getPersistStringCallback = null; this.m_hideOnClose = false; this.m_showHint = DockState.Unknown; this.m_isActivated = false; this.m_tabPageContextMenu = null; this.m_toolTipText = null; this.m_activeWindowHandle = IntPtr.Zero; this.m_tab = null; this.m_autoHideTab = null; this.m_flagClipWindow = false; this.m_tabPageContextMenuStrip = null; if (!(form is IDockContent)) { throw new ArgumentException(Strings.DockContent_Constructor_InvalidForm, "form"); } this.m_form = form; this.m_getPersistStringCallback = getPersistStringCallback; this.m_events = new EventHandlerList(); this.Form.Disposed += new EventHandler(this.Form_Disposed); this.Form.TextChanged += new EventHandler(this.Form_TextChanged); }
public DockContentEx(DockPanelEx panel, string name, string title, uint group, Icon icon, DockAreas areas, DockState state, bool can_close, Control control) { ContentName = name; ContentGroup = group; ContentControl = control; DefaultDockState = state; Text = title; Icon = icon; DockAreas = areas; CloseButton = can_close; CloseButtonVisible = can_close; HideOnClose = !can_close; FormClosing += panel.OnDockContentClosing; FormClosed += panel.OnDockContentClosed; Activated += panel.OnDockContentActivated; ContentControl.Dock = DockStyle.Fill; Controls.Add(ContentControl); }
internal IDockableWindow[] Select(DockAreas stateFilter) { if (DockPane != null) throw new InvalidOperationException(); int count = 0; foreach (IDockableWindow c in this) if (DockHelper.IsDockStateValid(c.DockHandler.DockState, stateFilter)) count ++; IDockableWindow[] contents = new IDockableWindow[count]; count = 0; foreach (IDockableWindow c in this) if (DockHelper.IsDockStateValid(c.DockHandler.DockState, stateFilter)) contents[count++] = c; return contents; }
private static DockContent AddDockContent(DockPane panelPrevious, DockAlignment aliggnment, double ratio, Control control, DockAreas areas, string caption) { DockContent contentNew = NewDockContent(caption, areas); DockControlToContentPanel(control, contentNew); contentNew.Show(panelPrevious, aliggnment, ratio); return(contentNew); }
public void SetStates(IWindowsFormsEditorService edSvc, DockAreas dockAreas) { m_edSvc = edSvc; m_oldDockAreas = dockAreas; if ((dockAreas & DockAreas.DockLeft) != 0) checkBoxDockLeft.Checked = true; if ((dockAreas & DockAreas.DockRight) != 0) checkBoxDockRight.Checked = true; if ((dockAreas & DockAreas.DockTop) != 0) checkBoxDockTop.Checked = true; if ((dockAreas & DockAreas.DockTop) != 0) checkBoxDockTop.Checked = true; if ((dockAreas & DockAreas.DockBottom) != 0) checkBoxDockBottom.Checked = true; if ((dockAreas & DockAreas.Document) != 0) checkBoxDockFill.Checked = true; if ((dockAreas & DockAreas.Float) != 0) checkBoxFloat.Checked = true; }
public ToolWindow() { InitializeComponent(); this.contextMenu = base.TabPageContextMenuStrip; this.m_oldDockAreas = base.DockAreas; }
private static bool EstimateDockState(DockState dockState, DockAreas dockableAreas) { return(EstimateDockFloat(dockState, dockableAreas)); }
public static bool IsDockStateValid(DockState dockState, DockAreas dockableAreas) { return(((dockableAreas & DockAreas.Float) != (DockAreas)0 || dockState != DockState.Float) && ((dockableAreas & DockAreas.Document) != (DockAreas)0 || dockState != DockState.Document) && ((dockableAreas & DockAreas.DockLeft) != (DockAreas)0 || (dockState != DockState.DockLeft && dockState != DockState.DockLeftAutoHide)) && ((dockableAreas & DockAreas.DockRight) != (DockAreas)0 || (dockState != DockState.DockRight && dockState != DockState.DockRightAutoHide)) && ((dockableAreas & DockAreas.DockTop) != (DockAreas)0 || (dockState != DockState.DockTop && dockState != DockState.DockTopAutoHide)) && ((dockableAreas & DockAreas.DockBottom) != (DockAreas)0 || (dockState != DockState.DockBottom && dockState != DockState.DockBottomAutoHide))); }
private void AddDockContent(string name, string title, uint group, DockAreas areas, DockState state, bool can_close, Control control) { AddDockContent(name, title, group, null, areas, state, can_close, control); }
public static bool IsDockStateValid(DockState dockState, DockAreas dockableAreas) { return(EstimateDockFloat(dockState, dockableAreas)); }
public void SetStates(DockAreas dockAreas) { m_oldDockAreas = dockAreas; if ((dockAreas & DockAreas.DockLeft) != 0) checkBoxDockLeft.Checked = true; if ((dockAreas & DockAreas.DockRight) != 0) checkBoxDockRight.Checked = true; if ((dockAreas & DockAreas.DockTop) != 0) checkBoxDockTop.Checked = true; if ((dockAreas & DockAreas.DockTop) != 0) checkBoxDockTop.Checked = true; if ((dockAreas & DockAreas.DockBottom) != 0) checkBoxDockBottom.Checked = true; if ((dockAreas & DockAreas.Document) != 0) checkBoxDockFill.Checked = true; if ((dockAreas & DockAreas.Float) != 0) checkBoxFloat.Checked = true; }
private void AddPanel(PanelBase nestedPanel, DockState dockState, string title, DockAreas dockAreas) { WidgetPanel panel = new WidgetPanel(nestedPanel); panel.ShowHint = dockState; panel.ShowIcon = false; panel.Name = nestedPanel.GetType().FullName; panel.Text = title; panel.DockAreas = dockAreas; panel.Show(dockPanel1); panels.Add(nestedPanel.GetType(), panel); }
internal DockContent[] Select(DockAreas stateFilter) { if (DockPane != null) throw new InvalidOperationException(); int count = 0; foreach (DockContent c in this) if (DockHelper.IsDockStateValid(c.DockState, stateFilter)) count ++; DockContent[] contents = new DockContent[count]; count = 0; foreach (DockContent c in this) if (DockHelper.IsDockStateValid(c.DockState, stateFilter)) contents[count++] = c; return contents; }