X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e02c72fa45b840601743e11bc6550481a36fa437..b052a864e9d5270fd40f9ee6021133d2c3cd3173:/include/wx/vscroll.h?ds=sidebyside diff --git a/include/wx/vscroll.h b/include/wx/vscroll.h index 06437b0a14..4da294ce60 100644 --- a/include/wx/vscroll.h +++ b/include/wx/vscroll.h @@ -78,7 +78,7 @@ public: { m_physicalScrolling = scrolling; } // wxNOT_FOUND if none, i.e. if it is below the last item - virtual int HitTest(wxCoord coord) const; + int VirtualHitTest(wxCoord coord) const; // recalculate all our parameters and redisplay all units virtual void RefreshAll(); @@ -324,9 +324,6 @@ public: virtual void RefreshRows(size_t from, size_t to) { RefreshUnits(from, to); } - virtual int HitTest(wxCoord y) const - { return wxVarScrollHelperBase::HitTest(y); } - // accessors size_t GetRowCount() const { return GetUnitCount(); } @@ -351,7 +348,7 @@ protected: // forward calls to OnGetRowsHeightHint() virtual void OnGetUnitsSizeHint(size_t unitMin, size_t unitMax) const - { return OnGetRowsHeightHint(unitMin, unitMax); } + { OnGetRowsHeightHint(unitMin, unitMax); } // again, if not overridden, it will fall back on default method virtual wxCoord EstimateTotalHeight() const @@ -401,8 +398,6 @@ public: { RefreshUnit(column); } virtual void RefreshColumns(size_t from, size_t to) { RefreshUnits(from, to); } - virtual int HitTest(wxCoord x) const - { return wxVarScrollHelperBase::HitTest(x); } // accessors @@ -434,7 +429,7 @@ protected: // forward calls to OnGetColumnsWidthHint() virtual void OnGetUnitsSizeHint(size_t unitMin, size_t unitMax) const - { return OnGetColumnsWidthHint(unitMin, unitMax); } + { OnGetColumnsWidthHint(unitMin, unitMax); } // again, if not overridden, it will fall back on default method virtual wxCoord EstimateTotalWidth() const { return DoEstimateTotalSize(); } @@ -514,10 +509,10 @@ public: from.GetColumn(), to.GetColumn()); } - // Override wxPanel::HitTest to use our version - virtual wxPosition HitTest(wxCoord x, wxCoord y) const; - virtual wxPosition HitTest(const wxPoint &pos) const - { return HitTest(pos.x, pos.y); } + // locate the virtual position from the given device coordinates + wxPosition VirtualHitTest(wxCoord x, wxCoord y) const; + wxPosition VirtualHitTest(const wxPoint &pos) const + { return VirtualHitTest(pos.x, pos.y); } // change the DC origin according to the scroll position. To properly // forward calls to wxWindow::Layout use WX_FORWARD_TO_SCROLL_HELPER() @@ -618,9 +613,15 @@ public: virtual bool ScrollPages(int pages) { return ScrollRowPages(pages); } protected: + // unless the code has been updated to override OnGetRowHeight() instead, // this function must be overridden in the derived class and it should // return the height of the given row in pixels - virtual wxCoord OnGetLineHeight(size_t n) const = 0; + virtual wxCoord OnGetLineHeight(size_t WXUNUSED(n)) const + { + wxFAIL_MSG( _T("must be overridden if OnGetRowHeight() isn't!") ); + + return -1; + } // forwards the calls from base class pure virtual function to pure virtual // OnGetLineHeight instead (backwards compatible name) @@ -648,7 +649,7 @@ protected: // forwards the calls from base class pure virtual function to pure virtual // OnGetLinesHint instead (backwards compatible name) void OnGetRowsHeightHint(size_t rowMin, size_t rowMax) const - { return OnGetLinesHint(rowMin, rowMax); } + { OnGetLinesHint(rowMin, rowMax); } // get the total height of the lines between lineMin (inclusive) and @@ -730,11 +731,14 @@ public: return wxPanel::Create(parent, id, pos, size, style | wxVSCROLL, name); } +#if WXWIN_COMPATIBILITY_2_8 // Make sure we prefer our version of HitTest rather than wxWindow's + // These functions should no longer be masked in favor of VirtualHitTest() int HitTest(wxCoord WXUNUSED(x), wxCoord y) const - { return wxVarVScrollHelper::HitTest(y); } + { return wxVarVScrollHelper::VirtualHitTest(y); } int HitTest(const wxPoint& pt) const { return HitTest(pt.x, pt.y); } +#endif // WXWIN_COMPATIBILITY_2_8 WX_FORWARD_TO_VAR_SCROLL_HELPER() @@ -803,12 +807,6 @@ public: return wxPanel::Create(parent, id, pos, size, style | wxHSCROLL, name); } - // Make sure we prefer our version of HitTest rather than wxWindow's - int HitTest(wxCoord x, wxCoord WXUNUSED(y)) const - { return wxVarHScrollHelper::HitTest(x); } - int HitTest(const wxPoint& pt) const - { return HitTest(pt.x, pt.y); } - WX_FORWARD_TO_VAR_SCROLL_HELPER() #ifdef __WXMAC__ @@ -874,12 +872,6 @@ public: style | wxVSCROLL | wxHSCROLL, name); } - // Make sure we prefer our version of HitTest rather than wxWindow's - wxPosition HitTest(wxCoord x, wxCoord y) const - { return wxVarHVScrollHelper::HitTest(x, y); } - wxPosition HitTest(const wxPoint &pt) const - { return HitTest(pt.x, pt.y); } - WX_FORWARD_TO_VAR_SCROLL_HELPER() #ifdef __WXMAC__