source: trunk/src/comctl32/flatsb.c@ 5280

Last change on this file since 5280 was 4627, checked in by sandervl, 25 years ago

Resynched with Christoph's changes for unicode handling

File size: 5.8 KB
Line 
1/*
2 * Flat Scrollbar control
3 *
4 * Copyright 1998, 1999 Eric Kohl
5 * Copyright 1998 Alex Priem
6 *
7 * NOTES
8 * This is just a dummy control. An author is needed! Any volunteers?
9 * I will only improve this control once in a while.
10 * Eric <ekohl@abo.rhein-zeitung.de>
11 *
12 * TODO:
13 * - All messages.
14 * - All notifications.
15 *
16 */
17
18#include "winbase.h"
19#include "winerror.h"
20#include "commctrl.h"
21#include "debugtools.h"
22
23DEFAULT_DEBUG_CHANNEL(commctrl);
24
25typedef struct
26{
27 DWORD dwDummy; /* just to keep the compiler happy ;-) */
28} FLATSB_INFO, *LPFLATSB_INFO;
29
30#define FlatSB_GetInfoPtr(hwnd) ((FLATSB_INFO*)GetWindowLongA (hwnd, 0))
31
32
33/***********************************************************************
34 * InitializeFlatSB
35 *
36 * returns nonzero if successful, zero otherwise
37 *
38 */
39BOOL WINAPI InitializeFlatSB(HWND hwnd)
40{
41 TRACE("[%04x]\n", hwnd);
42 FIXME("stub\n");
43 return FALSE;
44}
45
46/***********************************************************************
47 * UninitializeFlatSB
48 *
49 * returns:
50 * E_FAIL if one of the scroll bars is currently in use
51 * S_FALSE if InitializeFlatSB was never called on this hwnd
52 * S_OK otherwise
53 *
54 */
55HRESULT WINAPI UninitializeFlatSB(HWND hwnd)
56{
57 TRACE("[%04x]\n", hwnd);
58 FIXME("stub\n");
59 return S_FALSE;
60}
61
62/***********************************************************************
63 * FlatSB_GetScrollProp
64 *
65 * Returns nonzero if successful, or zero otherwise. If index is WSB_PROP_HSTYLE,
66 * the return is nonzero if InitializeFlatSB has been called for this window, or
67 * zero otherwise.
68 *
69 */
70BOOL WINAPI
71FlatSB_GetScrollProp(HWND hwnd, INT propIndex, LPINT prop)
72{
73 TRACE("[%04x] propIndex=%d\n", hwnd, propIndex);
74 FIXME("stub\n");
75 return FALSE;
76}
77
78/***********************************************************************
79 * FlatSB_SetScrollProp
80 */
81BOOL WINAPI
82FlatSB_SetScrollProp(HWND hwnd, UINT index, INT newValue, BOOL flag)
83{
84 TRACE("[%04x] index=%u newValue=%d flag=%d\n", hwnd, index, newValue, flag);
85 FIXME("stub\n");
86 return FALSE;
87}
88
89/***********************************************************************
90 * From the Microsoft docs:
91 * "If flat scroll bars haven't been initialized for the
92 * window, the flat scroll bar APIs will defer to the corresponding
93 * standard APIs. This allows the developer to turn flat scroll
94 * bars on and off without having to write conditional code."
95 *
96 * So, if we just call the standard functions until we implement
97 * the flat scroll bar functions, flat scroll bars will show up and
98 * behave properly, as though they had simply not been setup to
99 * have flat properties.
100 *
101 * Susan <sfarley@codeweavers.com>
102 *
103 */
104
105/***********************************************************************
106 * FlatSB_EnableScrollBar
107 */
108BOOL WINAPI
109FlatSB_EnableScrollBar(HWND hwnd, int nBar, UINT flags)
110{
111 return EnableScrollBar(hwnd, nBar, flags);
112}
113
114/***********************************************************************
115 * FlatSB_ShowScrollBar
116 */
117BOOL WINAPI
118FlatSB_ShowScrollBar(HWND hwnd, int nBar, BOOL fShow)
119{
120 return ShowScrollBar(hwnd, nBar, fShow);
121}
122
123/***********************************************************************
124 * FlatSB_GetScrollRange
125 */
126BOOL WINAPI
127FlatSB_GetScrollRange(HWND hwnd, int nBar, LPINT min, LPINT max)
128{
129 return GetScrollRange(hwnd, nBar, min, max);
130}
131
132/***********************************************************************
133 * FlatSB_GetScrollInfo
134 */
135BOOL WINAPI
136FlatSB_GetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info)
137{
138 return GetScrollInfo(hwnd, nBar, info);
139}
140
141/***********************************************************************
142 * FlatSB_GetScrollPos
143 */
144INT WINAPI
145FlatSB_GetScrollPos(HWND hwnd, int nBar)
146{
147 return GetScrollPos(hwnd, nBar);
148}
149
150/***********************************************************************
151 * FlatSB_SetScrollPos
152 */
153INT WINAPI
154FlatSB_SetScrollPos(HWND hwnd, int nBar, INT pos, BOOL bRedraw)
155{
156 return SetScrollPos(hwnd, nBar, pos, bRedraw);
157}
158
159/***********************************************************************
160 * FlatSB_SetScrollInfo
161 */
162INT WINAPI
163FlatSB_SetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info, BOOL bRedraw)
164{
165 return SetScrollInfo(hwnd, nBar, info, bRedraw);
166}
167
168/***********************************************************************
169 * FlatSB_SetScrollRange
170 */
171INT WINAPI
172FlatSB_SetScrollRange(HWND hwnd, int nBar, INT min, INT max, BOOL bRedraw)
173{
174 return SetScrollRange(hwnd, nBar, min, max, bRedraw);
175}
176
177
178static LRESULT
179FlatSB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
180{
181 TRACE("[%04x] wParam=%04x lParam=%08lx\n", hwnd, wParam, lParam);
182 return 0;
183}
184
185
186static LRESULT
187FlatSB_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
188{
189 TRACE("[%04x] wParam=%04x lParam=%08lx\n", hwnd, wParam, lParam);
190 return 0;
191}
192
193
194static LRESULT WINAPI
195FlatSB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
196{
197 switch (uMsg)
198 {
199 case WM_CREATE:
200 return FlatSB_Create (hwnd, wParam, lParam);
201
202 case WM_DESTROY:
203 return FlatSB_Destroy (hwnd, wParam, lParam);
204
205 default:
206 if (uMsg >= WM_USER)
207 ERR("unknown msg %04x wp=%08x lp=%08lx\n",
208 uMsg, wParam, lParam);
209#ifdef __WIN32OS2__
210 return defComCtl32ProcA (hwnd, uMsg, wParam, lParam);
211#else
212 return DefWindowProcA (hwnd, uMsg, wParam, lParam);
213#endif
214 }
215 return 0;
216}
217
218
219VOID
220FLATSB_Register (void)
221{
222 WNDCLASSA wndClass;
223
224 ZeroMemory (&wndClass, sizeof(WNDCLASSA));
225 wndClass.style = CS_GLOBALCLASS;
226 wndClass.lpfnWndProc = (WNDPROC)FlatSB_WindowProc;
227 wndClass.cbClsExtra = 0;
228 wndClass.cbWndExtra = sizeof(FLATSB_INFO *);
229 wndClass.hCursor = LoadCursorA (0, IDC_ARROWA);
230 wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
231 wndClass.lpszClassName = FLATSB_CLASSA;
232
233 RegisterClassA (&wndClass);
234}
235
236
237VOID
238FLATSB_Unregister (void)
239{
240 UnregisterClassA (FLATSB_CLASSA, (HINSTANCE)NULL);
241}
242
Note: See TracBrowser for help on using the repository browser.