X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6236b8b477e113922c63db0c1413150bb1986ebf..3b49331b7441e091fc5997b830801d76a1243f28:/include/wx/univ/scrolbar.h diff --git a/include/wx/univ/scrolbar.h b/include/wx/univ/scrolbar.h index b686eab5c0..a11cef70fe 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" @@ -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 WXDLLEXPORT class wxControlRenderer; // for geometry methods + friend class wxStdScrollBarInputHandler; // for geometry methods + DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxScrollBar) };