make Scroll() itself virtual too as existing code might override it (but new code should override DoScroll() only); use the same access in the derived classes as in wxScrollHelperBase
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57538 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -23,11 +23,12 @@ public:
|
|||||||
// implement base class pure virtuals
|
// implement base class pure virtuals
|
||||||
virtual void AdjustScrollbars();
|
virtual void AdjustScrollbars();
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
virtual void DoScroll(int x, int y);
|
virtual void DoScroll(int x, int y);
|
||||||
virtual void DoShowScrollbars(wxScrollbarVisibility horz,
|
virtual void DoShowScrollbars(wxScrollbarVisibility horz,
|
||||||
wxScrollbarVisibility vert);
|
wxScrollbarVisibility vert);
|
||||||
|
|
||||||
|
private:
|
||||||
// helper of AdjustScrollbars(): does the work for the single scrollbar
|
// helper of AdjustScrollbars(): does the work for the single scrollbar
|
||||||
//
|
//
|
||||||
// notice that the parameters passed by non-const references are modified
|
// notice that the parameters passed by non-const references are modified
|
||||||
|
@@ -22,6 +22,7 @@ public:
|
|||||||
// default ctor doesn't do anything
|
// default ctor doesn't do anything
|
||||||
wxScrollHelper(wxWindow *win) : wxScrollHelperBase(win) { }
|
wxScrollHelper(wxWindow *win) : wxScrollHelperBase(win) { }
|
||||||
|
|
||||||
|
// implement the base class methods
|
||||||
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
|
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
|
||||||
int noUnitsX, int noUnitsY,
|
int noUnitsX, int noUnitsY,
|
||||||
int xPos = 0, int yPos = 0,
|
int xPos = 0, int yPos = 0,
|
||||||
@@ -29,6 +30,11 @@ public:
|
|||||||
virtual void AdjustScrollbars();
|
virtual void AdjustScrollbars();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void DoScroll(int x, int y);
|
||||||
|
virtual void DoShowScrollbars(wxScrollbarVisibility horz,
|
||||||
|
wxScrollbarVisibility vert);
|
||||||
|
|
||||||
|
private:
|
||||||
// this does (each) half of AdjustScrollbars() work
|
// this does (each) half of AdjustScrollbars() work
|
||||||
void DoAdjustScrollbar(GtkRange* range,
|
void DoAdjustScrollbar(GtkRange* range,
|
||||||
int pixelsPerLine,
|
int pixelsPerLine,
|
||||||
@@ -64,11 +70,6 @@ protected:
|
|||||||
int pixelsPerLine,
|
int pixelsPerLine,
|
||||||
int *posOld);
|
int *posOld);
|
||||||
|
|
||||||
// implement the base class methods
|
|
||||||
virtual void DoScroll(int x, int y);
|
|
||||||
virtual void DoShowScrollbars(wxScrollbarVisibility horz,
|
|
||||||
wxScrollbarVisibility vert);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_NO_COPY_CLASS(wxScrollHelper)
|
DECLARE_NO_COPY_CLASS(wxScrollHelper)
|
||||||
};
|
};
|
||||||
|
@@ -70,8 +70,12 @@ public:
|
|||||||
bool noRefresh = false );
|
bool noRefresh = false );
|
||||||
|
|
||||||
// scroll to the given (in logical coords) position
|
// scroll to the given (in logical coords) position
|
||||||
void Scroll(int x, int y) { DoScroll(x, y); }
|
//
|
||||||
void Scroll(const wxPoint& pt) { DoScroll(pt.x, pt.y); }
|
// notice that for backwards compatibility reasons Scroll() is virtual as
|
||||||
|
// the existing code could override it but new code should override
|
||||||
|
// DoScroll() instead
|
||||||
|
virtual void Scroll(int x, int y) { DoScroll(x, y); }
|
||||||
|
virtual void Scroll(const wxPoint& pt) { DoScroll(pt.x, pt.y); }
|
||||||
|
|
||||||
// get/set the page size for this orientation (wxVERTICAL/wxHORIZONTAL)
|
// get/set the page size for this orientation (wxVERTICAL/wxHORIZONTAL)
|
||||||
int GetScrollPageSize(int orient) const;
|
int GetScrollPageSize(int orient) const;
|
||||||
|
Reference in New Issue
Block a user