]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/notebook.cpp
Fix scrolling bug where client size was reported wrong
[wxWidgets.git] / src / univ / notebook.cpp
index 237b4b73e25b1d687b823f0303faa0d1a5b50ba8..be60137093c8c447e18bf5325cf3c91447ee72b2 100644 (file)
 
 #include "wx/univ/renderer.h"
 
 
 #include "wx/univ/renderer.h"
 
+// ----------------------------------------------------------------------------
+// wxStdNotebookInputHandler: translates SPACE and ENTER keys and the left mouse
+// click into button press/release actions
+// ----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxStdNotebookInputHandler : public wxStdInputHandler
+{
+public:
+    wxStdNotebookInputHandler(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);
+
+protected:
+    void HandleFocusChange(wxInputConsumer *consumer);
+};
+
 // ----------------------------------------------------------------------------
 // macros
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // macros
 // ----------------------------------------------------------------------------
@@ -1319,6 +1342,14 @@ bool wxNotebook::PerformAction(const wxControlAction& action,
     return true;
 }
 
     return true;
 }
 
+/* static */
+wxInputHandler *wxNotebook::GetStdInputHandler(wxInputHandler *handlerDef)
+{
+    static wxStdNotebookInputHandler s_handler(handlerDef);
+
+    return &s_handler;
+}
+
 // ----------------------------------------------------------------------------
 // wxStdNotebookInputHandler
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // wxStdNotebookInputHandler
 // ----------------------------------------------------------------------------