]> git.saurik.com Git - wxWidgets.git/blob - src/os2/spinbutt.cpp
Committing in .
[wxWidgets.git] / src / os2 / spinbutt.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: spinbutt.cpp
3 // Purpose: wxSpinButton
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/15/99
7 // RCS-ID: $Id$
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifdef __GNUG__
13 #pragma implementation "spinbutt.h"
14 #pragma implementation "spinbutbase.h"
15 #endif
16
17 // For compilers that support precompilation, includes "wx.h".
18 #include "wx/wxprec.h"
19
20
21 #ifndef WX_PRECOMP
22 #include "wx/wx.h"
23 #endif
24
25 // Can't resolve reference to CreateUpDownControl in
26 // TWIN32, but could probably use normal CreateWindow instead.
27
28
29 #include "wx/spinbutt.h"
30
31 IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent)
32
33 #include "wx/os2/private.h"
34
35 // ============================================================================
36 // implementation
37 // ============================================================================
38
39 // ----------------------------------------------------------------------------
40 // wxWin macros
41 // ----------------------------------------------------------------------------
42
43 IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl)
44
45 bool wxSpinButton::Create(
46 wxWindow* parent
47 , wxWindowID id
48 , const wxPoint& pos
49 , const wxSize& size
50 , long style
51 , const wxString& name
52 )
53 {
54 SetName(name);
55
56 m_windowStyle = style;
57
58 SetParent(parent);
59
60 m_windowId = (id == -1) ? NewControlId() : id;
61
62 // TODO create spin button
63 return FALSE;
64 }
65
66 wxSpinButton::~wxSpinButton()
67 {
68 }
69
70 // ----------------------------------------------------------------------------
71 // size calculation
72 // ----------------------------------------------------------------------------
73
74 wxSize wxSpinButton::DoGetBestSize() const
75 {
76 // TODO:
77 /*
78 if ( (GetWindowStyle() & wxSP_VERTICAL) != 0 )
79 {
80 // vertical control
81 return wxSize(GetSystemMetrics(SM_CXVSCROLL),
82 2*GetSystemMetrics(SM_CYVSCROLL));
83 }
84 else
85 {
86 // horizontal control
87 return wxSize(2*GetSystemMetrics(SM_CXHSCROLL),
88 GetSystemMetrics(SM_CYHSCROLL));
89 }
90 */
91 return wxSize(0, 0);
92 }
93
94 // ----------------------------------------------------------------------------
95 // Attributes
96 // ----------------------------------------------------------------------------
97
98 int wxSpinButton::GetValue() const
99 {
100 // TODO
101 return 0;
102 }
103
104 void wxSpinButton::SetValue(int val)
105 {
106 // TODO
107 }
108
109 void wxSpinButton::SetRange(int minVal, int maxVal)
110 {
111 // TODO
112 }
113
114 bool wxSpinButton::OS2OnScroll(int orientation, WXWORD wParam,
115 WXWORD pos, WXHWND control)
116 {
117 wxCHECK_MSG( control, FALSE, wxT("scrolling what?") )
118 // TODO:
119 /*
120 if ( wParam != SB_THUMBPOSITION )
121 {
122 // probable SB_ENDSCROLL - we don't react to it
123 return FALSE;
124 }
125
126 wxSpinEvent event(wxEVT_SCROLL_THUMBTRACK, m_windowId);
127 event.SetPosition((short)pos); // cast is important for negative values!
128 event.SetEventObject(this);
129
130 return GetEventHandler()->ProcessEvent(event);
131 */
132 return FALSE;
133 }
134
135 bool wxSpinButton::OS2OnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
136 {
137 // TODO:
138 /*
139 LPNM_UPDOWN lpnmud = (LPNM_UPDOWN)lParam;
140
141 wxSpinEvent event(lpnmud->iDelta > 0 ? wxEVT_SCROLL_LINEUP
142 : wxEVT_SCROLL_LINEDOWN,
143 m_windowId);
144 event.SetPosition(lpnmud->iPos + lpnmud->iDelta);
145 event.SetEventObject(this);
146
147 bool processed = GetEventHandler()->ProcessEvent(event);
148
149 *result = event.IsAllowed() ? 0 : 1;
150
151 return processed;
152 */
153 return FALSE;
154 }
155
156 bool wxSpinButton::OS2Command(WXUINT cmd, WXWORD id)
157 {
158 // No command messages
159 return FALSE;
160 }
161