Kirix Support Forums

Fix floating panes which have Fixed() set

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

Fix floating panes which have Fixed() set

Postby abligh on Thu Apr 20, 2006 7:01 am

This patch fixes floating panes which have Fixed() set. They should be non-resizable. The technique previously employed tries to adjust the window style to remove the wxRESIZE_BORDER style after the window has been created. However, this does not in practice work (at least on GTK).

This patch can be found as fixedfloatingpanes.p at http://www.alex.org.uk/wxAUI/index.html

Code: Select all
Index: manager.cpp
===================================================================
--- src/manager.cpp     (revision 848)
+++ src/manager.cpp     (working copy)
@@ -582,12 +582,13 @@
     wxFloatingPane(wxWindow* parent,
                    wxFrameManager* owner_mgr,
                    wxWindowID id = -1,
-                   const wxPoint& pos = wxDefaultPosition,
-                   const wxSize& size = wxDefaultSize)
-                    : wxFloatingPaneBaseClass(parent, id, wxT(""), pos, size,
-                            wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION |
+                   const wxPaneInfo& pane)
+                    : wxFloatingPaneBaseClass(parent, id, wxT(""),
+                            pane.floating_pos, pane.floating_size,
+                            wxSYSTEM_MENU | wxCAPTION |
                             wxCLOSE_BOX | wxFRAME_NO_TASKBAR |
-                            wxFRAME_FLOAT_ON_PARENT | wxCLIP_CHILDREN)
+                            wxFRAME_FLOAT_ON_PARENT | wxCLIP_CHILDREN |
+                            (pane.IsFixed()?0:wxRESIZE_BORDER))
     {
         m_owner_mgr = owner_mgr;
         m_moving = false;
@@ -627,9 +628,6 @@

         SetTitle(pane.caption);

-        if (contained_pane.IsFixed())
-            SetWindowStyle(GetWindowStyle() & ~wxRESIZE_BORDER);
-
         if (pane.floating_size != wxDefaultSize)
         {
             SetSize(pane.floating_size);
@@ -2620,8 +2618,7 @@
                 // pane, which has recently been floated
                 wxFloatingPane* frame = new wxFloatingPane(m_frame,
                                                   this, -1,
-                                                  p.floating_pos,
-                                                  p.floating_size);
+                                                  p);

                 // on MSW, if the owner desires transparent dragging, and
                 // the dragging is happening right now, then the floating
abligh
Registered User
 
Posts: 59
Joined: Sun Jan 01, 2006 2:31 pm

Postby Ben on Thu Apr 20, 2006 3:00 pm

Looks great to me.

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

Postby igor on Fri May 12, 2006 3:44 pm

Made the exact changes you told me to do, and got this error:
manager.cpp
d:\wxWidgets-2.6.3\contrib\wxaui-0.9.2\src\manager.cpp(551) : error C2548: 'wxFloatingPane::wxFloatingPane' : missing default parameter for parameter 4
igor
 

same

Postby Darjk on Fri May 26, 2006 2:16 am

Igor, same problem here. Basically I just removed the defaul value for the WindowID and made sure to always set it to -1.

So presummably it should look like

Code: Select all
wxFloatingPane(wxWindow* parent,
               wxFrameManager* owner_mgr,
               wxWindowID id,
               const wxPaneInfo& pane)
                    : wxFloatingPaneBaseClass(parent, id, wxT(""),
                            pane.floating_pos, pane.floating_size,
                            wxSYSTEM_MENU | wxCAPTION |
                     wxCLOSE_BOX | wxFRAME_NO_TASKBAR |
                            wxFRAME_FLOAT_ON_PARENT | wxCLIP_CHILDREN |
                            (pane.IsFixed()?0:wxRESIZE_BORDER))
    {


Unless of course I missed something but went through all the patches for 0.9.2 and didn't see anything relevant
Darjk
 

Return to wxAUI Patches & Modifications