// Purpose: wxMouseEventsManager class declaration
// Author: Vadim Zeitlin
// Created: 2009-04-20
-// RCS-ID: $Id$
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
{
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();
State_Dragging // the item is being dragged
};
+ // common part of both ctors
+ void Init();
// various event handlers
void OnCaptureLost(wxMouseCaptureLostEvent& event);
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;