X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5a0ed193cdad8f68b5c0db37329bb60c8e238847..8e7a3ecb9c1b9f5653e56301f51dfa39acca6bc6:/include/wx/vscroll.h diff --git a/include/wx/vscroll.h b/include/wx/vscroll.h index 84f7694df4..2312d78f0b 100644 --- a/include/wx/vscroll.h +++ b/include/wx/vscroll.h @@ -1,10 +1,9 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: include/wx/vscroll.h +// Name: wx/vscroll.h // Purpose: Variable scrolled windows (wx[V/H/HV]ScrolledWindow) // Author: Vadim Zeitlin // Modified by: Brad Anderson, Bryan Petty // Created: 30.05.03 -// RCS-ID: $Id$ // Copyright: (c) 2003 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -14,8 +13,9 @@ #include "wx/panel.h" #include "wx/position.h" +#include "wx/scrolwin.h" -class WXDLLEXPORT wxVarScrollHelperEvtHandler; +class WXDLLIMPEXP_FWD_CORE wxVarScrollHelperEvtHandler; // Using the same techniques as the wxScrolledWindow class | @@ -24,6 +24,11 @@ class WXDLLEXPORT wxVarScrollHelperEvtHandler; // scrolwin.h) for the purpose of reducing code duplication | // through the use of mix-in classes. | // | +// wxAnyScrollHelperBase | +// | | +// | | +// | | +// V | // wxVarScrollHelperBase | // / \ | // / \ | @@ -59,7 +64,7 @@ class WXDLLEXPORT wxVarScrollHelperEvtHandler; // required virtual functions that need to be implemented for any orientation // specific work. -class WXDLLEXPORT wxVarScrollHelperBase +class WXDLLIMPEXP_CORE wxVarScrollHelperBase : public wxAnyScrollHelperBase { public: // constructors and such @@ -115,10 +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)) { } // change the DC origin according to the scroll position. To properly // forward calls to wxWindow::Layout use WX_FORWARD_TO_SCROLL_HELPER() @@ -236,7 +237,7 @@ protected: #ifdef __WXMAC__ // queue mac window update after handling scroll event - virtual void UpdateMacScrollWindow() = 0; + virtual void UpdateMacScrollWindow() { } #endif // __WXMAC__ // change the target window @@ -257,12 +258,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; @@ -297,7 +292,7 @@ private: // Provides public API functions targeted for vertical-specific scrolling, // wrapping the functionality of wxVarScrollHelperBase. -class WXDLLEXPORT wxVarVScrollHelper : public wxVarScrollHelperBase +class WXDLLIMPEXP_CORE wxVarVScrollHelper : public wxVarScrollHelperBase { public: // constructors and such @@ -370,7 +365,7 @@ protected: // Provides public API functions targeted for horizontal-specific scrolling, // wrapping the functionality of wxVarScrollHelperBase. -class WXDLLEXPORT wxVarHScrollHelper : public wxVarScrollHelperBase +class WXDLLIMPEXP_CORE wxVarHScrollHelper : public wxVarScrollHelperBase { public: // constructors and such @@ -453,7 +448,7 @@ protected: // functions to make changing values for both orientations at the same time // easier. -class WXDLLEXPORT wxVarHVScrollHelper : public wxVarVScrollHelper, +class WXDLLIMPEXP_CORE wxVarHVScrollHelper : public wxVarVScrollHelper, public wxVarHScrollHelper { public: @@ -561,7 +556,7 @@ public: // in not only those classes, but also in wxHVScrolledWindow where functions // are inherited from both. -class WXDLLEXPORT wxVarVScrollLegacyAdaptor : public wxVarVScrollHelper +class WXDLLIMPEXP_CORE wxVarVScrollLegacyAdaptor : public wxVarVScrollHelper { public: // constructors and such @@ -576,68 +571,54 @@ public: // this is the same as GetVisibleRowsBegin(), exists to match // GetLastVisibleLine() and for backwards compatibility only - wxDEPRECATED( size_t GetFirstVisibleLine() const ) - { return GetVisibleRowsBegin(); } + wxDEPRECATED( size_t GetFirstVisibleLine() const ); // 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 - wxDEPRECATED( size_t GetLastVisibleLine() const ) - { return GetVisibleRowsEnd() - 1; } + wxDEPRECATED( size_t GetLastVisibleLine() const ); // "line" to "unit" compatibility functions // ---------------------------------------- // get the number of lines this window contains (set by SetLineCount()) - wxDEPRECATED( size_t GetLineCount() const ) - { return GetRowCount(); } + wxDEPRECATED( size_t GetLineCount() const ); // 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() - wxDEPRECATED( void SetLineCount(size_t count) ) - { SetRowCount(count); } + wxDEPRECATED( void SetLineCount(size_t count) ); // redraw the specified line - wxDEPRECATED( virtual void RefreshLine(size_t line) ) - { RefreshRow(line); } + wxDEPRECATED( virtual void RefreshLine(size_t line) ); // redraw all lines in the specified range (inclusive) - wxDEPRECATED( virtual void RefreshLines(size_t from, size_t to) ) - { RefreshRows(from, to); } + wxDEPRECATED( virtual void RefreshLines(size_t from, size_t 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 - wxDEPRECATED( bool ScrollToLine(size_t line) ) - { return ScrollToRow(line); } + wxDEPRECATED( bool ScrollToLine(size_t line) ); // scroll by the specified number of lines/pages - wxDEPRECATED( virtual bool ScrollLines(int lines) ) - { return ScrollRows(lines); } - wxDEPRECATED( virtual bool ScrollPages(int pages) ) - { return ScrollRowPages(pages); } + wxDEPRECATED( virtual bool ScrollLines(int lines) ); + wxDEPRECATED( virtual bool ScrollPages(int 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 wxDEPRECATED_BUT_USED_INTERNALLY( - virtual wxCoord OnGetLineHeight(size_t WXUNUSED(n)) const ) - { - wxFAIL_MSG( _T("OnGetLineHeight() must be overridden if OnGetRowHeight() isn't!") ); - return -1; - } + virtual wxCoord OnGetLineHeight(size_t n) const ); // forwards the calls from base class pure virtual function to pure virtual // OnGetLineHeight instead (backwards compatible name) // note that we don't need to forward OnGetUnitSize() as it is already // forwarded to OnGetRowHeight() in wxVarVScrollHelper - virtual wxCoord OnGetRowHeight(size_t n) const - { return OnGetLineHeight(n); } + virtual wxCoord OnGetRowHeight(size_t n) const; // this function doesn't have to be overridden but it may be useful to do // it if calculating the lines heights is a relatively expensive operation @@ -653,12 +634,11 @@ protected: // finally note that lineMin is inclusive, while lineMax is exclusive, as // usual 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 // OnGetLinesHint instead (backwards compatible name) - void OnGetRowsHeightHint(size_t rowMin, size_t rowMax) const - { OnGetLinesHint(rowMin, rowMax); } + void OnGetRowsHeightHint(size_t rowMin, size_t rowMax) const; }; #else // !WXWIN_COMPATIBILITY_2_8 @@ -695,7 +675,7 @@ public: \ // wxScrolledWindow features however, notably it can't scroll only a rectangle // of the window and not its entire client area. -class WXDLLEXPORT wxVScrolledWindow : public wxPanel, +class WXDLLIMPEXP_CORE wxVScrolledWindow : public wxPanel, public wxVarVScrollLegacyAdaptor { public: @@ -751,7 +731,7 @@ protected: #endif // __WXMAC__ private: - DECLARE_NO_COPY_CLASS(wxVScrolledWindow) + wxDECLARE_NO_COPY_CLASS(wxVScrolledWindow); DECLARE_ABSTRACT_CLASS(wxVScrolledWindow) }; @@ -771,7 +751,7 @@ private: // wxScrolledWindow features however, notably it can't scroll only a rectangle // of the window and not its entire client area. -class WXDLLEXPORT wxHScrolledWindow : public wxPanel, +class WXDLLIMPEXP_CORE wxHScrolledWindow : public wxPanel, public wxVarHScrollHelper { public: @@ -818,7 +798,7 @@ protected: #endif // __WXMAC__ private: - DECLARE_NO_COPY_CLASS(wxHScrolledWindow) + wxDECLARE_NO_COPY_CLASS(wxHScrolledWindow); DECLARE_ABSTRACT_CLASS(wxHScrolledWindow) }; @@ -832,7 +812,7 @@ private: // scrolled windows automatically handling everything needed to scroll both // axis simultaneously. -class WXDLLEXPORT wxHVScrolledWindow : public wxPanel, +class WXDLLIMPEXP_CORE wxHVScrolledWindow : public wxPanel, public wxVarHVScrollHelper { public: @@ -855,7 +835,7 @@ public: long style = 0, const wxString& name = wxPanelNameStr) : wxPanel(), - wxVarHVScrollHelper(this) + wxVarHVScrollHelper(this) { (void)Create(parent, id, pos, size, style, name); } @@ -883,7 +863,7 @@ protected: #endif // __WXMAC__ private: - DECLARE_NO_COPY_CLASS(wxHVScrolledWindow) + wxDECLARE_NO_COPY_CLASS(wxHVScrolledWindow); DECLARE_ABSTRACT_CLASS(wxHVScrolledWindow) };