X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bca8c756a30d54ee4fade96a091d78ad8988fd23..e91e1e3d5cab263883c1cee1689c898b8f7c4ecd:/include/wx/mousemanager.h diff --git a/include/wx/mousemanager.h b/include/wx/mousemanager.h index 75c8920df9..caa2abeaec 100644 --- a/include/wx/mousemanager.h +++ b/include/wx/mousemanager.h @@ -3,7 +3,6 @@ // Purpose: wxMouseEventsManager class declaration // Author: Vadim Zeitlin // Created: 2009-04-20 -// RCS-ID: $Id$ // Copyright: (c) 2009 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -34,8 +33,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 +115,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 +125,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;