X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d83610edfa102f6e170719eeef5ad2c73622570..a912e81f6409f4ae37ddb1f66d8474decd8da9aa:/src/aui/framemanager.cpp diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index 19315ef73a..664c02947d 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -529,6 +529,13 @@ wxAuiFloatingFrame* wxAuiManager::CreateFloatingFrame(wxWindow* parent, return new wxAuiFloatingFrame(parent, this, pane_info); } +bool wxAuiManager::CanDockPanel(const wxAuiPaneInfo & WXUNUSED(p)) +{ + // if a key modifier is pressed while dragging the frame, + // don't dock the window + return !(wxGetKeyState(WXK_CONTROL) || wxGetKeyState(WXK_ALT)); +} + // GetPane() looks up a wxAuiPaneInfo structure based // on the supplied window pointer. Upon failure, GetPane() // returns an empty wxAuiPaneInfo, a condition which can be checked @@ -3392,7 +3399,7 @@ void wxAuiManager::OnFloatingPaneMoving(wxWindow* wnd, wxDirection dir) // if a key modifier is pressed while dragging the frame, // don't dock the window - if (wxGetKeyState(WXK_CONTROL) || wxGetKeyState(WXK_ALT)) + if (!CanDockPanel(pane)) { HideHint(); return; @@ -3467,7 +3474,7 @@ void wxAuiManager::OnFloatingPaneMoved(wxWindow* wnd, wxDirection dir) // if a key modifier is pressed while dragging the frame, // don't dock the window - if (!wxGetKeyState(WXK_CONTROL) && !wxGetKeyState(WXK_ALT)) + if (CanDockPanel(pane)) { // do the drop calculation DoDrop(m_docks, m_panes, pane, client_pt, action_offset); @@ -3839,9 +3846,6 @@ void wxAuiManager::OnLeftDown(wxMouseEvent& event) - if (part->dock && part->dock->dock_direction == wxAUI_DOCK_CENTER) - return; - if (GetFlags() & wxAUI_MGR_ALLOW_ACTIVE_PANE) { // set the caption as active @@ -3849,6 +3853,9 @@ void wxAuiManager::OnLeftDown(wxMouseEvent& event) Repaint(); } + if (part->dock && part->dock->dock_direction == wxAUI_DOCK_CENTER) + return; + m_action = actionClickCaption; m_action_part = part; m_action_start = wxPoint(event.m_x, event.m_y);