#if wxUSE_GUI
#include "wx/gdicmn.h"
+ #include "wx/cursor.h"
#endif
#include "wx/thread.h"
wxEVT_KEY_DOWN = wxEVT_FIRST + 215,
wxEVT_KEY_UP = wxEVT_FIRST + 216,
+ /* Set cursor event */
+ wxEVT_SET_CURSOR = wxEVT_FIRST + 230,
+
/*
* wxScrollbar and wxSlider event identifiers
*/
wxEVT_PLOT_END_TITLE_EDIT = wxEVT_FIRST + 1025,
wxEVT_PLOT_AREA_CREATE = wxEVT_FIRST + 1026,
+ /* Help events */
+ wxEVT_HELP = wxEVT_FIRST + 1050,
+ wxEVT_DETAILED_HELP,
+
wxEVT_USER_FIRST = wxEVT_FIRST + 2000
};
wxString GetString() const { return m_commandString; }
// Get checkbox value
- bool Checked() const { return (m_commandInt != 0); }
+ bool IsChecked() const { return m_commandInt != 0; }
// TRUE if the listbox event was a selection.
bool IsSelection() const { return (m_extraLong != 0); }
void CopyObject(wxObject& obj) const;
+#ifdef WXWIN_COMPATIBILITY_2
+ bool Checked() const { return IsChecked(); }
+#endif // WXWIN_COMPATIBILITY_2
+
public:
wxString m_commandString; // String event argument
int m_commandInt;
bool m_metaDown;
};
+// Cursor set event
+
+/*
+ wxEVT_SET_CURSOR
+ */
+
+class WXDLLEXPORT wxSetCursorEvent : public wxEvent
+{
+public:
+ wxSetCursorEvent(wxCoord x, wxCoord y)
+ {
+ m_eventType = wxEVT_SET_CURSOR;
+
+ m_x = x;
+ m_y = y;
+ }
+
+ wxCoord GetX() const { return m_x; }
+ wxCoord GetY() const { return m_y; }
+
+ void SetCursor(const wxCursor& cursor) { m_cursor = cursor; }
+ const wxCursor& GetCursor() const { return m_cursor; }
+ bool HasCursor() const { return m_cursor.Ok(); }
+
+private:
+ wxCoord m_x, m_y;
+ wxCursor m_cursor;
+};
+
// Keyboard input event class
/*
bool MetaDown() const { return m_metaDown; }
bool AltDown() const { return m_altDown; }
bool ShiftDown() const { return m_shiftDown; }
- long KeyCode() const { return m_keyCode; }
+
+ bool HasModifiers() const { return ControlDown() || AltDown() || MetaDown(); }
+
+ // get the key code: an ASCII7 char or an element of wxKeyCode enum
+ int GetKeyCode() const { return (int)m_keyCode; }
// Find the position of the event
void GetPosition(wxCoord *xpos, wxCoord *ypos) const
void CopyObject(wxObject& obj) const;
+ // deprecated
+ long KeyCode() const { return m_keyCode; }
+
public:
wxCoord m_x, m_y;
wxEVT_DESTROY
*/
-class WXDLLEXPORT wxWindowCreateEvent : public wxEvent
+class WXDLLEXPORT wxWindowCreateEvent : public wxCommandEvent
{
DECLARE_DYNAMIC_CLASS(wxWindowCreateEvent)
wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); }
};
-class WXDLLEXPORT wxWindowDestroyEvent : public wxEvent
+class WXDLLEXPORT wxWindowDestroyEvent : public wxCommandEvent
{
DECLARE_DYNAMIC_CLASS(wxWindowDestroyEvent)
wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); }
};
+/*
+ wxEVT_HELP, wxEVT_DETAILED_HELP
+ Sent when the user clicks on a window in context-help mode.
+ The cursor position is in screen coordinates.
+ */
+
+class WXDLLEXPORT wxHelpEvent : public wxCommandEvent
+{
+ DECLARE_DYNAMIC_CLASS(wxHelpEvent)
+
+public:
+ wxHelpEvent(wxEventType type = wxEVT_NULL, wxWindowID id = 0, const wxPoint& pt = wxPoint(0, 0))
+ { m_eventType = type; m_id = id; m_pos = pt; }
+
+ // Position of event
+ const wxPoint& GetPosition() const { return m_pos; }
+ void SetPosition(const wxPoint& pos) { m_pos = pos; }
+
+ // Optional link to further help
+ const wxString& GetLink() const { return m_link; }
+ void SetLink(const wxString& link) { m_link = link; }
+
+ // Optional target to display help in. E.g. a window specification
+ const wxString& GetTarget() const { return m_target; }
+ void SetTarget(const wxString& target) { m_target = target; }
+
+ wxPoint m_pos;
+ wxString m_target;
+ wxString m_link;
+};
+
#endif // wxUSE_GUI
// Idle event
typedef void (wxEvtHandler::*wxNavigationKeyEventFunction)(wxNavigationKeyEvent&);
typedef void (wxEvtHandler::*wxPaletteChangedEventFunction)(wxPaletteChangedEvent&);
typedef void (wxEvtHandler::*wxQueryNewPaletteEventFunction)(wxQueryNewPaletteEvent&);
+typedef void (wxEvtHandler::*wxWindowCreateEventFunction)(wxWindowCreateEvent&);
+typedef void (wxEvtHandler::*wxWindowDestroyEventFunction)(wxWindowDestroyEvent&);
+typedef void (wxEvtHandler::*wxSetCursorEventFunction)(wxSetCursorEvent&);
+typedef void (wxEvtHandler::*wxNotifyEventFunction)(wxNotifyEvent&);
+typedef void (wxEvtHandler::*wxHelpEventFunction)(wxHelpEvent&);
#endif // wxUSE_GUI
// N.B. In GNU-WIN32, you *have* to take the address of a member function
#define EVT_NAVIGATION_KEY(func) { wxEVT_NAVIGATION_KEY, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNavigationKeyEventFunction) & func, (wxObject *) NULL },
#define EVT_PALETTE_CHANGED(func) { wxEVT_PALETTE_CHANGED, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxPaletteChangedEventFunction) & func, (wxObject *) NULL },
#define EVT_QUERY_NEW_PALETTE(func) { wxEVT_QUERY_NEW_PALETTE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxQueryNewPaletteEventFunction) & func, (wxObject *) NULL },
-#define EVT_WINDOW_CREATE(func) { wxEVT_CREATE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxQueryNewPaletteEventFunction) & func, (wxObject *) NULL },
-#define EVT_WINDOW_DESTROY(func) { wxEVT_DESTROY, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxQueryNewPaletteEventFunction) & func, (wxObject *) NULL },
+#define EVT_WINDOW_CREATE(func) { wxEVT_CREATE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxWindowCreateEventFunction) & func, (wxObject *) NULL },
+#define EVT_WINDOW_DESTROY(func) { wxEVT_DESTROY, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxWindowDestroyEventFunction) & func, (wxObject *) NULL },
+#define EVT_SET_CURSOR(func) { wxEVT_SET_CURSOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxSetCursorEventFunction) & func, (wxObject *) NULL },
// Mouse events
#define EVT_LEFT_DOWN(func) { wxEVT_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
{ wxEVT_JOY_BUTTON_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
{ wxEVT_JOY_BUTTON_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
{ wxEVT_JOY_MOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
- { wxEVT_JOY_ZMOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
+ { wxEVT_JOY_ZMOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },
// Idle event
#define EVT_IDLE(func) \
- { wxEVT_IDLE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) & func, (wxObject *) NULL },\
+ { wxEVT_IDLE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) & func, (wxObject *) NULL },
// Update UI event
#define EVT_UPDATE_UI(id, func) \
- { wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, (wxObject *) NULL },\
+ { wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, (wxObject *) NULL },
+#define EVT_UPDATE_UI_RANGE(id1, id2, func) \
+ { wxEVT_UPDATE_UI, id1, id2, (wxObjectEventFunction)(wxEventFunction)(wxUpdateUIEventFunction)&func, (wxObject *) NULL },
+
+// Help events
+#define EVT_HELP(id, func) \
+ { wxEVT_HELP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxHelpEventFunction) & func, (wxObject *) NULL },
+
+#define EVT_HELP_RANGE(id1, id2, func) \
+ { wxEVT_HELP, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxHelpEventFunction) & func, (wxObject *) NULL },
+
+#define EVT_DETAILED_HELP(id, func) \
+ { wxEVT_DETAILED_HELP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxHelpEventFunction) & func, (wxObject *) NULL },
+
+#define EVT_DETAILED_HELP_RANGE(id1, id2, func) \
+ { wxEVT_DETAILED_HELP, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxHelpEventFunction) & func, (wxObject *) NULL },
// ----------------------------------------------------------------------------
// Global data