aui docking works well on systems with solid window dragging turned off

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Benjamin Williams
2006-10-31 13:12:36 +00:00
parent 3882e74621
commit 22fec94aa9
2 changed files with 27 additions and 2 deletions

View File

@@ -57,6 +57,7 @@ private:
static bool isMouseDown(); static bool isMouseDown();
private: private:
wxWindow* m_pane_window; // pane window being managed wxWindow* m_pane_window; // pane window being managed
bool m_solid_drag; // true if system uses solid window drag
bool m_moving; bool m_moving;
wxRect m_last_rect; wxRect m_last_rect;
wxRect m_last2_rect; wxRect m_last2_rect;

View File

@@ -52,6 +52,16 @@ wxFloatingPane::wxFloatingPane(wxWindow* parent,
m_owner_mgr = owner_mgr; m_owner_mgr = owner_mgr;
m_moving = false; m_moving = false;
m_mgr.SetManagedWindow(this); m_mgr.SetManagedWindow(this);
m_solid_drag = true;
// find out if the system supports solid window drag.
// on non-msw systems, this is assumed to be the case
#ifdef __WXMSW__
BOOL b = TRUE;
SystemParametersInfo(38 /*SPI_GETDRAGFULLWINDOWS*/, 0, &b, 0);
m_solid_drag = b ? true : false;
#endif
SetExtraStyle(wxWS_EX_PROCESS_IDLE); SetExtraStyle(wxWS_EX_PROCESS_IDLE);
} }
@@ -126,6 +136,20 @@ void wxFloatingPane::OnClose(wxCloseEvent& evt)
void wxFloatingPane::OnMoveEvent(wxMoveEvent& event) void wxFloatingPane::OnMoveEvent(wxMoveEvent& event)
{ {
if (!m_solid_drag)
{
// systems without solid window dragging need to be
// handled slightly differently, due to the lack of
// the constant stream of EVT_MOVING events
if (!isMouseDown())
return;
OnMoveStart();
OnMoving(event.GetRect(), wxNORTH);
m_moving = true;
return;
}
wxRect win_rect = GetRect(); wxRect win_rect = GetRect();
if (win_rect == m_last_rect) if (win_rect == m_last_rect)
@@ -194,7 +218,7 @@ void wxFloatingPane::OnMoveEvent(wxMoveEvent& event)
if (m_last3_rect.IsEmpty()) if (m_last3_rect.IsEmpty())
return; return;
OnMoving(event.GetRect(), dir ); OnMoving(event.GetRect(), dir);
} }
void wxFloatingPane::OnIdle(wxIdleEvent& event) void wxFloatingPane::OnIdle(wxIdleEvent& event)
@@ -206,7 +230,7 @@ void wxFloatingPane::OnIdle(wxIdleEvent& event)
m_moving = false; m_moving = false;
OnMoveFinished(); OnMoveFinished();
} }
else else
{ {
event.RequestMore(); event.RequestMore();
} }