// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
-// Copyright: (c) wxWindows team
+// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// this is used to make the event table entry type safe, so that for an event
// handler only a function with proper parameter list can be given.
-#ifdef HAVE_STATIC_CAST
- #define wxStaticCastEvent(type, val) static_cast<type>(val)
-#else
- #define wxStaticCastEvent(type, val) ((type)(val))
-#endif
+#define wxStaticCastEvent(type, val) wx_static_cast(type, val)
-// in previous versions of wxWindows the event types used to be constants
+// in previous versions of wxWidgets the event types used to be constants
// which created difficulties with custom/user event types definition
//
-// starting from wxWindows 2.4 the event types are now dynamically assigned
+// starting from wxWidgets 2.4 the event types are now dynamically assigned
// using wxNewEventType() which solves this problem, however at price of
// several incompatibilities:
//
// a) event table macros declaration changed, it now uses wxEventTableEntry
// ctor instead of initialisation from an agregate - the macro
// DECLARE_EVENT_TABLE_ENTRY may be used to write code which can compile
-// with all versions of wxWindows
+// with all versions of wxWidgets
//
// b) event types can't be used as switch() cases as they're not really
// constant any more - there is no magic solution here, you just have to
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_IDLE, 439)
DECLARE_EVENT_TYPE(wxEVT_UPDATE_UI, 440)
DECLARE_EVENT_TYPE(wxEVT_SIZING, 441)
- DECLARE_EVENT_TYPE(wxEVT_MOVING, 4442)
+ DECLARE_EVENT_TYPE(wxEVT_MOVING, 442)
// Generic command events
// Note: a click is a higher-level event than button down/up
};
/*
- * wxWindows events, covering all interesting things that might happen
+ * wxWidgets events, covering all interesting things that might happen
* (button clicking, resizing, setting text in widgets, etc.).
*
* For each completely new event type, derive a new event class.
// Set/Get client object from controls
void SetClientObject(wxClientData* clientObject) { m_clientObject = clientObject; }
- void *GetClientObject() const { return m_clientObject; }
+ wxClientData *GetClientObject() const { return m_clientObject; }
// Get listbox selection if single-choice
int GetSelection() const { return m_commandInt; }
*ypos = m_y;
}
-#ifndef __WIN16__
void GetPosition(long *xpos, long *ypos) const
{
if (xpos)
if (ypos)
*ypos = (long)m_y;
}
-#endif
// Find the position of the event
wxPoint GetPosition() const { return wxPoint(m_x, m_y); }
if (ypos) *ypos = m_y;
}
-#ifndef __WIN16__
void GetPosition(long *xpos, long *ypos) const
{
if (xpos) *xpos = (long)m_x;
if (ypos) *ypos = (long)m_y;
}
-#endif
wxPoint GetPosition() const
{ return wxPoint(m_x, m_y); }
// time we should update
static void ResetUpdateTime();
- // Specify how wxWindows will send update events: to
+ // Specify how wxWidgets will send update events: to
// all windows, or only to those which specify that they
// will process the events.
static void SetMode(wxUpdateUIMode mode) { sm_updateMode = mode; }
wxWindow* GetCurrentFocus() const { return m_focus; }
void SetCurrentFocus(wxWindow *win) { m_focus = win; }
+ // Set flags
+ void SetFlags(long flags) { m_flags = flags; }
+
virtual wxEvent *Clone() const { return new wxNavigationKeyEvent(*this); }
-private:
enum
{
IsForward = 0x0001,
virtual wxEvent *Clone() const { return new wxIdleEvent(*this); }
- // Specify how wxWindows will send idle events: to
+ // Specify how wxWidgets will send idle events: to
// all windows, or only to those which specify that they
// will process the events.
static void SetMode(wxIdleMode mode) { sm_idleMode = mode; }
};
// ----------------------------------------------------------------------------
-// wxEvtHandler: the base class for all objects handling wxWindows events
+// wxEvtHandler: the base class for all objects handling wxWidgets events
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxEvtHandler : public wxObject
typedef void (wxEvtHandler::*wxSizeEventFunction)(wxSizeEvent&);
typedef void (wxEvtHandler::*wxMoveEventFunction)(wxMoveEvent&);
typedef void (wxEvtHandler::*wxPaintEventFunction)(wxPaintEvent&);
+typedef void (wxEvtHandler::*wxNcPaintEventFunction)(wxNcPaintEvent&);
typedef void (wxEvtHandler::*wxEraseEventFunction)(wxEraseEvent&);
typedef void (wxEvtHandler::*wxMouseEventFunction)(wxMouseEvent&);
typedef void (wxEvtHandler::*wxCharEventFunction)(wxKeyEvent&);
#define EVT_END_SESSION(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_END_SESSION, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCloseEventFunction, & func ), (wxObject *) NULL ),
#define EVT_QUERY_END_SESSION(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_QUERY_END_SESSION, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCloseEventFunction, & func ), (wxObject *) NULL ),
#define EVT_PAINT(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PAINT, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPaintEventFunction, & func ), (wxObject *) NULL ),
-#define EVT_NC_PAINT(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_NC_PAINT, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPaintEventFunction, & func ), (wxObject *) NULL ),
+#define EVT_NC_PAINT(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_NC_PAINT, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxNcPaintEventFunction, & func ), (wxObject *) NULL ),
#define EVT_ERASE_BACKGROUND(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_ERASE_BACKGROUND, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxEraseEventFunction, & func ), (wxObject *) NULL ),
#define EVT_CHAR(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_CHAR, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCharEventFunction, & func ), (wxObject *) NULL ),
#define EVT_KEY_DOWN(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_KEY_DOWN, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCharEventFunction, & func ), (wxObject *) NULL ),