added default ctor to wxMouseEventsManager, this is convenient when deriving window classes (which must provide default ctors to e.g. allow loading them from XRC) from it

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60839 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-05-31 14:43:01 +00:00
parent 0598625cb2
commit 4b14a2f79b
3 changed files with 39 additions and 7 deletions

View File

@@ -34,8 +34,11 @@ class WXDLLIMPEXP_CORE wxMouseEventsManager : public wxEvtHandler
{
public:
// a mouse event manager is always associated with a window and must be
// deleted by the window when it is destroyed
wxMouseEventsManager(wxWindow *win);
// deleted by the window when it is destroyed so if it is created using the
// default ctor Create() must be called later
wxMouseEventsManager() { Init(); }
wxMouseEventsManager(wxWindow *win) { Init(); Create(win); }
bool Create(wxWindow *win);
virtual ~wxMouseEventsManager();
@@ -113,6 +116,8 @@ private:
State_Dragging // the item is being dragged
};
// common part of both ctors
void Init();
// various event handlers
void OnCaptureLost(wxMouseCaptureLostEvent& event);
@@ -121,8 +126,9 @@ private:
void OnMove(wxMouseEvent& event);
// the associated window, never NULL
wxWindow * const m_win;
// the associated window, never NULL except between the calls to the
// default ctor and Create()
wxWindow *m_win;
// the current state
State m_state;