X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32a2c06eeded8b7e9b56e59189c29458211ec5ee..d23bf09c7fbbe4f026d61043e55c81cfc4a6bef2:/include/wx/vscroll.h diff --git a/include/wx/vscroll.h b/include/wx/vscroll.h index f5b0a2fc5b..84f7694df4 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() @@ -581,50 +576,59 @@ public: // this is the same as GetVisibleRowsBegin(), exists to match // GetLastVisibleLine() and for backwards compatibility only - size_t GetFirstVisibleLine() const { return GetVisibleRowsBegin(); } + wxDEPRECATED( size_t GetFirstVisibleLine() const ) + { return GetVisibleRowsBegin(); } // get the last currently visible line // // this function is unsafe as it returns (size_t)-1 (i.e. a huge positive // number) if the control is empty, use GetVisibleRowsEnd() instead, this // one is kept for backwards compatibility - size_t GetLastVisibleLine() const { return GetVisibleRowsEnd() - 1; } + wxDEPRECATED( size_t GetLastVisibleLine() const ) + { return GetVisibleRowsEnd() - 1; } // "line" to "unit" compatibility functions // ---------------------------------------- // get the number of lines this window contains (set by SetLineCount()) - size_t GetLineCount() const { return GetRowCount(); } + wxDEPRECATED( size_t GetLineCount() const ) + { return GetRowCount(); } // set the number of lines the helper contains: the derived class must // provide the sizes for all lines with indices up to the one given here // in its OnGetLineHeight() - void SetLineCount(size_t count) { SetRowCount(count); } + wxDEPRECATED( void SetLineCount(size_t count) ) + { SetRowCount(count); } // redraw the specified line - virtual void RefreshLine(size_t line) { RefreshRow(line); } + wxDEPRECATED( virtual void RefreshLine(size_t line) ) + { RefreshRow(line); } // redraw all lines in the specified range (inclusive) - virtual void RefreshLines(size_t from, size_t to) { RefreshRows(from, to); } + wxDEPRECATED( virtual void RefreshLines(size_t from, size_t to) ) + { RefreshRows(from, to); } // scroll to the specified line: it will become the first visible line in // the window // // return true if we scrolled the window, false if nothing was done - bool ScrollToLine(size_t line) { return ScrollToRow(line); } + wxDEPRECATED( bool ScrollToLine(size_t line) ) + { return ScrollToRow(line); } // scroll by the specified number of lines/pages - virtual bool ScrollLines(int lines) { return ScrollRows(lines); } - virtual bool ScrollPages(int pages) { return ScrollRowPages(pages); } + wxDEPRECATED( virtual bool ScrollLines(int lines) ) + { return ScrollRows(lines); } + wxDEPRECATED( 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 WXUNUSED(n)) const + wxDEPRECATED_BUT_USED_INTERNALLY( + virtual wxCoord OnGetLineHeight(size_t WXUNUSED(n)) const ) { - wxFAIL_MSG( _T("must be overridden if OnGetRowHeight() isn't!") ); - + wxFAIL_MSG( _T("OnGetLineHeight() must be overridden if OnGetRowHeight() isn't!") ); return -1; } @@ -648,19 +652,13 @@ protected: // // finally note that lineMin is inclusive, while lineMax is exclusive, as // usual - virtual void OnGetLinesHint(size_t WXUNUSED(lineMin), - size_t WXUNUSED(lineMax)) const { } + wxDEPRECATED_BUT_USED_INTERNALLY( virtual void OnGetLinesHint( + size_t WXUNUSED(lineMin), size_t WXUNUSED(lineMax)) const ) { } // 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); } - - - // get the total height of the lines between lineMin (inclusive) and - // lineMax (exclusive) - wxCoord GetLinesHeight(size_t lineMin, size_t lineMax) const - { return GetRowsHeight(lineMin, lineMax); } + { OnGetLinesHint(rowMin, rowMax); } }; #else // !WXWIN_COMPATIBILITY_2_8 @@ -736,11 +734,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() @@ -809,12 +810,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__ @@ -880,12 +875,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__