Release 0.7
[wine] / controls / scroll.c
1 /*
2  * Interface code to SCROLLBAR widget
3  *
4  * Copyright  Martin Ayotte, 1993
5  *
6  */
7
8 /*
9 #define DEBUG_SCROLL
10 */
11
12 static char Copyright[] = "Copyright Martin Ayotte, 1993";
13
14 #include <X11/Intrinsic.h>
15 #include <X11/StringDefs.h>
16 #include "windows.h"
17 #include "scroll.h"
18 #include "heap.h"
19 #include "win.h"
20 #include <sys/types.h>
21 #include <dirent.h>
22 #include <sys/stat.h>
23
24 HBITMAP hUpArrow = 0;
25 HBITMAP hDnArrow = 0;
26 HBITMAP hLfArrow = 0;
27 HBITMAP hRgArrow = 0;
28 HBITMAP hUpArrowD = 0;
29 HBITMAP hDnArrowD = 0;
30 HBITMAP hLfArrowD = 0;
31 HBITMAP hRgArrowD = 0;
32
33 LPHEADSCROLL ScrollBarGetWindowAndStorage(HWND hwnd, WND **wndPtr);
34 LPHEADSCROLL ScrollBarGetStorageHeader(HWND hwnd);
35 void StdDrawScrollBar(HWND hwnd);
36 int CreateScrollBarStruct(HWND hwnd);
37
38
39 /***********************************************************************
40  *           WIDGETS_ScrollBarWndProc
41  */
42 LONG ScrollBarWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
43 {    
44     WORD        wRet;
45     short       x, y;
46     short       width, height;
47     WND         *wndPtr;
48     LPHEADSCROLL lphs;
49     LPDRAWITEMSTRUCT lpdis;
50     HDC         hMemDC;
51     BITMAP      bm;
52     RECT        rect;
53     static RECT rectsel;
54     switch(message)
55     {
56     case WM_CREATE:
57         CreateScrollBarStruct(hwnd);
58 #ifdef DEBUG_SCROLL
59         printf("ScrollBar Creation up=%X down=%X!\n", lphs->hWndUp, lphs->hWndDown);
60 #endif
61         if (hUpArrow == (HBITMAP)NULL) 
62             hUpArrow = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_UPARROWI));
63         if (hDnArrow == (HBITMAP)NULL) 
64             hDnArrow = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_DNARROWI));
65         if (hLfArrow == (HBITMAP)NULL) 
66             hLfArrow = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_LFARROWI));
67         if (hRgArrow == (HBITMAP)NULL) 
68             hRgArrow = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_RGARROWI));
69         if (hUpArrowD == (HBITMAP)NULL) 
70             hUpArrowD = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_UPARROWD));
71         if (hDnArrowD == (HBITMAP)NULL) 
72             hDnArrowD = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_DNARROWD));
73         if (hLfArrowD == (HBITMAP)NULL) 
74             hLfArrowD = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_LFARROWD));
75         if (hRgArrowD == (HBITMAP)NULL) 
76             hRgArrowD = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_RGARROWD));
77         return 0;
78     case WM_DESTROY:
79         lphs = ScrollBarGetWindowAndStorage(hwnd, &wndPtr);
80         if (lphs == 0) return 0;
81 #ifdef DEBUG_SCROLL
82         printf("ScrollBar WM_DESTROY %lX !\n", lphs);
83 #endif
84         DestroyWindow(lphs->hWndUp);
85         DestroyWindow(lphs->hWndDown);
86         free(lphs);
87         *((LPHEADSCROLL *)&wndPtr->wExtra[1]) = 0;
88         return 0;
89         
90     case WM_COMMAND:
91 #ifdef DEBUG_SCROLL
92         printf("ScrollBar WM_COMMAND wParam=%X lParam=%lX !\n", wParam, lParam);
93 #endif
94         lphs = ScrollBarGetWindowAndStorage(hwnd, &wndPtr);
95         if (HIWORD(lParam) != BN_CLICKED) return 0;
96         if (LOWORD(lParam) == lphs->hWndUp)
97             SendMessage(wndPtr->hwndParent, lphs->Direction, 
98                 SB_LINEUP, MAKELONG(0, hwnd));
99         if (LOWORD(lParam) == lphs->hWndDown)
100             SendMessage(wndPtr->hwndParent, lphs->Direction, 
101                 SB_LINEDOWN, MAKELONG(0, hwnd));
102 /*
103         SetFocus(hwnd);
104 */
105         return 0;
106
107     case WM_LBUTTONDOWN:
108         lphs = ScrollBarGetWindowAndStorage(hwnd, &wndPtr);
109 /*
110         SetFocus(hwnd);
111 */
112         SetCapture(hwnd);
113         GetClientRect(hwnd, &rect);
114         if (lphs->Direction == WM_VSCROLL) {
115             y = HIWORD(lParam);
116 #ifdef DEBUG_SCROLL
117             printf("WM_LBUTTONDOWN y=%d cur+right=%d %d\n", 
118                 y, lphs->CurPix + rect.right, lphs->CurPix + (rect.right << 1));
119 #endif
120             if (y < (lphs->CurPix + rect.right)) 
121                 SendMessage(wndPtr->hwndParent, lphs->Direction, 
122                         SB_PAGEUP, MAKELONG(0, hwnd));
123             if (y > (lphs->CurPix + (rect.right << 1))) 
124                 SendMessage(wndPtr->hwndParent, lphs->Direction, 
125                         SB_PAGEDOWN, MAKELONG(0, hwnd));
126             if ((y > (lphs->CurPix + rect.right)) &&
127                 (y < (lphs->CurPix + (rect.right << 1)))) {
128                 lphs->ThumbActive = TRUE;
129 #ifdef DEBUG_SCROLL
130                 printf("THUMB DOWN !\n");
131 #endif
132                 }
133             }
134         else {
135             x = LOWORD(lParam);
136 #ifdef DEBUG_SCROLL
137             printf("WM_LBUTTONDOWN x=%d Cur+bottom=%d %d\n",
138                  x, lphs->CurPix + rect.bottom, lphs->CurPix + (rect.bottom << 1));
139 #endif
140             if (x < (lphs->CurPix + rect.bottom))
141                 SendMessage(wndPtr->hwndParent, lphs->Direction, 
142                         SB_PAGEUP, MAKELONG(0, hwnd));
143             if (x > (lphs->CurPix + (rect.bottom << 1)))
144                 SendMessage(wndPtr->hwndParent, lphs->Direction, 
145                         SB_PAGEDOWN, MAKELONG(0, hwnd));
146             if ((x > (lphs->CurPix + rect.bottom)) &&
147                 (x < (lphs->CurPix + (rect.bottom << 1)))) {
148                 lphs->ThumbActive = TRUE;
149 #ifdef DEBUG_SCROLL
150                 printf("THUMB DOWN !\n");
151 #endif
152                 }
153             }
154         break;
155     case WM_LBUTTONUP:
156         lphs = ScrollBarGetStorageHeader(hwnd);
157         lphs->ThumbActive = FALSE;
158         ReleaseCapture();
159         break;
160
161     case WM_MOUSEMOVE:
162         if ((wParam & MK_LBUTTON) != 0) {
163             lphs = ScrollBarGetWindowAndStorage(hwnd, &wndPtr);
164             if (lphs->ThumbActive == 0) break;
165             GetClientRect(hwnd, &rect);
166             if (lphs->Direction == WM_VSCROLL)
167                 y = HIWORD(lParam) - rect.right - (rect.right >> 1);
168             else
169                 y = LOWORD(lParam) - rect.bottom - (rect.bottom >> 1);
170             x = (y * (lphs->MaxVal - lphs->MinVal) / 
171                         lphs->MaxPix) + lphs->MinVal;
172 #ifdef DEBUG_SCROLL
173             printf("Scroll WM_MOUSEMOVE val=%d pix=%d\n", x, y);
174 #endif
175             SendMessage(wndPtr->hwndParent, lphs->Direction, 
176                         SB_THUMBTRACK, MAKELONG(x, hwnd));
177             }
178         break;
179     case WM_KEYDOWN:
180     case WM_KEYUP:
181     case WM_CHAR:
182         lphs = ScrollBarGetWindowAndStorage(hwnd, &wndPtr);
183         return(SendMessage(wndPtr->hwndParent, message, wParam, lParam));
184
185     case WM_SIZE:
186         lphs = ScrollBarGetWindowAndStorage(hwnd, &wndPtr);
187         width  = LOWORD(lParam);
188         height = HIWORD(lParam);
189         if (lphs->Direction == WM_VSCROLL) {
190             MoveWindow(lphs->hWndUp, 0, 0, width, width, TRUE);
191             MoveWindow(lphs->hWndDown, 0, height - width, width, width, TRUE);
192             }
193         else {
194             MoveWindow(lphs->hWndUp, 0, 0, height, height, TRUE);
195             MoveWindow(lphs->hWndDown, width - height, 0, height, height, TRUE);
196             }
197         break;
198     case WM_DRAWITEM:
199 #ifdef DEBUG_SCROLL
200             printf("Scroll WM_DRAWITEM w=%04X l=%08X\n", wParam, lParam);
201 #endif
202         lpdis = (LPDRAWITEMSTRUCT)lParam;
203         if (lpdis->CtlType == ODT_BUTTON && lpdis->itemAction == ODA_DRAWENTIRE) {
204             hMemDC = CreateCompatibleDC(lpdis->hDC);
205             if (lpdis->CtlID == 1) {
206                 GetObject(hUpArrow, sizeof(BITMAP), (LPSTR)&bm);
207                 SelectObject(hMemDC, hUpArrow);
208 /*              BitBlt(lpdis->hDC, 0, 0, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY); */
209                 StretchBlt(lpdis->hDC, 0, 0, lpdis->rcItem.right, lpdis->rcItem.right,
210                         hMemDC, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
211                 }
212             if (lpdis->CtlID == 2) {
213                 GetObject(hDnArrow, sizeof(BITMAP), (LPSTR)&bm);
214                 SelectObject(hMemDC, hDnArrow);
215                 BitBlt(lpdis->hDC, 0, 0, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
216                 }
217             if (lpdis->CtlID == 3) {
218                 GetObject(hLfArrow, sizeof(BITMAP), (LPSTR)&bm);
219                 SelectObject(hMemDC, hLfArrow);
220                 BitBlt(lpdis->hDC, 0, 0, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
221                 }
222             if (lpdis->CtlID == 4) {
223                 GetObject(hRgArrow, sizeof(BITMAP), (LPSTR)&bm);
224                 SelectObject(hMemDC, hRgArrow);
225                 BitBlt(lpdis->hDC, 0, 0, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
226                 }
227             DeleteDC(hMemDC);
228             }
229         if (lpdis->CtlType == ODT_BUTTON && lpdis->itemAction == ODA_SELECT) {
230             hMemDC = CreateCompatibleDC(lpdis->hDC);
231             if (lpdis->CtlID == 1) {
232                 GetObject(hUpArrowD, sizeof(BITMAP), (LPSTR)&bm);
233                 SelectObject(hMemDC, hUpArrowD);
234                 BitBlt(lpdis->hDC, 0, 0, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
235                 }
236             if (lpdis->CtlID == 2) {
237                 GetObject(hDnArrowD, sizeof(BITMAP), (LPSTR)&bm);
238                 SelectObject(hMemDC, hDnArrowD);
239                 BitBlt(lpdis->hDC, 0, 0, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
240                 }
241             if (lpdis->CtlID == 3) {
242                 GetObject(hLfArrowD, sizeof(BITMAP), (LPSTR)&bm);
243                 SelectObject(hMemDC, hLfArrowD);
244                 BitBlt(lpdis->hDC, 0, 0, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
245                 }
246             if (lpdis->CtlID == 4) {
247                 GetObject(hRgArrowD, sizeof(BITMAP), (LPSTR)&bm);
248                 SelectObject(hMemDC, hRgArrowD);
249                 BitBlt(lpdis->hDC, 0, 0, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
250                 }
251             DeleteDC(hMemDC);
252             }
253         break;
254     case WM_PAINT:
255         StdDrawScrollBar(hwnd);
256         break;
257     default:
258         return DefWindowProc( hwnd, message, wParam, lParam );
259     }
260 return(0);
261 }
262
263
264
265 LPHEADSCROLL ScrollBarGetWindowAndStorage(HWND hwnd, WND **wndPtr)
266 {
267     WND  *Ptr;
268     LPHEADSCROLL lphs;
269     *(wndPtr) = Ptr = WIN_FindWndPtr(hwnd);
270     if (Ptr == 0) {
271         printf("Bad Window handle on ScrollBar !\n");
272         return 0;
273         }
274     lphs = *((LPHEADSCROLL *)&Ptr->wExtra[1]);
275     return lphs;
276 }
277
278
279 LPHEADSCROLL ScrollBarGetStorageHeader(HWND hwnd)
280 {
281     WND  *wndPtr;
282     LPHEADSCROLL lphs;
283     wndPtr = WIN_FindWndPtr(hwnd);
284     if (wndPtr == 0) {
285         printf("Bad Window handle on ScrollBar !\n");
286         return 0;
287         }
288     lphs = *((LPHEADSCROLL *)&wndPtr->wExtra[1]);
289     return lphs;
290 }
291
292
293 void StdDrawScrollBar(HWND hwnd)
294 {
295     LPHEADSCROLL lphs;
296     PAINTSTRUCT ps;
297     HBRUSH hBrush;
298     HDC hdc;
299     RECT rect;
300     UINT  i, w, h, siz;
301     char        C[128];
302     hdc = BeginPaint( hwnd, &ps );
303     if (!IsWindowVisible(hwnd)) {
304         EndPaint( hwnd, &ps );
305         return;
306         }
307     hBrush = SendMessage(GetParent(hwnd), WM_CTLCOLOR, (WORD)hdc,
308                         MAKELONG(hwnd, CTLCOLOR_SCROLLBAR));
309     if (hBrush == (HBRUSH)NULL)  hBrush = GetStockObject(LTGRAY_BRUSH);
310     lphs = ScrollBarGetStorageHeader(hwnd);
311     if (lphs == NULL) goto EndOfPaint;
312     GetClientRect(hwnd, &rect);
313     w = rect.right - rect.left;
314     h = rect.bottom - rect.top;
315     if (lphs->Direction == WM_VSCROLL) {
316         rect.top += w;
317         rect.bottom -= w;
318         }
319     else {
320         rect.left += h;
321         rect.right -= h;
322         }
323     FillRect(hdc, &rect, hBrush);
324     if (lphs->Direction == WM_VSCROLL)
325         SetRect(&rect, 0, lphs->CurPix + w, w, lphs->CurPix + (w << 1));
326     else
327         SetRect(&rect, lphs->CurPix + h, 0, lphs->CurPix + (h << 1), h);
328     FrameRect(hdc, &rect, GetStockObject(BLACK_BRUSH));
329     InflateRect(&rect, -1, -1);
330     FillRect(hdc, &rect, GetStockObject(LTGRAY_BRUSH));
331     DrawReliefRect(hdc, rect, 2, 0);
332     InflateRect(&rect, -3, -3);
333     DrawReliefRect(hdc, rect, 1, 1);
334     if (!lphs->ThumbActive) {
335         InvalidateRect(lphs->hWndUp, NULL, TRUE);
336         UpdateWindow(lphs->hWndUp);
337         InvalidateRect(lphs->hWndDown, NULL, TRUE);
338         UpdateWindow(lphs->hWndDown);
339         }
340 EndOfPaint:
341     EndPaint( hwnd, &ps );
342 }
343
344
345
346 int CreateScrollBarStruct(HWND hwnd)
347 {
348     RECT        rect;
349     int         width, height;
350     WND  *wndPtr;
351     LPHEADSCROLL lphs;
352     wndPtr = WIN_FindWndPtr(hwnd);
353     lphs = (LPHEADSCROLL)malloc(sizeof(HEADSCROLL));
354     if (lphs == 0) {
355         printf("Bad Memory Alloc on ScrollBar !\n");
356         return 0;
357         }
358
359 #ifdef DEBUG_SCROLL
360         printf("CreateScrollBarStruct %lX !\n", lphs);
361 #endif
362     *((LPHEADSCROLL *)&wndPtr->wExtra[1]) = lphs;
363     lphs->ThumbActive = FALSE;
364     lphs->MinVal = 0;
365     lphs->MaxVal = 100;
366     lphs->CurVal = 0;
367     lphs->CurPix = 0;
368     width = wndPtr->rectClient.right - wndPtr->rectClient.left;
369     height = wndPtr->rectClient.bottom - wndPtr->rectClient.top;
370     if (width <= height)
371         {
372         lphs->MaxPix = height - 3 * width;
373         lphs->Direction = WM_VSCROLL;
374         lphs->hWndUp = CreateWindow("BUTTON", "", 
375                 WS_CHILD | WS_VISIBLE | BS_OWNERDRAW,
376                 0, 0, width, width, hwnd, 1, wndPtr->hInstance, 0L);
377         lphs->hWndDown = CreateWindow("BUTTON", "", 
378                 WS_CHILD | WS_VISIBLE | BS_OWNERDRAW,
379                 0, height - width, width, width, hwnd, 2,
380                 wndPtr->hInstance, 0L);
381         }
382     else
383         {
384         lphs->MaxPix = width - 3 * height;
385         lphs->Direction = WM_HSCROLL;
386         lphs->hWndUp = CreateWindow("BUTTON", "", 
387                 WS_CHILD | WS_VISIBLE | BS_OWNERDRAW,
388                 0, 0, height, height, hwnd, 3, wndPtr->hInstance, 0L);
389         lphs->hWndDown = CreateWindow("BUTTON", "", 
390                 WS_CHILD | WS_VISIBLE | BS_OWNERDRAW,
391                 width - height, 0, height, height, hwnd, 4,
392                 wndPtr->hInstance, 0L);
393         }
394     if (lphs->MaxPix < 1)  lphs->MaxPix = 1;
395     if (wndPtr->hCursor == (HCURSOR)NULL)
396         wndPtr->hCursor = LoadCursor((HINSTANCE)NULL, IDC_ARROW);
397     return TRUE;
398 }
399
400
401 /*************************************************************************
402  *                      GetScrollWindowHandle
403  */
404 HWND GetScrollWindowHandle(HWND hWnd, int nBar)
405 {
406     WND *wndPtr;
407     if (nBar != SB_CTL) {
408     wndPtr = WIN_FindWndPtr(hWnd);
409         if (nBar == SB_VERT) return wndPtr->hWndVScroll;
410         if (nBar == SB_HORZ) return wndPtr->hWndHScroll;
411         return (HWND)NULL;
412         }
413     return hWnd;
414 }
415
416
417 /*************************************************************************
418  *                      SetScrollPos [USER.62]
419  */
420 int SetScrollPos(HWND hwnd, int nBar, int nPos, BOOL bRedraw)
421 {
422     int nRet;
423     LPHEADSCROLL lphs;
424     hwnd = GetScrollWindowHandle(hwnd, nBar);
425     lphs = ScrollBarGetStorageHeader(hwnd);
426     if (lphs == NULL) return 0;
427     nRet = lphs->CurVal;
428     lphs->CurVal = (short)nPos;
429     if (lphs->MaxVal != lphs->MinVal)
430         lphs->CurPix = lphs->MaxPix * (abs((short)nPos) - abs(lphs->MinVal)) / 
431                 (abs(lphs->MaxVal) - abs(lphs->MinVal));
432     if (lphs->CurPix > lphs->MaxPix)  lphs->CurPix = lphs->MaxPix;
433 #ifdef DEBUG_SCROLL
434     printf("SetScrollPos val=%d pixval=%d pixmax%d\n",
435             (short)nPos, lphs->CurPix, lphs->MaxPix);
436     printf("SetScrollPos min=%d max=%d\n", 
437             lphs->MinVal, lphs->MaxVal);
438 #endif
439     if ((bRedraw) && (IsWindowVisible(hwnd))) {
440         InvalidateRect(hwnd, NULL, TRUE);
441         UpdateWindow(hwnd);
442         }
443     return nRet;
444 }
445
446
447
448 /*************************************************************************
449  *                      GetScrollPos [USER.63]
450  */
451 int GetScrollPos(HWND hwnd, int nBar)
452 {
453     LPHEADSCROLL lphs;
454     hwnd = GetScrollWindowHandle(hwnd, nBar);
455     lphs = ScrollBarGetStorageHeader(hwnd);
456     if (lphs == NULL) return 0;
457     return lphs->CurVal;
458 }
459
460
461
462 /*************************************************************************
463  *                      SetScrollRange [USER.64]
464  */
465 void SetScrollRange(HWND hwnd, int nBar, int MinPos, int MaxPos, BOOL bRedraw)
466 {
467     LPHEADSCROLL lphs;
468     hwnd = GetScrollWindowHandle(hwnd, nBar);
469     lphs = ScrollBarGetStorageHeader(hwnd);
470     if (lphs == NULL) return;
471     lphs->MinVal = (short)MinPos;
472     lphs->MaxVal = (short)MaxPos;
473     if (lphs->MaxVal != lphs->MinVal)
474         lphs->CurPix = abs(lphs->MaxVal) * 
475                 (abs(lphs->CurVal) - abs(lphs->MinVal)) / 
476                 (abs(lphs->MaxVal) - abs(lphs->MinVal));
477     if (lphs->CurPix > lphs->MaxPix)  lphs->CurPix = lphs->MaxPix;
478 #ifdef DEBUG_SCROLL
479     printf("SetScrollRange min=%d max=%d\n", lphs->MinVal, lphs->MaxVal);
480 #endif
481     if ((bRedraw) && (IsWindowVisible(hwnd))) {
482         InvalidateRect(hwnd, NULL, TRUE);
483         UpdateWindow(hwnd);
484         }
485 }
486
487
488
489 /*************************************************************************
490  *                      GetScrollRange [USER.65]
491  */
492 void GetScrollRange(HWND hwnd, int nBar, LPINT lpMin, LPINT lpMax)
493 {
494     LPHEADSCROLL lphs;
495     hwnd = GetScrollWindowHandle(hwnd, nBar);
496     lphs = ScrollBarGetStorageHeader(hwnd);
497     if (lphs == NULL) return;
498     *lpMin = lphs->MinVal;
499     *lpMax = lphs->MaxVal;
500 }
501
502
503
504 /*************************************************************************
505  *                      ShowScrollBar [USER.267]
506  */
507 void ShowScrollBar(HWND hWnd, WORD wBar, BOOL bFlag)
508 {
509     WND  *wndPtr;
510 #ifdef DEBUG_SCROLL
511     printf("ShowScrollBar hWnd=%04X wBar=%d bFlag=%d\n", hWnd, wBar, bFlag);
512 #endif
513     if (wBar == SB_CTL) {
514         if (bFlag)
515             ShowWindow(hWnd, SW_SHOW);
516         else
517             ShowWindow(hWnd, SW_HIDE);
518         return;
519         }
520     wndPtr = WIN_FindWndPtr(hWnd);
521     if ((wBar == SB_VERT) || (wBar == SB_BOTH)) {
522         if (bFlag)
523             ShowWindow(wndPtr->hWndVScroll, SW_SHOW);
524         else
525             ShowWindow(wndPtr->hWndVScroll, SW_HIDE);
526         }
527     if ((wBar == SB_HORZ) || (wBar == SB_BOTH)) {
528         if (bFlag)
529             ShowWindow(wndPtr->hWndHScroll, SW_SHOW);
530         else
531             ShowWindow(wndPtr->hWndHScroll, SW_HIDE);
532         }
533 }
534
535