]> git.saurik.com Git - wxWidgets.git/commitdiff
Update AUI floating windows position and not just size on resize.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 31 May 2010 14:59:18 +0000 (14:59 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 31 May 2010 14:59:18 +0000 (14:59 +0000)
When a window is resized, its position can change as well as its size but it
wasn't updated before. Do it now.

Closes #11421.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64454 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/aui/framemanager.h
src/aui/floatpane.cpp
src/aui/framemanager.cpp

index 459fb4f5336589ee987feedc5dd92a52da165513..df26a84d93875a1c2a3516c226ef6f718ab0c3b5 100644 (file)
@@ -521,6 +521,7 @@ All (GUI):
 - Added wxProgressDialog::Was{Cancelled,Skipped}() (Julien Weinzorn).
 - Added wxTreeCtrl::{Clear,Set}FocusedItem() (Nikolay Tiushkov).
 - Added "filter changed" event to wxFileCtrl (Bill Jones).
+- wxAUI: update floating window position and not only size on resize (MacGyver).
 
 GTK:
 
index 79c0aa2d50cc1bb123187d72ec0fe4108f4659db..037989d4de0ca5d794331d5772b3b288044ae127 100644 (file)
@@ -551,7 +551,7 @@ protected:
     void OnFloatingPaneMoved(wxWindow* window, wxDirection dir);
     void OnFloatingPaneActivated(wxWindow* window);
     void OnFloatingPaneClosed(wxWindow* window, wxCloseEvent& evt);
-    void OnFloatingPaneResized(wxWindow* window, const wxSize& size);
+    void OnFloatingPaneResized(wxWindow* window, const wxRect& rect);
     void Render(wxDC* dc);
     void Repaint(wxDC* dc = NULL);
     void ProcessMgrEvent(wxAuiManagerEvent& event);
index ef7f35e513707e75a60b2b777d65043357be919c..99e80894e387af106f6637a40d06290c47c98010 100644 (file)
@@ -157,11 +157,11 @@ wxAuiManager* wxAuiFloatingFrame::GetOwnerManager() const
 }
 
 
-void wxAuiFloatingFrame::OnSize(wxSizeEvent& event)
+void wxAuiFloatingFrame::OnSize(wxSizeEvent& WXUNUSED(event))
 {
     if (m_owner_mgr)
     {
-        m_owner_mgr->OnFloatingPaneResized(m_pane_window, event.GetSize());
+        m_owner_mgr->OnFloatingPaneResized(m_pane_window, GetRect());
     }
 }
 
index 7bfe00a74f6005f9bf7a8e9275af5f5d9dbb1ce0..a1f7fb11dfe9a5a90ca8dbeef3806cb12d07511b 100644 (file)
@@ -3676,13 +3676,16 @@ void wxAuiManager::OnFloatingPaneMoved(wxWindow* wnd, wxDirection dir)
     HideHint();
 }
 
-void wxAuiManager::OnFloatingPaneResized(wxWindow* wnd, const wxSize& size)
+void wxAuiManager::OnFloatingPaneResized(wxWindow* wnd, const wxRect& rect)
 {
     // try to find the pane
     wxAuiPaneInfo& pane = GetPane(wnd);
     wxASSERT_MSG(pane.IsOk(), wxT("Pane window not found"));
 
-    pane.floating_size = size;
+    pane.FloatingSize(rect.GetWidth(), rect.GetHeight());
+
+    // the top-left position may change as well as the size
+    pane.FloatingPosition(rect.x, rect.y);
 }