DECLARE_EVENT_TYPE(wxEVT_ERASE_BACKGROUND, 417)
DECLARE_EVENT_TYPE(wxEVT_NC_PAINT, 418)
DECLARE_EVENT_TYPE(wxEVT_PAINT_ICON, 419)
- DECLARE_EVENT_TYPE(wxEVT_MENU_CHAR, 420)
- DECLARE_EVENT_TYPE(wxEVT_MENU_INIT, 421)
+ DECLARE_EVENT_TYPE(wxEVT_MENU_OPEN, 420)
+ DECLARE_EVENT_TYPE(wxEVT_MENU_CLOSE, 421)
DECLARE_EVENT_TYPE(wxEVT_MENU_HIGHLIGHT, 422)
- DECLARE_EVENT_TYPE(wxEVT_POPUP_MENU_INIT, 423)
+ // DECLARE_EVENT_TYPE(wxEVT_POPUP_MENU_INIT, 423) -- free slot
DECLARE_EVENT_TYPE(wxEVT_CONTEXT_MENU, 424)
DECLARE_EVENT_TYPE(wxEVT_SYS_COLOUR_CHANGED, 425)
DECLARE_EVENT_TYPE(wxEVT_DISPLAY_CHANGED, 426)
// get the key code: an ASCII7 char or an element of wxKeyCode enum
int GetKeyCode() const { return (int)m_keyCode; }
+ // get the raw key code (platform-dependent)
+ wxUint32 GetRawKeyCode() const { return m_rawCode; }
+
+ // get the raw key flags (platform-dependent)
+ wxUint32 GetRawKeyFlags() const { return m_rawFlags; }
+
// Find the position of the event
void GetPosition(wxCoord *xpos, wxCoord *ypos) const
{
m_altDown = evt.m_altDown;
m_metaDown = evt.m_metaDown;
m_scanCode = evt.m_scanCode;
+ m_rawCode = evt.m_rawCode;
+ m_rawFlags = evt.m_rawFlags;
return *this;
}
bool m_metaDown;
bool m_scanCode;
+ // these fields contain the platform-specific information about the pressed
+ // key
+ wxUint32 m_rawCode;
+ wxUint32 m_rawFlags;
+
private:
DECLARE_DYNAMIC_CLASS(wxKeyEvent)
};
// Miscellaneous menu event class
/*
- wxEVT_MENU_CHAR,
- wxEVT_MENU_INIT,
+ wxEVT_MENU_OPEN,
+ wxEVT_MENU_CLOSE,
wxEVT_MENU_HIGHLIGHT,
- wxEVT_POPUP_MENU_INIT,
*/
class WXDLLEXPORT wxMenuEvent : public wxEvent
{
public:
wxMenuEvent(wxEventType type = wxEVT_NULL, int id = 0)
- { m_eventType = type; m_menuId = id; m_id = id; }
+ : wxEvent(id, type)
+ { m_menuId = id; }
+ // only for wxEVT_MENU_HIGHLIGHT
int GetMenuId() const { return m_menuId; }
+ // only for wxEVT_MENU_OPEN/CLOSE
+ bool IsPopup() const { return m_menuId == -1; }
+
virtual wxEvent *Clone() const { return new wxMenuEvent(*this); }
private:
int m_menuId;
-private:
DECLARE_DYNAMIC_CLASS(wxMenuEvent)
};
DECLARE_DYNAMIC_CLASS(wxSysColourChangedEvent)
};
+/*
+ wxEVT_MOUSE_CAPTURE_CHANGED
+ The window losing the capture receives this message
+ (even if it released the capture itself).
+ */
+
+class WXDLLEXPORT wxMouseCaptureChangedEvent : public wxEvent
+{
+public:
+ wxMouseCaptureChangedEvent(wxWindowID id = 0, wxWindow* gainedCapture = NULL): wxEvent(id)
+ { m_eventType = wxEVT_MOUSE_CAPTURE_CHANGED; m_gainedCapture = gainedCapture; }
+
+ virtual wxEvent *Clone() const { return new wxMouseCaptureChangedEvent(*this); }
+
+ wxWindow* GetCapturedWindow() const { return m_gainedCapture; };
+
+private:
+ wxWindow* m_gainedCapture;
+ DECLARE_DYNAMIC_CLASS(wxMouseCaptureChangedEvent)
+};
+
/*
wxEVT_DISPLAY_CHANGED
*/
virtual void DoSetClientData( void *data );
virtual void *DoGetClientData() const;
-
private:
+ DECLARE_NO_COPY_CLASS(wxEvtHandler)
DECLARE_DYNAMIC_CLASS(wxEvtHandler)
};
typedef void (wxEvtHandler::*wxNotifyEventFunction)(wxNotifyEvent&);
typedef void (wxEvtHandler::*wxHelpEventFunction)(wxHelpEvent&);
typedef void (wxEvtHandler::*wxContextMenuEventFunction)(wxContextMenuEvent&);
+typedef void (wxEvtHandler::*wxMouseCaptureChangedEventFunction)(wxMouseCaptureChangedEvent&);
#endif // wxUSE_GUI
// N.B. In GNU-WIN32, you *have* to take the address of a member function
#define EVT_KEY_DOWN(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_KEY_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, (wxObject *) NULL ),
#define EVT_KEY_UP(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_KEY_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, (wxObject *) NULL ),
#define EVT_CHAR_HOOK(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_CHAR_HOOK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, NULL ),
+#define EVT_MENU_OPEN(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MENU_OPEN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMenuEventFunction) & func, (wxObject *) NULL ),
+#define EVT_MENU_CLOSE(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MENU_CLOSE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMenuEventFunction) & func, (wxObject *) NULL ),
#define EVT_MENU_HIGHLIGHT(id, func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MENU_HIGHLIGHT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMenuEventFunction) & func, (wxObject *) NULL ),
#define EVT_MENU_HIGHLIGHT_ALL(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MENU_HIGHLIGHT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMenuEventFunction) & func, (wxObject *) NULL ),
#define EVT_SET_FOCUS(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_SET_FOCUS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxFocusEventFunction) & func, (wxObject *) NULL ),
#define EVT_WINDOW_CREATE(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_CREATE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxWindowCreateEventFunction) & func, (wxObject *) NULL ),
#define EVT_WINDOW_DESTROY(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_DESTROY, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxWindowDestroyEventFunction) & func, (wxObject *) NULL ),
#define EVT_SET_CURSOR(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_SET_CURSOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxSetCursorEventFunction) & func, (wxObject *) NULL ),
+#define EVT_MOUSE_CAPTURE_CHANGED(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MOUSE_CAPTURE_CHANGED, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseCaptureChangedEventFunction) & func, (wxObject *) NULL ),
// Mouse events
#define EVT_LEFT_DOWN(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL ),