Kirix Support Forums

ProcessDockResult made virtual to override docking behavior

Please post any wxAUI patches or modifications you've created here. Thanks!

ProcessDockResult made virtual to override docking behavior

Postby tierra on Thu Jul 13, 2006 4:27 pm

This patch makes it possible to override the docking behaviour by deriving a new wxFrameManager and overriding ProcessDockResult with custom restrictions on locations where certain panes have the ability to dock for example. As a reminder, any overridden ProcessDockResult function should fall back on returning the result from wxFrameManager::ProcessDockResult if no conclusion is made so that the basic behaviour and rules for dock direction still apply.

Thanks goes to Alex Bligh for his help with this.

See also: wxWidgets SF.net Patch

Code: Select all
Index: include/wx/aui/framemanager.h
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/include/wx/aui/framemanager.h,v
retrieving revision 1.13
diff -u -r1.13 framemanager.h
--- include/wx/aui/framemanager.h       2006/07/12 07:18:15     1.13
+++ include/wx/aui/framemanager.h       2006/07/13 21:41:10
@@ -444,6 +444,9 @@
                        wxDockUIPartArray& uiparts,
                        bool spacer_only = false);

+    virtual bool ProcessDockResult(wxPaneInfo& target,
+                                   const wxPaneInfo& new_pos);
+
     bool DoDrop(wxDockInfoArray& docks,
                 wxPaneInfoArray& panes,
                 wxPaneInfo& drop,
Index: src/aui/framemanager.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/aui/framemanager.cpp,v
retrieving revision 1.27
diff -u -r1.27 framemanager.cpp
--- src/aui/framemanager.cpp    2006/07/12 07:18:19     1.27
+++ src/aui/framemanager.cpp    2006/07/13 21:41:14
@@ -2062,9 +2062,11 @@
// ProcessDockResult() is a utility function used by DoDrop() - it checks
// if a dock operation is allowed, the new dock position is copied into
// the target info.  If the operation was allowed, the function returns true.
+// This virtual function can be overridden to add additional custom
+// restrictions on dockable locations for specific panes.

-static bool ProcessDockResult(wxPaneInfo& target,
-                              const wxPaneInfo& new_pos)
+bool wxFrameManager::ProcessDockResult(wxPaneInfo& target,
+                                       const wxPaneInfo& new_pos)
{
     bool allowed = false;
     switch (new_pos.dock_direction)


Regards,
Bryan Petty
tierra
Registered User
 
Posts: 4
Joined: Tue Dec 20, 2005 4:49 pm

Re: ProcessDockResult made virtual to override docking behav

Postby Ben on Sat Jul 15, 2006 12:44 pm

Hello,

Thanks for your patch. It's been applied in wxWidgets CVS head.

Best,
Ben
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Return to wxAUI Patches & Modifications