X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6236b8b477e113922c63db0c1413150bb1986ebf..a721fd82b7ca8c97048453d4aaff559e8f741d69:/include/wx/univ/scrolbar.h?ds=sidebyside diff --git a/include/wx/univ/scrolbar.h b/include/wx/univ/scrolbar.h index b686eab5c0..dd59432a36 100644 --- a/include/wx/univ/scrolbar.h +++ b/include/wx/univ/scrolbar.h @@ -12,7 +12,7 @@ #ifndef _WX_UNIV_SCROLBAR_H_ #define _WX_UNIV_SCROLBAR_H_ -class WXDLLEXPORT wxScrollTimer; +class WXDLLIMPEXP_FWD_CORE wxScrollTimer; #include "wx/univ/scrarrow.h" #include "wx/renderer.h" @@ -38,7 +38,7 @@ class WXDLLEXPORT wxScrollTimer; // wxScrollBar // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxScrollBar : public wxScrollBarBase, +class WXDLLIMPEXP_CORE wxScrollBar : public wxScrollBarBase, public wxControlWithArrows { public: @@ -121,6 +121,9 @@ public: // for wxControlRenderer::DrawScrollbar() only const wxScrollArrows& GetArrows() const { return m_arrows; } + // returns one of wxHT_SCROLLBAR_XXX constants + wxHitTest HitTestBar(const wxPoint& pt) const; + // idle processing virtual void OnInternalIdle(); @@ -141,6 +144,30 @@ protected: // is this scrollbar attached to a window or a standalone control? bool IsStandalone() const; + // scrollbar geometry methods: + + // gets the bounding box for a scrollbar element for the given (by default + // - current) thumb position + wxRect GetScrollbarRect(wxScrollBar::Element elem, int thumbPos = -1) const; + + // returns the size of the scrollbar shaft excluding the arrows + wxCoord GetScrollbarSize() const; + + // translate the scrollbar position (in logical units) into physical + // coordinate (in pixels) and the other way round + wxCoord ScrollbarToPixel(int thumbPos = -1); + int PixelToScrollbar(wxCoord coord); + + // return the starting and ending positions, in pixels, of the thumb of a + // scrollbar with the given logical position, thumb size and range and the + // given physical length + static void GetScrollBarThumbSize(wxCoord length, + int thumbPos, + int thumbSize, + int range, + wxCoord *thumbStart, + wxCoord *thumbEnd); + private: // total range of the scrollbar in logical units int m_range; @@ -165,6 +192,9 @@ private: // the object handling the arrows wxScrollArrows m_arrows; + friend WXDLLIMPEXP_CORE class wxControlRenderer; // for geometry methods + friend class wxStdScrollBarInputHandler; // for geometry methods + DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxScrollBar) }; @@ -173,7 +203,7 @@ private: // Standard scrollbar input handler which can be used as a base class // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxStdScrollBarInputHandler : public wxStdInputHandler +class WXDLLIMPEXP_CORE wxStdScrollBarInputHandler : public wxStdInputHandler { public: // constructor takes a renderer (used for scrollbar hit testing) and the