From 76e1326addf95dc8eedbf46193ed601c1e9f5276 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 31 May 2010 14:59:18 +0000 Subject: [PATCH] Update AUI floating windows position and not just size on resize. 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 | 1 + include/wx/aui/framemanager.h | 2 +- src/aui/floatpane.cpp | 4 ++-- src/aui/framemanager.cpp | 7 +++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 459fb4f533..df26a84d93 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -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: diff --git a/include/wx/aui/framemanager.h b/include/wx/aui/framemanager.h index 79c0aa2d50..037989d4de 100644 --- a/include/wx/aui/framemanager.h +++ b/include/wx/aui/framemanager.h @@ -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); diff --git a/src/aui/floatpane.cpp b/src/aui/floatpane.cpp index ef7f35e513..99e80894e3 100644 --- a/src/aui/floatpane.cpp +++ b/src/aui/floatpane.cpp @@ -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()); } } diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index 7bfe00a74f..a1f7fb11df 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -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); } -- 2.47.2