1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/scrolbar.h
3 // Purpose: wxScrollBar class
4 // Author: Stefan Csomor
7 // Copyright: (c) Stefan Csomor
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_SCROLBAR_H_
12 #define _WX_SCROLBAR_H_
15 class WXDLLIMPEXP_CORE wxScrollBar
: public wxScrollBarBase
18 wxScrollBar() { m_pageSize
= 0; m_viewSize
= 0; m_objectSize
= 0; }
19 virtual ~wxScrollBar();
21 wxScrollBar(wxWindow
*parent
,
23 const wxPoint
& pos
= wxDefaultPosition
,
24 const wxSize
& size
= wxDefaultSize
,
25 long style
= wxSB_HORIZONTAL
,
26 const wxValidator
& validator
= wxDefaultValidator
,
27 const wxString
& name
= wxScrollBarNameStr
)
29 Create(parent
, id
, pos
, size
, style
, validator
, name
);
31 bool Create(wxWindow
*parent
,
33 const wxPoint
& pos
= wxDefaultPosition
,
34 const wxSize
& size
= wxDefaultSize
,
35 long style
= wxSB_HORIZONTAL
,
36 const wxValidator
& validator
= wxDefaultValidator
,
37 const wxString
& name
= wxScrollBarNameStr
);
39 virtual int GetThumbPosition() const ;
40 virtual int GetThumbSize() const { return m_viewSize
; }
41 virtual int GetPageSize() const { return m_pageSize
; }
42 virtual int GetRange() const { return m_objectSize
; }
44 virtual void SetThumbPosition(int viewStart
);
45 virtual void SetScrollbar(int position
, int thumbSize
, int range
,
46 int pageSize
, bool refresh
= true);
49 void SetThumbSize( int s
) { SetScrollbar( GetThumbPosition() , s
, GetRange() , GetPageSize() , true ) ; }
50 void SetPageSize( int s
) { SetScrollbar( GetThumbPosition() , GetThumbSize() , GetRange() , s
, true ) ; }
51 void SetRange( int s
) { SetScrollbar( GetThumbPosition() , GetThumbSize() , s
, GetPageSize() , true ) ; }
53 // implementation only from now on
54 void Command(wxCommandEvent
& event
);
55 virtual void TriggerScrollEvent( wxEventType scrollEvent
) ;
56 virtual bool OSXHandleClicked( double timestampsec
);
58 virtual wxSize
DoGetBestSize() const;
64 DECLARE_DYNAMIC_CLASS(wxScrollBar
)
68 #endif // _WX_SCROLBAR_H_