/////////////////////////////////////////////////////////////////////////////
-// Name: event.h
+// Name: wx/event.h
// Purpose: Event classes
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
-// Copyright: (c)
+// Copyright: (c) wxWindows team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
wxEVT_PLOT_AREA_SEL_CREATED = wxEVT_FIRST + 1015,
wxEVT_PLOT_AREA_SEL_CHANGING = wxEVT_FIRST + 1016,
wxEVT_PLOT_AREA_SEL_CHANGED = wxEVT_FIRST + 1017,
- wxEVT_PLOT_BEGIN_X_LABEL_EDIT = wxEVT_FIRST + 1020,
+ wxEVT_PLOT_BEGIN_X_LABEL_EDIT = wxEVT_FIRST + 1020,
wxEVT_PLOT_END_X_LABEL_EDIT = wxEVT_FIRST + 1021,
wxEVT_PLOT_BEGIN_Y_LABEL_EDIT = wxEVT_FIRST + 1022,
wxEVT_PLOT_END_Y_LABEL_EDIT = wxEVT_FIRST + 1023,
wxEVT_PLOT_END_TITLE_EDIT = wxEVT_FIRST + 1025,
wxEVT_PLOT_AREA_CREATE = wxEVT_FIRST + 1026,
+ /* Help events */
+ wxEVT_HELP = wxEVT_FIRST + 1050,
+ wxEVT_DETAILED_HELP,
+
wxEVT_USER_FIRST = wxEVT_FIRST + 2000
};
#if defined(__WXDEBUG__) && defined(__WXMSW__)
// see comments in src/msw/dcclient.cpp where g_isPainting is defined
- extern int g_isPainting;
+ extern WXDLLEXPORT int g_isPainting;
#endif // debug
class WXDLLEXPORT wxPaintEvent : public wxEvent
wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); }
};
+// A help event is sent when the user clicks on a window in context-help mode.
+/*
+ wxEVT_HELP
+ wxEVT_DETAILED_HELP
+*/
+
+class WXDLLEXPORT wxHelpEvent : public wxCommandEvent
+{
+public:
+ wxHelpEvent(wxEventType type = wxEVT_NULL,
+ wxWindowID id = 0,
+ const wxPoint& pt = wxDefaultPosition)
+ {
+ m_eventType = type;
+ m_id = id;
+ m_pos = pt;
+ }
+
+ // Position of event (in screen coordinates)
+ const wxPoint& GetPosition() const { return m_pos; }
+ void SetPosition(const wxPoint& pos) { m_pos = pos; }
+
+ // Optional link to further help
+ const wxString& GetLink() const { return m_link; }
+ void SetLink(const wxString& link) { m_link = link; }
+
+ // Optional target to display help in. E.g. a window specification
+ const wxString& GetTarget() const { return m_target; }
+ void SetTarget(const wxString& target) { m_target = target; }
+
+protected:
+ wxPoint m_pos;
+ wxString m_target;
+ wxString m_link;
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxHelpEvent)
+};
+
#endif // wxUSE_GUI
// Idle event
wxObjectEventFunction func = NULL,
wxObject *userData = (wxObject *) NULL )
{ return Disconnect(id, -1, eventType, func, userData); }
-
+
// implementation from now on
virtual bool SearchEventTable(wxEventTable& table, wxEvent& event);
bool SearchDynamicEventTable( wxEvent& event );
typedef void (wxEvtHandler::*wxWindowDestroyEventFunction)(wxWindowDestroyEvent&);
typedef void (wxEvtHandler::*wxSetCursorEventFunction)(wxSetCursorEvent&);
typedef void (wxEvtHandler::*wxNotifyEventFunction)(wxNotifyEvent&);
+typedef void (wxEvtHandler::*wxHelpEventFunction)(wxHelpEvent&);
#endif // wxUSE_GUI
// N.B. In GNU-WIN32, you *have* to take the address of a member function
#define EVT_UPDATE_UI_RANGE(id1, id2, func) \
{ wxEVT_UPDATE_UI, id1, id2, (wxObjectEventFunction)(wxEventFunction)(wxUpdateUIEventFunction)&func, (wxObject *) NULL },
+// Help events
+#define EVT_HELP(id, func) \
+ { wxEVT_HELP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxHelpEventFunction) & func, (wxObject *) NULL },
+
+#define EVT_HELP_RANGE(id1, id2, func) \
+ { wxEVT_HELP, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxHelpEventFunction) & func, (wxObject *) NULL },
+
+#define EVT_DETAILED_HELP(id, func) \
+ { wxEVT_DETAILED_HELP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxHelpEventFunction) & func, (wxObject *) NULL },
+
+#define EVT_DETAILED_HELP_RANGE(id1, id2, func) \
+ { wxEVT_DETAILED_HELP, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxHelpEventFunction) & func, (wxObject *) NULL },
+
// ----------------------------------------------------------------------------
// Global data
// ----------------------------------------------------------------------------