Changeset 1391 for trunk/src


Ignore:
Timestamp:
Oct 21, 1999, 2:19:29 PM (26 years ago)
Author:
sandervl
Message:

wm_adjustwindowpos & combobox fixes

Location:
trunk/src/user32
Files:
6 edited

Legend:

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

    r1387 r1391  
    1 /* $Id: combo.cpp,v 1.7 1999-10-20 22:35:52 sandervl Exp $ */
     1/* $Id: combo.cpp,v 1.8 1999-10-21 12:19:26 sandervl Exp $ */
    22/*
    33 * Combo controls
     
    165165{
    166166  RECT windowRect;
     167
     168  //SvL: Doesn't work for us
     169  return;
    167170
    168171  GetWindowRect(CB_HWND(lphc), &windowRect);
     
    181184                windowRect.right  - windowRect.left,
    182185                windowRect.bottom - windowRect.top +
    183                   lphc->droppedRect.bottom - lphc->droppedRect.top,
     186                lphc->droppedRect.bottom - lphc->droppedRect.top,
    184187                SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
    185188}
     
    431434  WINDOWPOS*  posChanging)
    432435{
     436  dprintf(("COMBO_WindowPosChanging"));
     437
    433438  /*
    434439   * We need to override the WM_WINDOWPOSCHANGING method to handle all
     
    474479  LPCREATESTRUCTA  lpcs = (CREATESTRUCTA*)lParam;
    475480
    476 //testestest
    477 #if 1
    478   lphc->dwStyle |= CBS_SIMPLE;
    479 #else
    480481  if( !CB_GETTYPE(lphc) ) lphc->dwStyle |= CBS_SIMPLE;
    481482  else if( CB_GETTYPE(lphc) != CBS_DROPDOWNLIST ) lphc->wState |= CBF_EDIT;
    482 #endif
    483483
    484484  lphc->hwndself  = hwnd;
  • trunk/src/user32/oslibwin.cpp

    r1376 r1391  
    1 /* $Id: oslibwin.cpp,v 1.32 1999-10-20 13:46:26 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.33 1999-10-21 12:19:26 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    486486   HWND   hWinAfter;
    487487   ULONG  flags = 0;
    488    SWP    swpFrame;
     488   SWP    swpFrame, swpClient;
    489489   POINTL point;
    490490
     
    508508    if (  fuFlags & SWP_SHOW)        flags |= SWP_SHOWWINDOW_W;
    509509    if (  fuFlags & SWP_HIDE)        flags |= SWP_HIDEWINDOW_W;
     510    if (  fuFlags & SWP_NOADJUST)    flags |= SWP_NOSENDCHANGING_W;
    510511
    511512    WinQueryWindowPos(hFrame, &swpFrame);
     513
     514    if ( fuFlags & SWP_NOADJUST) {
     515        WinQueryWindowPos(WinWindowFromID(hFrame, FID_CLIENT), &swpClient);
     516        x  = swpClient.x;
     517        cx = swpClient.cx;
     518        y  = swpClient.y;
     519        cy = swpClient.cy;
     520    }
    512521
    513522    if(fuFlags & (SWP_MOVE | SWP_SIZE))
     
    596605   if (  fuFlags & SWP_SHOWWINDOW_W)  flags |= SWP_SHOW;
    597606   if (  fuFlags & SWP_HIDEWINDOW_W)  flags |= SWP_HIDE;
     607   if (  fuFlags & SWP_NOSENDCHANGING_W) flags |= SWP_NOADJUST;
    598608
    599609   if (flags & (SWP_MOVE | SWP_SIZE))
  • trunk/src/user32/pmwindow.cpp

    r1387 r1391  
    1 /* $Id: pmwindow.cpp,v 1.38 1999-10-20 22:35:53 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.39 1999-10-21 12:19:27 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    253253      WINDOWPOS wp;
    254254      ULONG     parentHeight = 0;
    255       HWND      hParent = NULLHANDLE, hFrame = NULLHANDLE;
     255      HWND      hParent = NULLHANDLE, hFrame = NULLHANDLE, hwndAfter;
    256256
    257257        dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    258258
    259         if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break;
    260         if(!win32wnd->CanReceiveSizeMsgs()) break;
     259        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) goto RunDefWndProc;;
     260
     261        //SvL: TODO: Workaround. Why is this happening?
     262        //     When this flag is set the coordinates are 0, even though SWP_SIZE & SWP_MOVE are set.
     263//        if ((pswp->fl & SWP_NOADJUST)) goto RunDefWndProc;
     264
     265        if(!win32wnd->CanReceiveSizeMsgs()) goto RunDefWndProc;;
    261266
    262267        WinQueryWindowPos(hwnd, &swpOld);
     
    267272                        hParent = win32wnd->getParent()->getOS2WindowHandle();
    268273                }
    269                 else    break;
    270             }
    271         }
     274                else    goto RunDefWndProc;;
     275            }
     276        }
     277        hwndAfter = pswp->hwndInsertBehind;
    272278        hFrame = win32wnd->getOS2FrameWindowHandle();
    273279        OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hFrame);
     
    285291            OSLibMapWINDOWPOStoSWP(&wp, pswp, &swpOld, hParent, hFrame);
    286292            dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    287             //TODO: What should we return here? 0 means no changes, but the AWP flags
    288             //      aren't very useful either
     293            pswp->fl |= SWP_NOADJUST;
     294            pswp->hwndInsertBehind = hwndAfter;
     295            pswp->hwnd = hFrame;
     296
     297            WinSetMultWindowPos(GetThreadHAB(), pswp, 1);
     298            return (MRESULT)0;
    289299        }
    290300        break;
     
    301311      LONG      xDelta = pswp->cx - swpOld.cx;
    302312
    303         dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     313        dprintf(("OS2: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    304314
    305315        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break;
     
    314324            }
    315325        }
    316         hFrame = WinQueryWindow(hwnd, QW_PARENT);
    317         OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hFrame);
     326        OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hwnd);
    318327
    319328        win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
     
    388397    }
    389398
    390     case WM_MOVE:
    391     {
    392         if (!win32wnd->isFrameWindow()) break;
    393 
    394         HWND      hFrame = win32wnd->getOS2FrameWindowHandle();
    395         SWP       swp, swpo;
    396         WINDOWPOS wp;
    397         ULONG     parentHeight = 0;
    398         RECTL     rcl;
    399 
    400         WinQueryWindowRect (hwnd, &rcl);
    401         WinMapWindowPoints (hwnd, hFrame, (PPOINTL)&rcl, 2);
    402         swp.x  = swpo.x  = rcl.xLeft;
    403         swp.y  = swpo.y  = rcl.yBottom;
    404         swp.cx = swpo.cx = rcl.xRight - rcl.xLeft;
    405         swp.cy = swpo.cy = rcl.yTop   - rcl.yBottom;
    406         swp.fl = SWP_MOVE | SWP_NOREDRAW;
    407         swp.hwnd             = hwnd;
    408         swp.hwndInsertBehind = NULLHANDLE;
    409         dprintf(("OS2: WM_MOVE %x %x (%d,%d) (%d,%d)", hwnd, swp.fl, swp.x, swp.y, swp.cx, swp.cy));
    410 
    411         OSLibMapSWPtoWINDOWPOS(&swp, &wp, &swpo, NULLHANDLE, hFrame);
    412 
    413         wp.flags &= ~SWP_NOMOVE_W;
    414         wp.hwnd = win32wnd->getWindowHandle();
    415         win32wnd->setWindowRect(wp.x, wp.y, wp.x + wp.cx, wp.y + wp.cy);
    416         win32wnd->setClientRect(swpo.x, swpo.y, swpo.x + swpo.cx, swpo.y + swpo.cy);
    417         win32wnd->MsgPosChanged((LPARAM)&wp);
    418         break;
    419     }
    420 
    421399    case WM_SIZE:
    422400    {
    423         break;
     401        dprintf(("OS2: WM_SIZE (%d,%d) (%d,%d)", SHORT1FROMMP(mp2), SHORT2FROMMP(mp2), SHORT1FROMMP(mp1), SHORT2FROMMP(mp2)));
     402        break;
     403    }
     404
     405    case WM_OWNERPOSCHANGE:
     406    {
     407        dprintf(("OS2: WM_OWNERPOSCHANGE"));
     408        goto RunDefWndProc;
     409    }
     410
     411    case WM_CALCVALIDRECTS:
     412    {
     413        dprintf(("OS2: WM_CALCVALIDRECTS"));
     414        goto RunDefWndProc;
    424415    }
    425416
     
    820811            win32wnd->setEraseBkgnd (!erased, !erased);
    821812        }
    822 
    823813        break;
    824814    }
     
    853843    case WM_SYSCOLORCHANGE:
    854844    case WM_SYSVALUECHANGED:
    855     case WM_CALCVALIDRECTS:
    856845    case WM_SETSELECTION:
    857846    case WM_PPAINT:
  • trunk/src/user32/win32dlg.cpp

    r1346 r1391  
    1 /* $Id: win32dlg.cpp,v 1.18 1999-10-17 20:18:45 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.19 1999-10-21 12:19:27 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    2020#include "oslibmsg.h"
    2121#include "win32wdesktop.h"
     22#include "controls.h"
    2223
    2324#define DEFAULT_DLGFONT "9.WarpSans"
     
    770771        if (hwndCurFocus)
    771772        {
    772 #if 0
    773             WND *wnd = WIN_FindWndPtr( hwndFocus );
    774 
    775             if( wnd )
     773            Win32BaseWindow *wndFocus = Win32BaseWindow::GetWindowFromHandle(hwndFocus);
     774
     775            if(wndFocus)
    776776            {
    777777                /* always make combo box hide its listbox control */
    778                 if( WIDGETS_IsControl( wnd, BIC32_COMBO ) )
    779                     SendMessageA( hwndFocus, CB_SHOWDROPDOWN, FALSE, 0 );
     778                if( WIDGETS_IsControl( wndFocus, COMBOBOX_CONTROL ) )
     779                    wndFocus->SendMessageA(CB_SHOWDROPDOWN, FALSE, 0 );
    780780                else
    781                 if( WIDGETS_IsControl( wnd, BIC32_EDIT ) &&
    782                     WIDGETS_IsControl( wnd->parent, BIC32_COMBO ))
    783                     SendMessageA(CB_SHOWDROPDOWN, FALSE, 0 );
     781                if( WIDGETS_IsControl( wndFocus, EDIT_CONTROL ) &&
     782                    WIDGETS_IsControl( wndFocus->getParent(), COMBOBOX_CONTROL ))
     783                    wndFocus->SendMessageA(CB_SHOWDROPDOWN, FALSE, 0 );
    784784            }
    785 #endif
    786785        }
    787786        return DefWindowProcA( msg, wParam, lParam );
  • trunk/src/user32/win32wbase.cpp

    r1376 r1391  
    1 /* $Id: win32wbase.cpp,v 1.57 1999-10-20 13:46:27 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.58 1999-10-21 12:19:28 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    675675
    676676//        OffsetRect(&rectWindow, maxPos.x - rectWindow.left, maxPos.y - rectWindow.top);
    677         dprintf(("Sending WM_CREATE"));
    678677        if( (SendMessageA(WM_CREATE, 0, (LPARAM)cs )) != -1 )
    679678        {
  • trunk/src/user32/win32wbasepos.cpp

    r1376 r1391  
    1 /* $Id: win32wbasepos.cpp,v 1.4 1999-10-20 13:46:28 sandervl Exp $ */
     1/* $Id: win32wbasepos.cpp,v 1.5 1999-10-21 12:19:29 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (nonclient/position methods)
     
    426426{
    427427 POINT maxSize, minTrack;
     428 int   rc = 1;
    428429
    429430    if (winpos->flags & SWP_NOSIZE)
     
    431432
    432433    if ((getStyle() & WS_THICKFRAME) ||
    433             ((getStyle() & (WS_POPUP | WS_CHILD)) == 0))
    434     {
    435             GetMinMaxInfo(&maxSize, NULL, &minTrack, NULL );
    436             if (maxSize.x < winpos->cx) winpos->cx = maxSize.x;
    437             if (maxSize.y < winpos->cy) winpos->cy = maxSize.y;
    438             if (!(getStyle() & WS_MINIMIZE))
    439             {
    440             if (winpos->cx < minTrack.x ) winpos->cx = minTrack.x;
    441             if (winpos->cy < minTrack.y ) winpos->cy = minTrack.y;
    442         }
    443         return 0;
     434        ((getStyle() & (WS_POPUP | WS_CHILD)) == 0))
     435    {
     436        GetMinMaxInfo(&maxSize, NULL, &minTrack, NULL );
     437        if (maxSize.x < winpos->cx) {
     438            winpos->cx = maxSize.x;
     439            rc = 0;
     440        }
     441        if (maxSize.y < winpos->cy) {
     442            winpos->cy = maxSize.y;
     443            rc = 0;
     444        }
     445        if (!(getStyle() & WS_MINIMIZE))
     446        {
     447            if (winpos->cx < minTrack.x ) {
     448                winpos->cx = minTrack.x;
     449                rc = 0;
     450            }
     451            if (winpos->cy < minTrack.y ) {
     452                winpos->cy = minTrack.y;
     453                rc = 0;
     454            }
     455        }
    444456    }
    445     return 1;
     457    return rc;
    446458}
    447459//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.