Changeset 4068 for trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.WinFormsUI/2.3.1/WinFormsUI-2.3.1/Docking/DockPaneCaptionBase.cs
- Timestamp:
- 07/22/10 00:44:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.WinFormsUI/2.3.1/WinFormsUI-2.3.1/Docking/DockPaneCaptionBase.cs
r2645 r4068 1 using System; 1 using System.Drawing; 2 using System.Security.Permissions; 2 3 using System.Windows.Forms; 3 using System.Drawing;4 using System.Runtime.InteropServices;5 using System.Security.Permissions;6 4 7 namespace WeifenLuo.WinFormsUI.Docking 8 { 9 public abstract class DockPaneCaptionBase : Control 10 { 11 protected internal DockPaneCaptionBase(DockPane pane) 12 { 13 m_dockPane = pane; 5 namespace WeifenLuo.WinFormsUI.Docking { 6 public abstract class DockPaneCaptionBase : Control { 7 protected internal DockPaneCaptionBase(DockPane pane) { 8 m_dockPane = pane; 14 9 15 10 SetStyle(ControlStyles.OptimizedDoubleBuffer | 16 11 ControlStyles.ResizeRedraw | 17 12 ControlStyles.UserPaint | 18 13 ControlStyles.AllPaintingInWmPaint, true); 19 20 14 SetStyle(ControlStyles.Selectable, false); 15 } 21 16 22 private DockPane m_dockPane; 23 protected DockPane DockPane 24 { 25 get { return m_dockPane; } 26 } 17 private DockPane m_dockPane; 18 protected DockPane DockPane { 19 get { return m_dockPane; } 20 } 27 21 28 protected DockPane.AppearanceStyle Appearance 29 { 30 get { return DockPane.Appearance; } 31 } 22 protected DockPane.AppearanceStyle Appearance { 23 get { return DockPane.Appearance; } 24 } 32 25 33 protected bool HasTabPageContextMenu 34 { 35 get { return DockPane.HasTabPageContextMenu; } 26 protected bool HasTabPageContextMenu { 27 get { return DockPane.HasTabPageContextMenu; } 28 } 29 30 protected void ShowTabPageContextMenu(Point position) { 31 DockPane.ShowTabPageContextMenu(this, position); 32 } 33 34 protected override void OnMouseUp(MouseEventArgs e) { 35 base.OnMouseUp(e); 36 37 if (e.Button == MouseButtons.Right) 38 ShowTabPageContextMenu(new Point(e.X, e.Y)); 39 } 40 41 protected override void OnMouseDown(MouseEventArgs e) { 42 base.OnMouseDown(e); 43 44 if (e.Button == MouseButtons.Left && 45 DockPane.DockPanel.AllowEndUserDocking && 46 DockPane.AllowDockDragAndDrop && 47 !DockHelper.IsDockStateAutoHide(DockPane.DockState) && 48 DockPane.ActiveContent != null) 49 DockPane.DockPanel.BeginDrag(DockPane); 50 } 51 52 [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] 53 protected override void WndProc(ref Message m) { 54 if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDBLCLK) { 55 if (DockHelper.IsDockStateAutoHide(DockPane.DockState)) { 56 DockPane.DockPanel.ActiveAutoHideContent = null; 57 return; 36 58 } 37 59 38 protected void ShowTabPageContextMenu(Point position) 39 { 40 DockPane.ShowTabPageContextMenu(this, position); 41 } 60 if (DockPane.IsFloat) 61 DockPane.RestoreToPanel(); 62 else 63 DockPane.Float(); 64 } 65 base.WndProc(ref m); 66 } 42 67 43 protected override void OnMouseUp(MouseEventArgs e)44 {45 base.OnMouseUp(e);68 internal void RefreshChanges() { 69 if (IsDisposed) 70 return; 46 71 47 if (e.Button == MouseButtons.Right) 48 ShowTabPageContextMenu(new Point(e.X, e.Y)); 49 } 72 OnRefreshChanges(); 73 } 50 74 51 protected override void OnMouseDown(MouseEventArgs e) 52 { 53 base.OnMouseDown(e); 75 protected virtual void OnRightToLeftLayoutChanged() { 76 } 54 77 55 if (e.Button == MouseButtons.Left && 56 DockPane.DockPanel.AllowEndUserDocking && 57 DockPane.AllowDockDragAndDrop && 58 !DockHelper.IsDockStateAutoHide(DockPane.DockState) && 59 DockPane.ActiveContent != null) 60 DockPane.DockPanel.BeginDrag(DockPane); 61 } 78 protected virtual void OnRefreshChanges() { 79 } 62 80 63 [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] 64 protected override void WndProc(ref Message m) 65 { 66 if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDBLCLK) 67 { 68 if (DockHelper.IsDockStateAutoHide(DockPane.DockState)) 69 { 70 DockPane.DockPanel.ActiveAutoHideContent = null; 71 return; 72 } 73 74 if (DockPane.IsFloat) 75 DockPane.RestoreToPanel(); 76 else 77 DockPane.Float(); 78 } 79 base.WndProc(ref m); 80 } 81 82 internal void RefreshChanges() 83 { 84 if (IsDisposed) 85 return; 86 87 OnRefreshChanges(); 88 } 89 90 protected virtual void OnRightToLeftLayoutChanged() 91 { 92 } 93 94 protected virtual void OnRefreshChanges() 95 { 96 } 97 98 protected internal abstract int MeasureHeight(); 99 } 81 protected internal abstract int MeasureHeight(); 82 } 100 83 }
Note: See TracChangeset
for help on using the changeset viewer.