Applied [ 1708971 ] Make a virtual function to enable/disable docking

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48276 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2007-08-21 11:04:48 +00:00
parent 6757b667fd
commit 858a3a7a45
2 changed files with 27 additions and 19 deletions

View File

@@ -483,6 +483,7 @@ public:
public: public:
virtual wxAuiFloatingFrame* CreateFloatingFrame(wxWindow* parent, const wxAuiPaneInfo& p); virtual wxAuiFloatingFrame* CreateFloatingFrame(wxWindow* parent, const wxAuiPaneInfo& p);
virtual bool CanDockPanel(const wxAuiPaneInfo & p);
void StartPaneDrag( void StartPaneDrag(
wxWindow* pane_window, wxWindow* pane_window,

View File

@@ -529,6 +529,13 @@ wxAuiFloatingFrame* wxAuiManager::CreateFloatingFrame(wxWindow* parent,
return new wxAuiFloatingFrame(parent, this, pane_info); 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 // GetPane() looks up a wxAuiPaneInfo structure based
// on the supplied window pointer. Upon failure, GetPane() // on the supplied window pointer. Upon failure, GetPane()
// returns an empty wxAuiPaneInfo, a condition which can be checked // 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, // if a key modifier is pressed while dragging the frame,
// don't dock the window // don't dock the window
if (wxGetKeyState(WXK_CONTROL) || wxGetKeyState(WXK_ALT)) if (!CanDockPanel(pane))
{ {
HideHint(); HideHint();
return; return;
@@ -3467,7 +3474,7 @@ void wxAuiManager::OnFloatingPaneMoved(wxWindow* wnd, wxDirection dir)
// if a key modifier is pressed while dragging the frame, // if a key modifier is pressed while dragging the frame,
// don't dock the window // don't dock the window
if (!wxGetKeyState(WXK_CONTROL) && !wxGetKeyState(WXK_ALT)) if (CanDockPanel(pane))
{ {
// do the drop calculation // do the drop calculation
DoDrop(m_docks, m_panes, pane, client_pt, action_offset); DoDrop(m_docks, m_panes, pane, client_pt, action_offset);