X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e6feb95a79834836e88143b15d9f424ebe79621..c2193ac9115470a4ecbc6844bbe19734a8c636ad:/include/wx/univ/inphand.h diff --git a/include/wx/univ/inphand.h b/include/wx/univ/inphand.h index 48a630d510..fd36787fe8 100644 --- a/include/wx/univ/inphand.h +++ b/include/wx/univ/inphand.h @@ -6,18 +6,14 @@ // Modified by: // Created: 18.08.00 // RCS-ID: $Id$ -// Copyright: (c) 2000 Vadim Zeitlin -// Licence: wxWindows license +// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_UNIV_INPHAND_H_ #define _WX_UNIV_INPHAND_H_ -#ifdef __GNUG__ - #pragma interface "inphand.h" -#endif - -#include "wx/control.h" // for wxControlAction(s) +#include "wx/univ/inpcons.h" // for wxControlAction(s) // ---------------------------------------------------------------------------- // types of the standard input handlers which can be passed to @@ -35,42 +31,45 @@ #define wxINP_HANDLER_SCROLLBAR _T("scrollbar") #define wxINP_HANDLER_SLIDER _T("slider") #define wxINP_HANDLER_SPINBTN _T("spinbtn") +#define wxINP_HANDLER_STATUSBAR _T("statusbar") #define wxINP_HANDLER_TEXTCTRL _T("textctrl") +#define wxINP_HANDLER_TOOLBAR _T("toolbar") +#define wxINP_HANDLER_TOPLEVEL _T("toplevel") // ---------------------------------------------------------------------------- // wxInputHandler: maps the events to the actions // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxInputHandler +class WXDLLIMPEXP_CORE wxInputHandler : public wxObject { public: - // map a keyboard event to one or more actions (pressed == TRUE if the key - // was pressed, FALSE if released), returns TRUE if something was done - virtual bool HandleKey(wxControl *control, + // map a keyboard event to one or more actions (pressed == true if the key + // was pressed, false if released), returns true if something was done + virtual bool HandleKey(wxInputConsumer *consumer, const wxKeyEvent& event, bool pressed) = 0; // map a mouse (click) event to one or more actions - virtual bool HandleMouse(wxControl *control, + virtual bool HandleMouse(wxInputConsumer *consumer, const wxMouseEvent& event) = 0; // handle mouse movement (or enter/leave) event: it is separated from // HandleMouse() for convenience as many controls don't care about mouse // movements at all - virtual bool HandleMouseMove(wxControl *control, + virtual bool HandleMouseMove(wxInputConsumer *consumer, const wxMouseEvent& event); // do something with focus set/kill event: this is different from // HandleMouseMove() as the mouse maybe over the control without it having // focus // - // return TRUE to refresh the control, FALSE otherwise - virtual bool HandleFocus(wxControl *control, const wxFocusEvent& event); + // return true to refresh the control, false otherwise + virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event); // react to the app getting/losing activation // - // return TRUE to refresh the control, FALSE otherwise - virtual bool HandleActivation(wxControl *control, bool activated); + // return true to refresh the control, false otherwise + virtual bool HandleActivation(wxInputConsumer *consumer, bool activated); // virtual dtor for any base class virtual ~wxInputHandler(); @@ -81,33 +80,33 @@ public: // and also provides the way to chain input handlers together // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxStdInputHandler : public wxInputHandler +class WXDLLIMPEXP_CORE wxStdInputHandler : public wxInputHandler { public: wxStdInputHandler(wxInputHandler *handler) : m_handler(handler) { } - virtual bool HandleKey(wxControl *control, + virtual bool HandleKey(wxInputConsumer *consumer, const wxKeyEvent& event, bool pressed) { - return m_handler ? m_handler->HandleKey(control, event, pressed) - : FALSE; + return m_handler ? m_handler->HandleKey(consumer, event, pressed) + : false; } - virtual bool HandleMouse(wxControl *control, + virtual bool HandleMouse(wxInputConsumer *consumer, const wxMouseEvent& event) { - return m_handler ? m_handler->HandleMouse(control, event) : FALSE; + return m_handler ? m_handler->HandleMouse(consumer, event) : false; } - virtual bool HandleMouseMove(wxControl *control, const wxMouseEvent& event) + virtual bool HandleMouseMove(wxInputConsumer *consumer, const wxMouseEvent& event) { - return m_handler ? m_handler->HandleMouseMove(control, event) : FALSE; + return m_handler ? m_handler->HandleMouseMove(consumer, event) : false; } - virtual bool HandleFocus(wxControl *control, const wxFocusEvent& event) + virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event) { - return m_handler ? m_handler->HandleFocus(control, event) : FALSE; + return m_handler ? m_handler->HandleFocus(consumer, event) : false; } private: