X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9467bdb7f5bfde9f99331097daacb93564ca122e..f54e5c1a4f6952c62ed4480f7d26feddc20f98ba:/include/wx/univ/scrolbar.h diff --git a/include/wx/univ/scrolbar.h b/include/wx/univ/scrolbar.h index 8580977eb1..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: @@ -116,11 +116,14 @@ public: virtual int GetArrowState(wxScrollArrows::Arrow arrow) const; virtual void SetArrowFlag(wxScrollArrows::Arrow arrow, int flag, bool set); virtual bool OnArrow(wxScrollArrows::Arrow arrow); - virtual wxScrollArrows::Arrow HitTest(const wxPoint& pt) const; + virtual wxScrollArrows::Arrow HitTestArrow(const wxPoint& pt) const; // 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