#ifndef _WX_EVENTH__
#define _WX_EVENTH__
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "event.h"
#endif
#define BEGIN_DECLARE_EVENT_TYPES() enum {
#define END_DECLARE_EVENT_TYPES() };
#define DECLARE_EVENT_TYPE(name, value) name = wxEVT_FIRST + value,
-#define DECLARE_LOCAL_EVENT_TYPE(name, value) name = wxEVT_FIRST + value,
+#define DECLARE_LOCAL_EVENT_TYPE(name, value) name = wxEVT_USER_FIRST + value,
#define DEFINE_EVENT_TYPE(name)
#define DEFINE_LOCAL_EVENT_TYPE(name)
#else // !WXWIN_COMPATIBILITY_EVENT_TYPES
// it is important to still have these as constants to avoid
// initialization order related problems
- DECLARE_EVENT_TYPE(wxEVT_NULL,0);
+ DECLARE_EVENT_TYPE(wxEVT_NULL, 0)
const wxEventType wxEVT_FIRST = 10000;
const wxEventType wxEVT_USER_FIRST = wxEVT_FIRST + 2000;
#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
class WXDLLEXPORT wxMouseEvent : public wxEvent
{
-private:
- wxMouseEvent& operator=(const wxMouseEvent& event);
-
public:
wxMouseEvent(wxEventType mouseType = wxEVT_NULL);
wxMouseEvent(const wxMouseEvent& event) : wxEvent(event)
// wheel action. Defaults to one.
int GetLinesPerAction() const { return m_linesPerAction; }
+ // Is the system set to do page scrolling?
+ bool IsPageScroll() const { return ((unsigned int)m_linesPerAction == UINT_MAX); }
+
virtual wxEvent *Clone() const { return new wxMouseEvent(*this); }
+ wxMouseEvent& operator=(const wxMouseEvent& event) { Assign(event); return *this; }
+
public:
wxCoord m_x, m_y;
{
public:
wxKeyEvent(wxEventType keyType = wxEVT_NULL);
- wxKeyEvent(const wxKeyEvent& evt) : wxEvent(evt)
- {
- m_x = evt.m_x;
- m_y = evt.m_y;
-
- m_keyCode = evt.m_keyCode;
-
- m_controlDown = evt.m_controlDown;
- m_shiftDown = evt.m_shiftDown;
- 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;
- }
-
+ wxKeyEvent(const wxKeyEvent& evt);
// Find state of shift/control keys
bool ControlDown() const { return m_controlDown; }
bool m_metaDown;
bool m_scanCode;
- // these fields contain the platform-specific information about the pressed
- // key
+#if wxUSE_UNICODE
+ // This contains the full Unicode character
+ // in a character events in Unicode mode
+ wxChar m_uniChar;
+#endif
+
+ // these fields contain the platform-specific information about
+ // key that was pressed
wxUint32 m_rawCode;
wxUint32 m_rawFlags;
: wxEvent(event),
m_size(event.m_size)
{ }
-
+
wxSize GetSize() const { return m_size; }
virtual wxEvent *Clone() const { return new wxSizeEvent(*this); }
: wxEvent(event),
m_pos(event.m_pos)
{ }
-
+
wxPoint GetPosition() const { return m_pos; }
virtual wxEvent *Clone() const { return new wxMoveEvent(*this); }
wxActivateEvent(const wxActivateEvent& event)
: wxEvent(event)
{ m_active = event.m_active; }
-
+
bool GetActive() const { return m_active; }
virtual wxEvent *Clone() const { return new wxActivateEvent(*this); }
wxMenuEvent(const wxMenuEvent & event)
: wxEvent(event)
{ m_menuId = event.m_menuId; }
-
+
// only for wxEVT_MENU_HIGHLIGHT
int GetMenuId() const { return m_menuId; }
m_force = event.m_force;
#endif // WXWIN_COMPATIBILITY
}
-
+
void SetLoggingOff(bool logOff) { m_loggingOff = logOff; }
bool GetLoggingOff() const { return m_loggingOff; }
wxShowEvent(const wxShowEvent & event)
: wxEvent(event)
{ m_show = event.m_show; }
-
+
void SetShow(bool show) { m_show = show; }
bool GetShow() const { return m_show; }
wxIconizeEvent(const wxIconizeEvent & event)
: wxEvent(event)
{ m_iconized = event.m_iconized; }
-
+
// return true if the frame was iconized, false if restored
bool Iconized() const { return m_iconized; }
m_buttonState(event.m_buttonState),
m_joyStick(event.m_joyStick)
{ }
-
+
wxPoint GetPosition() const { return m_pos; }
int GetZPosition() const { return m_zPosition; }
int GetButtonState() const { return m_buttonState; }
m_checked =
m_enabled =
m_setEnabled =
- m_setText =
+ m_setText =
m_setChecked = FALSE;
}
wxUpdateUIEvent(const wxUpdateUIEvent & event)
m_setChecked(event.m_setChecked),
m_text(event.m_text)
{ }
-
+
bool GetChecked() const { return m_checked; }
bool GetEnabled() const { return m_enabled; }
wxString GetText() const { return m_text; }
: wxEvent(event),
m_paletteRealized(event.m_paletteRealized)
{ }
-
+
// App sets this if it changes the palette.
void SetPaletteRealized(bool realized) { m_paletteRealized = realized; }
bool GetPaletteRealized() const { return m_paletteRealized; }
m_target(event.m_target),
m_link(event.m_link)
{ }
-
+
// Position of event (in screen coordinates)
const wxPoint& GetPosition() const { return m_pos; }
void SetPosition(const wxPoint& pos) { m_pos = pos; }
: wxCommandEvent(event),
m_pos(event.m_pos)
{ }
-
+
// Position of event (in screen coordinates)
const wxPoint& GetPosition() const { return m_pos; }
void SetPosition(const wxPoint& pos) { m_pos = pos; }
: wxEvent(event),
m_requestMore(event.m_requestMore)
{ }
-
+
void RequestMore(bool needMore = TRUE) { m_requestMore = needMore; }
bool MoreRequested() const { return m_requestMore; }
typedef void (wxEvtHandler::*wxIdleEventFunction)(wxIdleEvent&);
typedef void (wxEvtHandler::*wxCloseEventFunction)(wxCloseEvent&);
typedef void (wxEvtHandler::*wxShowEventFunction)(wxShowEvent&);
-typedef void (wxEvtHandler::*wxIconizeEventFunction)(wxShowEvent&);
-typedef void (wxEvtHandler::*wxMaximizeEventFunction)(wxShowEvent&);
+typedef void (wxEvtHandler::*wxIconizeEventFunction)(wxIconizeEvent&);
+typedef void (wxEvtHandler::*wxMaximizeEventFunction)(wxMaximizeEvent&);
typedef void (wxEvtHandler::*wxNavigationKeyEventFunction)(wxNavigationKeyEvent&);
typedef void (wxEvtHandler::*wxPaletteChangedEventFunction)(wxPaletteChangedEvent&);
typedef void (wxEvtHandler::*wxQueryNewPaletteEventFunction)(wxQueryNewPaletteEvent&);
#define EVT_COMMAND_ENTER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_ENTER, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL ),
// Joystick events
-#define EVT_JOY_DOWN(func) \
+
+#define EVT_JOY_BUTTON_DOWN(func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_JOY_BUTTON_DOWN, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL ),
-#define EVT_JOY_UP(func) \
+#define EVT_JOY_BUTTON_UP(func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_JOY_BUTTON_UP, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL ),
#define EVT_JOY_MOVE(func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_JOY_MOVE, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL ),
#define EVT_JOY_ZMOVE(func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_JOY_ZMOVE, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL ),
+// These are obsolete, see _BUTTON_ events
+#define EVT_JOY_DOWN(func) \
+ DECLARE_EVENT_TABLE_ENTRY( wxEVT_JOY_BUTTON_DOWN, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL ),
+#define EVT_JOY_UP(func) \
+ DECLARE_EVENT_TABLE_ENTRY( wxEVT_JOY_BUTTON_UP, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL ),
+
// All joystick events
#define EVT_JOYSTICK_EVENTS(func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_JOY_BUTTON_DOWN, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL ),\