]>
Commit | Line | Data |
---|---|---|
2bda0e17 | 1 | ///////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/msw/scrolbar.h |
2bda0e17 KB |
3 | // Purpose: wxScrollBar class |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
bbcdf8bc | 7 | // Copyright: (c) Julian Smart |
65571936 | 8 | // Licence: wxWindows licence |
2bda0e17 KB |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
bbcdf8bc JS |
11 | #ifndef _WX_SCROLBAR_H_ |
12 | #define _WX_SCROLBAR_H_ | |
2bda0e17 | 13 | |
2bda0e17 | 14 | // Scrollbar item |
53a2db12 | 15 | class WXDLLIMPEXP_CORE wxScrollBar: public wxScrollBarBase |
2bda0e17 | 16 | { |
2bda0e17 | 17 | public: |
a23fd0e1 | 18 | wxScrollBar() { m_pageSize = 0; m_viewSize = 0; m_objectSize = 0; } |
d3c7fc99 | 19 | virtual ~wxScrollBar(); |
a23fd0e1 VZ |
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, | |
57f4f925 | 44 | bool refresh = true); |
2bda0e17 | 45 | |
a06bb527 SC |
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 | ||
a23fd0e1 | 51 | void Command(wxCommandEvent& event); |
a23fd0e1 VZ |
52 | virtual bool MSWOnScroll(int orientation, WXWORD wParam, |
53 | WXWORD pos, WXHWND control); | |
2bda0e17 | 54 | |
0cf11995 VZ |
55 | // override wxControl version to not use solid background here |
56 | virtual WXHBRUSH MSWControlColor(WXHDC pDC, WXHWND hWnd); | |
caafd082 | 57 | |
6f02a879 VZ |
58 | virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; |
59 | ||
a047aff2 JS |
60 | // returns true if the platform should explicitly apply a theme border |
61 | virtual bool CanApplyThemeBorder() const { return false; } | |
62 | ||
0cf11995 VZ |
63 | protected: |
64 | virtual wxSize DoGetBestSize() const; | |
caafd082 | 65 | |
2bda0e17 KB |
66 | int m_pageSize; |
67 | int m_viewSize; | |
68 | int m_objectSize; | |
69 | ||
fc7a2a60 | 70 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxScrollBar) |
2bda0e17 KB |
71 | }; |
72 | ||
73 | #endif | |
bbcdf8bc | 74 | // _WX_SCROLBAR_H_ |