X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/16361ec94128d2cea3a08c2c84a4eb38232715d6..3896f1cc5fa8b6ab3def7deac861bfdbfdb4df96:/include/wx/scrolwin.h diff --git a/include/wx/scrolwin.h b/include/wx/scrolwin.h index 62ccdb04b1..0ba4976501 100644 --- a/include/wx/scrolwin.h +++ b/include/wx/scrolwin.h @@ -208,6 +208,33 @@ protected: // in wxScrollHelperEvtHandler::ProcessEvent() void ResetDrawnFlag(); + // helper of AdjustScrollbars(): does the work for the single scrollbar + // + // notice that the parameters passed by non-const references are modified + // by this function + void AdjustScrollbar(int orient, + int clientSize, + int virtSize, + int& pixelsPerUnit, + int& scrollUnits, + int& scrollPosition); + + // this function should be overridden to return the size available for + // m_targetWindow inside m_win of the given size + // + // the default implementation is only good for m_targetWindow == m_win + // case, if we're scrolling a subwindow you must override this method + virtual wxSize GetSizeAvailableForScrollTarget(const wxSize& size) + { + // returning just size from here is wrong but it was decided that it is + // not wrong enough to break the existing code (which doesn't override + // this recently added function at all) by adding this assert + // + // wxASSERT_MSG( m_targetWindow == m_win, "must be overridden" ); + + return size; + } + double m_scaleX; double m_scaleY; @@ -237,6 +264,7 @@ protected: wxScrollHelperEvtHandler *m_handler; + DECLARE_NO_COPY_CLASS(wxScrollHelper) }; @@ -271,7 +299,7 @@ struct WXDLLIMPEXP_CORE wxScrolledT_Helper const wxScrollHelperNative *helper, const wxSize& origBest); #ifdef __WXMSW__ - static WXLRESULT FilterMSWWindowProc(WXLRESULT origResult); + static WXLRESULT FilterMSWWindowProc(WXUINT nMsg, WXLRESULT origResult); #endif }; @@ -306,7 +334,7 @@ public: m_targetWindow = this; #ifdef __WXMAC__ - MacSetClipChildren(true); + this->MacSetClipChildren(true); #endif this->Connect(wxEVT_PAINT, wxPaintEventHandler(wxScrolled::OnPaint)); @@ -325,7 +353,7 @@ public: #ifdef __WXMSW__ virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) { - return FilterMSWWindowProc(T::MSWWindowProc(nMsg, wParam, lParam)); + return FilterMSWWindowProc(nMsg, T::MSWWindowProc(nMsg, wParam, lParam)); } #endif // __WXMSW__ @@ -348,7 +376,11 @@ private: event.Skip(); } + // VC++ 6 gives warning for the declaration of template member function + // without definition +#if !defined(__VISUALC__) || wxCHECK_VISUALC_VERSION(7) DECLARE_NO_COPY_CLASS(wxScrolled) +#endif }; // VC++ <= 6 requires this; it's unlikely any other specializations would