]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/scrolbar.h
The rounded corners look really dumb at this size.
[wxWidgets.git] / include / wx / msw / scrolbar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/scrolbar.h
3 // Purpose: wxScrollBar class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_SCROLBAR_H_
12 #define _WX_SCROLBAR_H_
13
14 // Scrollbar item
15 class WXDLLIMPEXP_CORE wxScrollBar: public wxScrollBarBase
16 {
17 public:
18 wxScrollBar() { m_pageSize = 0; m_viewSize = 0; m_objectSize = 0; }
19 virtual ~wxScrollBar();
20
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)
27 {
28 Create(parent, id, pos, size, style, validator, name);
29 }
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);
36
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; }
41
42 virtual void SetThumbPosition(int viewStart);
43 virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize,
44 bool refresh = true);
45
46 // needed for RTTI
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 ) ; }
50
51 void Command(wxCommandEvent& event);
52 virtual bool MSWOnScroll(int orientation, WXWORD wParam,
53 WXWORD pos, WXHWND control);
54
55 // override wxControl version to not use solid background here
56 virtual WXHBRUSH MSWControlColor(WXHDC pDC, WXHWND hWnd);
57
58 virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
59
60 // returns true if the platform should explicitly apply a theme border
61 virtual bool CanApplyThemeBorder() const { return false; }
62
63 protected:
64 virtual wxSize DoGetBestSize() const;
65
66 int m_pageSize;
67 int m_viewSize;
68 int m_objectSize;
69
70 DECLARE_DYNAMIC_CLASS_NO_COPY(wxScrollBar)
71 };
72
73 #endif
74 // _WX_SCROLBAR_H_