void CopyObject(wxObject& obj) const;
-#ifdef WXWIN_COMPATIBILITY_2
+#if WXWIN_COMPATIBILITY_2
bool Checked() const { return IsChecked(); }
#endif // WXWIN_COMPATIBILITY_2
class WXDLLEXPORT wxScrollWinEvent : public wxEvent
{
- DECLARE_DYNAMIC_CLASS(wxScrollWinEvent)
-
public:
wxScrollWinEvent(wxEventType commandType = wxEVT_NULL,
int pos = 0, int orient = 0);
void SetPosition(int pos) { m_commandInt = pos; }
void CopyObject(wxObject& object_dest) const;
+
public:
int m_commandInt; // Additional information
long m_extraLong;
+
+ DECLARE_DYNAMIC_CLASS(wxScrollWinEvent)
};
// Mouse event class
class WXDLLEXPORT wxMouseEvent : public wxEvent
{
- DECLARE_DYNAMIC_CLASS(wxMouseEvent)
-
public:
wxMouseEvent(wxEventType mouseType = wxEVT_NULL);
// Was the given button 1,2,3 or any in Down state?
bool ButtonIsDown(int but) const;
+ // Get the button which is changing state (-1 if none)
+ int GetButton() const;
+
// Find state of shift/control keys
bool ControlDown() const { return m_controlDown; }
bool MetaDown() const { return m_metaDown; }
int m_wheelRotation;
int m_wheelDelta;
int m_linesPerAction;
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxMouseEvent)
};
// Cursor set event
#endif // debug
};
+class WXDLLEXPORT wxNcPaintEvent : public wxEvent
+{
+public:
+ wxNcPaintEvent(int id = 0) : wxEvent(id) { SetEventType(wxEVT_NC_PAINT); }
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxNcPaintEvent)
+};
+
// Erase background event class
/*
wxEVT_ERASE_BACKGROUND
class WXDLLEXPORT wxFocusEvent : public wxEvent
{
- DECLARE_DYNAMIC_CLASS(wxFocusEvent)
-
public:
- wxFocusEvent(wxEventType type = wxEVT_NULL, int Id = 0)
- { m_eventType = type; m_id = Id; }
+ wxFocusEvent(wxEventType type = wxEVT_NULL, int id = 0)
+ { m_eventType = type; m_id = id; m_win = NULL; }
+
+ // the window associated with this event is the window which had focus
+ // before for SET event and the window which will have focus for the KILL
+ // one
+ //
+ // NB: it may be NULL in both cases!
+ wxWindow *GetWindow() const { return m_win; }
+ void SetWindow(wxWindow *win) { m_win = win; }
+
+private:
+ wxWindow *m_win;
+
+ DECLARE_DYNAMIC_CLASS(wxFocusEvent)
};
// Activate event class
wxEVT_MENU_INIT,
wxEVT_MENU_HIGHLIGHT,
wxEVT_POPUP_MENU_INIT,
- wxEVT_CONTEXT_MENU,
*/
class WXDLLEXPORT wxMenuEvent : public wxEvent
class WXDLLEXPORT wxShowEvent : public wxEvent
{
- DECLARE_DYNAMIC_CLASS(wxShowEvent)
-
public:
-
wxShowEvent(int id = 0, bool show = FALSE)
{ m_eventType = wxEVT_SHOW; m_id = id; m_show = show; }
protected:
bool m_show;
+
+ DECLARE_DYNAMIC_CLASS(wxShowEvent)
};
/*
class WXDLLEXPORT wxIconizeEvent : public wxEvent
{
- DECLARE_DYNAMIC_CLASS(wxIconizeEvent)
-
public:
- wxIconizeEvent(int id = 0)
- { m_eventType = wxEVT_ICONIZE; m_id = id; }
+ wxIconizeEvent(int id = 0, bool iconized = TRUE)
+ { m_eventType = wxEVT_ICONIZE; m_id = id; m_iconized = iconized; }
+
+ // return true if the frame was iconized, false if restored
+ bool Iconized() const { return m_iconized; }
+
+protected:
+ bool m_iconized;
+
+ DECLARE_DYNAMIC_CLASS(wxIconizeEvent)
};
/*
class WXDLLEXPORT wxMaximizeEvent : public wxEvent
{
- DECLARE_DYNAMIC_CLASS(wxMaximizeEvent)
-
public:
- wxMaximizeEvent(int id = 0)
- { m_eventType = wxEVT_MAXIMIZE; m_id = id; }
+ wxMaximizeEvent(int id = 0)
+ { m_eventType = wxEVT_MAXIMIZE; m_id = id; }
+
+ DECLARE_DYNAMIC_CLASS(wxMaximizeEvent)
};
// Joystick event class
DECLARE_DYNAMIC_CLASS(wxHelpEvent)
};
+// A Context event is sent when the user right clicks on a window or
+// presses Shift-F10
+// NOTE : Under windows this is a repackaged WM_CONTETXMENU message
+// Under other systems it may have to be generated from a right click event
+/*
+ wxEVT_CONTEXT_MENU
+*/
+
+class WXDLLEXPORT wxContextMenuEvent : public wxCommandEvent
+{
+public:
+ wxContextMenuEvent(wxEventType type = wxEVT_NULL,
+ wxWindowID id = 0,
+ const wxPoint& pt = wxDefaultPosition)
+ {
+ m_eventType = type;
+ m_id = id;
+ m_pos = pt;
+ }
+
+ // Position of event (in screen coordinates)
+ const wxPoint& GetPosition() const { return m_pos; }
+ void SetPosition(const wxPoint& pos) { m_pos = pos; }
+
+protected:
+ wxPoint m_pos;
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxContextMenuEvent)
+};
+
#endif // wxUSE_GUI
// Idle event
typedef void (wxEvtHandler::*wxSetCursorEventFunction)(wxSetCursorEvent&);
typedef void (wxEvtHandler::*wxNotifyEventFunction)(wxNotifyEvent&);
typedef void (wxEvtHandler::*wxHelpEventFunction)(wxHelpEvent&);
+typedef void (wxEvtHandler::*wxContextMenuEventFunction)(wxContextMenuEvent&);
#endif // wxUSE_GUI
// N.B. In GNU-WIN32, you *have* to take the address of a member function
#define EVT_END_SESSION(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL ),
#define EVT_QUERY_END_SESSION(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_QUERY_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL ),
#define EVT_PAINT(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PAINT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxPaintEventFunction) & func, (wxObject *) NULL ),
+#define EVT_NC_PAINT(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_NC_PAINT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxPaintEventFunction) & func, (wxObject *) NULL ),
#define EVT_ERASE_BACKGROUND(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_ERASE_BACKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxEraseEventFunction) & func, (wxObject *) NULL ),
#define EVT_CHAR(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_CHAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, (wxObject *) NULL ),
#define EVT_KEY_DOWN(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_KEY_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, (wxObject *) NULL ),
#define EVT_DETAILED_HELP_RANGE(id1, id2, func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_DETAILED_HELP, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxHelpEventFunction) & func, (wxObject *) NULL ),
+// Context Menu Events
+#define EVT_CONTEXT_MENU(func) \
+ DECLARE_EVENT_TABLE_ENTRY(wxEVT_CONTEXT_MENU, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxContextMenuEventFunction) & func, (wxObject *) NULL ),
+
// ----------------------------------------------------------------------------
// Global data
// ----------------------------------------------------------------------------