public FloatWindowFrame(DockPanel dockPanel, FloatWindow innerForm) { SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.Selectable, false); this.dockPanel = dockPanel; this.innerForm = innerForm; CreateEdgeImage(); InitializeComponent(); caption = dockPanel.DockPaneCaptionFactory.CreateDockPaneCaption(innerForm.p); caption.Location = new Point(borderSize, borderSize); caption.Height = 20; this.Controls.Add(caption); innerForm.SizeChanged += new EventHandler(innerForm_SizeChanged); innerForm.LocationChanged += new EventHandler(innerForm_LocationChanged); MouseMove += new MouseEventHandler(FloatWindowFrame_MouseMove); MouseLeave += new EventHandler(FloatWindowFrame_MouseLeave); MouseDown += new MouseEventHandler(FloatWindowFrame_MouseDown); MouseUp += new MouseEventHandler(FloatWindowFrame_MouseUp); timer1.Tick += new EventHandler(timer1_Tick); ChangePosition(); ChangeSize(); }
public VS2012DockPaneCaptionInertButton(DockPaneCaptionBase dockPaneCaption, Bitmap hovered, Bitmap normal, Bitmap pressed, Bitmap hoveredActive, Bitmap active, Bitmap hoveredAutoHide = null, Bitmap autoHide = null, Bitmap pressedAutoHide = null) { m_dockPaneCaption = dockPaneCaption; _hovered = hovered; _normal = normal; _pressed = pressed; _hoveredActive = hoveredActive; _active = active; _hoveredAutoHide = hoveredAutoHide ?? hoveredActive; _autoHide = autoHide ?? active; _pressedAutoHide = pressedAutoHide ?? pressed; RefreshChanges(); }
private void InternalConstruct(IDockContent content, DockState dockState, bool flagBounds, Rectangle floatWindowBounds, DockPane prevPane, DockAlignment alignment, double proportion, bool show) { if (dockState == DockState.Hidden || dockState == DockState.Unknown) { throw new ArgumentException(Strings.DockPane_SetDockState_InvalidState); } if (content == null) { throw new ArgumentNullException(Strings.DockPane_Constructor_NullContent); } if (content.DockHandler.DockPanel == null) { throw new ArgumentException(Strings.DockPane_Constructor_NullDockPanel); } SuspendLayout(); SetStyle(ControlStyles.Selectable, false); m_isFloat = (dockState == DockState.Float); m_contents = new DockContentCollection(); m_displayingContents = new DockContentCollection(this); m_dockPanel = content.DockHandler.DockPanel; m_dockPanel.AddPane(this); m_splitter = new SplitterControl(this); m_nestedDockingStatus = new NestedDockingStatus(this); m_captionControl = DockPanel.DockPaneCaptionFactory.CreateDockPaneCaption(this); m_tabStripControl = DockPanel.DockPaneStripFactory.CreateDockPaneStrip(this); Controls.AddRange(new Control[] { m_captionControl, m_tabStripControl }); DockPanel.SuspendLayout(true); if (flagBounds) { FloatWindow = DockPanel.FloatWindowFactory.CreateFloatWindow(DockPanel, this, floatWindowBounds); } else if (prevPane != null) { DockTo(prevPane.NestedPanesContainer, prevPane, alignment, proportion); } SetDockState(dockState); if (show) { content.DockHandler.Pane = this; } else if (this.IsFloat) { content.DockHandler.FloatPane = this; } else { content.DockHandler.PanelPane = this; } ResumeLayout(); DockPanel.ResumeLayout(true, true); }
private void InternalConstruct(IDockContent content, DockState dockState, bool flagBounds, Rectangle floatWindowBounds, DockPane prevPane, DockAlignment alignment, double proportion, bool show) { if (dockState == DockState.Hidden || dockState == DockState.Unknown) throw new ArgumentException(Strings.DockPane_SetDockState_InvalidState); if (content == null) throw new ArgumentNullException(Strings.DockPane_Constructor_NullContent); if (content.DockHandler.DockPanel == null) throw new ArgumentException(Strings.DockPane_Constructor_NullDockPanel); SuspendLayout(); SetStyle(ControlStyles.Selectable, false); m_isFloat = (dockState == DockState.Float); m_contents = new DockContentCollection(); m_displayingContents = new DockContentCollection(this); m_dockPanel = content.DockHandler.DockPanel; m_dockPanel.AddPane(this); m_splitter = new SplitterControl(this); m_nestedDockingStatus = new NestedDockingStatus(this); m_captionControl = DockPanel.DockPaneCaptionFactory.CreateDockPaneCaption(this); m_tabStripControl = DockPanel.DockPaneStripFactory.CreateDockPaneStrip(this); Controls.AddRange(new Control[] { m_captionControl, m_tabStripControl }); DockPanel.SuspendLayout(true); if (flagBounds) FloatWindow = DockPanel.FloatWindowFactory.CreateFloatWindow(DockPanel, this, floatWindowBounds); else if (prevPane != null) DockTo(prevPane.NestedPanesContainer, prevPane, alignment, proportion); SetDockState(dockState); if (show) content.DockHandler.Pane = this; else if (this.IsFloat) content.DockHandler.FloatPane = this; else content.DockHandler.PanelPane = this; ResumeLayout(); DockPanel.ResumeLayout(true, true); }