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