X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/370efbe74165c03642ea7620d35d9e0be8572d74..7f8bd9fc5ff34562a7e5c411d95cef99582f7aab:/src/univ/toolbar.cpp diff --git a/src/univ/toolbar.cpp b/src/univ/toolbar.cpp index bdd436fc04..0ab62234b0 100644 --- a/src/univ/toolbar.cpp +++ b/src/univ/toolbar.cpp @@ -35,11 +35,35 @@ #include "wx/log.h" #include "wx/frame.h" #include "wx/dc.h" + #include "wx/image.h" #endif #include "wx/univ/renderer.h" -#include "wx/image.h" +// ---------------------------------------------------------------------------- +// wxStdToolbarInputHandler: translates SPACE and ENTER keys and the left mouse +// click into button press/release actions +// ---------------------------------------------------------------------------- + +class WXDLLEXPORT wxStdToolbarInputHandler : public wxStdInputHandler +{ +public: + wxStdToolbarInputHandler(wxInputHandler *inphand); + + virtual bool HandleKey(wxInputConsumer *consumer, + const wxKeyEvent& event, + bool pressed); + virtual bool HandleMouse(wxInputConsumer *consumer, + const wxMouseEvent& event); + virtual bool HandleMouseMove(wxInputConsumer *consumer, const wxMouseEvent& event); + virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event); + virtual bool HandleActivation(wxInputConsumer *consumer, bool activated); + +private: + wxWindow *m_winCapture; + wxToolBarToolBase *m_toolCapture; + wxToolBarToolBase *m_toolLast; +}; // ---------------------------------------------------------------------------- // constants @@ -819,6 +843,14 @@ bool wxToolBar::PerformAction(const wxControlAction& action, return true; } +/* static */ +wxInputHandler *wxToolBar::GetStdInputHandler(wxInputHandler *handlerDef) +{ + static wxStdToolbarInputHandler s_handler(handlerDef); + + return &s_handler; +} + // ============================================================================ // wxStdToolbarInputHandler implementation // ============================================================================