};
-//
// Create functors for the templatized events, either allocated on the heap for
-// wxNewXXX() variants (this is needed in wxEvtHandler::Connect() to store them
+// wxNewXXX() variants (this is needed in wxEvtHandler::Bind<>() to store them
// in dynamic event table) or just by returning them as temporary objects (this
-// is enough for Disconnect() and we allocate unnecessary heap allocation like
-// this)
+// is enough for Unbind<>() and we avoid unnecessary heap allocation like this).
// Create functors wrapping other functors (including functions):
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TOOL_RCLICKED, wxCommandEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED, wxCommandEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TOOL_ENTER, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_COMBOBOX_DROPDOWN, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_COMBOBOX_CLOSEUP, wxCommandEvent);
// Thread events
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_THREAD, wxThreadEvent);
// used in wxEventLoopBase::YieldFor to specify all event categories should be processed:
wxEVT_CATEGORY_ALL =
wxEVT_CATEGORY_UI|wxEVT_CATEGORY_USER_INPUT|wxEVT_CATEGORY_SOCKET| \
- wxEVT_CATEGORY_TIMER|wxEVT_CATEGORY_THREAD
+ wxEVT_CATEGORY_TIMER|wxEVT_CATEGORY_THREAD|wxEVT_CATEGORY_UNKNOWN| \
+ wxEVT_CATEGORY_CLIPBOARD
};
/*
wxEVT_PAINT_ICON
*/
-#if defined(__WXDEBUG__) && (defined(__WXMSW__) || defined(__WXPM__))
+#if wxDEBUG_LEVEL && (defined(__WXMSW__) || defined(__WXPM__))
+ #define wxHAS_PAINT_DEBUG
+
// see comments in src/msw|os2/dcclient.cpp where g_isPainting is defined
extern WXDLLIMPEXP_CORE int g_isPainting;
#endif // debug
wxPaintEvent(int Id = 0)
: wxEvent(Id, wxEVT_PAINT)
{
-#if defined(__WXDEBUG__) && (defined(__WXMSW__) || defined(__WXPM__))
- // set the internal flag for the duration of processing of WM_PAINT
+#ifdef wxHAS_PAINT_DEBUG
+ // set the internal flag for the duration of redrawing
g_isPainting++;
#endif // debug
}
// default copy ctor and dtor are normally fine, we only need them to keep
// g_isPainting updated in debug build
-#if defined(__WXDEBUG__) && (defined(__WXMSW__) || defined(__WXPM__))
+#ifdef wxHAS_PAINT_DEBUG
wxPaintEvent(const wxPaintEvent& event)
: wxEvent(event)
{
// Clear table
void Clear();
-#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING
- // Clear all tables
+#if wxUSE_MEMORY_TRACING
+ // Clear all tables: only used to work around problems in memory tracing
+ // code
static void ClearAll();
-#endif // __WXDEBUG__ && wxUSE_MEMORY_TRACING
+#endif // wxUSE_MEMORY_TRACING
protected:
// Init the hash table with the entries of the static event table.
// Bind arbitrary functor (including just a function) to an event:
template <typename EventTag, typename Functor>
void Bind(const EventTag& eventType,
- Functor func,
+ Functor functor,
int winid = wxID_ANY,
int lastId = wxID_ANY,
wxObject *userData = NULL)
{
DoConnect(winid, lastId, eventType,
- wxNewEventFunctor(eventType, func),
+ wxNewEventFunctor(eventType, functor),
userData);
}
template <typename EventTag, typename Functor>
bool Unbind(const EventTag& eventType,
- Functor func,
+ Functor functor,
int winid = wxID_ANY,
int lastId = wxID_ANY,
wxObject *userData = NULL)
{
return DoDisconnect(winid, lastId, eventType,
- wxMakeEventFunctor(eventType, func),
+ wxMakeEventFunctor(eventType, functor),
userData);
}
// Bind a method of a class (called on the specified eventSink which must
// be convertible to this class) object to an event:
- template
- <typename EventTag, typename Class, typename EventArg, typename ObjClass>
+ template <typename EventTag, typename Class, typename EventArg, typename ObjClass>
void Bind(const EventTag &eventType,
- void (Class::*func)(EventArg &),
+ void (Class::*method)(EventArg &),
ObjClass *eventSink,
int winid = wxID_ANY,
int lastId = wxID_ANY,
wxObject *userData = NULL)
{
DoConnect(winid, lastId, eventType,
- wxNewEventFunctor(eventType, func, eventSink),
+ wxNewEventFunctor(eventType, method, eventSink),
userData);
}
- template
- <typename EventTag, typename Class, typename EventArg, typename ObjClass>
+ template <typename EventTag, typename Class, typename EventArg, typename ObjClass>
bool Unbind(const EventTag &eventType,
- void (Class::*func)(EventArg&),
+ void (Class::*method)(EventArg&),
ObjClass *eventSink,
int winid = wxID_ANY,
int lastId = wxID_ANY,
wxObject *userData = NULL )
{
return DoDisconnect(winid, lastId, eventType,
- wxMakeEventFunctor(eventType, func, eventSink),
+ wxMakeEventFunctor(eventType, method, eventSink),
userData);
}
#endif // !wxEVENTS_COMPATIBILITY_2_8
#define EVT_TOOL_RCLICKED_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_COMMAND_TOOL_RCLICKED, id1, id2, wxCommandEventHandler(func))
#define EVT_TOOL_ENTER(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_TOOL_ENTER, winid, wxCommandEventHandler(func))
#define EVT_CHECKLISTBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, winid, wxCommandEventHandler(func))
+#define EVT_COMBOBOX_DROPDOWN(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_COMBOBOX_DROPDOWN, winid, wxCommandEventHandler(func))
+#define EVT_COMBOBOX_CLOSEUP(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_COMBOBOX_CLOSEUP, winid, wxCommandEventHandler(func))
// Generic command events
#define EVT_COMMAND_LEFT_CLICK(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_LEFT_CLICK, winid, wxCommandEventHandler(func))