X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dc2513650dce762388f5469360cbb0ac84dcc2d0..d2740de55efc52e8dc9270c0e17db921a379a049:/include/wx/scrolwin.h diff --git a/include/wx/scrolwin.h b/include/wx/scrolwin.h index 3ea03fcc60..d270554f8e 100644 --- a/include/wx/scrolwin.h +++ b/include/wx/scrolwin.h @@ -66,6 +66,17 @@ class WXDLLIMPEXP_CORE wxAnyScrollHelperBase public: wxEXPLICIT wxAnyScrollHelperBase(wxWindow* win); + // Disable use of keyboard keys for scrolling. By default cursor movement + // keys (including Home, End, Page Up and Down) are used to scroll the + // window appropriately. If the derived class uses these keys for something + // else, e.g. changing the currently selected item, this function can be + // used to disable this behaviour as it's not only not necessary then but + // can actually be actively harmful if another object forwards a keyboard + // event corresponding to one of the above keys to us using + // ProcessWindowEvent() because the event will always be processed which + // can be undesirable. + void DisableKeyboardScrolling() { m_kbdScrollingEnabled = false; } + // Override this function to draw the graphic (or just process EVT_PAINT) virtual void OnDraw(wxDC& WXUNUSED(dc)) { } @@ -77,6 +88,7 @@ public: // The methods called from the window event handlers. + void HandleOnChar(wxKeyEvent& event); void HandleOnPaint(wxPaintEvent& event); protected: @@ -84,6 +96,9 @@ protected: // scroll, respectively wxWindow *m_win, *m_targetWindow; + + // whether cursor keys should scroll the window + bool m_kbdScrollingEnabled; }; // This is the class containing the guts of (uniform) scrolling logic. @@ -146,17 +161,6 @@ public: // which it is implemented to not use wxWindow::ScrollWindow(). virtual void EnableScrolling(bool x_scrolling, bool y_scrolling); - // Disable use of keyboard keys for scrolling. By default cursor movement - // keys (including Home, End, Page Up and Down) are used to scroll the - // window appropriately. If the derived class uses these keys for something - // else, e.g. changing the currently selected item, this function can be - // used to disable this behaviour as it's not only not necessary then but - // can actually be actively harmful if another object forwards a keyboard - // event corresponding to one of the above keys to us using - // ProcessWindowEvent() because the event will always be processed which - // can be undesirable. - void DisableKeyboardScrolling() { m_kbdScrollingEnabled = false; } - // Get the view start void GetViewStart(int *x, int *y) const { DoGetViewStart(x, y); } @@ -228,7 +232,6 @@ public: // the methods to be called from the window event handlers void HandleOnScroll(wxScrollWinEvent& event); void HandleOnSize(wxSizeEvent& event); - void HandleOnChar(wxKeyEvent& event); void HandleOnMouseEnter(wxMouseEvent& event); void HandleOnMouseLeave(wxMouseEvent& event); #if wxUSE_MOUSEWHEEL @@ -324,8 +327,6 @@ protected: bool m_xScrollingEnabled; bool m_yScrollingEnabled; - bool m_kbdScrollingEnabled; - #if wxUSE_MOUSEWHEEL int m_wheelRotation; #endif // wxUSE_MOUSEWHEEL