# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1052562834 0 # Node ID 720e61df8cf6cb2c0a7e0ab10aaf09b709302c69 # Parent 6a3ef130962f6d3d8b31aa0d35a40caa185bbc86 An even better combobox drawing fix. Only add 100 pixels to the size of the combobox when the list needs to be shown. This way it won't screw up clipping of items below it in the box. So OS/2 comboboxes can now be safely used in vertical boxes without worries. diff -r 6a3ef130962f -r 720e61df8cf6 os2/dw.c --- a/os2/dw.c Sat May 10 07:54:09 2003 +0000 +++ b/os2/dw.c Sat May 10 10:33:54 2003 +0000 @@ -1161,8 +1161,13 @@ if(strncmp(tmpbuf, "#2", 3)==0) { /* Make the combobox big enough to drop down. :) */ - WinSetWindowPos(handle, HWND_TOP, currentx + pad, (currenty + pad) - 100, - width + vectorx, (height + vectory) + 100, SWP_MOVE | SWP_SIZE | SWP_ZORDER); + if(dw_window_get_data(handle, "_dw_dropped")) + WinSetWindowPos(handle, HWND_TOP, currentx + pad, (currenty + pad) - 100, + width + vectorx, (height + vectory) + 100, SWP_MOVE | SWP_SIZE | SWP_ZORDER); + else + WinSetWindowPos(handle, HWND_TOP, currentx + pad, currenty + pad, + width + vectorx, height + vectory, SWP_MOVE | SWP_SIZE | SWP_ZORDER); + } else if(strncmp(tmpbuf, "#6", 3)==0) { @@ -1736,11 +1741,39 @@ case WM_SETFOCUS: _run_event(hWnd, msg, mp1, mp2); break; + case CBM_SHOWLIST: + { + int dropped = dw_window_get_data(hWnd, "_dw_dropped"); + + if(mp1) + { + if(!dropped) + { + SWP swp; + + WinQueryWindowPos(hWnd, &swp); + WinSetWindowPos(hWnd, NULLHANDLE, swp.x, swp.y - 100, swp.cx, swp.cy + 100, SWP_MOVE | SWP_SIZE); + dw_window_set_data(hWnd, "_dw_dropped", (void *)1); + } + } + else + { + if(dropped) + { + SWP swp; + + WinQueryWindowPos(hWnd, &swp); + WinSetWindowPos(hWnd, NULLHANDLE, swp.x, swp.y + 100, swp.cx, swp.cy - 100, SWP_MOVE | SWP_SIZE); + dw_window_set_data(hWnd, "_dw_dropped", (void *)0); + } + } + } + break; case WM_PAINT: { HWND entry, parent = WinQueryWindow(hWnd, QW_PARENT); HPS hpsPaint; - POINTL ptl; /* Add 6 because it has a thick border like the entryfield */ + POINTL ptl; unsigned long width, height, thumbheight = 0; ULONG color; @@ -1750,26 +1783,29 @@ if(!thumbheight) thumbheight = WinQuerySysValue(HWND_DESKTOP, SV_CYVSCROLLARROW); + /* Add 6 because it has a thick border like the entryfield */ thumbheight += 6; color = (ULONG)dw_window_get_data(parent, "_dw_fore"); dw_window_get_pos_size(hWnd, 0, 0, &width, &height); - hpsPaint = WinGetPS(hWnd); - if(color) - GpiSetColor(hpsPaint, _internal_color(color-1)); - else - GpiSetColor(hpsPaint, CLR_PALEGRAY); - - ptl.x = 0; - ptl.y = 96; - GpiMove(hpsPaint, &ptl); - - ptl.x = width; - ptl.y = height - thumbheight; - GpiBox(hpsPaint, DRO_FILL, &ptl, 0, 0); - - WinReleasePS(hpsPaint); + if(height > thumbheight) + { + hpsPaint = WinGetPS(hWnd); + if(color) + GpiSetColor(hpsPaint, _internal_color(color-1)); + else + GpiSetColor(hpsPaint, CLR_PALEGRAY); + + ptl.x = ptl.y = 0; + GpiMove(hpsPaint, &ptl); + + ptl.x = width; + ptl.y = height - thumbheight; + GpiBox(hpsPaint, DRO_FILL, &ptl, 0, 0); + + WinReleasePS(hpsPaint); + } } break; } @@ -2503,6 +2539,14 @@ return (MRESULT)TRUE; } break; + case WM_MOUSEMOVE: + { + HPOINTER ptr = (HPOINTER)dw_window_get_data(hWnd, "_dw_pointer"); + + if(ptr) + WinSetPointer(HWND_DESKTOP, ptr); + } + break; case WM_USER: windowfunc = (void (* API)(void *))mp1; @@ -3619,11 +3663,10 @@ */ void API dw_window_pointer(HWND handle, int pointertype) { - WinSetPointer(handle, - pointertype < 65535 ? - WinQuerySysPointer(HWND_DESKTOP, - pointertype, - FALSE) : (HPOINTER)pointertype); + dw_window_set_data(handle, "_dw_pointer", + pointertype < 65535 ? + (void *)WinQuerySysPointer(HWND_DESKTOP,pointertype, FALSE) + : (void *)pointertype); } /*