]> git.saurik.com Git - wxWidgets.git/blob - include/wx/palmos/scrolbar.h
Rework the GTK WebKit backend history to remove the need for the map between wxWebHis...
[wxWidgets.git] / include / wx / palmos / scrolbar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/palmos/scrolbar.h
3 // Purpose: wxScrollBar class
4 // Author: William Osborne - minimal working wxPalmOS port
5 // Modified by:
6 // Created: 10/13/04
7 // RCS-ID: $Id$
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_SCROLBAR_H_
13 #define _WX_SCROLBAR_H_
14
15 // Scrollbar item
16 class WXDLLIMPEXP_CORE wxScrollBar: public wxScrollBarBase
17 {
18 public:
19 wxScrollBar() { m_pageSize = 0; m_viewSize = 0; m_objectSize = 0; }
20 virtual ~wxScrollBar();
21
22 wxScrollBar(wxWindow *parent, wxWindowID id,
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)
28 {
29 Create(parent, id, pos, size, style, validator, name);
30 }
31 bool Create(wxWindow *parent, wxWindowID id,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize,
34 long style = wxSB_HORIZONTAL,
35 const wxValidator& validator = wxDefaultValidator,
36 const wxString& name = wxScrollBarNameStr);
37
38 int GetThumbPosition() const ;
39 int GetThumbSize() const { return m_pageSize; }
40 int GetPageSize() const { return m_viewSize; }
41 int GetRange() const { return m_objectSize; }
42
43 virtual void SetThumbPosition(int viewStart);
44 virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize,
45 bool refresh = true);
46
47 // needed for RTTI
48 void SetThumbSize( int s ) { SetScrollbar( GetThumbPosition() , s , GetRange() , GetPageSize() , true ) ; }
49 void SetPageSize( int s ) { SetScrollbar( GetThumbPosition() , GetThumbSize() , GetRange() , s , true ) ; }
50 void SetRange( int s ) { SetScrollbar( GetThumbPosition() , GetThumbSize() , s , GetPageSize() , true ) ; }
51
52 void Command(wxCommandEvent& event);
53 virtual bool MSWOnScroll(int orientation, WXWORD wParam,
54 WXWORD pos, WXHWND control);
55
56 protected:
57
58 wxSize DoGetBestSize() const;
59
60 int m_pageSize;
61 int m_viewSize;
62 int m_objectSize;
63
64 DECLARE_DYNAMIC_CLASS_NO_COPY(wxScrollBar)
65 };
66
67 #endif
68 // _WX_SCROLBAR_H_