1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxScrollBar class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_SCROLBAR_H_
13 #define _WX_SCROLBAR_H_
16 class WXDLLIMPEXP_CORE wxScrollBar
: public wxScrollBarBase
19 wxScrollBar() { m_pageSize
= 0; m_viewSize
= 0; m_objectSize
= 0; }
20 virtual ~wxScrollBar();
22 wxScrollBar(wxWindow
*parent
,
24 const wxPoint
& pos
= wxDefaultPosition
,
25 const wxSize
& size
= wxDefaultSize
,
26 long style
= wxSB_HORIZONTAL
,
27 const wxValidator
& validator
= wxDefaultValidator
,
28 const wxString
& name
= wxScrollBarNameStr
)
30 Create(parent
, id
, pos
, size
, style
, validator
, name
);
32 bool Create(wxWindow
*parent
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
,
36 long style
= wxSB_HORIZONTAL
,
37 const wxValidator
& validator
= wxDefaultValidator
,
38 const wxString
& name
= wxScrollBarNameStr
);
40 virtual int GetThumbPosition() const ;
41 virtual int GetThumbSize() const { return m_viewSize
; }
42 virtual int GetPageSize() const { return m_pageSize
; }
43 virtual int GetRange() const { return m_objectSize
; }
45 virtual void SetThumbPosition(int viewStart
);
46 virtual void SetScrollbar(int position
, int thumbSize
, int range
,
47 int pageSize
, bool refresh
= true);
50 void SetThumbSize( int s
) { SetScrollbar( GetThumbPosition() , s
, GetRange() , GetPageSize() , true ) ; }
51 void SetPageSize( int s
) { SetScrollbar( GetThumbPosition() , GetThumbSize() , GetRange() , s
, true ) ; }
52 void SetRange( int s
) { SetScrollbar( GetThumbPosition() , GetThumbSize() , s
, GetPageSize() , true ) ; }
54 // implementation only from now on
55 void Command(wxCommandEvent
& event
);
56 virtual void TriggerScrollEvent( wxEventType scrollEvent
) ;
57 virtual bool OSXHandleClicked( double timestampsec
);
59 virtual wxSize
DoGetBestSize() const;
65 DECLARE_DYNAMIC_CLASS(wxScrollBar
)
69 #endif // _WX_SCROLBAR_H_