]> git.saurik.com Git - wxWidgets.git/blob - include/wx/palmos/slider.h
wxCommandProcessor::MarkAsSaved() and IsDirty() added (modified patch 1062556)
[wxWidgets.git] / include / wx / palmos / slider.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/palmos/slider95.h
3 // Purpose: wxSlider class
4 // Author: William Osborne - minimal working wxPalmOS port
5 // Modified by: Wlodzimierz ABX Skiba - native implementation
6 // Created: 10/13/04
7 // RCS-ID: $Id$
8 // Copyright: (c) William Osborne, Wlodzimierz Skiba
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _SLIDER95_H_
13 #define _SLIDER95_H_
14
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "slider95.h"
17 #endif
18
19 // Slider
20 class WXDLLEXPORT wxSlider : public wxSliderBase
21 {
22 public:
23 wxSlider()
24 {
25 Init();
26 }
27
28 wxSlider(wxWindow *parent, wxWindowID id,
29 int value, int minValue, int maxValue,
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize,
32 long style = wxSL_HORIZONTAL,
33 const wxValidator& validator = wxDefaultValidator,
34 const wxString& name = wxSliderNameStr)
35 {
36 Init();
37 Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
38 }
39
40 ~wxSlider();
41
42 bool Create(wxWindow *parent, wxWindowID id,
43 int value, int minValue, int maxValue,
44 const wxPoint& pos = wxDefaultPosition,
45 const wxSize& size = wxDefaultSize,
46 long style = wxSL_HORIZONTAL,
47 const wxValidator& validator = wxDefaultValidator,
48 const wxString& name = wxSliderNameStr);
49
50 virtual int GetValue() const;
51 virtual void SetValue(int);
52
53 void SetRange(int minValue, int maxValue);
54
55 int GetMin() const;
56 int GetMax() const;
57
58 // For trackbars only
59 void SetTickFreq(int n, int pos);
60 int GetTickFreq() const;
61 void SetPageSize(int pageSize);
62 int GetPageSize() const;
63 void ClearSel();
64 void ClearTicks();
65 void SetLineSize(int lineSize);
66 int GetLineSize() const;
67 int GetSelEnd() const;
68 int GetSelStart() const;
69 void SetSelection(int minPos, int maxPos);
70 void SetThumbLength(int len);
71 int GetThumbLength() const;
72 void SetTick(int tickPos);
73
74 // implementation
75 void Command(wxCommandEvent& event);
76
77 // send a notification event, return true if processed
78 bool SendUpdatedEvent();
79 bool SendScrollEvent(EventType* event);
80
81 protected:
82
83 virtual wxSize DoGetBestSize() const;
84
85 private:
86
87 void Init();
88
89 int m_oldPos; // needed for tracing thumb position during scrolling
90 int m_oldValue; // needed for comparing thumb position before and after scrolling
91 int m_lineSize; // imitate line size
92
93 DECLARE_DYNAMIC_CLASS_NO_COPY(wxSlider)
94 };
95
96 #endif
97 // _SLIDER95_H_