wxKeyEvent(wxEventType keyType = wxEVT_NULL);
wxKeyEvent(const wxKeyEvent& evt);
+ // can be used check if the key event has exactly the given modifiers:
+ // "GetModifiers() = wxMOD_CONTROL" is easier to write than "ControlDown()
+ // && !MetaDown() && !AltDown() && !ShiftDown()"
+ int GetModifiers() const
+ {
+ return (m_controlDown ? wxMOD_CONTROL : 0) |
+ (m_shiftDown ? wxMOD_SHIFT : 0) |
+ (m_metaDown ? wxMOD_META : 0) |
+ (m_altDown ? wxMOD_ALT : 0);
+ }
+
// Find state of shift/control keys
bool ControlDown() const { return m_controlDown; }
+ bool ShiftDown() const { return m_shiftDown; }
bool MetaDown() const { return m_metaDown; }
bool AltDown() const { return m_altDown; }
- bool ShiftDown() const { return m_shiftDown; }
// "Cmd" is a pseudo key which is Control for PC and Unix platforms but
// Apple ("Command") key under Macs: it makes often sense to use it instead
// Get Y position
wxCoord GetY() const { return m_y; }
+#if WXWIN_COMPATIBILITY_2_6
// deprecated, Use GetKeyCode instead.
wxDEPRECATED( long KeyCode() const );
+#endif // WXWIN_COMPATIBILITY_2_6
virtual wxEvent *Clone() const { return new wxKeyEvent(*this); }
long m_keyCode;
+ // TODO: replace those with a single m_modifiers bitmask of wxMOD_XXX?
bool m_controlDown;
bool m_shiftDown;
bool m_altDown;
bool m_metaDown;
+
+ // FIXME: what is this for? relation to m_rawXXX?
bool m_scanCode;
#if wxUSE_UNICODE
{
m_checked =
m_enabled =
+ m_shown =
m_setEnabled =
+ m_setShown =
m_setText =
m_setChecked = false;
}
: wxCommandEvent(event),
m_checked(event.m_checked),
m_enabled(event.m_enabled),
+ m_shown(event.m_shown),
m_setEnabled(event.m_setEnabled),
+ m_setShown(event.m_setShown),
m_setText(event.m_setText),
m_setChecked(event.m_setChecked),
m_text(event.m_text)
bool GetChecked() const { return m_checked; }
bool GetEnabled() const { return m_enabled; }
+ bool GetShown() const { return m_shown; }
wxString GetText() const { return m_text; }
bool GetSetText() const { return m_setText; }
bool GetSetChecked() const { return m_setChecked; }
bool GetSetEnabled() const { return m_setEnabled; }
+ bool GetSetShown() const { return m_setShown; }
void Check(bool check) { m_checked = check; m_setChecked = true; }
void Enable(bool enable) { m_enabled = enable; m_setEnabled = true; }
+ void Show(bool show) { m_shown = show; m_setShown = true; }
void SetText(const wxString& text) { m_text = text; m_setText = true; }
// Sets the interval between updates in milliseconds.
protected:
bool m_checked;
bool m_enabled;
+ bool m_shown;
bool m_setEnabled;
+ bool m_setShown;
bool m_setText;
bool m_setChecked;
wxString m_text;
{ return theClass::sm_eventHashTable; } \
const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
+#define BEGIN_EVENT_TABLE_TEMPLATE1(theClass, baseClass, T1) \
+ template<typename T1> \
+ const wxEventTable theClass<T1>::sm_eventTable = \
+ { &baseClass::sm_eventTable, &theClass<T1>::sm_eventTableEntries[0] }; \
+ template<typename T1> \
+ const wxEventTable *theClass<T1>::GetEventTable() const \
+ { return &theClass<T1>::sm_eventTable; } \
+ template<typename T1> \
+ wxEventHashTable theClass<T1>::sm_eventHashTable(theClass<T1>::sm_eventTable); \
+ template<typename T1> \
+ wxEventHashTable &theClass<T1>::GetEventHashTable() const \
+ { return theClass<T1>::sm_eventHashTable; } \
+ template<typename T1> \
+ const wxEventTableEntry theClass<T1>::sm_eventTableEntries[] = { \
+
+#define BEGIN_EVENT_TABLE_TEMPLATE2(theClass, baseClass, T1, T2) \
+ template<typename T1, typename T2> \
+ const wxEventTable theClass<T1, T2>::sm_eventTable = \
+ { &baseClass::sm_eventTable, &theClass<T1, T2>::sm_eventTableEntries[0] }; \
+ template<typename T1, typename T2> \
+ const wxEventTable *theClass<T1, T2>::GetEventTable() const \
+ { return &theClass<T1, T2>::sm_eventTable; } \
+ template<typename T1, typename T2> \
+ wxEventHashTable theClass<T1, T2>::sm_eventHashTable(theClass<T1, T2>::sm_eventTable); \
+ template<typename T1, typename T2> \
+ wxEventHashTable &theClass<T1, T2>::GetEventHashTable() const \
+ { return theClass<T1, T2>::sm_eventHashTable; } \
+ template<typename T1, typename T2> \
+ const wxEventTableEntry theClass<T1, T2>::sm_eventTableEntries[] = { \
+
+#define BEGIN_EVENT_TABLE_TEMPLATE3(theClass, baseClass, T1, T2, T3) \
+ template<typename T1, typename T2, typename T3> \
+ const wxEventTable theClass<T1, T2, T3>::sm_eventTable = \
+ { &baseClass::sm_eventTable, &theClass<T1, T2, T3>::sm_eventTableEntries[0] }; \
+ template<typename T1, typename T2, typename T3> \
+ const wxEventTable *theClass<T1, T2, T3>::GetEventTable() const \
+ { return &theClass<T1, T2, T3>::sm_eventTable; } \
+ template<typename T1, typename T2, typename T3> \
+ wxEventHashTable theClass<T1, T2, T3>::sm_eventHashTable(theClass<T1, T2, T3>::sm_eventTable); \
+ template<typename T1, typename T2, typename T3> \
+ wxEventHashTable &theClass<T1, T2, T3>::GetEventHashTable() const \
+ { return theClass<T1, T2, T3>::sm_eventHashTable; } \
+ template<typename T1, typename T2, typename T3> \
+ const wxEventTableEntry theClass<T1, T2, T3>::sm_eventTableEntries[] = { \
+
+#define BEGIN_EVENT_TABLE_TEMPLATE4(theClass, baseClass, T1, T2, T3, T4) \
+ template<typename T1, typename T2, typename T3, typename T4> \
+ const wxEventTable theClass<T1, T2, T3, T4>::sm_eventTable = \
+ { &baseClass::sm_eventTable, &theClass<T1, T2, T3, T4>::sm_eventTableEntries[0] }; \
+ template<typename T1, typename T2, typename T3, typename T4> \
+ const wxEventTable *theClass<T1, T2, T3, T4>::GetEventTable() const \
+ { return &theClass<T1, T2, T3, T4>::sm_eventTable; } \
+ template<typename T1, typename T2, typename T3, typename T4> \
+ wxEventHashTable theClass<T1, T2, T3, T4>::sm_eventHashTable(theClass<T1, T2, T3, T4>::sm_eventTable); \
+ template<typename T1, typename T2, typename T3, typename T4> \
+ wxEventHashTable &theClass<T1, T2, T3, T4>::GetEventHashTable() const \
+ { return theClass<T1, T2, T3, T4>::sm_eventHashTable; } \
+ template<typename T1, typename T2, typename T3, typename T4> \
+ const wxEventTableEntry theClass<T1, T2, T3, T4>::sm_eventTableEntries[] = { \
+
+#define BEGIN_EVENT_TABLE_TEMPLATE5(theClass, baseClass, T1, T2, T3, T4, T5) \
+ template<typename T1, typename T2, typename T3, typename T4, typename T5> \
+ const wxEventTable theClass<T1, T2, T3, T4, T5>::sm_eventTable = \
+ { &baseClass::sm_eventTable, &theClass<T1, T2, T3, T4, T5>::sm_eventTableEntries[0] }; \
+ template<typename T1, typename T2, typename T3, typename T4, typename T5> \
+ const wxEventTable *theClass<T1, T2, T3, T4, T5>::GetEventTable() const \
+ { return &theClass<T1, T2, T3, T4, T5>::sm_eventTable; } \
+ template<typename T1, typename T2, typename T3, typename T4, typename T5> \
+ wxEventHashTable theClass<T1, T2, T3, T4, T5>::sm_eventHashTable(theClass<T1, T2, T3, T4, T5>::sm_eventTable); \
+ template<typename T1, typename T2, typename T3, typename T4, typename T5> \
+ wxEventHashTable &theClass<T1, T2, T3, T4, T5>::GetEventHashTable() const \
+ { return theClass<T1, T2, T3, T4, T5>::sm_eventHashTable; } \
+ template<typename T1, typename T2, typename T3, typename T4, typename T5> \
+ const wxEventTableEntry theClass<T1, T2, T3, T4, T5>::sm_eventTableEntries[] = { \
+
+#define BEGIN_EVENT_TABLE_TEMPLATE7(theClass, baseClass, T1, T2, T3, T4, T5, T6, T7) \
+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> \
+ const wxEventTable theClass<T1, T2, T3, T4, T5, T6, T7>::sm_eventTable = \
+ { &baseClass::sm_eventTable, &theClass<T1, T2, T3, T4, T5, T6, T7>::sm_eventTableEntries[0] }; \
+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> \
+ const wxEventTable *theClass<T1, T2, T3, T4, T5, T6, T7>::GetEventTable() const \
+ { return &theClass<T1, T2, T3, T4, T5, T6, T7>::sm_eventTable; } \
+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> \
+ wxEventHashTable theClass<T1, T2, T3, T4, T5, T6, T7>::sm_eventHashTable(theClass<T1, T2, T3, T4, T5, T6, T7>::sm_eventTable); \
+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> \
+ wxEventHashTable &theClass<T1, T2, T3, T4, T5, T6, T7>::GetEventHashTable() const \
+ { return theClass<T1, T2, T3, T4, T5, T6, T7>::sm_eventHashTable; } \
+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> \
+ const wxEventTableEntry theClass<T1, T2, T3, T4, T5, T6, T7>::sm_eventTableEntries[] = { \
+
+#define BEGIN_EVENT_TABLE_TEMPLATE8(theClass, baseClass, T1, T2, T3, T4, T5, T6, T7, T8) \
+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> \
+ const wxEventTable theClass<T1, T2, T3, T4, T5, T6, T7, T8>::sm_eventTable = \
+ { &baseClass::sm_eventTable, &theClass<T1, T2, T3, T4, T5, T6, T7, T8>::sm_eventTableEntries[0] }; \
+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> \
+ const wxEventTable *theClass<T1, T2, T3, T4, T5, T6, T7, T8>::GetEventTable() const \
+ { return &theClass<T1, T2, T3, T4, T5, T6, T7, T8>::sm_eventTable; } \
+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> \
+ wxEventHashTable theClass<T1, T2, T3, T4, T5, T6, T7, T8>::sm_eventHashTable(theClass<T1, T2, T3, T4, T5, T6, T7, T8>::sm_eventTable); \
+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> \
+ wxEventHashTable &theClass<T1, T2, T3, T4, T5, T6, T7, T8>::GetEventHashTable() const \
+ { return theClass<T1, T2, T3, T4, T5, T6, T7, T8>::sm_eventHashTable; } \
+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> \
+ const wxEventTableEntry theClass<T1, T2, T3, T4, T5, T6, T7, T8>::sm_eventTableEntries[] = { \
+
#define END_EVENT_TABLE() DECLARE_EVENT_TABLE_ENTRY( wxEVT_NULL, 0, 0, 0, 0 ) };
/*
EVT_COMMAND_SCROLL_THUMBRELEASE(winid, func) \
EVT_COMMAND_SCROLL_CHANGED(winid, func)
-// compatibility macros for the old name, to be deprecated in 2.8
-#define wxEVT_SCROLL_ENDSCROLL wxEVT_SCROLL_CHANGED
-#define EVT_COMMAND_SCROLL_ENDSCROLL EVT_COMMAND_SCROLL_CHANGED
-#define EVT_SCROLL_ENDSCROLL EVT_SCROLL_CHANGED
+#if WXWIN_COMPATIBILITY_2_6
+ // compatibility macros for the old name, deprecated in 2.8
+ #define wxEVT_SCROLL_ENDSCROLL wxEVT_SCROLL_CHANGED
+ #define EVT_COMMAND_SCROLL_ENDSCROLL EVT_COMMAND_SCROLL_CHANGED
+ #define EVT_SCROLL_ENDSCROLL EVT_SCROLL_CHANGED
+#endif // WXWIN_COMPATIBILITY_2_6
// Convenience macros for commonly-used commands
#define EVT_CHECKBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_CHECKBOX_CLICKED, winid, wxCommandEventHandler(func))
#endif // wxUSE_GUI
#endif // _WX_EVENT_H__
-