maintaint the mouse capture stack in all ports, not just wxUniv

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-01-19 19:31:19 +00:00
parent aa8a815b84
commit 94633ad9f1
10 changed files with 92 additions and 89 deletions

View File

@@ -65,8 +65,6 @@ public:
virtual bool Reparent( wxWindowBase *newParent );
virtual void WarpPointer(int x, int y);
virtual void CaptureMouse();
virtual void ReleaseMouse();
virtual void Refresh( bool eraseBackground = TRUE,
const wxRect *rect = (const wxRect *) NULL );
@@ -159,7 +157,7 @@ public:
// the layouting functions have to be called later on
// (i.e. in idle time, implemented in OnInternalIdle() ).
void GtkUpdateSize() { m_sizeSet = FALSE; }
// position and size of the window
int m_x, m_y;
int m_width, m_height;
@@ -168,7 +166,7 @@ public:
// see the docs in src/gtk/window.cpp
GtkWidget *m_widget; // mostly the widget seen by the rest of GTK
GtkWidget *m_wxwindow; // mostly the client area as per wxWindows
// this widget will be queried for GTK's focus events
GtkWidget *m_focusWidget;
@@ -229,6 +227,9 @@ public:
virtual void DoSetClientSize(int width, int height);
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual void DoCaptureMouse();
virtual void DoReleaseMouse();
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip( wxToolTip *tip );
#endif // wxUSE_TOOLTIPS

View File

@@ -65,8 +65,6 @@ public:
virtual bool Reparent( wxWindowBase *newParent );
virtual void WarpPointer(int x, int y);
virtual void CaptureMouse();
virtual void ReleaseMouse();
virtual void Refresh( bool eraseBackground = TRUE,
const wxRect *rect = (const wxRect *) NULL );
@@ -159,7 +157,7 @@ public:
// the layouting functions have to be called later on
// (i.e. in idle time, implemented in OnInternalIdle() ).
void GtkUpdateSize() { m_sizeSet = FALSE; }
// position and size of the window
int m_x, m_y;
int m_width, m_height;
@@ -168,7 +166,7 @@ public:
// see the docs in src/gtk/window.cpp
GtkWidget *m_widget; // mostly the widget seen by the rest of GTK
GtkWidget *m_wxwindow; // mostly the client area as per wxWindows
// this widget will be queried for GTK's focus events
GtkWidget *m_focusWidget;
@@ -229,6 +227,9 @@ public:
virtual void DoSetClientSize(int width, int height);
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual void DoCaptureMouse();
virtual void DoReleaseMouse();
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip( wxToolTip *tip );
#endif // wxUSE_TOOLTIPS

View File

@@ -90,8 +90,6 @@ public:
virtual bool Reparent(wxWindowBase *newParent);
virtual void WarpPointer(int x, int y);
virtual void CaptureMouse();
virtual void ReleaseMouse();
virtual void Refresh( bool eraseBackground = TRUE,
const wxRect *rect = (const wxRect *) NULL );
@@ -438,6 +436,9 @@ protected:
int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height);
virtual void DoCaptureMouse();
virtual void DoReleaseMouse();
// move the window to the specified location and resize it: this is called
// from both DoSetSize() and DoSetClientSize() and would usually just call
// ::MoveWindow() except for composite controls which will want to arrange

View File

@@ -200,13 +200,6 @@ public:
// we refresh the window when it is dis/enabled
virtual bool Enable(bool enable = TRUE);
// our Capture/ReleaseMouse() maintains the stack of windows which had
// captured the mouse and when ReleaseMouse() is called, the mouse freed
// only if the stack is empty, otherwise it is captured back by the window
// on top of the stack
virtual void CaptureMouse();
virtual void ReleaseMouse();
protected:
// common part of all ctors
void Init();

View File

@@ -460,9 +460,12 @@ public:
// move the mouse to the specified position
virtual void WarpPointer(int x, int y) = 0;
// start or end mouse capture
virtual void CaptureMouse() = 0;
virtual void ReleaseMouse() = 0;
// start or end mouse capture, these functions maintain the stack of
// windows having captured the mouse and after calling ReleaseMouse()
// the mouse is not released but returns to the window which had had
// captured it previously (if any)
void CaptureMouse();
void ReleaseMouse();
// get the window which currently captures the mouse or NULL
static wxWindow *GetCapture();
@@ -883,6 +886,10 @@ protected:
virtual wxHitTest DoHitTest(wxCoord x, wxCoord y) const;
// capture/release the mouse, used by Capture/ReleaseMouse()
virtual void DoCaptureMouse();
virtual void DoReleaseMouse();
// retrieve the position/size of the window
virtual void DoGetPosition( int *x, int *y ) const = 0;
virtual void DoGetSize( int *width, int *height ) const = 0;