1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2000-09-10 12:43:37 +00:00
|
|
|
// Name: wx/event.h
|
1998-05-20 14:01:55 +00:00
|
|
|
// Purpose: Event classes
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
2004-05-23 14:56:36 +00:00
|
|
|
// Copyright: (c) wxWidgets team
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2007-12-03 02:55:14 +00:00
|
|
|
#ifndef _WX_EVENT_H_
|
|
|
|
#define _WX_EVENT_H_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
#include "wx/defs.h"
|
2006-11-03 21:06:57 +00:00
|
|
|
#include "wx/cpp.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#include "wx/object.h"
|
2004-07-12 21:49:30 +00:00
|
|
|
#include "wx/clntdata.h"
|
1999-10-04 20:15:38 +00:00
|
|
|
|
|
|
|
#if wxUSE_GUI
|
|
|
|
#include "wx/gdicmn.h"
|
2000-03-14 00:45:54 +00:00
|
|
|
#include "wx/cursor.h"
|
1999-10-04 20:15:38 +00:00
|
|
|
#endif
|
1999-05-19 00:53:27 +00:00
|
|
|
|
2003-07-17 23:59:49 +00:00
|
|
|
#include "wx/dynarray.h"
|
2008-01-05 19:07:52 +00:00
|
|
|
#include "wx/thread.h"
|
2008-01-08 17:57:27 +00:00
|
|
|
#include "wx/tracker.h"
|
2003-07-17 23:59:49 +00:00
|
|
|
|
1999-10-04 20:15:38 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// forward declarations
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2007-07-09 10:09:52 +00:00
|
|
|
class WXDLLIMPEXP_FWD_BASE wxList;
|
1999-10-04 20:15:38 +00:00
|
|
|
#if wxUSE_GUI
|
2007-07-09 10:09:52 +00:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxDC;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxMenu;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxWindowBase;
|
1999-10-04 20:15:38 +00:00
|
|
|
#endif // wxUSE_GUI
|
|
|
|
|
2007-07-09 10:09:52 +00:00
|
|
|
class WXDLLIMPEXP_FWD_BASE wxEvtHandler;
|
2008-01-13 01:12:13 +00:00
|
|
|
class wxEventConnectionRef;
|
2005-02-16 18:02:48 +00:00
|
|
|
|
1999-10-04 20:15:38 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Event types
|
|
|
|
// ----------------------------------------------------------------------------
|
1998-06-26 20:19:48 +00:00
|
|
|
|
2001-01-27 20:16:02 +00:00
|
|
|
typedef int wxEventType;
|
|
|
|
|
2007-02-04 00:12:50 +00:00
|
|
|
#define wxEVT_ANY ((wxEventType)-1)
|
|
|
|
|
2004-02-10 22:15:19 +00:00
|
|
|
// this is used to make the event table entry type safe, so that for an event
|
|
|
|
// handler only a function with proper parameter list can be given.
|
2004-04-16 10:30:07 +00:00
|
|
|
#define wxStaticCastEvent(type, val) wx_static_cast(type, val)
|
2004-02-10 22:15:19 +00:00
|
|
|
|
2003-03-21 02:58:55 +00:00
|
|
|
#define DECLARE_EVENT_TABLE_ENTRY(type, winid, idLast, fn, obj) \
|
|
|
|
wxEventTableEntry(type, winid, idLast, fn, obj)
|
2001-01-27 20:16:02 +00:00
|
|
|
|
2008-01-27 13:21:39 +00:00
|
|
|
// obsolete event declaration/definition macros, we don't need them any longer
|
|
|
|
// but we keep them for compatibility as it doesn't cost us anything anyhow
|
2001-01-31 17:16:40 +00:00
|
|
|
#define BEGIN_DECLARE_EVENT_TYPES()
|
|
|
|
#define END_DECLARE_EVENT_TYPES()
|
2003-07-02 01:41:23 +00:00
|
|
|
#define DECLARE_EXPORTED_EVENT_TYPE(expdecl, name, value) \
|
|
|
|
extern expdecl const wxEventType name;
|
2001-02-01 16:12:21 +00:00
|
|
|
#define DECLARE_EVENT_TYPE(name, value) \
|
2003-07-02 01:59:24 +00:00
|
|
|
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_CORE, name, value)
|
2003-07-02 01:41:23 +00:00
|
|
|
#define DECLARE_LOCAL_EVENT_TYPE(name, value) \
|
2006-11-03 21:06:57 +00:00
|
|
|
DECLARE_EXPORTED_EVENT_TYPE(wxEMPTY_PARAMETER_VALUE, name, value)
|
2001-01-31 17:19:06 +00:00
|
|
|
#define DEFINE_EVENT_TYPE(name) const wxEventType name = wxNewEventType();
|
2003-07-02 01:41:23 +00:00
|
|
|
#define DEFINE_LOCAL_EVENT_TYPE(name) DEFINE_EVENT_TYPE(name)
|
2001-01-27 20:16:02 +00:00
|
|
|
|
|
|
|
// generate a new unique event type
|
2003-07-02 01:59:24 +00:00
|
|
|
extern WXDLLIMPEXP_BASE wxEventType wxNewEventType();
|
2001-01-27 20:16:02 +00:00
|
|
|
|
2008-01-27 13:21:39 +00:00
|
|
|
// many, but not all, standard event types
|
|
|
|
|
|
|
|
// some generic events
|
|
|
|
extern WXDLLIMPEXP_BASE const wxEventType wxEVT_NULL;
|
|
|
|
extern WXDLLIMPEXP_BASE const wxEventType wxEVT_FIRST;
|
|
|
|
extern WXDLLIMPEXP_BASE const wxEventType wxEVT_USER_FIRST;
|
|
|
|
|
|
|
|
// Command events
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_BUTTON_CLICKED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHECKBOX_CLICKED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHOICE_SELECTED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LISTBOX_SELECTED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LISTBOX_DOUBLECLICKED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHECKLISTBOX_TOGGLED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_MENU_SELECTED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SLIDER_UPDATED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_RADIOBOX_SELECTED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_RADIOBUTTON_SELECTED;
|
|
|
|
|
|
|
|
// wxEVT_COMMAND_SCROLLBAR_UPDATED is deprecated, use wxEVT_SCROLL... events
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SCROLLBAR_UPDATED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_VLBOX_SELECTED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_COMBOBOX_SELECTED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TOOL_RCLICKED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TOOL_ENTER;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SPINCTRL_UPDATED;
|
2008-03-18 14:04:19 +00:00
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SPINCTRLDOUBLE_UPDATED;
|
2008-01-27 13:21:39 +00:00
|
|
|
|
|
|
|
// Sockets and timers send events, too
|
|
|
|
extern WXDLLIMPEXP_BASE const wxEventType wxEVT_SOCKET;
|
|
|
|
extern WXDLLIMPEXP_BASE const wxEventType wxEVT_TIMER;
|
|
|
|
|
|
|
|
// Mouse event types
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_LEFT_DOWN;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_LEFT_UP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MIDDLE_DOWN;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MIDDLE_UP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_RIGHT_DOWN;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_RIGHT_UP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOTION;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_ENTER_WINDOW;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_LEAVE_WINDOW;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_LEFT_DCLICK;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MIDDLE_DCLICK;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_RIGHT_DCLICK;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SET_FOCUS;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_KILL_FOCUS;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_CHILD_FOCUS;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOUSEWHEEL;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_AUX1_DOWN;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_AUX1_UP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_AUX1_DCLICK;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_AUX2_DOWN;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_AUX2_UP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_AUX2_DCLICK;
|
|
|
|
|
|
|
|
// Non-client mouse events
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_LEFT_DOWN;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_LEFT_UP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_MIDDLE_DOWN;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_MIDDLE_UP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_RIGHT_DOWN;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_RIGHT_UP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_MOTION;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_ENTER_WINDOW;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_LEAVE_WINDOW;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_LEFT_DCLICK;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_MIDDLE_DCLICK;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_RIGHT_DCLICK;
|
|
|
|
|
|
|
|
// Character input event type
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_CHAR;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_CHAR_HOOK;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NAVIGATION_KEY;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_KEY_DOWN;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_KEY_UP;
|
2003-07-10 09:16:00 +00:00
|
|
|
#if wxUSE_HOTKEY
|
2008-01-27 13:21:39 +00:00
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_HOTKEY;
|
2003-07-10 09:16:00 +00:00
|
|
|
#endif
|
2008-01-27 13:21:39 +00:00
|
|
|
// Set cursor event
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SET_CURSOR;
|
|
|
|
|
|
|
|
// wxScrollBar and wxSlider event identifiers
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_TOP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_BOTTOM;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_LINEUP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_LINEDOWN;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_PAGEUP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_PAGEDOWN;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_THUMBTRACK;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_THUMBRELEASE;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_CHANGED;
|
|
|
|
|
|
|
|
// Scroll events from wxWindow
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_TOP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_BOTTOM;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_LINEUP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_LINEDOWN;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_PAGEUP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_PAGEDOWN;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_THUMBTRACK;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_THUMBRELEASE;
|
|
|
|
|
|
|
|
// System events
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SIZE;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOVE;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_CLOSE_WINDOW;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_END_SESSION;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_QUERY_END_SESSION;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_ACTIVATE_APP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_ACTIVATE;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_CREATE;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DESTROY;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SHOW;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_ICONIZE;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MAXIMIZE;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOUSE_CAPTURE_CHANGED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOUSE_CAPTURE_LOST;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_PAINT;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_ERASE_BACKGROUND;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_PAINT;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_PAINT_ICON;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MENU_OPEN;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MENU_CLOSE;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MENU_HIGHLIGHT;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_CONTEXT_MENU;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SYS_COLOUR_CHANGED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DISPLAY_CHANGED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SETTING_CHANGED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_QUERY_NEW_PALETTE;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_PALETTE_CHANGED;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_JOY_BUTTON_DOWN;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_JOY_BUTTON_UP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_JOY_MOVE;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_JOY_ZMOVE;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DROP_FILES;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DRAW_ITEM;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MEASURE_ITEM;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMPARE_ITEM;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_INIT_DIALOG;
|
|
|
|
extern WXDLLIMPEXP_BASE const wxEventType wxEVT_IDLE;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_UPDATE_UI;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SIZING;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOVING;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOVE_START;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOVE_END;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_HIBERNATE;
|
|
|
|
|
|
|
|
// Clipboard events
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TEXT_COPY;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TEXT_CUT;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TEXT_PASTE;
|
|
|
|
|
|
|
|
// Generic command events
|
|
|
|
// Note: a click is a higher-level event than button down/up
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LEFT_CLICK;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LEFT_DCLICK;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_RIGHT_CLICK;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_RIGHT_DCLICK;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SET_FOCUS;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_KILL_FOCUS;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_ENTER;
|
|
|
|
|
|
|
|
// Help events
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_HELP;
|
|
|
|
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DETAILED_HELP;
|
2001-01-27 12:38:09 +00:00
|
|
|
|
2001-01-27 20:16:02 +00:00
|
|
|
// these 2 events are the same
|
|
|
|
#define wxEVT_COMMAND_TOOL_CLICKED wxEVT_COMMAND_MENU_SELECTED
|
2001-01-27 12:38:09 +00:00
|
|
|
|
2001-07-31 17:56:45 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
2001-01-25 18:30:30 +00:00
|
|
|
// Compatibility
|
2001-07-31 17:56:45 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// this event is also used by wxComboBox and wxSpinCtrl which don't include
|
|
|
|
// wx/textctrl.h in all ports [yet], so declare it here as well
|
|
|
|
//
|
|
|
|
// still, any new code using it should include wx/textctrl.h explicitly
|
2007-12-20 11:24:44 +00:00
|
|
|
extern const wxEventType WXDLLIMPEXP_CORE wxEVT_COMMAND_TEXT_UPDATED;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2003-07-18 00:39:05 +00:00
|
|
|
// the predefined constants for the number of times we propagate event
|
|
|
|
// upwards window child-parent chain
|
|
|
|
enum Propagation_state
|
|
|
|
{
|
|
|
|
// don't propagate it at all
|
|
|
|
wxEVENT_PROPAGATE_NONE = 0,
|
|
|
|
|
|
|
|
// propagate it until it is processed
|
|
|
|
wxEVENT_PROPAGATE_MAX = INT_MAX
|
|
|
|
};
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
/*
|
2004-05-23 14:56:36 +00:00
|
|
|
* wxWidgets events, covering all interesting things that might happen
|
1998-05-20 14:01:55 +00:00
|
|
|
* (button clicking, resizing, setting text in widgets, etc.).
|
|
|
|
*
|
|
|
|
* For each completely new event type, derive a new event class.
|
|
|
|
* An event CLASS represents a C++ class defining a range of similar event TYPES;
|
|
|
|
* examples are canvas events, panel item command events.
|
|
|
|
* An event TYPE is a unique identifier for a particular system event,
|
|
|
|
* such as a button press or a listbox deselection.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_BASE wxEvent : public wxObject
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
2002-05-08 21:13:51 +00:00
|
|
|
private:
|
|
|
|
wxEvent& operator=(const wxEvent&);
|
2002-05-23 21:25:06 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
protected:
|
|
|
|
wxEvent(const wxEvent&); // for implementing Clone()
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
public:
|
2003-03-21 02:58:55 +00:00
|
|
|
wxEvent(int winid = 0, wxEventType commandType = wxEVT_NULL );
|
1999-02-05 14:26:48 +00:00
|
|
|
|
|
|
|
void SetEventType(wxEventType typ) { m_eventType = typ; }
|
|
|
|
wxEventType GetEventType() const { return m_eventType; }
|
|
|
|
wxObject *GetEventObject() const { return m_eventObject; }
|
|
|
|
void SetEventObject(wxObject *obj) { m_eventObject = obj; }
|
|
|
|
long GetTimestamp() const { return m_timeStamp; }
|
|
|
|
void SetTimestamp(long ts = 0) { m_timeStamp = ts; }
|
|
|
|
int GetId() const { return m_id; }
|
|
|
|
void SetId(int Id) { m_id = Id; }
|
|
|
|
|
|
|
|
// Can instruct event processor that we wish to ignore this event
|
|
|
|
// (treat as if the event table entry had not been found): this must be done
|
|
|
|
// to allow the event processing by the base classes (calling event.Skip()
|
2004-09-04 01:26:40 +00:00
|
|
|
// is the analog of calling the base class version of a virtual function)
|
|
|
|
void Skip(bool skip = true) { m_skipped = skip; }
|
2007-04-14 09:58:37 +00:00
|
|
|
bool GetSkipped() const { return m_skipped; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-11-21 21:44:52 +00:00
|
|
|
// this function is used to create a copy of the event polymorphically and
|
|
|
|
// all derived classes must implement it because otherwise wxPostEvent()
|
|
|
|
// for them wouldn't work (it needs to do a copy of the event)
|
|
|
|
virtual wxEvent *Clone() const = 0;
|
1999-04-26 18:16:56 +00:00
|
|
|
|
2004-07-04 11:19:47 +00:00
|
|
|
// Implementation only: this test is explicitly anti OO and this function
|
2003-07-18 00:39:05 +00:00
|
|
|
// exists only for optimization purposes.
|
|
|
|
bool IsCommandEvent() const { return m_isCommandEvent; }
|
|
|
|
|
|
|
|
// Determine if this event should be propagating to the parent window.
|
|
|
|
bool ShouldPropagate() const
|
|
|
|
{ return m_propagationLevel != wxEVENT_PROPAGATE_NONE; }
|
|
|
|
|
|
|
|
// Stop an event from propagating to its parent window, returns the old
|
|
|
|
// propagation level value
|
|
|
|
int StopPropagation()
|
|
|
|
{
|
|
|
|
int propagationLevel = m_propagationLevel;
|
|
|
|
m_propagationLevel = wxEVENT_PROPAGATE_NONE;
|
|
|
|
return propagationLevel;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Resume the event propagation by restoring the propagation level
|
|
|
|
// (returned by StopPropagation())
|
|
|
|
void ResumePropagation(int propagationLevel)
|
|
|
|
{
|
|
|
|
m_propagationLevel = propagationLevel;
|
|
|
|
}
|
|
|
|
|
2005-01-18 15:12:53 +00:00
|
|
|
protected:
|
1999-02-05 14:26:48 +00:00
|
|
|
wxObject* m_eventObject;
|
|
|
|
wxEventType m_eventType;
|
|
|
|
long m_timeStamp;
|
|
|
|
int m_id;
|
2005-01-18 15:12:53 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
// m_callbackUserData is for internal usage only
|
1999-02-05 14:26:48 +00:00
|
|
|
wxObject* m_callbackUserData;
|
2003-07-18 00:39:05 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// the propagation level: while it is positive, we propagate the event to
|
|
|
|
// the parent window (if any)
|
|
|
|
//
|
|
|
|
// this one doesn't have to be public, we don't have to worry about
|
|
|
|
// backwards compatibility as it is new
|
|
|
|
int m_propagationLevel;
|
|
|
|
|
2005-01-18 15:12:53 +00:00
|
|
|
protected:
|
1999-05-19 00:53:27 +00:00
|
|
|
bool m_skipped;
|
1999-02-23 22:41:37 +00:00
|
|
|
bool m_isCommandEvent;
|
2003-09-17 23:35:36 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-18 00:39:05 +00:00
|
|
|
// it needs to access our m_propagationLevel
|
2007-07-09 10:09:52 +00:00
|
|
|
friend class WXDLLIMPEXP_FWD_BASE wxPropagateOnce;
|
2003-07-18 00:39:05 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
DECLARE_ABSTRACT_CLASS(wxEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2003-07-18 00:39:05 +00:00
|
|
|
/*
|
|
|
|
* Helper class to temporarily change an event not to propagate.
|
|
|
|
*/
|
|
|
|
class WXDLLIMPEXP_BASE wxPropagationDisabler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxPropagationDisabler(wxEvent& event) : m_event(event)
|
|
|
|
{
|
|
|
|
m_propagationLevelOld = m_event.StopPropagation();
|
|
|
|
}
|
|
|
|
|
|
|
|
~wxPropagationDisabler()
|
|
|
|
{
|
|
|
|
m_event.ResumePropagation(m_propagationLevelOld);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxEvent& m_event;
|
|
|
|
int m_propagationLevelOld;
|
2003-07-22 00:24:07 +00:00
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS(wxPropagationDisabler)
|
2003-07-18 00:39:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Another one to temporarily lower propagation level.
|
|
|
|
*/
|
|
|
|
class WXDLLIMPEXP_BASE wxPropagateOnce
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxPropagateOnce(wxEvent& event) : m_event(event)
|
|
|
|
{
|
|
|
|
wxASSERT_MSG( m_event.m_propagationLevel > 0,
|
|
|
|
_T("shouldn't be used unless ShouldPropagate()!") );
|
|
|
|
|
|
|
|
m_event.m_propagationLevel--;
|
|
|
|
}
|
|
|
|
|
|
|
|
~wxPropagateOnce()
|
|
|
|
{
|
|
|
|
m_event.m_propagationLevel++;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxEvent& m_event;
|
2003-07-22 00:24:07 +00:00
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS(wxPropagateOnce)
|
2003-07-18 00:39:05 +00:00
|
|
|
};
|
|
|
|
|
2007-02-04 00:12:50 +00:00
|
|
|
|
1999-10-04 20:15:38 +00:00
|
|
|
#if wxUSE_GUI
|
|
|
|
|
2003-07-18 00:39:05 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
// Item or menu event class
|
|
|
|
/*
|
|
|
|
wxEVT_COMMAND_BUTTON_CLICKED
|
|
|
|
wxEVT_COMMAND_CHECKBOX_CLICKED
|
|
|
|
wxEVT_COMMAND_CHOICE_SELECTED
|
|
|
|
wxEVT_COMMAND_LISTBOX_SELECTED
|
|
|
|
wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
|
|
|
|
wxEVT_COMMAND_TEXT_UPDATED
|
|
|
|
wxEVT_COMMAND_TEXT_ENTER
|
|
|
|
wxEVT_COMMAND_MENU_SELECTED
|
|
|
|
wxEVT_COMMAND_SLIDER_UPDATED
|
|
|
|
wxEVT_COMMAND_RADIOBOX_SELECTED
|
|
|
|
wxEVT_COMMAND_RADIOBUTTON_SELECTED
|
|
|
|
wxEVT_COMMAND_SCROLLBAR_UPDATED
|
|
|
|
wxEVT_COMMAND_VLBOX_SELECTED
|
|
|
|
wxEVT_COMMAND_COMBOBOX_SELECTED
|
2001-02-08 18:57:23 +00:00
|
|
|
wxEVT_COMMAND_TOGGLEBUTTON_CLICKED
|
1998-05-20 14:01:55 +00:00
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxCommandEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
2003-03-21 02:58:55 +00:00
|
|
|
wxCommandEvent(wxEventType commandType = wxEVT_NULL, int winid = 0);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2002-05-08 21:13:51 +00:00
|
|
|
wxCommandEvent(const wxCommandEvent& event)
|
2002-07-03 16:25:22 +00:00
|
|
|
: wxEvent(event),
|
2008-04-22 13:14:00 +00:00
|
|
|
m_cmdString(event.m_cmdString.c_str()), // "thread-safe"
|
2002-07-03 16:25:22 +00:00
|
|
|
m_commandInt(event.m_commandInt),
|
|
|
|
m_extraLong(event.m_extraLong),
|
|
|
|
m_clientData(event.m_clientData),
|
|
|
|
m_clientObject(event.m_clientObject)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Set/Get client data from controls
|
|
|
|
void SetClientData(void* clientData) { m_clientData = clientData; }
|
|
|
|
void *GetClientData() const { return m_clientData; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Set/Get client object from controls
|
|
|
|
void SetClientObject(wxClientData* clientObject) { m_clientObject = clientObject; }
|
2004-04-15 23:10:08 +00:00
|
|
|
wxClientData *GetClientObject() const { return m_clientObject; }
|
1998-11-06 13:13:43 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Get listbox selection if single-choice
|
|
|
|
int GetSelection() const { return m_commandInt; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Set/Get listbox/choice selection string
|
2005-01-18 15:12:53 +00:00
|
|
|
void SetString(const wxString& s) { m_cmdString = s; }
|
|
|
|
wxString GetString() const;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Get checkbox value
|
2000-08-08 06:11:51 +00:00
|
|
|
bool IsChecked() const { return m_commandInt != 0; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2004-09-04 01:26:40 +00:00
|
|
|
// true if the listbox event was a selection.
|
1999-02-05 14:26:48 +00:00
|
|
|
bool IsSelection() const { return (m_extraLong != 0); }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
void SetExtraLong(long extraLong) { m_extraLong = extraLong; }
|
2003-08-02 00:12:39 +00:00
|
|
|
long GetExtraLong() const { return m_extraLong; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
void SetInt(int i) { m_commandInt = i; }
|
2006-04-21 00:53:59 +00:00
|
|
|
int GetInt() const { return m_commandInt; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxCommandEvent(*this); }
|
1999-05-07 18:34:32 +00:00
|
|
|
|
2005-01-18 15:12:53 +00:00
|
|
|
protected:
|
|
|
|
wxString m_cmdString; // String event argument
|
1999-02-05 14:26:48 +00:00
|
|
|
int m_commandInt;
|
|
|
|
long m_extraLong; // Additional information (e.g. select/deselect)
|
|
|
|
void* m_clientData; // Arbitrary client data
|
|
|
|
wxClientData* m_clientObject; // Arbitrary client object
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCommandEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
1998-11-24 23:30:50 +00:00
|
|
|
// this class adds a possibility to react (from the user) code to a control
|
|
|
|
// notification: allow or veto the operation being reported.
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxNotifyEvent : public wxCommandEvent
|
1998-11-24 23:30:50 +00:00
|
|
|
{
|
|
|
|
public:
|
2003-03-21 02:58:55 +00:00
|
|
|
wxNotifyEvent(wxEventType commandType = wxEVT_NULL, int winid = 0)
|
|
|
|
: wxCommandEvent(commandType, winid)
|
2004-09-04 01:26:40 +00:00
|
|
|
{ m_bAllow = true; }
|
2002-05-08 21:13:51 +00:00
|
|
|
|
|
|
|
wxNotifyEvent(const wxNotifyEvent& event)
|
|
|
|
: wxCommandEvent(event)
|
2002-07-03 16:25:22 +00:00
|
|
|
{ m_bAllow = event.m_bAllow; }
|
1998-11-24 23:30:50 +00:00
|
|
|
|
2000-02-15 00:05:36 +00:00
|
|
|
// veto the operation (usually it's allowed by default)
|
2004-09-04 01:26:40 +00:00
|
|
|
void Veto() { m_bAllow = false; }
|
1998-11-24 23:30:50 +00:00
|
|
|
|
2000-02-15 00:05:36 +00:00
|
|
|
// allow the operation if it was disabled by default
|
2004-09-04 01:26:40 +00:00
|
|
|
void Allow() { m_bAllow = true; }
|
2000-02-15 00:05:36 +00:00
|
|
|
|
1998-11-24 23:30:50 +00:00
|
|
|
// for implementation code only: is the operation allowed?
|
|
|
|
bool IsAllowed() const { return m_bAllow; }
|
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxNotifyEvent(*this); }
|
1999-12-29 17:16:55 +00:00
|
|
|
|
1998-11-24 23:30:50 +00:00
|
|
|
private:
|
|
|
|
bool m_bAllow;
|
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxNotifyEvent)
|
1998-11-24 23:30:50 +00:00
|
|
|
};
|
|
|
|
|
1999-05-12 09:31:02 +00:00
|
|
|
// Scroll event class, derived form wxCommandEvent. wxScrollEvents are
|
2002-07-09 23:33:28 +00:00
|
|
|
// sent by wxSlider and wxScrollBar.
|
1998-05-20 14:01:55 +00:00
|
|
|
/*
|
|
|
|
wxEVT_SCROLL_TOP
|
|
|
|
wxEVT_SCROLL_BOTTOM
|
|
|
|
wxEVT_SCROLL_LINEUP
|
|
|
|
wxEVT_SCROLL_LINEDOWN
|
|
|
|
wxEVT_SCROLL_PAGEUP
|
|
|
|
wxEVT_SCROLL_PAGEDOWN
|
|
|
|
wxEVT_SCROLL_THUMBTRACK
|
2000-02-11 17:55:28 +00:00
|
|
|
wxEVT_SCROLL_THUMBRELEASE
|
2005-05-31 15:22:10 +00:00
|
|
|
wxEVT_SCROLL_CHANGED
|
1998-05-20 14:01:55 +00:00
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxScrollEvent : public wxCommandEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
|
|
|
wxScrollEvent(wxEventType commandType = wxEVT_NULL,
|
2003-03-21 02:58:55 +00:00
|
|
|
int winid = 0, int pos = 0, int orient = 0);
|
1999-02-05 14:26:48 +00:00
|
|
|
|
2003-08-02 00:12:39 +00:00
|
|
|
int GetOrientation() const { return (int) m_extraLong; }
|
|
|
|
int GetPosition() const { return m_commandInt; }
|
1999-02-05 14:26:48 +00:00
|
|
|
void SetOrientation(int orient) { m_extraLong = (long) orient; }
|
|
|
|
void SetPosition(int pos) { m_commandInt = pos; }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxScrollEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxScrollEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
1999-05-12 09:31:02 +00:00
|
|
|
// ScrollWin event class, derived fom wxEvent. wxScrollWinEvents
|
|
|
|
// are sent by wxWindow.
|
|
|
|
/*
|
|
|
|
wxEVT_SCROLLWIN_TOP
|
|
|
|
wxEVT_SCROLLWIN_BOTTOM
|
|
|
|
wxEVT_SCROLLWIN_LINEUP
|
|
|
|
wxEVT_SCROLLWIN_LINEDOWN
|
|
|
|
wxEVT_SCROLLWIN_PAGEUP
|
|
|
|
wxEVT_SCROLLWIN_PAGEDOWN
|
|
|
|
wxEVT_SCROLLWIN_THUMBTRACK
|
2000-02-11 17:55:28 +00:00
|
|
|
wxEVT_SCROLLWIN_THUMBRELEASE
|
1999-05-12 09:31:02 +00:00
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxScrollWinEvent : public wxEvent
|
1999-05-12 09:31:02 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxScrollWinEvent(wxEventType commandType = wxEVT_NULL,
|
|
|
|
int pos = 0, int orient = 0);
|
2003-01-12 22:30:51 +00:00
|
|
|
wxScrollWinEvent(const wxScrollWinEvent & event) : wxEvent(event)
|
|
|
|
{ m_commandInt = event.m_commandInt;
|
|
|
|
m_extraLong = event.m_extraLong; }
|
1999-05-12 09:31:02 +00:00
|
|
|
|
2003-08-02 00:12:39 +00:00
|
|
|
int GetOrientation() const { return (int) m_extraLong; }
|
|
|
|
int GetPosition() const { return m_commandInt; }
|
1999-05-12 09:31:02 +00:00
|
|
|
void SetOrientation(int orient) { m_extraLong = (long) orient; }
|
|
|
|
void SetPosition(int pos) { m_commandInt = pos; }
|
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxScrollWinEvent(*this); }
|
2001-06-26 20:59:19 +00:00
|
|
|
|
2005-01-18 15:12:53 +00:00
|
|
|
protected:
|
2001-11-18 12:42:45 +00:00
|
|
|
int m_commandInt;
|
1999-11-22 05:27:57 +00:00
|
|
|
long m_extraLong;
|
2001-06-26 20:59:19 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxScrollWinEvent)
|
1999-05-12 09:31:02 +00:00
|
|
|
};
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
// Mouse event class
|
|
|
|
|
|
|
|
/*
|
|
|
|
wxEVT_LEFT_DOWN
|
|
|
|
wxEVT_LEFT_UP
|
|
|
|
wxEVT_MIDDLE_DOWN
|
|
|
|
wxEVT_MIDDLE_UP
|
|
|
|
wxEVT_RIGHT_DOWN
|
|
|
|
wxEVT_RIGHT_UP
|
|
|
|
wxEVT_MOTION
|
|
|
|
wxEVT_ENTER_WINDOW
|
|
|
|
wxEVT_LEAVE_WINDOW
|
|
|
|
wxEVT_LEFT_DCLICK
|
|
|
|
wxEVT_MIDDLE_DCLICK
|
|
|
|
wxEVT_RIGHT_DCLICK
|
|
|
|
wxEVT_NC_LEFT_DOWN
|
|
|
|
wxEVT_NC_LEFT_UP,
|
|
|
|
wxEVT_NC_MIDDLE_DOWN,
|
|
|
|
wxEVT_NC_MIDDLE_UP,
|
|
|
|
wxEVT_NC_RIGHT_DOWN,
|
|
|
|
wxEVT_NC_RIGHT_UP,
|
|
|
|
wxEVT_NC_MOTION,
|
|
|
|
wxEVT_NC_ENTER_WINDOW,
|
|
|
|
wxEVT_NC_LEAVE_WINDOW,
|
|
|
|
wxEVT_NC_LEFT_DCLICK,
|
|
|
|
wxEVT_NC_MIDDLE_DCLICK,
|
|
|
|
wxEVT_NC_RIGHT_DCLICK,
|
|
|
|
*/
|
|
|
|
|
2002-07-03 16:25:22 +00:00
|
|
|
// the symbolic names for the mouse buttons
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
wxMOUSE_BTN_ANY = -1,
|
2003-10-03 22:22:59 +00:00
|
|
|
wxMOUSE_BTN_NONE = 0,
|
|
|
|
wxMOUSE_BTN_LEFT = 1,
|
|
|
|
wxMOUSE_BTN_MIDDLE = 2,
|
2007-07-29 01:04:33 +00:00
|
|
|
wxMOUSE_BTN_RIGHT = 3,
|
|
|
|
wxMOUSE_BTN_AUX1 = 4,
|
|
|
|
wxMOUSE_BTN_AUX2 = 5,
|
|
|
|
wxMOUSE_BTN_MAX
|
2002-07-03 16:25:22 +00:00
|
|
|
};
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxMouseEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
|
|
|
wxMouseEvent(wxEventType mouseType = wxEVT_NULL);
|
2007-10-29 22:31:18 +00:00
|
|
|
wxMouseEvent(const wxMouseEvent& event) : wxEvent(event)
|
2003-01-12 22:30:51 +00:00
|
|
|
{ Assign(event); }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Was it a button event? (*doesn't* mean: is any button *down*?)
|
2002-07-03 16:25:22 +00:00
|
|
|
bool IsButton() const { return Button(wxMOUSE_BTN_ANY); }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2003-10-03 22:22:59 +00:00
|
|
|
// Was it a down event from this (or any) button?
|
2002-07-03 16:25:22 +00:00
|
|
|
bool ButtonDown(int but = wxMOUSE_BTN_ANY) const;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2003-10-03 22:22:59 +00:00
|
|
|
// Was it a dclick event from this (or any) button?
|
2002-07-03 16:25:22 +00:00
|
|
|
bool ButtonDClick(int but = wxMOUSE_BTN_ANY) const;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2003-10-03 22:22:59 +00:00
|
|
|
// Was it a up event from this (or any) button?
|
2002-07-03 16:25:22 +00:00
|
|
|
bool ButtonUp(int but = wxMOUSE_BTN_ANY) const;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2003-10-03 22:22:59 +00:00
|
|
|
// Was the given button?
|
1999-02-05 14:26:48 +00:00
|
|
|
bool Button(int but) const;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2003-10-03 22:22:59 +00:00
|
|
|
// Was the given button in Down state?
|
1999-02-05 14:26:48 +00:00
|
|
|
bool ButtonIsDown(int but) const;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2002-07-03 16:25:22 +00:00
|
|
|
// Get the button which is changing state (wxMOUSE_BTN_NONE if none)
|
2001-06-26 20:59:19 +00:00
|
|
|
int GetButton() const;
|
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Find state of shift/control keys
|
|
|
|
bool ControlDown() const { return m_controlDown; }
|
|
|
|
bool MetaDown() const { return m_metaDown; }
|
|
|
|
bool AltDown() const { return m_altDown; }
|
|
|
|
bool ShiftDown() const { return m_shiftDown; }
|
2004-07-01 00:04:48 +00:00
|
|
|
bool CmdDown() const
|
|
|
|
{
|
|
|
|
#if defined(__WXMAC__) || defined(__WXCOCOA__)
|
|
|
|
return MetaDown();
|
|
|
|
#else
|
|
|
|
return ControlDown();
|
|
|
|
#endif
|
|
|
|
}
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Find which event was just generated
|
|
|
|
bool LeftDown() const { return (m_eventType == wxEVT_LEFT_DOWN); }
|
|
|
|
bool MiddleDown() const { return (m_eventType == wxEVT_MIDDLE_DOWN); }
|
|
|
|
bool RightDown() const { return (m_eventType == wxEVT_RIGHT_DOWN); }
|
2007-07-29 01:04:33 +00:00
|
|
|
bool Aux1Down() const { return (m_eventType == wxEVT_AUX1_DOWN); }
|
|
|
|
bool Aux2Down() const { return (m_eventType == wxEVT_AUX2_DOWN); }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
bool LeftUp() const { return (m_eventType == wxEVT_LEFT_UP); }
|
|
|
|
bool MiddleUp() const { return (m_eventType == wxEVT_MIDDLE_UP); }
|
|
|
|
bool RightUp() const { return (m_eventType == wxEVT_RIGHT_UP); }
|
2007-07-29 01:04:33 +00:00
|
|
|
bool Aux1Up() const { return (m_eventType == wxEVT_AUX1_UP); }
|
|
|
|
bool Aux2Up() const { return (m_eventType == wxEVT_AUX2_UP); }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
bool LeftDClick() const { return (m_eventType == wxEVT_LEFT_DCLICK); }
|
|
|
|
bool MiddleDClick() const { return (m_eventType == wxEVT_MIDDLE_DCLICK); }
|
|
|
|
bool RightDClick() const { return (m_eventType == wxEVT_RIGHT_DCLICK); }
|
2007-07-29 01:04:33 +00:00
|
|
|
bool Aux1DClick() const { return (m_eventType == wxEVT_AUX1_UP); }
|
|
|
|
bool Aux2DClick() const { return (m_eventType == wxEVT_AUX2_UP); }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Find the current state of the mouse buttons (regardless
|
|
|
|
// of current event type)
|
|
|
|
bool LeftIsDown() const { return m_leftDown; }
|
|
|
|
bool MiddleIsDown() const { return m_middleDown; }
|
|
|
|
bool RightIsDown() const { return m_rightDown; }
|
2007-07-29 01:04:33 +00:00
|
|
|
bool Aux1IsDown() const { return m_aux1Down; }
|
|
|
|
bool Aux2IsDown() const { return m_aux2Down; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// True if a button is down and the mouse is moving
|
|
|
|
bool Dragging() const
|
|
|
|
{
|
2003-10-16 15:05:32 +00:00
|
|
|
return (m_eventType == wxEVT_MOTION) && ButtonIsDown(wxMOUSE_BTN_ANY);
|
1999-02-05 14:26:48 +00:00
|
|
|
}
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// True if the mouse is moving, and no button is down
|
2003-10-16 07:55:25 +00:00
|
|
|
bool Moving() const
|
|
|
|
{
|
2003-10-16 15:05:32 +00:00
|
|
|
return (m_eventType == wxEVT_MOTION) && !ButtonIsDown(wxMOUSE_BTN_ANY);
|
2003-10-16 07:55:25 +00:00
|
|
|
}
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// True if the mouse is just entering the window
|
|
|
|
bool Entering() const { return (m_eventType == wxEVT_ENTER_WINDOW); }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// True if the mouse is just leaving the window
|
|
|
|
bool Leaving() const { return (m_eventType == wxEVT_LEAVE_WINDOW); }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2007-10-29 22:31:18 +00:00
|
|
|
// Returns the number of mouse clicks associated with this event.
|
|
|
|
int GetClickCount() const { return m_clickCount; }
|
|
|
|
|
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Find the position of the event
|
1999-11-22 05:27:57 +00:00
|
|
|
void GetPosition(wxCoord *xpos, wxCoord *ypos) const
|
1999-11-02 18:41:23 +00:00
|
|
|
{
|
|
|
|
if (xpos)
|
1999-11-22 05:27:57 +00:00
|
|
|
*xpos = m_x;
|
1999-11-02 18:41:23 +00:00
|
|
|
if (ypos)
|
|
|
|
*ypos = m_y;
|
|
|
|
}
|
|
|
|
|
1999-11-02 18:46:33 +00:00
|
|
|
void GetPosition(long *xpos, long *ypos) const
|
1999-11-02 18:41:23 +00:00
|
|
|
{
|
|
|
|
if (xpos)
|
1999-11-22 05:27:57 +00:00
|
|
|
*xpos = (long)m_x;
|
1999-11-02 18:41:23 +00:00
|
|
|
if (ypos)
|
1999-11-02 18:46:33 +00:00
|
|
|
*ypos = (long)m_y;
|
1999-11-02 18:41:23 +00:00
|
|
|
}
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Find the position of the event
|
|
|
|
wxPoint GetPosition() const { return wxPoint(m_x, m_y); }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Find the logical position of the event given the DC
|
2003-08-02 00:12:39 +00:00
|
|
|
wxPoint GetLogicalPosition(const wxDC& dc) const;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Get X position
|
2000-02-18 20:20:15 +00:00
|
|
|
wxCoord GetX() const { return m_x; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Get Y position
|
2000-02-18 20:20:15 +00:00
|
|
|
wxCoord GetY() const { return m_y; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-05-04 07:26:30 +00:00
|
|
|
// Get wheel rotation, positive or negative indicates direction of
|
|
|
|
// rotation. Current devices all send an event when rotation is equal to
|
|
|
|
// +/-WheelDelta, but this allows for finer resolution devices to be
|
|
|
|
// created in the future. Because of this you shouldn't assume that one
|
|
|
|
// event is equal to 1 line or whatever, but you should be able to either
|
|
|
|
// do partial line scrolling or wait until +/-WheelDelta rotation values
|
|
|
|
// have been accumulated before scrolling.
|
|
|
|
int GetWheelRotation() const { return m_wheelRotation; }
|
|
|
|
|
|
|
|
// Get wheel delta, normally 120. This is the threshold for action to be
|
|
|
|
// taken, and one such action (for example, scrolling one increment)
|
|
|
|
// should occur for each delta.
|
|
|
|
int GetWheelDelta() const { return m_wheelDelta; }
|
|
|
|
|
2007-02-04 06:24:28 +00:00
|
|
|
// Gets the axis the wheel operation concerns, 0 being the y axis as on
|
|
|
|
// most mouse wheels, 1 is the x axis for things like MightyMouse scrolls
|
|
|
|
// or horizontal trackpad scrolling
|
|
|
|
int GetWheelAxis() const { return m_wheelAxis; }
|
|
|
|
|
2001-05-04 07:26:30 +00:00
|
|
|
// Returns the configured number of lines (or whatever) to be scrolled per
|
|
|
|
// wheel action. Defaults to one.
|
|
|
|
int GetLinesPerAction() const { return m_linesPerAction; }
|
2007-08-01 15:34:48 +00:00
|
|
|
|
2002-07-19 21:11:31 +00:00
|
|
|
// Is the system set to do page scrolling?
|
2002-07-20 02:06:47 +00:00
|
|
|
bool IsPageScroll() const { return ((unsigned int)m_linesPerAction == UINT_MAX); }
|
2002-07-19 21:11:31 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxMouseEvent(*this); }
|
1999-05-07 18:34:32 +00:00
|
|
|
|
2008-01-09 04:08:33 +00:00
|
|
|
wxMouseEvent& operator=(const wxMouseEvent& event) { if (&event != this) Assign(event); return *this; }
|
2002-07-21 17:34:06 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
public:
|
1999-11-02 18:41:23 +00:00
|
|
|
wxCoord m_x, m_y;
|
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
bool m_leftDown;
|
|
|
|
bool m_middleDown;
|
|
|
|
bool m_rightDown;
|
2007-07-29 01:04:33 +00:00
|
|
|
bool m_aux1Down;
|
|
|
|
bool m_aux2Down;
|
1999-02-05 14:26:48 +00:00
|
|
|
|
|
|
|
bool m_controlDown;
|
|
|
|
bool m_shiftDown;
|
|
|
|
bool m_altDown;
|
|
|
|
bool m_metaDown;
|
2007-08-01 15:34:48 +00:00
|
|
|
|
2007-10-29 22:31:18 +00:00
|
|
|
int m_clickCount;
|
|
|
|
|
2007-02-04 06:24:28 +00:00
|
|
|
int m_wheelAxis;
|
2001-05-04 07:26:30 +00:00
|
|
|
int m_wheelRotation;
|
|
|
|
int m_wheelDelta;
|
|
|
|
int m_linesPerAction;
|
2001-06-26 20:59:19 +00:00
|
|
|
|
2002-05-23 21:25:06 +00:00
|
|
|
protected:
|
|
|
|
void Assign(const wxMouseEvent& evt);
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxMouseEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2000-03-14 00:45:54 +00:00
|
|
|
// Cursor set event
|
|
|
|
|
|
|
|
/*
|
|
|
|
wxEVT_SET_CURSOR
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxSetCursorEvent : public wxEvent
|
2000-03-14 00:45:54 +00:00
|
|
|
{
|
|
|
|
public:
|
2001-11-18 12:42:45 +00:00
|
|
|
wxSetCursorEvent(wxCoord x = 0, wxCoord y = 0)
|
2002-07-03 16:25:22 +00:00
|
|
|
: wxEvent(0, wxEVT_SET_CURSOR),
|
|
|
|
m_x(x), m_y(y), m_cursor()
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
2000-03-14 00:45:54 +00:00
|
|
|
|
2003-01-12 22:30:51 +00:00
|
|
|
wxSetCursorEvent(const wxSetCursorEvent & event)
|
|
|
|
: wxEvent(event),
|
|
|
|
m_x(event.m_x),
|
|
|
|
m_y(event.m_y),
|
|
|
|
m_cursor(event.m_cursor)
|
|
|
|
{ }
|
2002-07-19 19:43:55 +00:00
|
|
|
|
2000-03-14 00:45:54 +00:00
|
|
|
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(); }
|
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxSetCursorEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2000-03-14 00:45:54 +00:00
|
|
|
private:
|
|
|
|
wxCoord m_x, m_y;
|
|
|
|
wxCursor m_cursor;
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSetCursorEvent)
|
2000-03-14 00:45:54 +00:00
|
|
|
};
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
// Keyboard input event class
|
|
|
|
|
|
|
|
/*
|
|
|
|
wxEVT_CHAR
|
|
|
|
wxEVT_CHAR_HOOK
|
1999-01-14 11:23:37 +00:00
|
|
|
wxEVT_KEY_DOWN
|
1998-05-20 14:01:55 +00:00
|
|
|
wxEVT_KEY_UP
|
2003-07-10 09:16:00 +00:00
|
|
|
wxEVT_HOTKEY
|
1998-05-20 14:01:55 +00:00
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxKeyEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
|
|
|
public:
|
1999-02-05 14:26:48 +00:00
|
|
|
wxKeyEvent(wxEventType keyType = wxEVT_NULL);
|
2003-01-12 22:30:51 +00:00
|
|
|
wxKeyEvent(const wxKeyEvent& evt);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2005-11-10 11:59:47 +00:00
|
|
|
// 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);
|
|
|
|
}
|
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Find state of shift/control keys
|
|
|
|
bool ControlDown() const { return m_controlDown; }
|
2005-11-10 11:59:47 +00:00
|
|
|
bool ShiftDown() const { return m_shiftDown; }
|
1999-02-05 14:26:48 +00:00
|
|
|
bool MetaDown() const { return m_metaDown; }
|
|
|
|
bool AltDown() const { return m_altDown; }
|
2000-07-15 19:51:35 +00:00
|
|
|
|
2004-07-01 00:04:48 +00:00
|
|
|
// "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
|
|
|
|
// of, say, ControlDown() because Cmd key is used for the same thing under
|
|
|
|
// Mac as Ctrl elsewhere (but Ctrl still exists, just not used for this
|
|
|
|
// purpose under Mac)
|
|
|
|
bool CmdDown() const
|
|
|
|
{
|
|
|
|
#if defined(__WXMAC__) || defined(__WXCOCOA__)
|
|
|
|
return MetaDown();
|
|
|
|
#else
|
|
|
|
return ControlDown();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2001-10-08 15:58:52 +00:00
|
|
|
// exclude MetaDown() from HasModifiers() because NumLock under X is often
|
|
|
|
// configured as mod2 modifier, yet the key events even when it is pressed
|
|
|
|
// should be processed normally, not like Ctrl- or Alt-key
|
|
|
|
bool HasModifiers() const { return ControlDown() || AltDown(); }
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
|
|
// get the key code: an ASCII7 char or an element of wxKeyCode enum
|
|
|
|
int GetKeyCode() const { return (int)m_keyCode; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2004-06-26 13:34:15 +00:00
|
|
|
#if wxUSE_UNICODE
|
|
|
|
// get the Unicode character corresponding to this key
|
|
|
|
wxChar GetUnicodeKey() const { return m_uniChar; }
|
|
|
|
#endif // wxUSE_UNICODE
|
|
|
|
|
2002-04-07 21:06:59 +00:00
|
|
|
// 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; }
|
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Find the position of the event
|
1999-11-02 18:41:23 +00:00
|
|
|
void GetPosition(wxCoord *xpos, wxCoord *ypos) const
|
|
|
|
{
|
1999-11-22 05:27:57 +00:00
|
|
|
if (xpos) *xpos = m_x;
|
1999-11-02 18:41:23 +00:00
|
|
|
if (ypos) *ypos = m_y;
|
|
|
|
}
|
|
|
|
|
1999-11-02 18:46:33 +00:00
|
|
|
void GetPosition(long *xpos, long *ypos) const
|
1999-11-02 18:41:23 +00:00
|
|
|
{
|
1999-11-22 05:27:57 +00:00
|
|
|
if (xpos) *xpos = (long)m_x;
|
1999-11-02 18:46:33 +00:00
|
|
|
if (ypos) *ypos = (long)m_y;
|
1999-11-02 18:41:23 +00:00
|
|
|
}
|
1999-03-02 16:21:27 +00:00
|
|
|
|
|
|
|
wxPoint GetPosition() const
|
|
|
|
{ return wxPoint(m_x, m_y); }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Get X position
|
1999-11-02 18:41:23 +00:00
|
|
|
wxCoord GetX() const { return m_x; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Get Y position
|
1999-11-02 18:41:23 +00:00
|
|
|
wxCoord GetY() const { return m_y; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxKeyEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
|
|
|
// we do need to copy wxKeyEvent sometimes (in wxTreeCtrl code, for
|
|
|
|
// example)
|
|
|
|
wxKeyEvent& operator=(const wxKeyEvent& evt)
|
|
|
|
{
|
2008-01-09 04:08:33 +00:00
|
|
|
if (&evt != this)
|
|
|
|
{
|
|
|
|
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;
|
2004-10-28 08:18:52 +00:00
|
|
|
#if wxUSE_UNICODE
|
2008-01-09 04:08:33 +00:00
|
|
|
m_uniChar = evt.m_uniChar;
|
2004-10-28 08:18:52 +00:00
|
|
|
#endif
|
2008-01-09 04:08:33 +00:00
|
|
|
}
|
2001-11-18 23:08:00 +00:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
1999-11-02 18:41:23 +00:00
|
|
|
wxCoord m_x, m_y;
|
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
long m_keyCode;
|
1999-11-02 18:41:23 +00:00
|
|
|
|
2005-11-10 11:59:47 +00:00
|
|
|
// TODO: replace those with a single m_modifiers bitmask of wxMOD_XXX?
|
1999-02-05 14:26:48 +00:00
|
|
|
bool m_controlDown;
|
|
|
|
bool m_shiftDown;
|
|
|
|
bool m_altDown;
|
|
|
|
bool m_metaDown;
|
2005-11-10 11:59:47 +00:00
|
|
|
|
|
|
|
// FIXME: what is this for? relation to m_rawXXX?
|
1999-05-13 09:53:44 +00:00
|
|
|
bool m_scanCode;
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2002-12-04 14:11:26 +00:00
|
|
|
#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
|
2002-04-07 21:06:59 +00:00
|
|
|
wxUint32 m_rawCode;
|
|
|
|
wxUint32 m_rawFlags;
|
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxKeyEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Size event class
|
|
|
|
/*
|
|
|
|
wxEVT_SIZE
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxSizeEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
2002-07-03 16:25:22 +00:00
|
|
|
wxSizeEvent() : wxEvent(0, wxEVT_SIZE)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
2003-03-21 02:58:55 +00:00
|
|
|
wxSizeEvent(const wxSize& sz, int winid = 0)
|
|
|
|
: wxEvent(winid, wxEVT_SIZE),
|
2002-07-03 16:25:22 +00:00
|
|
|
m_size(sz)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
2002-07-19 19:43:55 +00:00
|
|
|
wxSizeEvent(const wxSizeEvent & event)
|
2003-01-12 22:30:51 +00:00
|
|
|
: wxEvent(event),
|
2003-06-01 14:37:28 +00:00
|
|
|
m_size(event.m_size), m_rect(event.m_rect)
|
2003-01-12 22:30:51 +00:00
|
|
|
{ }
|
2003-06-01 14:37:28 +00:00
|
|
|
wxSizeEvent(const wxRect& rect, int id = 0)
|
2003-06-01 20:47:50 +00:00
|
|
|
: m_size(rect.GetSize()), m_rect(rect)
|
2003-06-01 14:37:28 +00:00
|
|
|
{ m_eventType = wxEVT_SIZING; m_id = id; }
|
2002-07-20 02:06:47 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
wxSize GetSize() const { return m_size; }
|
2003-06-01 14:37:28 +00:00
|
|
|
wxRect GetRect() const { return m_rect; }
|
2005-09-24 21:43:15 +00:00
|
|
|
void SetRect(const wxRect& rect) { m_rect = rect; }
|
1999-05-07 18:34:32 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxSizeEvent(*this); }
|
|
|
|
|
|
|
|
public:
|
2005-01-18 15:12:53 +00:00
|
|
|
// For internal usage only. Will be converted to protected members.
|
2001-11-18 12:42:45 +00:00
|
|
|
wxSize m_size;
|
2003-06-01 14:37:28 +00:00
|
|
|
wxRect m_rect; // Used for wxEVT_SIZING
|
2001-11-18 12:42:45 +00:00
|
|
|
|
2001-11-18 23:08:00 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSizeEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Move event class
|
|
|
|
|
|
|
|
/*
|
|
|
|
wxEVT_MOVE
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxMoveEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
2002-05-08 21:13:51 +00:00
|
|
|
wxMoveEvent()
|
|
|
|
: wxEvent(0, wxEVT_MOVE)
|
|
|
|
{ }
|
2003-03-21 02:58:55 +00:00
|
|
|
wxMoveEvent(const wxPoint& pos, int winid = 0)
|
|
|
|
: wxEvent(winid, wxEVT_MOVE),
|
2002-07-03 16:25:22 +00:00
|
|
|
m_pos(pos)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
2002-07-19 19:43:55 +00:00
|
|
|
wxMoveEvent(const wxMoveEvent& event)
|
|
|
|
: wxEvent(event),
|
2003-01-12 22:30:51 +00:00
|
|
|
m_pos(event.m_pos)
|
|
|
|
{ }
|
2003-06-01 14:37:28 +00:00
|
|
|
wxMoveEvent(const wxRect& rect, int id = 0)
|
|
|
|
: m_pos(rect.GetPosition()), m_rect(rect)
|
|
|
|
{ m_eventType = wxEVT_MOVING; m_id = id; }
|
2002-07-20 02:06:47 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
wxPoint GetPosition() const { return m_pos; }
|
2005-01-21 20:25:38 +00:00
|
|
|
void SetPosition(const wxPoint& pos) { m_pos = pos; }
|
2003-06-01 14:37:28 +00:00
|
|
|
wxRect GetRect() const { return m_rect; }
|
2005-09-24 21:43:15 +00:00
|
|
|
void SetRect(const wxRect& rect) { m_rect = rect; }
|
1999-05-07 18:34:32 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxMoveEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2005-01-18 15:12:53 +00:00
|
|
|
protected:
|
2001-11-18 12:42:45 +00:00
|
|
|
wxPoint m_pos;
|
2003-06-01 14:37:28 +00:00
|
|
|
wxRect m_rect;
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMoveEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Paint event class
|
|
|
|
/*
|
|
|
|
wxEVT_PAINT
|
|
|
|
wxEVT_NC_PAINT
|
|
|
|
wxEVT_PAINT_ICON
|
|
|
|
*/
|
|
|
|
|
2000-10-23 06:26:19 +00:00
|
|
|
#if defined(__WXDEBUG__) && (defined(__WXMSW__) || defined(__WXPM__))
|
|
|
|
// see comments in src/msw|os2/dcclient.cpp where g_isPainting is defined
|
2003-07-02 01:59:24 +00:00
|
|
|
extern WXDLLIMPEXP_CORE int g_isPainting;
|
1999-06-17 21:21:52 +00:00
|
|
|
#endif // debug
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxPaintEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
1999-06-17 21:21:52 +00:00
|
|
|
wxPaintEvent(int Id = 0)
|
2002-05-08 21:13:51 +00:00
|
|
|
: wxEvent(Id, wxEVT_PAINT)
|
1999-06-17 21:21:52 +00:00
|
|
|
{
|
2000-10-23 06:26:19 +00:00
|
|
|
#if defined(__WXDEBUG__) && (defined(__WXMSW__) || defined(__WXPM__))
|
1999-06-17 21:21:52 +00:00
|
|
|
// set the internal flag for the duration of processing of WM_PAINT
|
|
|
|
g_isPainting++;
|
|
|
|
#endif // debug
|
|
|
|
}
|
|
|
|
|
2004-10-20 22:10:35 +00:00
|
|
|
// default copy ctor and dtor are normally fine, we only need them to keep
|
|
|
|
// g_isPainting updated in debug build
|
2000-10-23 06:26:19 +00:00
|
|
|
#if defined(__WXDEBUG__) && (defined(__WXMSW__) || defined(__WXPM__))
|
2004-10-20 22:10:35 +00:00
|
|
|
wxPaintEvent(const wxPaintEvent& event)
|
|
|
|
: wxEvent(event)
|
|
|
|
{
|
|
|
|
g_isPainting++;
|
|
|
|
}
|
|
|
|
|
2006-09-05 20:47:48 +00:00
|
|
|
virtual ~wxPaintEvent()
|
1999-06-17 21:21:52 +00:00
|
|
|
{
|
|
|
|
g_isPainting--;
|
|
|
|
}
|
|
|
|
#endif // debug
|
2001-11-18 12:42:45 +00:00
|
|
|
|
|
|
|
virtual wxEvent *Clone() const { return new wxPaintEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxPaintEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxNcPaintEvent : public wxEvent
|
2001-06-26 20:59:19 +00:00
|
|
|
{
|
|
|
|
public:
|
2003-03-21 02:58:55 +00:00
|
|
|
wxNcPaintEvent(int winid = 0)
|
|
|
|
: wxEvent(winid, wxEVT_NC_PAINT)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxNcPaintEvent(*this); }
|
2001-06-26 20:59:19 +00:00
|
|
|
|
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxNcPaintEvent)
|
2001-06-26 20:59:19 +00:00
|
|
|
};
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
// Erase background event class
|
|
|
|
/*
|
|
|
|
wxEVT_ERASE_BACKGROUND
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxEraseEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
|
|
|
wxEraseEvent(int Id = 0, wxDC *dc = (wxDC *) NULL)
|
2002-07-03 16:25:22 +00:00
|
|
|
: wxEvent(Id, wxEVT_ERASE_BACKGROUND),
|
|
|
|
m_dc(dc)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
|
|
|
|
|
|
|
wxEraseEvent(const wxEraseEvent& event)
|
2002-07-03 16:25:22 +00:00
|
|
|
: wxEvent(event),
|
|
|
|
m_dc(event.m_dc)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
wxDC *GetDC() const { return m_dc; }
|
1999-05-07 18:34:32 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxEraseEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2005-01-18 15:12:53 +00:00
|
|
|
protected:
|
2001-11-18 12:42:45 +00:00
|
|
|
wxDC *m_dc;
|
|
|
|
|
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxEraseEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Focus event class
|
|
|
|
/*
|
|
|
|
wxEVT_SET_FOCUS
|
|
|
|
wxEVT_KILL_FOCUS
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxFocusEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
2003-03-21 02:58:55 +00:00
|
|
|
wxFocusEvent(wxEventType type = wxEVT_NULL, int winid = 0)
|
|
|
|
: wxEvent(winid, type)
|
2002-07-03 16:25:22 +00:00
|
|
|
{ m_win = NULL; }
|
2002-05-08 21:13:51 +00:00
|
|
|
|
|
|
|
wxFocusEvent(const wxFocusEvent& event)
|
|
|
|
: wxEvent(event)
|
2002-07-03 16:25:22 +00:00
|
|
|
{ m_win = event.m_win; }
|
2001-06-26 20:59:19 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
// The window associated with this event is the window which had focus
|
2001-06-26 20:59:19 +00:00
|
|
|
// before for SET event and the window which will have focus for the KILL
|
2001-11-18 12:42:45 +00:00
|
|
|
// one. NB: it may be NULL in both cases!
|
2001-06-26 20:59:19 +00:00
|
|
|
wxWindow *GetWindow() const { return m_win; }
|
|
|
|
void SetWindow(wxWindow *win) { m_win = win; }
|
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxFocusEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
private:
|
|
|
|
wxWindow *m_win;
|
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFocusEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2001-08-06 00:49:59 +00:00
|
|
|
// wxChildFocusEvent notifies the parent that a child has got the focus: unlike
|
2003-07-18 00:39:05 +00:00
|
|
|
// wxFocusEvent it is propagated upwards the window chain
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxChildFocusEvent : public wxCommandEvent
|
2001-08-06 00:49:59 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxChildFocusEvent(wxWindow *win = NULL);
|
|
|
|
|
|
|
|
wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); }
|
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxChildFocusEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxChildFocusEvent)
|
2001-08-06 00:49:59 +00:00
|
|
|
};
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
// Activate event class
|
|
|
|
/*
|
|
|
|
wxEVT_ACTIVATE
|
|
|
|
wxEVT_ACTIVATE_APP
|
2005-03-18 14:26:57 +00:00
|
|
|
wxEVT_HIBERNATE
|
1998-05-20 14:01:55 +00:00
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxActivateEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
2004-09-04 01:26:40 +00:00
|
|
|
wxActivateEvent(wxEventType type = wxEVT_NULL, bool active = true, int Id = 0)
|
2002-05-08 21:13:51 +00:00
|
|
|
: wxEvent(Id, type)
|
2002-07-03 16:25:22 +00:00
|
|
|
{ m_active = active; }
|
2002-07-19 19:43:55 +00:00
|
|
|
wxActivateEvent(const wxActivateEvent& event)
|
|
|
|
: wxEvent(event)
|
2003-01-12 22:30:51 +00:00
|
|
|
{ m_active = event.m_active; }
|
2002-07-20 02:06:47 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
bool GetActive() const { return m_active; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxActivateEvent(*this); }
|
1999-05-07 18:34:32 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
private:
|
|
|
|
bool m_active;
|
2001-11-18 12:42:45 +00:00
|
|
|
|
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxActivateEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// InitDialog event class
|
|
|
|
/*
|
|
|
|
wxEVT_INIT_DIALOG
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxInitDialogEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
|
|
|
wxInitDialogEvent(int Id = 0)
|
2002-05-08 21:13:51 +00:00
|
|
|
: wxEvent(Id, wxEVT_INIT_DIALOG)
|
|
|
|
{ }
|
2001-11-18 12:42:45 +00:00
|
|
|
|
|
|
|
virtual wxEvent *Clone() const { return new wxInitDialogEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxInitDialogEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Miscellaneous menu event class
|
|
|
|
/*
|
2002-02-23 23:16:32 +00:00
|
|
|
wxEVT_MENU_OPEN,
|
|
|
|
wxEVT_MENU_CLOSE,
|
1998-05-20 14:01:55 +00:00
|
|
|
wxEVT_MENU_HIGHLIGHT,
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxMenuEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
|
|
|
public:
|
2003-07-12 23:09:04 +00:00
|
|
|
wxMenuEvent(wxEventType type = wxEVT_NULL, int winid = 0, wxMenu* menu = NULL)
|
2003-03-21 02:58:55 +00:00
|
|
|
: wxEvent(winid, type)
|
2003-07-22 00:24:07 +00:00
|
|
|
{ m_menuId = winid; m_menu = menu; }
|
2002-07-19 19:43:55 +00:00
|
|
|
wxMenuEvent(const wxMenuEvent & event)
|
|
|
|
: wxEvent(event)
|
2003-07-12 23:09:04 +00:00
|
|
|
{ m_menuId = event.m_menuId; m_menu = event.m_menu; }
|
2002-07-20 02:06:47 +00:00
|
|
|
|
2002-02-23 23:16:32 +00:00
|
|
|
// only for wxEVT_MENU_HIGHLIGHT
|
1999-05-07 18:34:32 +00:00
|
|
|
int GetMenuId() const { return m_menuId; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2002-02-23 23:16:32 +00:00
|
|
|
// only for wxEVT_MENU_OPEN/CLOSE
|
2004-09-13 18:03:44 +00:00
|
|
|
bool IsPopup() const { return m_menuId == wxID_ANY; }
|
2002-02-23 23:16:32 +00:00
|
|
|
|
2003-07-12 23:09:04 +00:00
|
|
|
// only for wxEVT_MENU_OPEN/CLOSE
|
|
|
|
wxMenu* GetMenu() const { return m_menu; }
|
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxMenuEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
private:
|
2003-07-12 23:09:04 +00:00
|
|
|
int m_menuId;
|
|
|
|
wxMenu* m_menu;
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMenuEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Window close or session close event class
|
|
|
|
/*
|
|
|
|
wxEVT_CLOSE_WINDOW,
|
|
|
|
wxEVT_END_SESSION,
|
|
|
|
wxEVT_QUERY_END_SESSION
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxCloseEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
|
|
|
public:
|
2003-03-21 02:58:55 +00:00
|
|
|
wxCloseEvent(wxEventType type = wxEVT_NULL, int winid = 0)
|
|
|
|
: wxEvent(winid, type),
|
2004-09-04 01:26:40 +00:00
|
|
|
m_loggingOff(true),
|
|
|
|
m_veto(false), // should be false by default
|
|
|
|
m_canVeto(true) {}
|
2003-08-17 12:50:53 +00:00
|
|
|
|
2002-07-19 19:43:55 +00:00
|
|
|
wxCloseEvent(const wxCloseEvent & event)
|
|
|
|
: wxEvent(event),
|
2003-01-12 22:30:51 +00:00
|
|
|
m_loggingOff(event.m_loggingOff),
|
|
|
|
m_veto(event.m_veto),
|
2003-08-17 12:50:53 +00:00
|
|
|
m_canVeto(event.m_canVeto) {}
|
2002-07-20 02:06:47 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
void SetLoggingOff(bool logOff) { m_loggingOff = logOff; }
|
2005-05-22 11:21:21 +00:00
|
|
|
bool GetLoggingOff() const
|
|
|
|
{
|
|
|
|
// m_loggingOff flag is only used by wxEVT_[QUERY_]END_SESSION, it
|
|
|
|
// doesn't make sense for wxEVT_CLOSE_WINDOW
|
|
|
|
wxASSERT_MSG( m_eventType != wxEVT_CLOSE_WINDOW,
|
|
|
|
_T("this flag is for end session events only") );
|
|
|
|
|
|
|
|
return m_loggingOff;
|
|
|
|
}
|
1999-02-05 14:26:48 +00:00
|
|
|
|
2004-09-04 01:26:40 +00:00
|
|
|
void Veto(bool veto = true)
|
1999-02-05 16:12:43 +00:00
|
|
|
{
|
2004-09-04 01:26:40 +00:00
|
|
|
// GetVeto() will return false anyhow...
|
1999-02-05 16:12:43 +00:00
|
|
|
wxCHECK_RET( m_canVeto,
|
1999-10-08 14:35:56 +00:00
|
|
|
wxT("call to Veto() ignored (can't veto this event)") );
|
1999-02-05 16:12:43 +00:00
|
|
|
|
|
|
|
m_veto = veto;
|
|
|
|
}
|
1999-02-05 14:26:48 +00:00
|
|
|
void SetCanVeto(bool canVeto) { m_canVeto = canVeto; }
|
|
|
|
bool CanVeto() const { return m_canVeto; }
|
1999-02-05 16:12:43 +00:00
|
|
|
bool GetVeto() const { return m_canVeto && m_veto; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxCloseEvent(*this); }
|
1999-05-07 18:34:32 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
protected:
|
2005-05-22 11:21:21 +00:00
|
|
|
bool m_loggingOff,
|
|
|
|
m_veto,
|
|
|
|
m_canVeto;
|
1999-02-05 14:26:48 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCloseEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
wxEVT_SHOW
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxShowEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
|
|
|
public:
|
2004-09-04 01:26:40 +00:00
|
|
|
wxShowEvent(int winid = 0, bool show = false)
|
2003-03-21 02:58:55 +00:00
|
|
|
: wxEvent(winid, wxEVT_SHOW)
|
2002-07-03 16:25:22 +00:00
|
|
|
{ m_show = show; }
|
2002-07-19 19:43:55 +00:00
|
|
|
wxShowEvent(const wxShowEvent & event)
|
|
|
|
: wxEvent(event)
|
2003-01-12 22:30:51 +00:00
|
|
|
{ m_show = event.m_show; }
|
2002-07-20 02:06:47 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
void SetShow(bool show) { m_show = show; }
|
|
|
|
bool GetShow() const { return m_show; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxShowEvent(*this); }
|
1999-05-07 18:34:32 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
protected:
|
1999-02-05 14:26:48 +00:00
|
|
|
bool m_show;
|
2001-05-31 14:32:06 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxShowEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
wxEVT_ICONIZE
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxIconizeEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
2004-09-04 01:26:40 +00:00
|
|
|
wxIconizeEvent(int winid = 0, bool iconized = true)
|
2003-03-21 02:58:55 +00:00
|
|
|
: wxEvent(winid, wxEVT_ICONIZE)
|
2002-07-03 16:25:22 +00:00
|
|
|
{ m_iconized = iconized; }
|
2002-07-19 19:43:55 +00:00
|
|
|
wxIconizeEvent(const wxIconizeEvent & event)
|
|
|
|
: wxEvent(event)
|
2003-01-12 22:30:51 +00:00
|
|
|
{ m_iconized = event.m_iconized; }
|
2002-07-20 02:06:47 +00:00
|
|
|
|
2001-05-31 14:32:06 +00:00
|
|
|
// return true if the frame was iconized, false if restored
|
|
|
|
bool Iconized() const { return m_iconized; }
|
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxIconizeEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-05-31 14:32:06 +00:00
|
|
|
protected:
|
|
|
|
bool m_iconized;
|
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxIconizeEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
/*
|
|
|
|
wxEVT_MAXIMIZE
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxMaximizeEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
2003-03-21 02:58:55 +00:00
|
|
|
wxMaximizeEvent(int winid = 0)
|
|
|
|
: wxEvent(winid, wxEVT_MAXIMIZE)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
2001-05-31 14:32:06 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxMaximizeEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMaximizeEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Joystick event class
|
|
|
|
/*
|
|
|
|
wxEVT_JOY_BUTTON_DOWN,
|
|
|
|
wxEVT_JOY_BUTTON_UP,
|
|
|
|
wxEVT_JOY_MOVE,
|
|
|
|
wxEVT_JOY_ZMOVE
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Which joystick? Same as Windows ids so no conversion necessary.
|
2002-07-03 16:25:22 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
wxJOYSTICK1,
|
|
|
|
wxJOYSTICK2
|
|
|
|
};
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// Which button is down?
|
2002-07-03 16:25:22 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
wxJOY_BUTTON_ANY = -1,
|
|
|
|
wxJOY_BUTTON1 = 1,
|
|
|
|
wxJOY_BUTTON2 = 2,
|
|
|
|
wxJOY_BUTTON3 = 4,
|
|
|
|
wxJOY_BUTTON4 = 8
|
|
|
|
};
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxJoystickEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
2005-01-18 15:12:53 +00:00
|
|
|
protected:
|
1999-02-05 14:26:48 +00:00
|
|
|
wxPoint m_pos;
|
|
|
|
int m_zPosition;
|
2002-07-03 16:25:22 +00:00
|
|
|
int m_buttonChange; // Which button changed?
|
|
|
|
int m_buttonState; // Which buttons are down?
|
|
|
|
int m_joyStick; // Which joystick?
|
1999-02-05 14:26:48 +00:00
|
|
|
|
2005-01-18 15:12:53 +00:00
|
|
|
public:
|
1999-02-05 14:26:48 +00:00
|
|
|
wxJoystickEvent(wxEventType type = wxEVT_NULL,
|
|
|
|
int state = 0,
|
|
|
|
int joystick = wxJOYSTICK1,
|
|
|
|
int change = 0)
|
2002-07-03 16:25:22 +00:00
|
|
|
: wxEvent(0, type),
|
2005-02-11 10:42:05 +00:00
|
|
|
m_pos(),
|
2002-07-03 16:25:22 +00:00
|
|
|
m_zPosition(0),
|
|
|
|
m_buttonChange(change),
|
|
|
|
m_buttonState(state),
|
|
|
|
m_joyStick(joystick)
|
1999-02-05 14:26:48 +00:00
|
|
|
{
|
|
|
|
}
|
2002-07-19 19:43:55 +00:00
|
|
|
wxJoystickEvent(const wxJoystickEvent & event)
|
2003-01-12 22:30:51 +00:00
|
|
|
: wxEvent(event),
|
|
|
|
m_pos(event.m_pos),
|
|
|
|
m_zPosition(event.m_zPosition),
|
|
|
|
m_buttonChange(event.m_buttonChange),
|
|
|
|
m_buttonState(event.m_buttonState),
|
|
|
|
m_joyStick(event.m_joyStick)
|
2002-07-19 19:43:55 +00:00
|
|
|
{ }
|
2002-07-20 02:06:47 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
wxPoint GetPosition() const { return m_pos; }
|
|
|
|
int GetZPosition() const { return m_zPosition; }
|
|
|
|
int GetButtonState() const { return m_buttonState; }
|
|
|
|
int GetButtonChange() const { return m_buttonChange; }
|
|
|
|
int GetJoystick() const { return m_joyStick; }
|
|
|
|
|
|
|
|
void SetJoystick(int stick) { m_joyStick = stick; }
|
|
|
|
void SetButtonState(int state) { m_buttonState = state; }
|
|
|
|
void SetButtonChange(int change) { m_buttonChange = change; }
|
|
|
|
void SetPosition(const wxPoint& pos) { m_pos = pos; }
|
|
|
|
void SetZPosition(int zPos) { m_zPosition = zPos; }
|
|
|
|
|
|
|
|
// Was it a button event? (*doesn't* mean: is any button *down*?)
|
|
|
|
bool IsButton() const { return ((GetEventType() == wxEVT_JOY_BUTTON_DOWN) ||
|
1999-09-08 08:29:49 +00:00
|
|
|
(GetEventType() == wxEVT_JOY_BUTTON_UP)); }
|
1999-02-05 14:26:48 +00:00
|
|
|
|
|
|
|
// Was it a move event?
|
2003-08-02 00:12:39 +00:00
|
|
|
bool IsMove() const { return (GetEventType() == wxEVT_JOY_MOVE); }
|
1999-02-05 14:26:48 +00:00
|
|
|
|
|
|
|
// Was it a zmove event?
|
2003-08-02 00:12:39 +00:00
|
|
|
bool IsZMove() const { return (GetEventType() == wxEVT_JOY_ZMOVE); }
|
1999-02-05 14:26:48 +00:00
|
|
|
|
|
|
|
// Was it a down event from button 1, 2, 3, 4 or any?
|
|
|
|
bool ButtonDown(int but = wxJOY_BUTTON_ANY) const
|
1998-05-20 14:01:55 +00:00
|
|
|
{ return ((GetEventType() == wxEVT_JOY_BUTTON_DOWN) &&
|
1999-02-05 14:26:48 +00:00
|
|
|
((but == wxJOY_BUTTON_ANY) || (but == m_buttonChange))); }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Was it a up event from button 1, 2, 3 or any?
|
|
|
|
bool ButtonUp(int but = wxJOY_BUTTON_ANY) const
|
1998-05-20 14:01:55 +00:00
|
|
|
{ return ((GetEventType() == wxEVT_JOY_BUTTON_UP) &&
|
1999-02-05 14:26:48 +00:00
|
|
|
((but == wxJOY_BUTTON_ANY) || (but == m_buttonChange))); }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// Was the given button 1,2,3,4 or any in Down state?
|
|
|
|
bool ButtonIsDown(int but = wxJOY_BUTTON_ANY) const
|
1998-05-20 14:01:55 +00:00
|
|
|
{ return (((but == wxJOY_BUTTON_ANY) && (m_buttonState != 0)) ||
|
1999-02-05 14:26:48 +00:00
|
|
|
((m_buttonState & but) == but)); }
|
1999-05-13 15:24:59 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxJoystickEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxJoystickEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Drop files event class
|
|
|
|
/*
|
|
|
|
wxEVT_DROP_FILES
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxDropFilesEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
|
|
|
int m_noFiles;
|
|
|
|
wxPoint m_pos;
|
2001-11-21 23:48:49 +00:00
|
|
|
wxString* m_files;
|
1999-02-05 14:26:48 +00:00
|
|
|
|
|
|
|
wxDropFilesEvent(wxEventType type = wxEVT_NULL,
|
|
|
|
int noFiles = 0,
|
|
|
|
wxString *files = (wxString *) NULL)
|
2002-07-03 16:25:22 +00:00
|
|
|
: wxEvent(0, type),
|
|
|
|
m_noFiles(noFiles),
|
|
|
|
m_pos(),
|
|
|
|
m_files(files)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
1999-02-05 14:26:48 +00:00
|
|
|
|
2001-11-21 23:48:49 +00:00
|
|
|
// we need a copy ctor to avoid deleting m_files pointer twice
|
|
|
|
wxDropFilesEvent(const wxDropFilesEvent& other)
|
2002-07-03 16:25:22 +00:00
|
|
|
: wxEvent(other),
|
|
|
|
m_noFiles(other.m_noFiles),
|
|
|
|
m_pos(other.m_pos),
|
|
|
|
m_files(NULL)
|
2001-11-21 23:48:49 +00:00
|
|
|
{
|
|
|
|
m_files = new wxString[m_noFiles];
|
|
|
|
for ( int n = 0; n < m_noFiles; n++ )
|
|
|
|
{
|
|
|
|
m_files[n] = other.m_files[n];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~wxDropFilesEvent()
|
|
|
|
{
|
|
|
|
delete [] m_files;
|
|
|
|
}
|
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
wxPoint GetPosition() const { return m_pos; }
|
|
|
|
int GetNumberOfFiles() const { return m_noFiles; }
|
|
|
|
wxString *GetFiles() const { return m_files; }
|
1999-05-13 15:24:59 +00:00
|
|
|
|
2001-11-21 23:48:49 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxDropFilesEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDropFilesEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Update UI event
|
|
|
|
/*
|
|
|
|
wxEVT_UPDATE_UI
|
|
|
|
*/
|
|
|
|
|
2003-07-09 10:15:21 +00:00
|
|
|
// Whether to always send update events to windows, or
|
|
|
|
// to only send update events to those with the
|
|
|
|
// wxWS_EX_PROCESS_UI_UPDATES style.
|
|
|
|
|
|
|
|
enum wxUpdateUIMode
|
|
|
|
{
|
|
|
|
// Send UI update events to all windows
|
|
|
|
wxUPDATE_UI_PROCESS_ALL,
|
|
|
|
|
|
|
|
// Send UI update events to windows that have
|
|
|
|
// the wxWS_EX_PROCESS_UI_UPDATES flag specified
|
|
|
|
wxUPDATE_UI_PROCESS_SPECIFIED
|
|
|
|
};
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxUpdateUIEvent : public wxCommandEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
|
|
|
wxUpdateUIEvent(wxWindowID commandId = 0)
|
2002-05-08 21:13:51 +00:00
|
|
|
: wxCommandEvent(wxEVT_UPDATE_UI, commandId)
|
2002-07-03 16:25:22 +00:00
|
|
|
{
|
|
|
|
m_checked =
|
|
|
|
m_enabled =
|
2006-02-12 16:32:50 +00:00
|
|
|
m_shown =
|
2002-07-03 16:25:22 +00:00
|
|
|
m_setEnabled =
|
2006-02-12 16:32:50 +00:00
|
|
|
m_setShown =
|
2002-07-19 21:11:31 +00:00
|
|
|
m_setText =
|
2004-09-04 01:26:40 +00:00
|
|
|
m_setChecked = false;
|
2002-07-03 16:25:22 +00:00
|
|
|
}
|
2002-07-19 19:43:55 +00:00
|
|
|
wxUpdateUIEvent(const wxUpdateUIEvent & event)
|
|
|
|
: wxCommandEvent(event),
|
2003-01-12 22:30:51 +00:00
|
|
|
m_checked(event.m_checked),
|
|
|
|
m_enabled(event.m_enabled),
|
2006-02-12 16:32:50 +00:00
|
|
|
m_shown(event.m_shown),
|
2003-01-12 22:30:51 +00:00
|
|
|
m_setEnabled(event.m_setEnabled),
|
2006-02-12 16:32:50 +00:00
|
|
|
m_setShown(event.m_setShown),
|
2003-01-12 22:30:51 +00:00
|
|
|
m_setText(event.m_setText),
|
|
|
|
m_setChecked(event.m_setChecked),
|
|
|
|
m_text(event.m_text)
|
|
|
|
{ }
|
2002-07-20 02:06:47 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
bool GetChecked() const { return m_checked; }
|
|
|
|
bool GetEnabled() const { return m_enabled; }
|
2006-02-12 16:32:50 +00:00
|
|
|
bool GetShown() const { return m_shown; }
|
1999-02-05 14:26:48 +00:00
|
|
|
wxString GetText() const { return m_text; }
|
|
|
|
bool GetSetText() const { return m_setText; }
|
|
|
|
bool GetSetChecked() const { return m_setChecked; }
|
|
|
|
bool GetSetEnabled() const { return m_setEnabled; }
|
2006-02-12 16:32:50 +00:00
|
|
|
bool GetSetShown() const { return m_setShown; }
|
1999-02-05 14:26:48 +00:00
|
|
|
|
2004-09-04 01:26:40 +00:00
|
|
|
void Check(bool check) { m_checked = check; m_setChecked = true; }
|
|
|
|
void Enable(bool enable) { m_enabled = enable; m_setEnabled = true; }
|
2006-02-12 16:32:50 +00:00
|
|
|
void Show(bool show) { m_shown = show; m_setShown = true; }
|
2004-09-04 01:26:40 +00:00
|
|
|
void SetText(const wxString& text) { m_text = text; m_setText = true; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2003-07-07 16:21:44 +00:00
|
|
|
// Sets the interval between updates in milliseconds.
|
|
|
|
// Set to -1 to disable updates, or to 0 to update as frequently as possible.
|
2003-07-09 10:15:21 +00:00
|
|
|
static void SetUpdateInterval(long updateInterval) { sm_updateInterval = updateInterval; }
|
2003-07-07 16:21:44 +00:00
|
|
|
|
|
|
|
// Returns the current interval between updates in milliseconds
|
2003-08-02 00:12:39 +00:00
|
|
|
static long GetUpdateInterval() { return sm_updateInterval; }
|
2003-07-07 16:21:44 +00:00
|
|
|
|
2003-07-09 10:15:21 +00:00
|
|
|
// Can we update this window?
|
2003-08-02 00:12:39 +00:00
|
|
|
static bool CanUpdate(wxWindowBase *win);
|
2003-07-07 16:21:44 +00:00
|
|
|
|
|
|
|
// Reset the update time to provide a delay until the next
|
|
|
|
// time we should update
|
2003-08-02 00:12:39 +00:00
|
|
|
static void ResetUpdateTime();
|
2003-07-07 16:21:44 +00:00
|
|
|
|
2004-05-23 14:56:36 +00:00
|
|
|
// Specify how wxWidgets will send update events: to
|
2003-07-09 10:15:21 +00:00
|
|
|
// all windows, or only to those which specify that they
|
|
|
|
// will process the events.
|
|
|
|
static void SetMode(wxUpdateUIMode mode) { sm_updateMode = mode; }
|
|
|
|
|
|
|
|
// Returns the UI update mode
|
2003-08-02 00:12:39 +00:00
|
|
|
static wxUpdateUIMode GetMode() { return sm_updateMode; }
|
2003-07-09 10:15:21 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxUpdateUIEvent(*this); }
|
1999-05-13 15:24:59 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
protected:
|
|
|
|
bool m_checked;
|
|
|
|
bool m_enabled;
|
2006-02-12 16:32:50 +00:00
|
|
|
bool m_shown;
|
1999-02-05 14:26:48 +00:00
|
|
|
bool m_setEnabled;
|
2006-02-12 16:32:50 +00:00
|
|
|
bool m_setShown;
|
1999-02-05 14:26:48 +00:00
|
|
|
bool m_setText;
|
|
|
|
bool m_setChecked;
|
|
|
|
wxString m_text;
|
2003-07-07 16:21:44 +00:00
|
|
|
#if wxUSE_LONGLONG
|
2003-07-09 10:15:21 +00:00
|
|
|
static wxLongLong sm_lastUpdate;
|
2003-07-07 16:21:44 +00:00
|
|
|
#endif
|
2003-07-09 10:15:21 +00:00
|
|
|
static long sm_updateInterval;
|
|
|
|
static wxUpdateUIMode sm_updateMode;
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxUpdateUIEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
wxEVT_SYS_COLOUR_CHANGED
|
|
|
|
*/
|
|
|
|
|
|
|
|
// TODO: shouldn't all events record the window ID?
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxSysColourChangedEvent : public wxEvent
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
|
|
|
wxSysColourChangedEvent()
|
2002-05-08 21:13:51 +00:00
|
|
|
: wxEvent(0, wxEVT_SYS_COLOUR_CHANGED)
|
|
|
|
{ }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxSysColourChangedEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSysColourChangedEvent)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2002-04-12 20:26:43 +00:00
|
|
|
/*
|
|
|
|
wxEVT_MOUSE_CAPTURE_CHANGED
|
|
|
|
The window losing the capture receives this message
|
|
|
|
(even if it released the capture itself).
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxMouseCaptureChangedEvent : public wxEvent
|
2002-04-12 20:26:43 +00:00
|
|
|
{
|
|
|
|
public:
|
2003-03-21 02:58:55 +00:00
|
|
|
wxMouseCaptureChangedEvent(wxWindowID winid = 0, wxWindow* gainedCapture = NULL)
|
|
|
|
: wxEvent(winid, wxEVT_MOUSE_CAPTURE_CHANGED),
|
2002-07-03 16:25:22 +00:00
|
|
|
m_gainedCapture(gainedCapture)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
|
|
|
|
|
|
|
wxMouseCaptureChangedEvent(const wxMouseCaptureChangedEvent& event)
|
2002-07-03 16:25:22 +00:00
|
|
|
: wxEvent(event),
|
|
|
|
m_gainedCapture(event.m_gainedCapture)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
2002-04-12 20:26:43 +00:00
|
|
|
|
|
|
|
virtual wxEvent *Clone() const { return new wxMouseCaptureChangedEvent(*this); }
|
|
|
|
|
2007-04-14 09:58:37 +00:00
|
|
|
wxWindow* GetCapturedWindow() const { return m_gainedCapture; }
|
2002-04-12 20:26:43 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
wxWindow* m_gainedCapture;
|
2003-07-22 00:24:07 +00:00
|
|
|
|
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMouseCaptureChangedEvent)
|
2002-04-12 20:26:43 +00:00
|
|
|
};
|
|
|
|
|
2006-07-31 09:27:54 +00:00
|
|
|
/*
|
|
|
|
wxEVT_MOUSE_CAPTURE_LOST
|
|
|
|
The window losing the capture receives this message, unless it released it
|
|
|
|
it itself or unless wxWindow::CaptureMouse was called on another window
|
|
|
|
(and so capture will be restored when the new capturer releases it).
|
|
|
|
*/
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_CORE wxMouseCaptureLostEvent : public wxEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxMouseCaptureLostEvent(wxWindowID winid = 0)
|
|
|
|
: wxEvent(winid, wxEVT_MOUSE_CAPTURE_LOST)
|
|
|
|
{}
|
|
|
|
|
|
|
|
wxMouseCaptureLostEvent(const wxMouseCaptureLostEvent& event)
|
|
|
|
: wxEvent(event)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual wxEvent *Clone() const { return new wxMouseCaptureLostEvent(*this); }
|
|
|
|
|
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMouseCaptureLostEvent)
|
|
|
|
};
|
|
|
|
|
2002-02-07 18:46:31 +00:00
|
|
|
/*
|
|
|
|
wxEVT_DISPLAY_CHANGED
|
|
|
|
*/
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxDisplayChangedEvent : public wxEvent
|
2002-02-07 18:46:31 +00:00
|
|
|
{
|
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDisplayChangedEvent)
|
2002-02-07 18:46:31 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
wxDisplayChangedEvent()
|
2002-05-08 21:13:51 +00:00
|
|
|
: wxEvent(0, wxEVT_DISPLAY_CHANGED)
|
|
|
|
{ }
|
2002-02-07 18:46:31 +00:00
|
|
|
|
|
|
|
virtual wxEvent *Clone() const { return new wxDisplayChangedEvent(*this); }
|
|
|
|
};
|
|
|
|
|
1998-07-29 06:51:33 +00:00
|
|
|
/*
|
|
|
|
wxEVT_PALETTE_CHANGED
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxPaletteChangedEvent : public wxEvent
|
1998-07-29 06:51:33 +00:00
|
|
|
{
|
|
|
|
public:
|
2003-03-21 02:58:55 +00:00
|
|
|
wxPaletteChangedEvent(wxWindowID winid = 0)
|
|
|
|
: wxEvent(winid, wxEVT_PALETTE_CHANGED),
|
2002-07-03 16:25:22 +00:00
|
|
|
m_changedWindow((wxWindow *) NULL)
|
|
|
|
{ }
|
2002-05-08 21:13:51 +00:00
|
|
|
|
|
|
|
wxPaletteChangedEvent(const wxPaletteChangedEvent& event)
|
2002-07-03 16:25:22 +00:00
|
|
|
: wxEvent(event),
|
|
|
|
m_changedWindow(event.m_changedWindow)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
1998-07-29 06:51:33 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
void SetChangedWindow(wxWindow* win) { m_changedWindow = win; }
|
|
|
|
wxWindow* GetChangedWindow() const { return m_changedWindow; }
|
1998-07-29 06:51:33 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxPaletteChangedEvent(*this); }
|
1999-05-13 15:24:59 +00:00
|
|
|
|
1998-07-29 06:51:33 +00:00
|
|
|
protected:
|
1999-02-05 14:26:48 +00:00
|
|
|
wxWindow* m_changedWindow;
|
2001-11-18 12:42:45 +00:00
|
|
|
|
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxPaletteChangedEvent)
|
1998-07-29 06:51:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
wxEVT_QUERY_NEW_PALETTE
|
|
|
|
Indicates the window is getting keyboard focus and should re-do its palette.
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxQueryNewPaletteEvent : public wxEvent
|
1998-07-29 06:51:33 +00:00
|
|
|
{
|
|
|
|
public:
|
2003-03-21 02:58:55 +00:00
|
|
|
wxQueryNewPaletteEvent(wxWindowID winid = 0)
|
|
|
|
: wxEvent(winid, wxEVT_QUERY_NEW_PALETTE),
|
2004-09-04 01:26:40 +00:00
|
|
|
m_paletteRealized(false)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
2002-07-19 19:43:55 +00:00
|
|
|
wxQueryNewPaletteEvent(const wxQueryNewPaletteEvent & event)
|
|
|
|
: wxEvent(event),
|
2003-01-12 22:30:51 +00:00
|
|
|
m_paletteRealized(event.m_paletteRealized)
|
|
|
|
{ }
|
2002-07-20 02:06:47 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// App sets this if it changes the palette.
|
|
|
|
void SetPaletteRealized(bool realized) { m_paletteRealized = realized; }
|
|
|
|
bool GetPaletteRealized() const { return m_paletteRealized; }
|
1998-07-29 06:51:33 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxQueryNewPaletteEvent(*this); }
|
1999-05-13 15:24:59 +00:00
|
|
|
|
1998-07-29 06:51:33 +00:00
|
|
|
protected:
|
1999-02-05 14:26:48 +00:00
|
|
|
bool m_paletteRealized;
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxQueryNewPaletteEvent)
|
1998-07-29 06:51:33 +00:00
|
|
|
};
|
|
|
|
|
1998-07-08 22:16:19 +00:00
|
|
|
/*
|
|
|
|
Event generated by dialog navigation keys
|
|
|
|
wxEVT_NAVIGATION_KEY
|
|
|
|
*/
|
2000-01-23 03:05:24 +00:00
|
|
|
// NB: don't derive from command event to avoid being propagated to the parent
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxNavigationKeyEvent : public wxEvent
|
1998-07-08 22:16:19 +00:00
|
|
|
{
|
|
|
|
public:
|
2000-01-23 03:05:24 +00:00
|
|
|
wxNavigationKeyEvent()
|
2002-07-03 16:25:22 +00:00
|
|
|
: wxEvent(0, wxEVT_NAVIGATION_KEY),
|
2005-02-19 21:59:21 +00:00
|
|
|
m_flags(IsForward | FromTab), // defaults are for TAB
|
2002-07-03 16:25:22 +00:00
|
|
|
m_focus((wxWindow *)NULL)
|
2003-09-30 12:49:56 +00:00
|
|
|
{
|
|
|
|
m_propagationLevel = wxEVENT_PROPAGATE_NONE;
|
|
|
|
}
|
2000-01-23 03:05:24 +00:00
|
|
|
|
2002-05-08 21:13:51 +00:00
|
|
|
wxNavigationKeyEvent(const wxNavigationKeyEvent& event)
|
2002-07-03 16:25:22 +00:00
|
|
|
: wxEvent(event),
|
|
|
|
m_flags(event.m_flags),
|
|
|
|
m_focus(event.m_focus)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
1998-07-08 22:16:19 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// direction: forward (true) or backward (false)
|
2000-01-23 03:05:24 +00:00
|
|
|
bool GetDirection() const
|
|
|
|
{ return (m_flags & IsForward) != 0; }
|
|
|
|
void SetDirection(bool bForward)
|
|
|
|
{ if ( bForward ) m_flags |= IsForward; else m_flags &= ~IsForward; }
|
1998-07-08 22:16:19 +00:00
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// it may be a window change event (MDI, notebook pages...) or a control
|
|
|
|
// change event
|
2000-01-23 03:05:24 +00:00
|
|
|
bool IsWindowChange() const
|
|
|
|
{ return (m_flags & WinChange) != 0; }
|
|
|
|
void SetWindowChange(bool bIs)
|
|
|
|
{ if ( bIs ) m_flags |= WinChange; else m_flags &= ~WinChange; }
|
|
|
|
|
2005-02-19 21:59:21 +00:00
|
|
|
// Set to true under MSW if the event was generated using the tab key.
|
|
|
|
// This is required for proper navogation over radio buttons
|
|
|
|
bool IsFromTab() const
|
|
|
|
{ return (m_flags & FromTab) != 0; }
|
|
|
|
void SetFromTab(bool bIs)
|
|
|
|
{ if ( bIs ) m_flags |= FromTab; else m_flags &= ~FromTab; }
|
|
|
|
|
1999-02-05 14:26:48 +00:00
|
|
|
// the child which has the focus currently (may be NULL - use
|
|
|
|
// wxWindow::FindFocus then)
|
2000-01-23 03:05:24 +00:00
|
|
|
wxWindow* GetCurrentFocus() const { return m_focus; }
|
|
|
|
void SetCurrentFocus(wxWindow *win) { m_focus = win; }
|
|
|
|
|
2004-06-15 22:24:49 +00:00
|
|
|
// Set flags
|
|
|
|
void SetFlags(long flags) { m_flags = flags; }
|
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxNavigationKeyEvent(*this); }
|
|
|
|
|
2000-01-23 03:05:24 +00:00
|
|
|
enum
|
|
|
|
{
|
2004-07-09 10:42:14 +00:00
|
|
|
IsBackward = 0x0000,
|
2000-01-23 03:05:24 +00:00
|
|
|
IsForward = 0x0001,
|
2005-02-19 21:59:21 +00:00
|
|
|
WinChange = 0x0002,
|
|
|
|
FromTab = 0x0004
|
2000-01-23 03:05:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
long m_flags;
|
|
|
|
wxWindow *m_focus;
|
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxNavigationKeyEvent)
|
1998-07-08 22:16:19 +00:00
|
|
|
};
|
|
|
|
|
1999-05-19 00:53:27 +00:00
|
|
|
// Window creation/destruction events: the first is sent as soon as window is
|
|
|
|
// created (i.e. the underlying GUI object exists), but when the C++ object is
|
|
|
|
// fully initialized (so virtual functions may be called). The second,
|
|
|
|
// wxEVT_DESTROY, is sent right before the window is destroyed - again, it's
|
|
|
|
// still safe to call virtual functions at this moment
|
|
|
|
/*
|
|
|
|
wxEVT_CREATE
|
|
|
|
wxEVT_DESTROY
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxWindowCreateEvent : public wxCommandEvent
|
1999-05-19 00:53:27 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxWindowCreateEvent(wxWindow *win = NULL);
|
|
|
|
|
|
|
|
wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxWindowCreateEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxWindowCreateEvent)
|
1999-05-19 00:53:27 +00:00
|
|
|
};
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxWindowDestroyEvent : public wxCommandEvent
|
1999-05-19 00:53:27 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxWindowDestroyEvent(wxWindow *win = NULL);
|
|
|
|
|
|
|
|
wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxWindowDestroyEvent(*this); }
|
|
|
|
|
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxWindowDestroyEvent)
|
1999-05-19 00:53:27 +00:00
|
|
|
};
|
|
|
|
|
2000-09-10 12:43:37 +00:00
|
|
|
// A help event is sent when the user clicks on a window in context-help mode.
|
2000-09-06 09:45:24 +00:00
|
|
|
/*
|
2000-09-10 12:43:37 +00:00
|
|
|
wxEVT_HELP
|
|
|
|
wxEVT_DETAILED_HELP
|
|
|
|
*/
|
2000-09-06 09:45:24 +00:00
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxHelpEvent : public wxCommandEvent
|
2000-09-06 09:45:24 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-05-26 02:21:38 +00:00
|
|
|
// how was this help event generated?
|
|
|
|
enum Origin
|
|
|
|
{
|
|
|
|
Origin_Unknown, // unrecognized event source
|
|
|
|
Origin_Keyboard, // event generated from F1 key press
|
|
|
|
Origin_HelpButton // event from [?] button on the title bar (Windows)
|
|
|
|
};
|
|
|
|
|
2000-09-10 12:43:37 +00:00
|
|
|
wxHelpEvent(wxEventType type = wxEVT_NULL,
|
2003-03-21 02:58:55 +00:00
|
|
|
wxWindowID winid = 0,
|
2006-05-26 02:21:38 +00:00
|
|
|
const wxPoint& pt = wxDefaultPosition,
|
|
|
|
Origin origin = Origin_Unknown)
|
2003-03-21 02:58:55 +00:00
|
|
|
: wxCommandEvent(type, winid),
|
2006-05-26 02:21:38 +00:00
|
|
|
m_pos(pt),
|
|
|
|
m_origin(GuessOrigin(origin))
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
2002-07-19 19:43:55 +00:00
|
|
|
wxHelpEvent(const wxHelpEvent & event)
|
|
|
|
: wxCommandEvent(event),
|
2003-01-12 22:30:51 +00:00
|
|
|
m_pos(event.m_pos),
|
|
|
|
m_target(event.m_target),
|
2006-05-26 02:21:38 +00:00
|
|
|
m_link(event.m_link),
|
|
|
|
m_origin(event.m_origin)
|
2002-07-19 19:43:55 +00:00
|
|
|
{ }
|
2002-07-20 02:06:47 +00:00
|
|
|
|
2000-09-10 12:43:37 +00:00
|
|
|
// Position of event (in screen coordinates)
|
|
|
|
const wxPoint& GetPosition() const { return m_pos; }
|
|
|
|
void SetPosition(const wxPoint& pos) { m_pos = pos; }
|
2000-09-06 09:45:24 +00:00
|
|
|
|
2000-09-10 12:43:37 +00:00
|
|
|
// Optional link to further help
|
|
|
|
const wxString& GetLink() const { return m_link; }
|
|
|
|
void SetLink(const wxString& link) { m_link = link; }
|
2000-09-08 10:49:39 +00:00
|
|
|
|
2000-09-10 12:43:37 +00:00
|
|
|
// 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; }
|
2000-09-08 10:49:39 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxHelpEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2006-05-26 02:21:38 +00:00
|
|
|
// optional indication of the event source
|
|
|
|
Origin GetOrigin() const { return m_origin; }
|
|
|
|
void SetOrigin(Origin origin) { m_origin = origin; }
|
|
|
|
|
2000-09-10 12:43:37 +00:00
|
|
|
protected:
|
|
|
|
wxPoint m_pos;
|
|
|
|
wxString m_target;
|
|
|
|
wxString m_link;
|
2006-05-26 02:21:38 +00:00
|
|
|
Origin m_origin;
|
|
|
|
|
|
|
|
// we can try to guess the event origin ourselves, even if none is
|
|
|
|
// specified in the ctor
|
|
|
|
static Origin GuessOrigin(Origin origin);
|
2000-09-10 12:43:37 +00:00
|
|
|
|
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxHelpEvent)
|
2000-09-06 09:45:24 +00:00
|
|
|
};
|
|
|
|
|
2006-05-12 15:21:41 +00:00
|
|
|
// A Clipboard Text event is sent when a window intercepts text copy/cut/paste
|
|
|
|
// message, i.e. the user has cut/copied/pasted data from/into a text control
|
|
|
|
// via ctrl-C/X/V, ctrl/shift-del/insert, a popup menu command, etc.
|
|
|
|
// NOTE : under windows these events are *NOT* generated automatically
|
|
|
|
// for a Rich Edit text control.
|
|
|
|
/*
|
|
|
|
wxEVT_COMMAND_TEXT_COPY
|
|
|
|
wxEVT_COMMAND_TEXT_CUT
|
|
|
|
wxEVT_COMMAND_TEXT_PASTE
|
|
|
|
*/
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_CORE wxClipboardTextEvent : public wxCommandEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxClipboardTextEvent(wxEventType type = wxEVT_NULL,
|
|
|
|
wxWindowID winid = 0)
|
|
|
|
: wxCommandEvent(type, winid)
|
|
|
|
{ }
|
|
|
|
wxClipboardTextEvent(const wxClipboardTextEvent & event)
|
|
|
|
: wxCommandEvent(event)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
virtual wxEvent *Clone() const { return new wxClipboardTextEvent(*this); }
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxClipboardTextEvent)
|
|
|
|
};
|
|
|
|
|
2001-05-16 11:32:21 +00:00
|
|
|
// 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
|
|
|
|
*/
|
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxContextMenuEvent : public wxCommandEvent
|
2001-05-16 11:32:21 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxContextMenuEvent(wxEventType type = wxEVT_NULL,
|
2003-03-21 02:58:55 +00:00
|
|
|
wxWindowID winid = 0,
|
2002-05-08 21:13:51 +00:00
|
|
|
const wxPoint& pt = wxDefaultPosition)
|
2003-03-21 02:58:55 +00:00
|
|
|
: wxCommandEvent(type, winid),
|
2002-07-03 16:25:22 +00:00
|
|
|
m_pos(pt)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
2002-07-19 19:43:55 +00:00
|
|
|
wxContextMenuEvent(const wxContextMenuEvent & event)
|
|
|
|
: wxCommandEvent(event),
|
2003-01-12 22:30:51 +00:00
|
|
|
m_pos(event.m_pos)
|
2002-07-19 19:43:55 +00:00
|
|
|
{ }
|
2002-07-20 02:06:47 +00:00
|
|
|
|
2001-05-16 11:32:21 +00:00
|
|
|
// Position of event (in screen coordinates)
|
|
|
|
const wxPoint& GetPosition() const { return m_pos; }
|
|
|
|
void SetPosition(const wxPoint& pos) { m_pos = pos; }
|
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxContextMenuEvent(*this); }
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-05-16 11:32:21 +00:00
|
|
|
protected:
|
|
|
|
wxPoint m_pos;
|
|
|
|
|
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxContextMenuEvent)
|
2001-05-16 11:32:21 +00:00
|
|
|
};
|
|
|
|
|
2007-05-14 23:43:39 +00:00
|
|
|
#endif // wxUSE_GUI
|
|
|
|
|
1999-10-04 20:15:38 +00:00
|
|
|
// Idle event
|
|
|
|
/*
|
|
|
|
wxEVT_IDLE
|
|
|
|
*/
|
|
|
|
|
2003-07-09 10:15:21 +00:00
|
|
|
// Whether to always send idle events to windows, or
|
|
|
|
// to only send update events to those with the
|
|
|
|
// wxWS_EX_PROCESS_IDLE style.
|
|
|
|
|
|
|
|
enum wxIdleMode
|
|
|
|
{
|
|
|
|
// Send idle events to all windows
|
|
|
|
wxIDLE_PROCESS_ALL,
|
|
|
|
|
|
|
|
// Send idle events to windows that have
|
|
|
|
// the wxWS_EX_PROCESS_IDLE flag specified
|
|
|
|
wxIDLE_PROCESS_SPECIFIED
|
|
|
|
};
|
|
|
|
|
2007-05-14 23:43:39 +00:00
|
|
|
class WXDLLIMPEXP_BASE wxIdleEvent : public wxEvent
|
1999-10-04 20:15:38 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxIdleEvent()
|
2002-07-03 16:25:22 +00:00
|
|
|
: wxEvent(0, wxEVT_IDLE),
|
2004-09-04 01:26:40 +00:00
|
|
|
m_requestMore(false)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
2002-07-19 19:43:55 +00:00
|
|
|
wxIdleEvent(const wxIdleEvent & event)
|
|
|
|
: wxEvent(event),
|
2003-01-12 22:30:51 +00:00
|
|
|
m_requestMore(event.m_requestMore)
|
|
|
|
{ }
|
2002-07-20 02:06:47 +00:00
|
|
|
|
2004-09-04 01:26:40 +00:00
|
|
|
void RequestMore(bool needMore = true) { m_requestMore = needMore; }
|
1999-10-04 20:15:38 +00:00
|
|
|
bool MoreRequested() const { return m_requestMore; }
|
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
virtual wxEvent *Clone() const { return new wxIdleEvent(*this); }
|
1999-10-04 20:15:38 +00:00
|
|
|
|
2004-05-23 14:56:36 +00:00
|
|
|
// Specify how wxWidgets will send idle events: to
|
2003-07-09 10:15:21 +00:00
|
|
|
// all windows, or only to those which specify that they
|
|
|
|
// will process the events.
|
|
|
|
static void SetMode(wxIdleMode mode) { sm_idleMode = mode; }
|
|
|
|
|
|
|
|
// Returns the idle event mode
|
2003-08-02 00:12:39 +00:00
|
|
|
static wxIdleMode GetMode() { return sm_idleMode; }
|
2003-07-09 10:15:21 +00:00
|
|
|
|
1999-10-04 20:15:38 +00:00
|
|
|
protected:
|
|
|
|
bool m_requestMore;
|
2003-07-09 10:15:21 +00:00
|
|
|
static wxIdleMode sm_idleMode;
|
2001-11-18 23:08:00 +00:00
|
|
|
|
2001-11-18 12:42:45 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxIdleEvent)
|
1999-10-04 20:15:38 +00:00
|
|
|
};
|
|
|
|
|
1998-06-14 20:53:26 +00:00
|
|
|
/* TODO
|
1998-05-20 14:01:55 +00:00
|
|
|
wxEVT_MOUSE_CAPTURE_CHANGED,
|
|
|
|
wxEVT_SETTING_CHANGED, // WM_WININICHANGE (NT) / WM_SETTINGCHANGE (Win95)
|
|
|
|
// wxEVT_FONT_CHANGED, // WM_FONTCHANGE: roll into wxEVT_SETTING_CHANGED, but remember to propagate
|
|
|
|
// wxEVT_FONT_CHANGED to all other windows (maybe).
|
|
|
|
wxEVT_DRAW_ITEM, // Leave these three as virtual functions in wxControl?? Platform-specific.
|
|
|
|
wxEVT_MEASURE_ITEM,
|
|
|
|
wxEVT_COMPARE_ITEM
|
|
|
|
*/
|
|
|
|
|
2001-10-09 22:50:33 +00:00
|
|
|
|
1999-10-17 01:18:49 +00:00
|
|
|
// ============================================================================
|
|
|
|
// event handler and related classes
|
|
|
|
// ============================================================================
|
|
|
|
|
2005-03-07 19:22:00 +00:00
|
|
|
// for backwards compatibility and to prevent eVC 4 for ARM from crashing with
|
|
|
|
// internal compiler error when compiling wx, we define wxObjectEventFunction
|
|
|
|
// as a wxObject method even though it can only be a wxEvtHandler one
|
|
|
|
typedef void (wxObject::*wxObjectEventFunction)(wxEvent&);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-01-31 16:00:00 +00:00
|
|
|
// struct containing the members common to static and dynamic event tables
|
|
|
|
// entries
|
2003-07-02 01:59:24 +00:00
|
|
|
struct WXDLLIMPEXP_BASE wxEventTableEntryBase
|
2001-01-25 18:30:30 +00:00
|
|
|
{
|
2002-05-08 21:13:51 +00:00
|
|
|
private:
|
|
|
|
wxEventTableEntryBase& operator=(const wxEventTableEntryBase& event);
|
2002-05-23 21:25:06 +00:00
|
|
|
|
2002-05-08 21:13:51 +00:00
|
|
|
public:
|
2003-03-21 02:58:55 +00:00
|
|
|
wxEventTableEntryBase(int winid, int idLast,
|
2001-01-31 16:00:00 +00:00
|
|
|
wxObjectEventFunction fn, wxObject *data)
|
2003-03-21 02:58:55 +00:00
|
|
|
: m_id(winid),
|
2002-07-03 16:25:22 +00:00
|
|
|
m_lastId(idLast),
|
|
|
|
m_fn(fn),
|
|
|
|
m_callbackUserData(data)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
|
|
|
|
|
|
|
wxEventTableEntryBase(const wxEventTableEntryBase& event)
|
2002-07-03 16:25:22 +00:00
|
|
|
: m_id(event.m_id),
|
|
|
|
m_lastId(event.m_lastId),
|
|
|
|
m_fn(event.m_fn),
|
|
|
|
m_callbackUserData(event.m_callbackUserData)
|
2002-05-23 21:25:06 +00:00
|
|
|
{ }
|
2001-01-31 16:00:00 +00:00
|
|
|
|
2002-07-03 16:25:22 +00:00
|
|
|
// the range of ids for this entry: if m_lastId == wxID_ANY, the range
|
|
|
|
// consists only of m_id, otherwise it is m_id..m_lastId inclusive
|
|
|
|
int m_id,
|
|
|
|
m_lastId;
|
2001-01-26 17:35:36 +00:00
|
|
|
|
2001-01-31 16:00:00 +00:00
|
|
|
// function to call: not wxEventFunction, because of dependency problems
|
|
|
|
wxObjectEventFunction m_fn;
|
2001-01-25 18:30:30 +00:00
|
|
|
|
2001-01-31 16:00:00 +00:00
|
|
|
// arbitrary user data asosciated with the callback
|
2001-01-25 18:30:30 +00:00
|
|
|
wxObject* m_callbackUserData;
|
|
|
|
};
|
|
|
|
|
2001-01-31 16:00:00 +00:00
|
|
|
// an entry from a static event table
|
2003-07-02 01:59:24 +00:00
|
|
|
struct WXDLLIMPEXP_BASE wxEventTableEntry : public wxEventTableEntryBase
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
2003-03-21 02:58:55 +00:00
|
|
|
wxEventTableEntry(const int& evType, int winid, int idLast,
|
2001-01-31 16:00:00 +00:00
|
|
|
wxObjectEventFunction fn, wxObject *data)
|
2003-03-21 02:58:55 +00:00
|
|
|
: wxEventTableEntryBase(winid, idLast, fn, data),
|
2002-05-08 21:13:51 +00:00
|
|
|
m_eventType(evType)
|
|
|
|
{ }
|
2001-01-31 16:00:00 +00:00
|
|
|
|
|
|
|
// the reference to event type: this allows us to not care about the
|
|
|
|
// (undefined) order in which the event table entries and the event types
|
|
|
|
// are initialized: initially the value of this reference might be
|
|
|
|
// invalid, but by the time it is used for the first time, all global
|
|
|
|
// objects will have been initialized (including the event type constants)
|
|
|
|
// and so it will have the correct value when it is needed
|
|
|
|
const int& m_eventType;
|
2003-07-22 00:24:07 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
wxEventTableEntry& operator=(const wxEventTableEntry&);
|
2001-01-31 16:00:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// an entry used in dynamic event table managed by wxEvtHandler::Connect()
|
2003-07-02 01:59:24 +00:00
|
|
|
struct WXDLLIMPEXP_BASE wxDynamicEventTableEntry : public wxEventTableEntryBase
|
2001-01-31 16:00:00 +00:00
|
|
|
{
|
2003-03-21 02:58:55 +00:00
|
|
|
wxDynamicEventTableEntry(int evType, int winid, int idLast,
|
2003-06-30 13:11:51 +00:00
|
|
|
wxObjectEventFunction fn, wxObject *data, wxEvtHandler* eventSink)
|
2003-03-21 02:58:55 +00:00
|
|
|
: wxEventTableEntryBase(winid, idLast, fn, data),
|
2003-06-30 13:11:51 +00:00
|
|
|
m_eventType(evType),
|
|
|
|
m_eventSink(eventSink)
|
2002-05-08 21:13:51 +00:00
|
|
|
{ }
|
2001-01-31 16:00:00 +00:00
|
|
|
|
|
|
|
// not a reference here as we can't keep a reference to a temporary int
|
|
|
|
// created to wrap the constant value typically passed to Connect() - nor
|
|
|
|
// do we need it
|
|
|
|
int m_eventType;
|
2003-06-30 13:11:51 +00:00
|
|
|
|
|
|
|
// Pointer to object whose function is fn - so we don't assume the
|
2003-09-17 23:35:36 +00:00
|
|
|
// EventFunction is always a member of the EventHandler receiving the
|
2003-06-30 13:11:51 +00:00
|
|
|
// message
|
|
|
|
wxEvtHandler* m_eventSink;
|
2003-07-22 00:24:07 +00:00
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS(wxDynamicEventTableEntry)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2001-01-31 17:16:40 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxEventTable: an array of event entries terminated with {0, 0, 0, 0, 0}
|
|
|
|
// ----------------------------------------------------------------------------
|
2003-07-02 01:41:23 +00:00
|
|
|
|
2003-07-02 01:59:24 +00:00
|
|
|
struct WXDLLIMPEXP_BASE wxEventTable
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
2001-01-26 18:58:14 +00:00
|
|
|
const wxEventTable *baseTable; // base event table (next in chain)
|
|
|
|
const wxEventTableEntry *entries; // bottom of entry array
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2003-07-17 23:59:49 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxEventHashTable: a helper of wxEvtHandler to speed up wxEventTable lookups.
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2003-10-08 22:13:14 +00:00
|
|
|
WX_DEFINE_ARRAY_PTR(const wxEventTableEntry*, wxEventTableEntryPointerArray);
|
2003-07-17 23:59:49 +00:00
|
|
|
|
|
|
|
class WXDLLIMPEXP_BASE wxEventHashTable
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
// Internal data structs
|
|
|
|
struct EventTypeTable
|
|
|
|
{
|
|
|
|
wxEventType eventType;
|
|
|
|
wxEventTableEntryPointerArray eventEntryTable;
|
|
|
|
};
|
|
|
|
typedef EventTypeTable* EventTypeTablePointer;
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Constructor, needs the event table it needs to hash later on.
|
2003-09-17 23:35:36 +00:00
|
|
|
// Note: hashing of the event table is not done in the constructor as it
|
|
|
|
// can be that the event table is not yet full initialize, the hash
|
2003-07-17 23:59:49 +00:00
|
|
|
// will gets initialized when handling the first event look-up request.
|
|
|
|
wxEventHashTable(const wxEventTable &table);
|
|
|
|
// Destructor.
|
|
|
|
~wxEventHashTable();
|
|
|
|
|
2003-09-17 23:35:36 +00:00
|
|
|
// Handle the given event, in other words search the event table hash
|
2003-07-17 23:59:49 +00:00
|
|
|
// and call self->ProcessEvent() if a match was found.
|
|
|
|
bool HandleEvent(wxEvent &event, wxEvtHandler *self);
|
|
|
|
|
2003-09-26 10:50:58 +00:00
|
|
|
// Clear table
|
|
|
|
void Clear();
|
|
|
|
|
2007-08-01 15:34:48 +00:00
|
|
|
#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING
|
2003-09-26 10:50:58 +00:00
|
|
|
// Clear all tables
|
|
|
|
static void ClearAll();
|
2007-05-24 23:53:05 +00:00
|
|
|
#endif // __WXDEBUG__ && wxUSE_MEMORY_TRACING
|
2003-09-26 10:50:58 +00:00
|
|
|
|
2003-07-17 23:59:49 +00:00
|
|
|
protected:
|
|
|
|
// Init the hash table with the entries of the static event table.
|
|
|
|
void InitHashTable();
|
|
|
|
// Helper funtion of InitHashTable() to insert 1 entry into the hash table.
|
|
|
|
void AddEntry(const wxEventTableEntry &entry);
|
|
|
|
// Allocate and init with null pointers the base hash table.
|
|
|
|
void AllocEventTypeTable(size_t size);
|
2003-09-17 23:35:36 +00:00
|
|
|
// Grow the hash table in size and transfer all items currently
|
2003-07-17 23:59:49 +00:00
|
|
|
// in the table to the correct location in the new table.
|
|
|
|
void GrowEventTypeTable();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
const wxEventTable &m_table;
|
|
|
|
bool m_rebuildHash;
|
|
|
|
|
|
|
|
size_t m_size;
|
|
|
|
EventTypeTablePointer *m_eventTypeTable;
|
2003-07-22 00:24:07 +00:00
|
|
|
|
2003-09-26 10:50:58 +00:00
|
|
|
static wxEventHashTable* sm_first;
|
|
|
|
wxEventHashTable* m_previous;
|
|
|
|
wxEventHashTable* m_next;
|
|
|
|
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_NO_COPY_CLASS(wxEventHashTable)
|
2003-07-17 23:59:49 +00:00
|
|
|
};
|
|
|
|
|
2001-01-31 16:00:00 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
2004-05-23 14:56:36 +00:00
|
|
|
// wxEvtHandler: the base class for all objects handling wxWidgets events
|
2001-01-31 16:00:00 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-02-09 14:40:26 +00:00
|
|
|
class WXDLLIMPEXP_BASE wxEvtHandler : public wxObject
|
|
|
|
#if wxUSE_WEAKREF
|
|
|
|
, public wxTrackable
|
|
|
|
#endif
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-02-05 14:26:48 +00:00
|
|
|
public:
|
|
|
|
wxEvtHandler();
|
2001-01-31 16:00:00 +00:00
|
|
|
virtual ~wxEvtHandler();
|
1999-02-05 14:26:48 +00:00
|
|
|
|
|
|
|
wxEvtHandler *GetNextHandler() const { return m_nextHandler; }
|
|
|
|
wxEvtHandler *GetPreviousHandler() const { return m_previousHandler; }
|
|
|
|
void SetNextHandler(wxEvtHandler *handler) { m_nextHandler = handler; }
|
|
|
|
void SetPreviousHandler(wxEvtHandler *handler) { m_previousHandler = handler; }
|
|
|
|
|
1999-10-17 01:18:49 +00:00
|
|
|
void SetEvtHandlerEnabled(bool enabled) { m_enabled = enabled; }
|
1999-02-05 14:26:48 +00:00
|
|
|
bool GetEvtHandlerEnabled() const { return m_enabled; }
|
|
|
|
|
1999-10-17 01:18:49 +00:00
|
|
|
// process an event right now
|
|
|
|
virtual bool ProcessEvent(wxEvent& event);
|
1999-02-05 14:26:48 +00:00
|
|
|
|
2007-11-29 17:00:58 +00:00
|
|
|
// Process an event by calling ProcessEvent and handling any exceptions
|
|
|
|
// thrown by event handlers. It's mostly useful when processing wx events
|
|
|
|
// when called from C code (e.g. in GTK+ callback) when the exception
|
|
|
|
// wouldn't correctly propagate to wxEventLoop.
|
|
|
|
bool SafelyProcessEvent(wxEvent& event);
|
|
|
|
|
1999-10-17 01:18:49 +00:00
|
|
|
// add an event to be processed later
|
2007-06-21 21:56:50 +00:00
|
|
|
virtual void AddPendingEvent(const wxEvent& event);
|
1999-02-05 14:26:48 +00:00
|
|
|
|
1999-10-17 01:18:49 +00:00
|
|
|
void ProcessPendingEvents();
|
1999-02-05 14:26:48 +00:00
|
|
|
|
1999-03-27 18:50:54 +00:00
|
|
|
#if wxUSE_THREADS
|
2007-06-21 21:56:50 +00:00
|
|
|
bool ProcessThreadEvent(const wxEvent& event);
|
1999-03-27 18:50:54 +00:00
|
|
|
#endif
|
1999-02-05 14:26:48 +00:00
|
|
|
|
|
|
|
// Dynamic association of a member function handler with the event handler,
|
2003-03-21 02:58:55 +00:00
|
|
|
// winid and event type
|
2005-02-14 23:53:48 +00:00
|
|
|
void Connect(int winid,
|
|
|
|
int lastId,
|
|
|
|
int eventType,
|
|
|
|
wxObjectEventFunction func,
|
|
|
|
wxObject *userData = (wxObject *) NULL,
|
|
|
|
wxEvtHandler *eventSink = (wxEvtHandler *) NULL);
|
1999-02-05 14:26:48 +00:00
|
|
|
|
|
|
|
// Convenience function: take just one id
|
2005-02-14 23:53:48 +00:00
|
|
|
void Connect(int winid,
|
|
|
|
int eventType,
|
|
|
|
wxObjectEventFunction func,
|
|
|
|
wxObject *userData = (wxObject *) NULL,
|
|
|
|
wxEvtHandler *eventSink = (wxEvtHandler *) NULL)
|
2003-06-30 13:11:51 +00:00
|
|
|
{ Connect(winid, wxID_ANY, eventType, func, userData, eventSink); }
|
1999-02-05 14:26:48 +00:00
|
|
|
|
2005-02-14 23:53:48 +00:00
|
|
|
// Even more convenient: without id (same as using id of wxID_ANY)
|
|
|
|
void Connect(int eventType,
|
|
|
|
wxObjectEventFunction func,
|
|
|
|
wxObject *userData = (wxObject *) NULL,
|
|
|
|
wxEvtHandler *eventSink = (wxEvtHandler *) NULL)
|
|
|
|
{ Connect(wxID_ANY, wxID_ANY, eventType, func, userData, eventSink); }
|
|
|
|
|
|
|
|
bool Disconnect(int winid,
|
|
|
|
int lastId,
|
|
|
|
wxEventType eventType,
|
|
|
|
wxObjectEventFunction func = NULL,
|
|
|
|
wxObject *userData = (wxObject *) NULL,
|
|
|
|
wxEvtHandler *eventSink = (wxEvtHandler *) NULL);
|
|
|
|
|
2005-02-15 12:04:53 +00:00
|
|
|
bool Disconnect(int winid = wxID_ANY,
|
2005-02-14 23:53:48 +00:00
|
|
|
wxEventType eventType = wxEVT_NULL,
|
|
|
|
wxObjectEventFunction func = NULL,
|
|
|
|
wxObject *userData = (wxObject *) NULL,
|
|
|
|
wxEvtHandler *eventSink = (wxEvtHandler *) NULL)
|
2003-06-30 13:11:51 +00:00
|
|
|
{ return Disconnect(winid, wxID_ANY, eventType, func, userData, eventSink); }
|
2000-10-07 02:38:05 +00:00
|
|
|
|
2005-05-18 22:40:09 +00:00
|
|
|
bool Disconnect(wxEventType eventType,
|
2005-05-19 17:37:59 +00:00
|
|
|
wxObjectEventFunction func,
|
2005-05-18 22:40:09 +00:00
|
|
|
wxObject *userData = (wxObject *) NULL,
|
|
|
|
wxEvtHandler *eventSink = (wxEvtHandler *) NULL)
|
|
|
|
{ return Disconnect(wxID_ANY, eventType, func, userData, eventSink); }
|
2005-02-14 23:53:48 +00:00
|
|
|
|
2003-08-09 08:17:07 +00:00
|
|
|
wxList* GetDynamicEventTable() const { return m_dynamicEvents ; }
|
2001-10-12 03:18:35 +00:00
|
|
|
|
|
|
|
// User data can be associated with each wxEvtHandler
|
|
|
|
void SetClientObject( wxClientData *data ) { DoSetClientObject(data); }
|
|
|
|
wxClientData *GetClientObject() const { return DoGetClientObject(); }
|
|
|
|
|
|
|
|
void SetClientData( void *data ) { DoSetClientData(data); }
|
|
|
|
void *GetClientData() const { return DoGetClientData(); }
|
|
|
|
|
2003-09-17 23:35:36 +00:00
|
|
|
// check if the given event table entry matches this event and call the
|
|
|
|
// handler if it does
|
|
|
|
//
|
|
|
|
// return true if the event was processed, false otherwise (no match or the
|
|
|
|
// handler decided to skip the event)
|
|
|
|
static bool ProcessEventIfMatches(const wxEventTableEntryBase& tableEntry,
|
|
|
|
wxEvtHandler *handler,
|
|
|
|
wxEvent& event);
|
2001-10-12 03:18:35 +00:00
|
|
|
|
1999-10-17 01:18:49 +00:00
|
|
|
// implementation from now on
|
|
|
|
virtual bool SearchEventTable(wxEventTable& table, wxEvent& event);
|
1999-02-05 14:26:48 +00:00
|
|
|
bool SearchDynamicEventTable( wxEvent& event );
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2003-09-26 10:50:58 +00:00
|
|
|
// Avoid problems at exit by cleaning up static hash table gracefully
|
|
|
|
void ClearEventHashTable() { GetEventHashTable().Clear(); }
|
2008-02-09 14:40:26 +00:00
|
|
|
#if wxUSE_WEAKREF
|
2008-01-08 17:57:27 +00:00
|
|
|
void OnSinkDestroyed( wxEvtHandler *sink );
|
2008-02-09 14:40:26 +00:00
|
|
|
#endif
|
2003-09-26 10:50:58 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
private:
|
1999-10-17 01:18:49 +00:00
|
|
|
static const wxEventTableEntry sm_eventTableEntries[];
|
1999-02-05 14:26:48 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
protected:
|
2003-06-26 00:44:55 +00:00
|
|
|
// hooks for wxWindow used by ProcessEvent()
|
|
|
|
// -----------------------------------------
|
|
|
|
|
2003-08-17 10:33:25 +00:00
|
|
|
// This one is called before trying our own event table to allow plugging
|
|
|
|
// in the validators.
|
2003-09-17 23:35:36 +00:00
|
|
|
//
|
2003-08-17 10:33:25 +00:00
|
|
|
// NB: This method is intentionally *not* inside wxUSE_VALIDATORS!
|
|
|
|
// It is part of wxBase which doesn't use validators and the code
|
|
|
|
// is compiled out when building wxBase w/o GUI classes, which affects
|
2005-05-31 09:20:43 +00:00
|
|
|
// binary compatibility and wxBase library can't be used by GUI
|
2003-08-17 10:33:25 +00:00
|
|
|
// ports.
|
2003-06-26 00:44:55 +00:00
|
|
|
virtual bool TryValidator(wxEvent& WXUNUSED(event)) { return false; }
|
|
|
|
|
|
|
|
// this one is called after failing to find the event handle in our own
|
|
|
|
// table to give a chance to the other windows to process it
|
|
|
|
//
|
|
|
|
// base class implementation passes the event to wxTheApp
|
|
|
|
virtual bool TryParent(wxEvent& event);
|
|
|
|
|
|
|
|
|
2003-09-17 23:35:36 +00:00
|
|
|
static const wxEventTable sm_eventTable;
|
1999-02-23 22:41:37 +00:00
|
|
|
virtual const wxEventTable *GetEventTable() const;
|
|
|
|
|
2003-07-17 23:59:49 +00:00
|
|
|
static wxEventHashTable sm_eventHashTable;
|
|
|
|
virtual wxEventHashTable& GetEventHashTable() const;
|
|
|
|
|
1999-04-19 10:14:51 +00:00
|
|
|
wxEvtHandler* m_nextHandler;
|
|
|
|
wxEvtHandler* m_previousHandler;
|
|
|
|
wxList* m_dynamicEvents;
|
1999-05-19 00:53:27 +00:00
|
|
|
wxList* m_pendingEvents;
|
2001-01-31 16:00:00 +00:00
|
|
|
|
1999-03-27 18:50:54 +00:00
|
|
|
#if wxUSE_THREADS
|
2008-01-05 19:07:52 +00:00
|
|
|
// critical section protecting m_pendingEvents
|
|
|
|
wxCriticalSection m_pendingEventsLock;
|
|
|
|
#endif // wxUSE_THREADS
|
1999-02-23 22:41:37 +00:00
|
|
|
|
1999-10-17 01:18:49 +00:00
|
|
|
// Is event handler enabled?
|
|
|
|
bool m_enabled;
|
2001-01-31 16:00:00 +00:00
|
|
|
|
2001-10-12 03:18:35 +00:00
|
|
|
|
|
|
|
// The user data: either an object which will be deleted by the container
|
|
|
|
// when it's deleted or some raw pointer which we do nothing with - only
|
|
|
|
// one type of data can be used with the given window (i.e. you cannot set
|
|
|
|
// the void data and then associate the container with wxClientData or vice
|
|
|
|
// versa)
|
|
|
|
union
|
|
|
|
{
|
|
|
|
wxClientData *m_clientObject;
|
|
|
|
void *m_clientData;
|
|
|
|
};
|
|
|
|
|
|
|
|
// what kind of data do we have?
|
|
|
|
wxClientDataType m_clientDataType;
|
|
|
|
|
|
|
|
// client data accessors
|
|
|
|
virtual void DoSetClientObject( wxClientData *data );
|
|
|
|
virtual wxClientData *DoGetClientObject() const;
|
|
|
|
|
|
|
|
virtual void DoSetClientData( void *data );
|
|
|
|
virtual void *DoGetClientData() const;
|
|
|
|
|
2008-02-09 14:40:26 +00:00
|
|
|
#if wxUSE_WEAKREF
|
2008-01-08 17:57:27 +00:00
|
|
|
// Search tracker objects for event connection with this sink
|
2008-01-13 01:12:13 +00:00
|
|
|
wxEventConnectionRef *FindRefInTrackerList(wxEvtHandler *eventSink);
|
2008-02-09 14:40:26 +00:00
|
|
|
#endif
|
2008-01-08 17:57:27 +00:00
|
|
|
|
2001-01-31 16:00:00 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxEvtHandler)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2008-02-09 14:40:26 +00:00
|
|
|
#if wxUSE_WEAKREF
|
2008-01-13 01:12:13 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxEventConnectionRef represents all connections between two event handlers
|
|
|
|
// and enables automatic disconnect when an event handler sink goes out of
|
|
|
|
// scope. Each connection/disconnect increases/decreases ref count, and
|
|
|
|
// when it reaches zero the node goes out of scope.
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxEventConnectionRef : public wxTrackerNode
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxEventConnectionRef() : m_src(NULL), m_sink(NULL), m_refCount(0) { }
|
|
|
|
wxEventConnectionRef(wxEvtHandler *src, wxEvtHandler *sink)
|
|
|
|
: m_src(src), m_sink(sink), m_refCount(1)
|
|
|
|
{
|
|
|
|
m_sink->AddNode(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
// The sink is being destroyed
|
|
|
|
virtual void OnObjectDestroy( )
|
|
|
|
{
|
|
|
|
if ( m_src )
|
|
|
|
m_src->OnSinkDestroyed( m_sink );
|
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual wxEventConnectionRef *ToEventConnection() { return this; }
|
|
|
|
|
|
|
|
void IncRef() { m_refCount++; }
|
|
|
|
void DecRef()
|
|
|
|
{
|
|
|
|
if ( !--m_refCount )
|
|
|
|
{
|
|
|
|
// The sink holds the only external pointer to this object
|
|
|
|
if ( m_sink )
|
|
|
|
m_sink->RemoveNode(this);
|
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxEvtHandler *m_src,
|
|
|
|
*m_sink;
|
|
|
|
int m_refCount;
|
|
|
|
|
|
|
|
friend class wxEvtHandler;
|
|
|
|
|
|
|
|
DECLARE_NO_ASSIGN_CLASS(wxEventConnectionRef)
|
|
|
|
};
|
2008-02-09 14:40:26 +00:00
|
|
|
#endif // wxUSE_WEAKREF
|
2008-01-13 01:12:13 +00:00
|
|
|
|
2003-06-24 00:56:19 +00:00
|
|
|
// Post a message to the given eventhandler which will be processed during the
|
|
|
|
// next event loop iteration
|
2007-06-21 21:56:50 +00:00
|
|
|
inline void wxPostEvent(wxEvtHandler *dest, const wxEvent& event)
|
2003-06-24 00:56:19 +00:00
|
|
|
{
|
|
|
|
wxCHECK_RET( dest, wxT("need an object to post event to in wxPostEvent") );
|
|
|
|
|
|
|
|
dest->AddPendingEvent(event);
|
|
|
|
}
|
|
|
|
|
2005-06-21 09:56:18 +00:00
|
|
|
typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&);
|
2008-02-03 14:08:01 +00:00
|
|
|
typedef void (wxEvtHandler::*wxIdleEventFunction)(wxIdleEvent&);
|
2005-06-21 09:56:18 +00:00
|
|
|
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxEventHandler(func) \
|
|
|
|
(wxObjectEventFunction)wxStaticCastEvent(wxEventFunction, &func)
|
2008-02-03 14:08:01 +00:00
|
|
|
#define wxIdleEventHandler(func) \
|
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxIdleEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
|
1999-10-04 20:15:38 +00:00
|
|
|
#if wxUSE_GUI
|
2005-02-14 23:53:48 +00:00
|
|
|
|
2007-02-04 00:12:50 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxEventBlocker: helper class to temporarily disable event handling for a window
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2007-02-05 18:19:32 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxEventBlocker : public wxEvtHandler
|
2007-02-04 00:12:50 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxEventBlocker(wxWindow *win, wxEventType type = wxEVT_ANY);
|
|
|
|
virtual ~wxEventBlocker();
|
|
|
|
|
|
|
|
void Block(wxEventType type)
|
|
|
|
{
|
|
|
|
m_eventsToBlock.push_back(type);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool ProcessEvent(wxEvent& event);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
wxArrayInt m_eventsToBlock;
|
|
|
|
wxWindow *m_window;
|
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS(wxEventBlocker)
|
|
|
|
};
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
typedef void (wxEvtHandler::*wxCommandEventFunction)(wxCommandEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxScrollEventFunction)(wxScrollEvent&);
|
1999-05-17 19:17:28 +00:00
|
|
|
typedef void (wxEvtHandler::*wxScrollWinEventFunction)(wxScrollWinEvent&);
|
1998-05-20 14:01:55 +00:00
|
|
|
typedef void (wxEvtHandler::*wxSizeEventFunction)(wxSizeEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxMoveEventFunction)(wxMoveEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxPaintEventFunction)(wxPaintEvent&);
|
2004-02-11 00:18:21 +00:00
|
|
|
typedef void (wxEvtHandler::*wxNcPaintEventFunction)(wxNcPaintEvent&);
|
1998-05-20 14:01:55 +00:00
|
|
|
typedef void (wxEvtHandler::*wxEraseEventFunction)(wxEraseEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxMouseEventFunction)(wxMouseEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxCharEventFunction)(wxKeyEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxFocusEventFunction)(wxFocusEvent&);
|
2001-08-06 00:49:59 +00:00
|
|
|
typedef void (wxEvtHandler::*wxChildFocusEventFunction)(wxChildFocusEvent&);
|
1998-05-20 14:01:55 +00:00
|
|
|
typedef void (wxEvtHandler::*wxActivateEventFunction)(wxActivateEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxMenuEventFunction)(wxMenuEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxJoystickEventFunction)(wxJoystickEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxDropFilesEventFunction)(wxDropFilesEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxInitDialogEventFunction)(wxInitDialogEvent&);
|
2005-02-14 23:53:48 +00:00
|
|
|
typedef void (wxEvtHandler::*wxSysColourChangedEventFunction)(wxSysColourChangedEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxDisplayChangedEventFunction)(wxDisplayChangedEvent&);
|
1998-05-20 14:01:55 +00:00
|
|
|
typedef void (wxEvtHandler::*wxUpdateUIEventFunction)(wxUpdateUIEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxCloseEventFunction)(wxCloseEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxShowEventFunction)(wxShowEvent&);
|
2002-08-11 20:11:01 +00:00
|
|
|
typedef void (wxEvtHandler::*wxIconizeEventFunction)(wxIconizeEvent&);
|
2002-08-12 11:10:28 +00:00
|
|
|
typedef void (wxEvtHandler::*wxMaximizeEventFunction)(wxMaximizeEvent&);
|
1998-07-27 09:47:57 +00:00
|
|
|
typedef void (wxEvtHandler::*wxNavigationKeyEventFunction)(wxNavigationKeyEvent&);
|
1998-07-29 06:51:33 +00:00
|
|
|
typedef void (wxEvtHandler::*wxPaletteChangedEventFunction)(wxPaletteChangedEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxQueryNewPaletteEventFunction)(wxQueryNewPaletteEvent&);
|
2000-03-14 00:45:54 +00:00
|
|
|
typedef void (wxEvtHandler::*wxWindowCreateEventFunction)(wxWindowCreateEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxWindowDestroyEventFunction)(wxWindowDestroyEvent&);
|
|
|
|
typedef void (wxEvtHandler::*wxSetCursorEventFunction)(wxSetCursorEvent&);
|
2000-03-15 18:52:23 +00:00
|
|
|
typedef void (wxEvtHandler::*wxNotifyEventFunction)(wxNotifyEvent&);
|
2000-09-06 09:45:24 +00:00
|
|
|
typedef void (wxEvtHandler::*wxHelpEventFunction)(wxHelpEvent&);
|
2001-05-16 11:32:21 +00:00
|
|
|
typedef void (wxEvtHandler::*wxContextMenuEventFunction)(wxContextMenuEvent&);
|
2002-04-12 20:26:43 +00:00
|
|
|
typedef void (wxEvtHandler::*wxMouseCaptureChangedEventFunction)(wxMouseCaptureChangedEvent&);
|
2006-07-31 09:27:54 +00:00
|
|
|
typedef void (wxEvtHandler::*wxMouseCaptureLostEventFunction)(wxMouseCaptureLostEvent&);
|
2006-05-12 15:21:41 +00:00
|
|
|
typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent&);
|
2005-02-14 23:53:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define wxCommandEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCommandEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxScrollEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxScrollEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxScrollWinEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxScrollWinEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxSizeEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSizeEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxMoveEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMoveEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxPaintEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxPaintEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxNcPaintEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNcPaintEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxEraseEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxEraseEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxMouseEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMouseEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxCharEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCharEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxKeyEventHandler(func) wxCharEventHandler(func)
|
|
|
|
#define wxFocusEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFocusEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxChildFocusEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxChildFocusEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxActivateEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxActivateEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxMenuEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMenuEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxJoystickEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxJoystickEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxDropFilesEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDropFilesEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxInitDialogEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxInitDialogEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxSysColourChangedEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSysColourChangedEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxDisplayChangedEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDisplayChangedEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxUpdateUIEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxUpdateUIEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxCloseEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCloseEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxShowEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxShowEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxIconizeEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxIconizeEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxMaximizeEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMaximizeEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxNavigationKeyEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNavigationKeyEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxPaletteChangedEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxPaletteChangedEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxQueryNewPaletteEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxQueryNewPaletteEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxWindowCreateEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWindowCreateEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxWindowDestroyEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWindowDestroyEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxSetCursorEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSetCursorEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxNotifyEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNotifyEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxHelpEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxHelpEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxContextMenuEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxContextMenuEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define wxMouseCaptureChangedEventHandler(func) \
|
2005-03-08 20:53:16 +00:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMouseCaptureChangedEventFunction, &func)
|
2006-07-31 09:27:54 +00:00
|
|
|
#define wxMouseCaptureLostEventHandler(func) \
|
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMouseCaptureLostEventFunction, &func)
|
2006-05-12 15:21:41 +00:00
|
|
|
#define wxClipboardTextEventHandler(func) \
|
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxClipboardTextEventFunction, &func)
|
2005-02-14 23:53:48 +00:00
|
|
|
|
1999-10-04 20:15:38 +00:00
|
|
|
#endif // wxUSE_GUI
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// N.B. In GNU-WIN32, you *have* to take the address of a member function
|
|
|
|
// (use &) or the compiler crashes...
|
|
|
|
|
|
|
|
#define DECLARE_EVENT_TABLE() \
|
2001-01-31 17:16:40 +00:00
|
|
|
private: \
|
|
|
|
static const wxEventTableEntry sm_eventTableEntries[]; \
|
|
|
|
protected: \
|
|
|
|
static const wxEventTable sm_eventTable; \
|
2003-07-17 23:59:49 +00:00
|
|
|
virtual const wxEventTable* GetEventTable() const; \
|
|
|
|
static wxEventHashTable sm_eventHashTable; \
|
|
|
|
virtual wxEventHashTable& GetEventHashTable() const;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2003-07-03 16:43:16 +00:00
|
|
|
// N.B.: when building DLL with Borland C++ 5.5 compiler, you must initialize
|
|
|
|
// sm_eventTable before using it in GetEventTable() or the compiler gives
|
|
|
|
// E2233 (see http://groups.google.com/groups?selm=397dcc8a%241_2%40dnews)
|
2003-07-17 23:59:49 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#define BEGIN_EVENT_TABLE(theClass, baseClass) \
|
2001-01-31 17:16:40 +00:00
|
|
|
const wxEventTable theClass::sm_eventTable = \
|
|
|
|
{ &baseClass::sm_eventTable, &theClass::sm_eventTableEntries[0] }; \
|
2003-07-03 16:43:16 +00:00
|
|
|
const wxEventTable *theClass::GetEventTable() const \
|
|
|
|
{ return &theClass::sm_eventTable; } \
|
2003-07-17 23:59:49 +00:00
|
|
|
wxEventHashTable theClass::sm_eventHashTable(theClass::sm_eventTable); \
|
|
|
|
wxEventHashTable &theClass::GetEventHashTable() const \
|
|
|
|
{ return theClass::sm_eventHashTable; } \
|
2001-01-31 17:16:40 +00:00
|
|
|
const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2006-01-19 09:42:54 +00:00
|
|
|
#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[] = { \
|
|
|
|
|
2001-04-03 16:07:57 +00:00
|
|
|
#define END_EVENT_TABLE() DECLARE_EVENT_TABLE_ENTRY( wxEVT_NULL, 0, 0, 0, 0 ) };
|
1999-02-05 14:26:48 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
/*
|
|
|
|
* Event table macros
|
|
|
|
*/
|
|
|
|
|
2005-02-14 23:53:48 +00:00
|
|
|
// helpers for writing shorter code below: declare an event macro taking 2, 1
|
|
|
|
// or none ids (the missing ids default to wxID_ANY)
|
|
|
|
//
|
|
|
|
// macro arguments:
|
|
|
|
// - evt one of wxEVT_XXX constants
|
|
|
|
// - id1, id2 ids of the first/last id
|
|
|
|
// - fn the function (should be cast to the right type)
|
|
|
|
#define wx__DECLARE_EVT2(evt, id1, id2, fn) \
|
|
|
|
DECLARE_EVENT_TABLE_ENTRY(evt, id1, id2, fn, NULL),
|
|
|
|
#define wx__DECLARE_EVT1(evt, id, fn) \
|
|
|
|
wx__DECLARE_EVT2(evt, id, wxID_ANY, fn)
|
|
|
|
#define wx__DECLARE_EVT0(evt, fn) \
|
|
|
|
wx__DECLARE_EVT1(evt, wxID_ANY, fn)
|
|
|
|
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
// Generic events
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_CUSTOM(event, winid, func) \
|
|
|
|
wx__DECLARE_EVT1(event, winid, wxEventHandler(func))
|
|
|
|
#define EVT_CUSTOM_RANGE(event, id1, id2, func) \
|
|
|
|
wx__DECLARE_EVT2(event, id1, id2, wxEventHandler(func))
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2004-12-05 16:30:54 +00:00
|
|
|
// EVT_COMMAND
|
2005-02-17 16:56:35 +00:00
|
|
|
#define EVT_COMMAND(winid, event, func) \
|
2005-02-14 23:53:48 +00:00
|
|
|
wx__DECLARE_EVT1(event, winid, wxCommandEventHandler(func))
|
2005-02-17 16:56:35 +00:00
|
|
|
#define EVT_COMMAND_RANGE(id1, id2, event, func) \
|
2005-02-14 23:53:48 +00:00
|
|
|
wx__DECLARE_EVT2(event, id1, id2, wxCommandEventHandler(func))
|
2004-12-05 16:30:54 +00:00
|
|
|
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_NOTIFY(event, winid, func) \
|
|
|
|
wx__DECLARE_EVT1(event, winid, wxNotifyEventHandler(func))
|
|
|
|
#define EVT_NOTIFY_RANGE(event, id1, id2, func) \
|
|
|
|
wx__DECLARE_EVT2(event, id1, id2, wxNotifyEventHandler(func))
|
2004-12-05 16:30:54 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
// Miscellaneous
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_SIZE(func) wx__DECLARE_EVT0(wxEVT_SIZE, wxSizeEventHandler(func))
|
|
|
|
#define EVT_SIZING(func) wx__DECLARE_EVT0(wxEVT_SIZING, wxSizeEventHandler(func))
|
|
|
|
#define EVT_MOVE(func) wx__DECLARE_EVT0(wxEVT_MOVE, wxMoveEventHandler(func))
|
|
|
|
#define EVT_MOVING(func) wx__DECLARE_EVT0(wxEVT_MOVING, wxMoveEventHandler(func))
|
2007-08-01 15:34:48 +00:00
|
|
|
#define EVT_MOVE_START(func) wx__DECLARE_EVT0(wxEVT_MOVE_START, wxMoveEventHandler(func))
|
|
|
|
#define EVT_MOVE_END(func) wx__DECLARE_EVT0(wxEVT_MOVE_END, wxMoveEventHandler(func))
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_CLOSE(func) wx__DECLARE_EVT0(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(func))
|
|
|
|
#define EVT_END_SESSION(func) wx__DECLARE_EVT0(wxEVT_END_SESSION, wxCloseEventHandler(func))
|
|
|
|
#define EVT_QUERY_END_SESSION(func) wx__DECLARE_EVT0(wxEVT_QUERY_END_SESSION, wxCloseEventHandler(func))
|
|
|
|
#define EVT_PAINT(func) wx__DECLARE_EVT0(wxEVT_PAINT, wxPaintEventHandler(func))
|
|
|
|
#define EVT_NC_PAINT(func) wx__DECLARE_EVT0(wxEVT_NC_PAINT, wxNcPaintEventHandler(func))
|
|
|
|
#define EVT_ERASE_BACKGROUND(func) wx__DECLARE_EVT0(wxEVT_ERASE_BACKGROUND, wxEraseEventHandler(func))
|
|
|
|
#define EVT_CHAR(func) wx__DECLARE_EVT0(wxEVT_CHAR, wxCharEventHandler(func))
|
|
|
|
#define EVT_KEY_DOWN(func) wx__DECLARE_EVT0(wxEVT_KEY_DOWN, wxKeyEventHandler(func))
|
|
|
|
#define EVT_KEY_UP(func) wx__DECLARE_EVT0(wxEVT_KEY_UP, wxKeyEventHandler(func))
|
2003-07-10 09:16:00 +00:00
|
|
|
#if wxUSE_HOTKEY
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_HOTKEY(winid, func) wx__DECLARE_EVT1(wxEVT_HOTKEY, winid, wxCharEventHandler(func))
|
2003-07-10 09:16:00 +00:00
|
|
|
#endif
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_CHAR_HOOK(func) wx__DECLARE_EVT0(wxEVT_CHAR_HOOK, wxCharEventHandler(func))
|
|
|
|
#define EVT_MENU_OPEN(func) wx__DECLARE_EVT0(wxEVT_MENU_OPEN, wxMenuEventHandler(func))
|
|
|
|
#define EVT_MENU_CLOSE(func) wx__DECLARE_EVT0(wxEVT_MENU_CLOSE, wxMenuEventHandler(func))
|
|
|
|
#define EVT_MENU_HIGHLIGHT(winid, func) wx__DECLARE_EVT1(wxEVT_MENU_HIGHLIGHT, winid, wxMenuEventHandler(func))
|
|
|
|
#define EVT_MENU_HIGHLIGHT_ALL(func) wx__DECLARE_EVT0(wxEVT_MENU_HIGHLIGHT, wxMenuEventHandler(func))
|
|
|
|
#define EVT_SET_FOCUS(func) wx__DECLARE_EVT0(wxEVT_SET_FOCUS, wxFocusEventHandler(func))
|
|
|
|
#define EVT_KILL_FOCUS(func) wx__DECLARE_EVT0(wxEVT_KILL_FOCUS, wxFocusEventHandler(func))
|
|
|
|
#define EVT_CHILD_FOCUS(func) wx__DECLARE_EVT0(wxEVT_CHILD_FOCUS, wxChildFocusEventHandler(func))
|
|
|
|
#define EVT_ACTIVATE(func) wx__DECLARE_EVT0(wxEVT_ACTIVATE, wxActivateEventHandler(func))
|
|
|
|
#define EVT_ACTIVATE_APP(func) wx__DECLARE_EVT0(wxEVT_ACTIVATE_APP, wxActivateEventHandler(func))
|
2005-03-18 14:26:57 +00:00
|
|
|
#define EVT_HIBERNATE(func) wx__DECLARE_EVT0(wxEVT_HIBERNATE, wxActivateEventHandler(func))
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_END_SESSION(func) wx__DECLARE_EVT0(wxEVT_END_SESSION, wxCloseEventHandler(func))
|
|
|
|
#define EVT_QUERY_END_SESSION(func) wx__DECLARE_EVT0(wxEVT_QUERY_END_SESSION, wxCloseEventHandler(func))
|
|
|
|
#define EVT_DROP_FILES(func) wx__DECLARE_EVT0(wxEVT_DROP_FILES, wxDropFilesEventHandler(func))
|
|
|
|
#define EVT_INIT_DIALOG(func) wx__DECLARE_EVT0(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(func))
|
|
|
|
#define EVT_SYS_COLOUR_CHANGED(func) wx__DECLARE_EVT0(wxEVT_SYS_COLOUR_CHANGED, wxSysColourChangedEventHandler(func))
|
|
|
|
#define EVT_DISPLAY_CHANGED(func) wx__DECLARE_EVT0(wxEVT_DISPLAY_CHANGED, wxDisplayChangedEventHandler(func))
|
|
|
|
#define EVT_SHOW(func) wx__DECLARE_EVT0(wxEVT_SHOW, wxShowEventHandler(func))
|
|
|
|
#define EVT_MAXIMIZE(func) wx__DECLARE_EVT0(wxEVT_MAXIMIZE, wxMaximizeEventHandler(func))
|
|
|
|
#define EVT_ICONIZE(func) wx__DECLARE_EVT0(wxEVT_ICONIZE, wxIconizeEventHandler(func))
|
|
|
|
#define EVT_NAVIGATION_KEY(func) wx__DECLARE_EVT0(wxEVT_NAVIGATION_KEY, wxNavigationKeyEventHandler(func))
|
|
|
|
#define EVT_PALETTE_CHANGED(func) wx__DECLARE_EVT0(wxEVT_PALETTE_CHANGED, wxPaletteChangedEventHandler(func))
|
|
|
|
#define EVT_QUERY_NEW_PALETTE(func) wx__DECLARE_EVT0(wxEVT_QUERY_NEW_PALETTE, wxQueryNewPaletteEventHandler(func))
|
|
|
|
#define EVT_WINDOW_CREATE(func) wx__DECLARE_EVT0(wxEVT_CREATE, wxWindowCreateEventHandler(func))
|
|
|
|
#define EVT_WINDOW_DESTROY(func) wx__DECLARE_EVT0(wxEVT_DESTROY, wxWindowDestroyEventHandler(func))
|
|
|
|
#define EVT_SET_CURSOR(func) wx__DECLARE_EVT0(wxEVT_SET_CURSOR, wxSetCursorEventHandler(func))
|
|
|
|
#define EVT_MOUSE_CAPTURE_CHANGED(func) wx__DECLARE_EVT0(wxEVT_MOUSE_CAPTURE_CHANGED, wxMouseCaptureChangedEventHandler(func))
|
2006-07-31 09:27:54 +00:00
|
|
|
#define EVT_MOUSE_CAPTURE_LOST(func) wx__DECLARE_EVT0(wxEVT_MOUSE_CAPTURE_LOST, wxMouseCaptureLostEventHandler(func))
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// Mouse events
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_LEFT_DOWN(func) wx__DECLARE_EVT0(wxEVT_LEFT_DOWN, wxMouseEventHandler(func))
|
|
|
|
#define EVT_LEFT_UP(func) wx__DECLARE_EVT0(wxEVT_LEFT_UP, wxMouseEventHandler(func))
|
|
|
|
#define EVT_MIDDLE_DOWN(func) wx__DECLARE_EVT0(wxEVT_MIDDLE_DOWN, wxMouseEventHandler(func))
|
|
|
|
#define EVT_MIDDLE_UP(func) wx__DECLARE_EVT0(wxEVT_MIDDLE_UP, wxMouseEventHandler(func))
|
|
|
|
#define EVT_RIGHT_DOWN(func) wx__DECLARE_EVT0(wxEVT_RIGHT_DOWN, wxMouseEventHandler(func))
|
|
|
|
#define EVT_RIGHT_UP(func) wx__DECLARE_EVT0(wxEVT_RIGHT_UP, wxMouseEventHandler(func))
|
|
|
|
#define EVT_MOTION(func) wx__DECLARE_EVT0(wxEVT_MOTION, wxMouseEventHandler(func))
|
|
|
|
#define EVT_LEFT_DCLICK(func) wx__DECLARE_EVT0(wxEVT_LEFT_DCLICK, wxMouseEventHandler(func))
|
|
|
|
#define EVT_MIDDLE_DCLICK(func) wx__DECLARE_EVT0(wxEVT_MIDDLE_DCLICK, wxMouseEventHandler(func))
|
|
|
|
#define EVT_RIGHT_DCLICK(func) wx__DECLARE_EVT0(wxEVT_RIGHT_DCLICK, wxMouseEventHandler(func))
|
|
|
|
#define EVT_LEAVE_WINDOW(func) wx__DECLARE_EVT0(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(func))
|
|
|
|
#define EVT_ENTER_WINDOW(func) wx__DECLARE_EVT0(wxEVT_ENTER_WINDOW, wxMouseEventHandler(func))
|
|
|
|
#define EVT_MOUSEWHEEL(func) wx__DECLARE_EVT0(wxEVT_MOUSEWHEEL, wxMouseEventHandler(func))
|
2007-07-29 01:04:33 +00:00
|
|
|
#define EVT_MOUSE_AUX1_DOWN(func) wx__DECLARE_EVT0(wxEVT_AUX1_DOWN, wxMouseEventHandler(func))
|
|
|
|
#define EVT_MOUSE_AUX1_UP(func) wx__DECLARE_EVT0(wxEVT_AUX1_UP, wxMouseEventHandler(func))
|
|
|
|
#define EVT_MOUSE_AUX1_DCLICK(func) wx__DECLARE_EVT0(wxEVT_AUX1_DCLICK, wxMouseEventHandler(func))
|
|
|
|
#define EVT_MOUSE_AUX2_DOWN(func) wx__DECLARE_EVT0(wxEVT_AUX2_DOWN, wxMouseEventHandler(func))
|
|
|
|
#define EVT_MOUSE_AUX2_UP(func) wx__DECLARE_EVT0(wxEVT_AUX2_UP, wxMouseEventHandler(func))
|
|
|
|
#define EVT_MOUSE_AUX2_DCLICK(func) wx__DECLARE_EVT0(wxEVT_AUX2_DCLICK, wxMouseEventHandler(func))
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// All mouse events
|
|
|
|
#define EVT_MOUSE_EVENTS(func) \
|
2005-02-14 23:53:48 +00:00
|
|
|
EVT_LEFT_DOWN(func) \
|
|
|
|
EVT_LEFT_UP(func) \
|
2007-07-29 01:04:33 +00:00
|
|
|
EVT_LEFT_DCLICK(func) \
|
2005-02-14 23:53:48 +00:00
|
|
|
EVT_MIDDLE_DOWN(func) \
|
|
|
|
EVT_MIDDLE_UP(func) \
|
2007-07-29 01:04:33 +00:00
|
|
|
EVT_MIDDLE_DCLICK(func) \
|
2005-02-14 23:53:48 +00:00
|
|
|
EVT_RIGHT_DOWN(func) \
|
|
|
|
EVT_RIGHT_UP(func) \
|
|
|
|
EVT_RIGHT_DCLICK(func) \
|
2007-07-29 01:04:33 +00:00
|
|
|
EVT_MOUSE_AUX1_DOWN(func) \
|
|
|
|
EVT_MOUSE_AUX1_UP(func) \
|
|
|
|
EVT_MOUSE_AUX1_DCLICK(func) \
|
|
|
|
EVT_MOUSE_AUX2_DOWN(func) \
|
|
|
|
EVT_MOUSE_AUX2_UP(func) \
|
|
|
|
EVT_MOUSE_AUX2_DCLICK(func) \
|
|
|
|
EVT_MOTION(func) \
|
2005-02-14 23:53:48 +00:00
|
|
|
EVT_LEAVE_WINDOW(func) \
|
|
|
|
EVT_ENTER_WINDOW(func) \
|
|
|
|
EVT_MOUSEWHEEL(func)
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-05-17 19:17:28 +00:00
|
|
|
// Scrolling from wxWindow (sent to wxScrolledWindow)
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_SCROLLWIN_TOP(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_TOP, wxScrollWinEventHandler(func))
|
|
|
|
#define EVT_SCROLLWIN_BOTTOM(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_BOTTOM, wxScrollWinEventHandler(func))
|
|
|
|
#define EVT_SCROLLWIN_LINEUP(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_LINEUP, wxScrollWinEventHandler(func))
|
|
|
|
#define EVT_SCROLLWIN_LINEDOWN(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_LINEDOWN, wxScrollWinEventHandler(func))
|
|
|
|
#define EVT_SCROLLWIN_PAGEUP(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_PAGEUP, wxScrollWinEventHandler(func))
|
|
|
|
#define EVT_SCROLLWIN_PAGEDOWN(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_PAGEDOWN, wxScrollWinEventHandler(func))
|
|
|
|
#define EVT_SCROLLWIN_THUMBTRACK(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_THUMBTRACK, wxScrollWinEventHandler(func))
|
|
|
|
#define EVT_SCROLLWIN_THUMBRELEASE(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_THUMBRELEASE, wxScrollWinEventHandler(func))
|
|
|
|
|
1999-05-17 19:17:28 +00:00
|
|
|
#define EVT_SCROLLWIN(func) \
|
2005-02-14 23:53:48 +00:00
|
|
|
EVT_SCROLLWIN_TOP(func) \
|
|
|
|
EVT_SCROLLWIN_BOTTOM(func) \
|
|
|
|
EVT_SCROLLWIN_LINEUP(func) \
|
|
|
|
EVT_SCROLLWIN_LINEDOWN(func) \
|
|
|
|
EVT_SCROLLWIN_PAGEUP(func) \
|
|
|
|
EVT_SCROLLWIN_PAGEDOWN(func) \
|
|
|
|
EVT_SCROLLWIN_THUMBTRACK(func) \
|
|
|
|
EVT_SCROLLWIN_THUMBRELEASE(func)
|
1999-05-17 19:17:28 +00:00
|
|
|
|
|
|
|
// Scrolling from wxSlider and wxScrollBar
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_SCROLL_TOP(func) wx__DECLARE_EVT0(wxEVT_SCROLL_TOP, wxScrollEventHandler(func))
|
|
|
|
#define EVT_SCROLL_BOTTOM(func) wx__DECLARE_EVT0(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(func))
|
|
|
|
#define EVT_SCROLL_LINEUP(func) wx__DECLARE_EVT0(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(func))
|
|
|
|
#define EVT_SCROLL_LINEDOWN(func) wx__DECLARE_EVT0(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(func))
|
|
|
|
#define EVT_SCROLL_PAGEUP(func) wx__DECLARE_EVT0(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(func))
|
|
|
|
#define EVT_SCROLL_PAGEDOWN(func) wx__DECLARE_EVT0(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(func))
|
|
|
|
#define EVT_SCROLL_THUMBTRACK(func) wx__DECLARE_EVT0(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(func))
|
|
|
|
#define EVT_SCROLL_THUMBRELEASE(func) wx__DECLARE_EVT0(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(func))
|
2005-05-31 15:22:10 +00:00
|
|
|
#define EVT_SCROLL_CHANGED(func) wx__DECLARE_EVT0(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(func))
|
2005-02-14 23:53:48 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#define EVT_SCROLL(func) \
|
2005-02-14 23:53:48 +00:00
|
|
|
EVT_SCROLL_TOP(func) \
|
|
|
|
EVT_SCROLL_BOTTOM(func) \
|
|
|
|
EVT_SCROLL_LINEUP(func) \
|
|
|
|
EVT_SCROLL_LINEDOWN(func) \
|
|
|
|
EVT_SCROLL_PAGEUP(func) \
|
|
|
|
EVT_SCROLL_PAGEDOWN(func) \
|
|
|
|
EVT_SCROLL_THUMBTRACK(func) \
|
2005-05-30 00:17:57 +00:00
|
|
|
EVT_SCROLL_THUMBRELEASE(func) \
|
2005-09-25 20:23:30 +00:00
|
|
|
EVT_SCROLL_CHANGED(func)
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-05-17 19:17:28 +00:00
|
|
|
// Scrolling from wxSlider and wxScrollBar, with an id
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_COMMAND_SCROLL_TOP(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_TOP, winid, wxScrollEventHandler(func))
|
|
|
|
#define EVT_COMMAND_SCROLL_BOTTOM(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_BOTTOM, winid, wxScrollEventHandler(func))
|
|
|
|
#define EVT_COMMAND_SCROLL_LINEUP(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_LINEUP, winid, wxScrollEventHandler(func))
|
|
|
|
#define EVT_COMMAND_SCROLL_LINEDOWN(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_LINEDOWN, winid, wxScrollEventHandler(func))
|
|
|
|
#define EVT_COMMAND_SCROLL_PAGEUP(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_PAGEUP, winid, wxScrollEventHandler(func))
|
|
|
|
#define EVT_COMMAND_SCROLL_PAGEDOWN(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_PAGEDOWN, winid, wxScrollEventHandler(func))
|
|
|
|
#define EVT_COMMAND_SCROLL_THUMBTRACK(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_THUMBTRACK, winid, wxScrollEventHandler(func))
|
|
|
|
#define EVT_COMMAND_SCROLL_THUMBRELEASE(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_THUMBRELEASE, winid, wxScrollEventHandler(func))
|
2005-05-31 15:22:10 +00:00
|
|
|
#define EVT_COMMAND_SCROLL_CHANGED(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_CHANGED, winid, wxScrollEventHandler(func))
|
2005-02-14 23:53:48 +00:00
|
|
|
|
2003-03-21 02:58:55 +00:00
|
|
|
#define EVT_COMMAND_SCROLL(winid, func) \
|
2005-02-14 23:53:48 +00:00
|
|
|
EVT_COMMAND_SCROLL_TOP(winid, func) \
|
|
|
|
EVT_COMMAND_SCROLL_BOTTOM(winid, func) \
|
|
|
|
EVT_COMMAND_SCROLL_LINEUP(winid, func) \
|
|
|
|
EVT_COMMAND_SCROLL_LINEDOWN(winid, func) \
|
|
|
|
EVT_COMMAND_SCROLL_PAGEUP(winid, func) \
|
|
|
|
EVT_COMMAND_SCROLL_PAGEDOWN(winid, func) \
|
|
|
|
EVT_COMMAND_SCROLL_THUMBTRACK(winid, func) \
|
2005-05-30 00:17:57 +00:00
|
|
|
EVT_COMMAND_SCROLL_THUMBRELEASE(winid, func) \
|
2005-09-25 20:23:30 +00:00
|
|
|
EVT_COMMAND_SCROLL_CHANGED(winid, func)
|
2005-05-31 15:22:10 +00:00
|
|
|
|
2006-03-30 14:04:17 +00:00
|
|
|
#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
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// Convenience macros for commonly-used commands
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_CHECKBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_CHECKBOX_CLICKED, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_CHOICE(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_CHOICE_SELECTED, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_LISTBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_LISTBOX_SELECTED, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_LISTBOX_DCLICK(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_MENU(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_MENU_SELECTED, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_MENU_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_COMMAND_MENU_SELECTED, id1, id2, wxCommandEventHandler(func))
|
2004-06-23 10:44:16 +00:00
|
|
|
#if defined(__SMARTPHONE__)
|
2005-02-14 23:53:48 +00:00
|
|
|
# define EVT_BUTTON(winid, func) EVT_MENU(winid, func)
|
2004-06-23 10:44:16 +00:00
|
|
|
#else
|
2005-02-14 23:53:48 +00:00
|
|
|
# define EVT_BUTTON(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_BUTTON_CLICKED, winid, wxCommandEventHandler(func))
|
2004-06-23 10:44:16 +00:00
|
|
|
#endif
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_SLIDER(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_SLIDER_UPDATED, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_RADIOBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_RADIOBOX_SELECTED, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_RADIOBUTTON(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_RADIOBUTTON_SELECTED, winid, wxCommandEventHandler(func))
|
1998-05-20 14:01:55 +00:00
|
|
|
// EVT_SCROLLBAR is now obsolete since we use EVT_COMMAND_SCROLL... events
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_SCROLLBAR(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_SCROLLBAR_UPDATED, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_VLBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_VLBOX_SELECTED, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_COMBOBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_COMBOBOX_SELECTED, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_TOOL(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_TOOL_CLICKED, winid, wxCommandEventHandler(func))
|
2007-05-11 23:35:49 +00:00
|
|
|
#define EVT_TOOL_DROPDOWN(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED, winid, wxCommandEventHandler(func))
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_TOOL_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_COMMAND_TOOL_CLICKED, id1, id2, wxCommandEventHandler(func))
|
|
|
|
#define EVT_TOOL_RCLICKED(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_TOOL_RCLICKED, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_TOOL_RCLICKED_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_COMMAND_TOOL_RCLICKED, id1, id2, wxCommandEventHandler(func))
|
|
|
|
#define EVT_TOOL_ENTER(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_TOOL_ENTER, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_CHECKLISTBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, winid, wxCommandEventHandler(func))
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// Generic command events
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_COMMAND_LEFT_CLICK(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_LEFT_CLICK, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_COMMAND_LEFT_DCLICK(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_LEFT_DCLICK, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_COMMAND_RIGHT_CLICK(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_RIGHT_CLICK, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_COMMAND_RIGHT_DCLICK(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_RIGHT_DCLICK, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_COMMAND_SET_FOCUS(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_SET_FOCUS, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_COMMAND_KILL_FOCUS(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_KILL_FOCUS, winid, wxCommandEventHandler(func))
|
|
|
|
#define EVT_COMMAND_ENTER(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_ENTER, winid, wxCommandEventHandler(func))
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// Joystick events
|
2002-08-19 16:09:40 +00:00
|
|
|
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_JOY_BUTTON_DOWN(func) wx__DECLARE_EVT0(wxEVT_JOY_BUTTON_DOWN, wxJoystickEventHandler(func))
|
|
|
|
#define EVT_JOY_BUTTON_UP(func) wx__DECLARE_EVT0(wxEVT_JOY_BUTTON_UP, wxJoystickEventHandler(func))
|
|
|
|
#define EVT_JOY_MOVE(func) wx__DECLARE_EVT0(wxEVT_JOY_MOVE, wxJoystickEventHandler(func))
|
|
|
|
#define EVT_JOY_ZMOVE(func) wx__DECLARE_EVT0(wxEVT_JOY_ZMOVE, wxJoystickEventHandler(func))
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// All joystick events
|
|
|
|
#define EVT_JOYSTICK_EVENTS(func) \
|
2005-02-14 23:53:48 +00:00
|
|
|
EVT_JOY_BUTTON_DOWN(func) \
|
|
|
|
EVT_JOY_BUTTON_UP(func) \
|
|
|
|
EVT_JOY_MOVE(func) \
|
|
|
|
EVT_JOY_ZMOVE(func)
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// Idle event
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_IDLE(func) wx__DECLARE_EVT0(wxEVT_IDLE, wxIdleEventHandler(func))
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// Update UI event
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_UPDATE_UI(winid, func) wx__DECLARE_EVT1(wxEVT_UPDATE_UI, winid, wxUpdateUIEventHandler(func))
|
|
|
|
#define EVT_UPDATE_UI_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_UPDATE_UI, id1, id2, wxUpdateUIEventHandler(func))
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-09-06 09:45:24 +00:00
|
|
|
// Help events
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_HELP(winid, func) wx__DECLARE_EVT1(wxEVT_HELP, winid, wxHelpEventHandler(func))
|
|
|
|
#define EVT_HELP_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_HELP, id1, id2, wxHelpEventHandler(func))
|
|
|
|
#define EVT_DETAILED_HELP(winid, func) wx__DECLARE_EVT1(wxEVT_DETAILED_HELP, winid, wxHelpEventHandler(func))
|
|
|
|
#define EVT_DETAILED_HELP_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_DETAILED_HELP, id1, id2, wxHelpEventHandler(func))
|
2000-09-08 10:49:39 +00:00
|
|
|
|
2001-05-16 11:32:21 +00:00
|
|
|
// Context Menu Events
|
2005-02-14 23:53:48 +00:00
|
|
|
#define EVT_CONTEXT_MENU(func) wx__DECLARE_EVT0(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(func))
|
2005-02-15 09:28:00 +00:00
|
|
|
#define EVT_COMMAND_CONTEXT_MENU(winid, func) wx__DECLARE_EVT1(wxEVT_CONTEXT_MENU, winid, wxContextMenuEventHandler(func))
|
2001-05-16 11:32:21 +00:00
|
|
|
|
2006-05-12 15:21:41 +00:00
|
|
|
// Clipboard text Events
|
|
|
|
#define EVT_TEXT_CUT(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_TEXT_CUT, winid, wxClipboardTextEventHandler(func))
|
|
|
|
#define EVT_TEXT_COPY(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_TEXT_COPY, winid, wxClipboardTextEventHandler(func))
|
|
|
|
#define EVT_TEXT_PASTE(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_TEXT_PASTE, winid, wxClipboardTextEventHandler(func))
|
|
|
|
|
1999-10-17 01:18:49 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Global data
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-01-05 17:29:20 +00:00
|
|
|
// list containing event handlers with pending events for them
|
|
|
|
//
|
|
|
|
// notice that each event handler should occur at most once in this list
|
2003-07-02 01:59:24 +00:00
|
|
|
extern WXDLLIMPEXP_BASE wxList *wxPendingEvents;
|
1999-10-17 01:18:49 +00:00
|
|
|
#if wxUSE_THREADS
|
2003-07-02 01:59:24 +00:00
|
|
|
extern WXDLLIMPEXP_BASE wxCriticalSection *wxPendingEventsLocker;
|
1999-10-17 01:18:49 +00:00
|
|
|
#endif
|
|
|
|
|
1999-10-04 20:15:38 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Helper functions
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#if wxUSE_GUI
|
1999-04-07 21:33:22 +00:00
|
|
|
|
|
|
|
// Find a window with the focus, that is also a descendant of the given window.
|
|
|
|
// This is used to determine the window to initially send commands to.
|
2005-10-23 22:16:33 +00:00
|
|
|
WXDLLIMPEXP_CORE wxWindow* wxFindFocusDescendant(wxWindow* ancestor);
|
1999-04-07 21:33:22 +00:00
|
|
|
|
1999-10-04 20:15:38 +00:00
|
|
|
#endif // wxUSE_GUI
|
|
|
|
|
2007-12-03 02:55:14 +00:00
|
|
|
#endif // _WX_EVENT_H_
|