1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/scrolbar.h
3 // Purpose: wxScrollBar class
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
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
, wxWindowID id
,
22 const wxPoint
& pos
= wxDefaultPosition
,
23 const wxSize
& size
= wxDefaultSize
,
24 long style
= wxSB_HORIZONTAL
,
25 const wxValidator
& validator
= wxDefaultValidator
,
26 const wxString
& name
= wxScrollBarNameStr
)
28 Create(parent
, id
, pos
, size
, style
, validator
, name
);
30 bool Create(wxWindow
*parent
, wxWindowID id
,
31 const wxPoint
& pos
= wxDefaultPosition
,
32 const wxSize
& size
= wxDefaultSize
,
33 long style
= wxSB_HORIZONTAL
,
34 const wxValidator
& validator
= wxDefaultValidator
,
35 const wxString
& name
= wxScrollBarNameStr
);
37 int GetThumbPosition() const ;
38 int GetThumbSize() const { return m_pageSize
; }
39 int GetPageSize() const { return m_viewSize
; }
40 int GetRange() const { return m_objectSize
; }
42 virtual void SetThumbPosition(int viewStart
);
43 virtual void SetScrollbar(int position
, int thumbSize
, int range
, int pageSize
,
47 void SetThumbSize( int s
) { SetScrollbar( GetThumbPosition() , s
, GetRange() , GetPageSize() , true ) ; }
48 void SetPageSize( int s
) { SetScrollbar( GetThumbPosition() , GetThumbSize() , GetRange() , s
, true ) ; }
49 void SetRange( int s
) { SetScrollbar( GetThumbPosition() , GetThumbSize() , s
, GetPageSize() , true ) ; }
51 void Command(wxCommandEvent
& event
);
52 virtual bool MSWOnScroll(int orientation
, WXWORD wParam
,
53 WXWORD pos
, WXHWND control
);
55 // override wxControl version to not use solid background here
56 virtual WXHBRUSH
MSWControlColor(WXHDC pDC
, WXHWND hWnd
);
58 virtual WXDWORD
MSWGetStyle(long style
, WXDWORD
*exstyle
) const;
60 // returns true if the platform should explicitly apply a theme border
61 virtual bool CanApplyThemeBorder() const { return false; }
64 virtual wxSize
DoGetBestSize() const;
70 DECLARE_DYNAMIC_CLASS_NO_COPY(wxScrollBar
)