Add wxAnyScrollHelperBase to reduce code duplication in wxVarScrollHelperBase.

This is just a small refactoring to move some trivially common parts of
wxScrollHelperBase and wxVarScrollHelperBase in a new common base class.
This will make it possible to apply other corrections to wxVarScrollHelperBase
without having to physically duplicate the code from wxScrollHelperBase in it.

See #15357.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74813 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-09-15 00:15:07 +00:00
parent e91e1e3d5c
commit 010d821b31
4 changed files with 45 additions and 34 deletions

View File

@@ -13,6 +13,7 @@
#include "wx/panel.h"
#include "wx/position.h"
#include "wx/scrolwin.h"
class WXDLLIMPEXP_FWD_CORE wxVarScrollHelperEvtHandler;
@@ -23,6 +24,11 @@ class WXDLLIMPEXP_FWD_CORE wxVarScrollHelperEvtHandler;
// scrolwin.h) for the purpose of reducing code duplication |
// through the use of mix-in classes. |
// |
// wxAnyScrollHelperBase |
// | |
// | |
// | |
// V |
// wxVarScrollHelperBase |
// / \ |
// / \ |
@@ -58,7 +64,7 @@ class WXDLLIMPEXP_FWD_CORE wxVarScrollHelperEvtHandler;
// required virtual functions that need to be implemented for any orientation
// specific work.
class WXDLLIMPEXP_CORE wxVarScrollHelperBase
class WXDLLIMPEXP_CORE wxVarScrollHelperBase : public wxAnyScrollHelperBase
{
public:
// constructors and such
@@ -114,7 +120,6 @@ public:
// child of it in order to scroll only a portion the area between the
// scrollbars (spreadsheet: only cell area will move).
virtual void SetTargetWindow(wxWindow *target);
virtual wxWindow *GetTargetWindow() const { return m_targetWindow; }
// Override this function to draw the graphic (or just process EVT_PAINT)
//virtual void OnDraw(wxDC& WXUNUSED(dc)) { }
@@ -256,12 +261,6 @@ protected:
void IncOrient(wxCoord& x, wxCoord& y, wxCoord inc);
private:
// the window that receives the scroll events and the window to actually
// scroll, respectively
wxWindow *m_win,
*m_targetWindow;
// the total number of (logical) units
size_t m_unitMax;