From 13ef4c0826d5e38a30e8b6d11d42749c10b05076 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 13 Aug 2005 20:32:50 +0000 Subject: [PATCH] Patched docking suite. Take care on docking library updates: Fixed warnings in docking suite. Tabs can be closed with middle mouse button. Included bug fixes from docking suite's bug tracker on SF. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@365 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../DockPanel_Src/WinFormsUI/AssemblyInfo.cs | 28 ------------------- .../WinFormsUI/Controls/InertButton.cs | 4 +-- .../WinFormsUI/Docking/AutoHideStripVS2003.cs | 2 +- .../WinFormsUI/Docking/DockContent.cs | 4 +-- .../WinFormsUI/Docking/DockPane.cs | 5 ++-- .../WinFormsUI/Docking/DockPaneCaptionBase.cs | 2 +- .../WinFormsUI/Docking/DockPaneStripBase.cs | 10 +++++++ .../WinFormsUI/Docking/DockPaneStripVS2003.cs | 6 ++-- .../WinFormsUI/Docking/DockPanel.cs | 4 +-- .../WinFormsUI/Helpers/LocalWindowsHook.cs | 2 ++ .../WinFormsUI/WinFormsUI.csproj | 5 ---- 11 files changed, 26 insertions(+), 46 deletions(-) diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/AssemblyInfo.cs b/src/Libraries/DockPanel_Src/WinFormsUI/AssemblyInfo.cs index 6abb53d3d6..6d2f531f53 100644 --- a/src/Libraries/DockPanel_Src/WinFormsUI/AssemblyInfo.cs +++ b/src/Libraries/DockPanel_Src/WinFormsUI/AssemblyInfo.cs @@ -27,31 +27,3 @@ using System.Runtime.CompilerServices; // by using the '*' as shown below: [assembly: AssemblyVersion("0.99.0.3")] - -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Controls/InertButton.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Controls/InertButton.cs index a20f82419b..67ccfb9d16 100644 --- a/src/Libraries/DockPanel_Src/WinFormsUI/Controls/InertButton.cs +++ b/src/Libraries/DockPanel_Src/WinFormsUI/Controls/InertButton.cs @@ -64,7 +64,7 @@ namespace WeifenLuo.WinFormsUI SetStyle(ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); - SetStyle(ControlStyles.DoubleBuffer, true); + SetStyle(ControlStyles.OptimizedDoubleBuffer, true); // Prevent base class from trying to generate double click events and // so testing clicks against the double click time and rectangle. Getting @@ -606,4 +606,4 @@ namespace WeifenLuo.WinFormsUI Invalidate(); } } -} \ No newline at end of file +} diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideStripVS2003.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideStripVS2003.cs index 3cc16ee828..a25d435517 100644 --- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideStripVS2003.cs +++ b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideStripVS2003.cs @@ -179,7 +179,7 @@ namespace WeifenLuo.WinFormsUI SetStyle(ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); - SetStyle(ControlStyles.DoubleBuffer, true); + SetStyle(ControlStyles.OptimizedDoubleBuffer, true); BackColor = Color.WhiteSmoke; } diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContent.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContent.cs index 8aed4ddcdd..a93e4c7e36 100644 --- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContent.cs +++ b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContent.cs @@ -667,9 +667,9 @@ namespace WeifenLuo.WinFormsUI if (dockPanel == null) throw(new ArgumentNullException(ResourceHelper.GetString("DockContent.Show.NullDockPanel"))); - if (DockState == DockState.Unknown) + if (DockState == DockState.Unknown || Pane == null) Show(dockPanel, DefaultShowState); - else + else Activate(); } diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPane.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPane.cs index 367f1a24ca..317e77d1e2 100644 --- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPane.cs +++ b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPane.cs @@ -109,7 +109,7 @@ namespace WeifenLuo.WinFormsUI SetStyle(ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); - SetStyle(ControlStyles.DoubleBuffer, true); + SetStyle(ControlStyles.OptimizedDoubleBuffer, true); SetStyle(ControlStyles.Selectable, true); m_isFloat = (dockState == DockState.Float); @@ -597,8 +597,9 @@ namespace WeifenLuo.WinFormsUI // Need to set the visible content first, otherwise keyboard focus will be lost if (ActiveContent != null) { - ActiveContent.Visible = true; ActiveContent.Bounds = rectContent; + ActiveContent.BringToFront(); + ActiveContent.Visible = true; } // Hide all inactive contents diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneCaptionBase.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneCaptionBase.cs index 4d4a8f4bc7..5a323dc0eb 100644 --- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneCaptionBase.cs +++ b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneCaptionBase.cs @@ -24,7 +24,7 @@ namespace WeifenLuo.WinFormsUI SetStyle(ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); - SetStyle(ControlStyles.DoubleBuffer, true); + SetStyle(ControlStyles.OptimizedDoubleBuffer, true); SetStyle(ControlStyles.Selectable, false); } diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneStripBase.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneStripBase.cs index af2bcc67e0..824ca26f08 100644 --- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneStripBase.cs +++ b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneStripBase.cs @@ -112,6 +112,16 @@ namespace WeifenLuo.WinFormsUI base.WndProc(ref m); return; } + else if (m.Msg == (int)Win32.Msgs.WM_MBUTTONUP) + { + base.WndProc(ref m); + int index = GetHitTest(); + if (index != -1) + { + DockPane.CloseContent(Tabs[index].Content); + } + return; + } else if (m.Msg == (int)Win32.Msgs.WM_RBUTTONDOWN) { int index = GetHitTest(); diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneStripVS2003.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneStripVS2003.cs index 6219affd26..a597b4d52b 100644 --- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneStripVS2003.cs +++ b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneStripVS2003.cs @@ -383,7 +383,7 @@ namespace WeifenLuo.WinFormsUI SetStyle(ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); - SetStyle(ControlStyles.DoubleBuffer, true); + SetStyle(ControlStyles.OptimizedDoubleBuffer, true); SuspendLayout(); @@ -838,10 +838,10 @@ namespace WeifenLuo.WinFormsUI Rectangle rectTabStrip = TabsRectangle; int index; - for (index=0; index bin\Debug\ - false 285212672 false DEBUG;TRACE - bin\Debug\CodeDoc.xml true 4096 false - false - false false - false 4