GCC doesn't like inline wxDEPRECATED methods.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2007-07-07 14:09:22 +00:00
parent 17a691c1ef
commit 9bb3f212e2
2 changed files with 55 additions and 24 deletions

View File

@@ -576,61 +576,48 @@ public:
// this is the same as GetVisibleRowsBegin(), exists to match // this is the same as GetVisibleRowsBegin(), exists to match
// GetLastVisibleLine() and for backwards compatibility only // GetLastVisibleLine() and for backwards compatibility only
wxDEPRECATED( size_t GetFirstVisibleLine() const ) wxDEPRECATED( size_t GetFirstVisibleLine() const );
{ return GetVisibleRowsBegin(); }
// get the last currently visible line // get the last currently visible line
// //
// this function is unsafe as it returns (size_t)-1 (i.e. a huge positive // 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 // number) if the control is empty, use GetVisibleRowsEnd() instead, this
// one is kept for backwards compatibility // one is kept for backwards compatibility
wxDEPRECATED( size_t GetLastVisibleLine() const ) wxDEPRECATED( size_t GetLastVisibleLine() const );
{ return GetVisibleRowsEnd() - 1; }
// "line" to "unit" compatibility functions // "line" to "unit" compatibility functions
// ---------------------------------------- // ----------------------------------------
// get the number of lines this window contains (set by SetLineCount()) // get the number of lines this window contains (set by SetLineCount())
wxDEPRECATED( size_t GetLineCount() const ) wxDEPRECATED( size_t GetLineCount() const );
{ return GetRowCount(); }
// set the number of lines the helper contains: the derived class must // 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 // provide the sizes for all lines with indices up to the one given here
// in its OnGetLineHeight() // in its OnGetLineHeight()
wxDEPRECATED( void SetLineCount(size_t count) ) wxDEPRECATED( void SetLineCount(size_t count) );
{ SetRowCount(count); }
// redraw the specified line // redraw the specified line
wxDEPRECATED( virtual void RefreshLine(size_t line) ) wxDEPRECATED( virtual void RefreshLine(size_t line) );
{ RefreshRow(line); }
// redraw all lines in the specified range (inclusive) // redraw all lines in the specified range (inclusive)
wxDEPRECATED( virtual void RefreshLines(size_t from, size_t 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 // scroll to the specified line: it will become the first visible line in
// the window // the window
// //
// return true if we scrolled the window, false if nothing was done // return true if we scrolled the window, false if nothing was done
wxDEPRECATED( bool ScrollToLine(size_t line) ) wxDEPRECATED( bool ScrollToLine(size_t line) );
{ return ScrollToRow(line); }
// scroll by the specified number of lines/pages // scroll by the specified number of lines/pages
wxDEPRECATED( virtual bool ScrollLines(int lines) ) wxDEPRECATED( virtual bool ScrollLines(int lines) );
{ return ScrollRows(lines); } wxDEPRECATED( virtual bool ScrollPages(int pages) );
wxDEPRECATED( virtual bool ScrollPages(int pages) )
{ return ScrollRowPages(pages); }
protected: protected:
// unless the code has been updated to override OnGetRowHeight() instead, // unless the code has been updated to override OnGetRowHeight() instead,
// this function must be overridden in the derived class and it should // this function must be overridden in the derived class and it should
// return the height of the given row in pixels // return the height of the given row in pixels
wxDEPRECATED_BUT_USED_INTERNALLY( wxDEPRECATED_BUT_USED_INTERNALLY(
virtual wxCoord OnGetLineHeight(size_t WXUNUSED(n)) const ) virtual wxCoord OnGetLineHeight(size_t n) const );
{
wxFAIL_MSG( _T("OnGetLineHeight() must be overridden if OnGetRowHeight() isn't!") );
return -1;
}
// forwards the calls from base class pure virtual function to pure virtual // forwards the calls from base class pure virtual function to pure virtual
// OnGetLineHeight instead (backwards compatible name) // OnGetLineHeight instead (backwards compatible name)
@@ -653,7 +640,7 @@ protected:
// finally note that lineMin is inclusive, while lineMax is exclusive, as // finally note that lineMin is inclusive, while lineMax is exclusive, as
// usual // usual
wxDEPRECATED_BUT_USED_INTERNALLY( virtual void OnGetLinesHint( wxDEPRECATED_BUT_USED_INTERNALLY( virtual void OnGetLinesHint(
size_t WXUNUSED(lineMin), size_t WXUNUSED(lineMax)) const ) { } size_t lineMin, size_t lineMax) const );
// forwards the calls from base class pure virtual function to pure virtual // forwards the calls from base class pure virtual function to pure virtual
// OnGetLinesHint instead (backwards compatible name) // OnGetLinesHint instead (backwards compatible name)

View File

@@ -923,3 +923,47 @@ IMPLEMENT_ABSTRACT_CLASS(wxVScrolledWindow, wxPanel)
IMPLEMENT_ABSTRACT_CLASS(wxHScrolledWindow, wxPanel) IMPLEMENT_ABSTRACT_CLASS(wxHScrolledWindow, wxPanel)
IMPLEMENT_ABSTRACT_CLASS(wxHVScrolledWindow, wxPanel) IMPLEMENT_ABSTRACT_CLASS(wxHVScrolledWindow, wxPanel)
#if WXWIN_COMPATIBILITY_2_8
// ===========================================================================
// wxVarVScrollLegacyAdaptor
// ===========================================================================
size_t wxVarVScrollLegacyAdaptor::GetFirstVisibleLine() const
{ return GetVisibleRowsBegin(); }
size_t wxVarVScrollLegacyAdaptor::GetLastVisibleLine() const
{ return GetVisibleRowsEnd() - 1; }
size_t wxVarVScrollLegacyAdaptor::GetLineCount() const
{ return GetRowCount(); }
void wxVarVScrollLegacyAdaptor::SetLineCount(size_t count)
{ SetRowCount(count); }
void wxVarVScrollLegacyAdaptor::RefreshLine(size_t line)
{ RefreshRow(line); }
void wxVarVScrollLegacyAdaptor::RefreshLines(size_t from, size_t to)
{ RefreshRows(from, to); }
bool wxVarVScrollLegacyAdaptor::ScrollToLine(size_t line)
{ return ScrollToRow(line); }
bool wxVarVScrollLegacyAdaptor::ScrollLines(int lines)
{ return ScrollRows(lines); }
bool wxVarVScrollLegacyAdaptor::ScrollPages(int pages)
{ return ScrollRowPages(pages); }
wxCoord wxVarVScrollLegacyAdaptor::OnGetLineHeight(size_t WXUNUSED(n)) const
{
wxFAIL_MSG( _T("OnGetLineHeight() must be overridden if OnGetRowHeight() isn't!") );
return -1;
}
void wxVarVScrollLegacyAdaptor::OnGetLinesHint( size_t WXUNUSED(lineMin), size_t WXUNUSED(lineMax)) const
{ }
#endif