#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"
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();
// 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;
// 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)
};