Changeset 1387 for trunk/src


Ignore:
Timestamp:
Oct 21, 1999, 12:35:54 AM (26 years ago)
Author:
sandervl
Message:

Combobox fixes + scrollbar position fix

Location:
trunk/src/user32
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/combo.cpp

    r1368 r1387  
    1 /* $Id: combo.cpp,v 1.6 1999-10-20 06:38:08 sandervl Exp $ */
     1/* $Id: combo.cpp,v 1.7 1999-10-20 22:35:52 sandervl Exp $ */
    22/*
    33 * Combo controls
     
    375375  else
    376376  {
     377    //SvL: Listbox size might have changed!
     378    if(lphc->hWndLBox)
     379        GetWindowRect(lphc->hWndLBox, lprLB);
     380
    377381    /*
    378382     * Make sure the dropped width is as large as the combobox itself.
     
    470474  LPCREATESTRUCTA  lpcs = (CREATESTRUCTA*)lParam;
    471475
     476//testestest
     477#if 1
     478  lphc->dwStyle |= CBS_SIMPLE;
     479#else
    472480  if( !CB_GETTYPE(lphc) ) lphc->dwStyle |= CBS_SIMPLE;
    473481  else if( CB_GETTYPE(lphc) != CBS_DROPDOWNLIST ) lphc->wState |= CBF_EDIT;
     482#endif
    474483
    475484  lphc->hwndself  = hwnd;
     
    15461555static void COMBO_Size( LPHEADCOMBO lphc )
    15471556  {
     1557  dprintf(("COMBO_Size"));
    15481558  CBCalcPlacement(lphc->hwndself,
    15491559                  lphc,
  • trunk/src/user32/pmwindow.cpp

    r1376 r1387  
    1 /* $Id: pmwindow.cpp,v 1.37 1999-10-20 13:46:26 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.38 1999-10-20 22:35:53 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    911911        HWND      hParent = NULLHANDLE, hFrame = NULLHANDLE;
    912912
     913        dprintf(("OS2Subclass: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    913914        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break;
    914915
    915         if(pswp->fl & (SWP_MOVE | SWP_SIZE))
    916           hFrame = WinQueryWindow(hwnd, QW_PARENT);
     916        hParent = hFrame = WinQueryWindow(hwnd, QW_PARENT);
    917917
    918918        OSLibMapSWPtoWINDOWPOS(pswp,&wp, &swpOld,hParent,hFrame);
    919919
    920         win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
     920        win32wnd->setWindowRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
    921921        win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
     922        wp.x = swpOld.x;
     923        wp.y = swpOld.y;
     924        wp.cx = swpOld.cx;
     925        wp.cy = swpOld.cy;
     926
     927        wp.hwnd = win32wnd->getWindowHandle();
    922928
    923929        win32wnd->MsgPosChanged((LPARAM)&wp);
  • trunk/src/user32/user32.cpp

    r1377 r1387  
    1 /* $Id: user32.cpp,v 1.45 1999-10-20 13:48:07 phaller Exp $ */
     1/* $Id: user32.cpp,v 1.46 1999-10-20 22:35:54 sandervl Exp $ */
    22
    33/*
     
    22622262}
    22632263
    2264 /* Coordinate Space and Transformation Functions */
    2265 
    2266 int WIN32API MapWindowPoints( HWND hWndFrom, HWND hWndTo, LPPOINT lpPoints, UINT cPoints)
    2267 {
    2268 #ifdef DEBUG
    2269     WriteLog("USER32:  MapWindowPoints\n");
    2270 #endif
    2271     hWndFrom = Win32Window::Win32ToOS2Handle(hWndFrom);
    2272     hWndTo = Win32Window::Win32ToOS2Handle(hWndTo);
    2273 
    2274     return O32_MapWindowPoints(hWndFrom,hWndTo,lpPoints,cPoints);
    2275 }
    2276 //******************************************************************************
    2277 //******************************************************************************
    2278 BOOL WIN32API ScreenToClient (HWND hwnd, LPPOINT pt)
    2279 {
    2280     Win32BaseWindow *wnd;
    2281     PRECT rcl;
    2282 
    2283     dprintf(("ScreenToClient %x (%d,%d)\n", hwnd, pt->x, pt->y));
    2284 
    2285     if (!hwnd) return (TRUE);
    2286     wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
    2287     if (!wnd) return (TRUE);
    2288 
    2289     rcl   = wnd->getClientRect();
    2290     pt->y = ScreenHeight - pt->y;
    2291     OSLibWinMapWindowPoints (OSLIB_HWND_DESKTOP, wnd->getOS2WindowHandle(), (OSLIBPOINT *)pt, 1);
    2292     pt->y = (rcl->bottom - rcl->top) - pt->y;
    2293     dprintf(("ScreenToClient %x returned (%d,%d)\n", hwnd, pt->x, pt->y));
    2294     return (TRUE);
    2295 }
    2296 
    22972264/* Icon Functions */
    22982265int WIN32API LookupIconIdFromDirectory(PBYTE presbits, BOOL fIcon)
  • trunk/src/user32/window.cpp

    r1351 r1387  
    1 /* $Id: window.cpp,v 1.21 1999-10-18 11:59:58 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.22 1999-10-20 22:35:54 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    318318        return 0;
    319319    }
    320     dprintf(("GetParent %x", hwnd));
     320//    dprintf(("GetParent %x", hwnd));
    321321    return window->GetParent();
    322322}
     
    715715 HWND hwndWin32 = hwnd;
    716716
    717 #if 1
    718717 Win32BaseWindow *window;
    719718
     
    728727    dprintf(("GetClientRect of %X returned (%d,%d) (%d,%d)\n", hwndWin32, pRect->left, pRect->top, pRect->right, pRect->bottom));
    729728    return TRUE;
    730 #else
    731     hwnd = Win32BaseWindow::Win32ToOS2Handle(hwnd);
    732     rc = OSLibWinQueryWindowRect(hwnd, pRect);
    733     dprintf(("GetClientRect of %X returned (%d,%d) (%d,%d)\n", hwndWin32, pRect->left, pRect->top, pRect->right, pRect->bottom));
    734     return rc;
    735 #endif
    736729}
    737730//******************************************************************************
     
    747740    dprintf(("AdjustWindowRectEx %x %x %d (%d,%d)(%d,%d)\n", style, exStyle, menu, rect->right, rect->top, rect->left, rect->bottom));
    748741
    749 #if 0
    750     O32_AdjustWindowRectEx(rect, style, menu, exStyle);
    751 #else
    752742    /* Correct the window style */
    753743    if (!(style & (WS_POPUP | WS_CHILD)))  /* Overlapped window */
     
    761751    Win32BaseWindow::NC_AdjustRectOuter( rect, style, menu, exStyle );
    762752    Win32BaseWindow::NC_AdjustRectInner( rect, style, exStyle );
    763 #endif
    764753
    765754    dprintf(("AdjustWindowRectEx returned (%d,%d)(%d,%d)\n", rect->right, rect->top, rect->left, rect->bottom));
    766755    return TRUE;
     756}
     757//******************************************************************************
     758/* Coordinate Space and Transformation Functions */
     759//******************************************************************************
     760int WIN32API MapWindowPoints(HWND hwndFrom, HWND hwndTo, LPPOINT lpPoints,
     761                             UINT cPoints)
     762{
     763 Win32BaseWindow *wndfrom, *wndto;
     764 int retval = 0;
     765 OSLIBPOINT point;
     766
     767    if(lpPoints == NULL || cPoints == 0) {
     768        SetLastError(ERROR_INVALID_PARAMETER);
     769        return 0;
     770    }
     771    if(hwndFrom)
     772    {
     773        wndfrom = Win32BaseWindow::GetWindowFromHandle(hwndFrom);
     774        if(!wndfrom) {
     775            dprintf(("MapWindowPoints, window %x not found", hwndFrom));
     776            SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     777            return 0;
     778        }
     779    }
     780    else wndfrom = windowDesktop;
     781
     782    if(hwndTo)
     783    {
     784        wndto = Win32BaseWindow::GetWindowFromHandle(hwndTo);
     785        if(!wndto) {
     786            dprintf(("MapWindowPoints, window %x not found", hwndTo));
     787            SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     788            return 0;
     789        }
     790    }
     791    else wndto = windowDesktop;
     792
     793    if(wndto == wndfrom)
     794        return 0; //nothing to do
     795
     796    dprintf(("USER32: MapWindowPoints %x to %x (%d,%d) (%d)", hwndFrom, hwndTo, lpPoints->x, lpPoints->y, cPoints));
     797    point.x = lpPoints->x;
     798    point.y = wndfrom->getWindowHeight() - lpPoints->y;
     799
     800    OSLibWinMapWindowPoints(wndfrom->getOS2WindowHandle(), wndto->getOS2WindowHandle(), &point, 1);
     801    point.y = wndto->getWindowHeight() - point.y;
     802
     803    WORD xinc = point.x - lpPoints->x;
     804    WORD yinc = point.y - lpPoints->y;
     805
     806    for(int i=1;i<cPoints;i++)
     807    {
     808        lpPoints[i].x += xinc;
     809        lpPoints[i].y += yinc;
     810    }
     811    retval = ((DWORD)yinc << 16) | xinc;
     812    return retval;
     813}
     814//******************************************************************************
     815//******************************************************************************
     816BOOL WIN32API ScreenToClient (HWND hwnd, LPPOINT pt)
     817{
     818    Win32BaseWindow *wnd;
     819    PRECT rcl;
     820
     821    dprintf(("ScreenToClient %x (%d,%d)\n", hwnd, pt->x, pt->y));
     822
     823    if (!hwnd) return (TRUE);
     824    wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
     825    if (!wnd) return (TRUE);
     826
     827    rcl   = wnd->getClientRect();
     828    pt->y = ScreenHeight - pt->y;
     829    OSLibWinMapWindowPoints (OSLIB_HWND_DESKTOP, wnd->getOS2WindowHandle(), (OSLIBPOINT *)pt, 1);
     830    pt->y = (rcl->bottom - rcl->top) - pt->y;
     831    dprintf(("ScreenToClient %x returned (%d,%d)\n", hwnd, pt->x, pt->y));
     832    return (TRUE);
    767833}
    768834//******************************************************************************
     
    12801346
    12811347  if(lpfn == NULL) {
    1282         dprintf(("EnumChildWindows invalid parameter %x %x\n", hwnd, lParam));
     1348    dprintf(("EnumChildWindows invalid parameter %x %x\n", hwnd, lParam));
    12831349        SetLastError(ERROR_INVALID_PARAMETER);
    12841350        return FALSE;
Note: See TracChangeset for help on using the changeset viewer.