Changeset 2489 for trunk/src


Ignore:
Timestamp:
Jan 21, 2000, 2:30:35 PM (26 years ago)
Author:
sandervl
Message:

Many bugfixes

Location:
trunk/src/user32
Files:
4 edited

Legend:

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

    r2483 r2489  
    1 /* $Id: oslibwin.cpp,v 1.62 2000-01-20 16:48:55 cbratschi Exp $ */
     1/* $Id: oslibwin.cpp,v 1.63 2000-01-21 13:30:34 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    613613        point.y = y;
    614614
    615         if (hParent)
     615        if(hParent)
    616616        {
    617           RECTL parentRect;
    618 
    619           WinQueryWindowRect(hParent,&parentRect);
    620           point.y = parentRect.yTop-point.y-cy;
    621         } else point.y = ScreenHeight-point.y-cy;
     617                WinMapWindowPoints(hParent, HWND_DESKTOP, &point, 1);
     618        }
     619        point.y = ScreenHeight-point.y-cy;
    622620
    623621        x  = point.x;
  • trunk/src/user32/pmwindow.cpp

    r2486 r2489  
    1 /* $Id: pmwindow.cpp,v 1.80 2000-01-20 21:45:07 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.81 2000-01-21 13:30:34 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    287287
    288288    case WM_CALCVALIDRECTS:
     289#if 1
     290    {
     291      PRECTL oldRect = (PRECTL)mp1,newRect = oldRect+1;
     292      UINT res = CVR_ALIGNLEFT | CVR_ALIGNTOP;
     293
     294//CB: todo: use WM_NCCALCSIZE result
     295      if (win32wnd->getWindowClass())
     296      {
     297        DWORD dwStyle = win32wnd->getWindowClass()->getClassLongA(GCL_STYLE_W);
     298
     299        if ((dwStyle & CS_HREDRAW_W) && (newRect->xRight-newRect->xLeft != oldRect->xRight-oldRect->xLeft))
     300          res |= CVR_REDRAW;
     301        else if ((dwStyle & CS_VREDRAW_W) && (newRect->yTop-newRect->yBottom != oldRect->yTop-oldRect->yBottom))
     302          res |= CVR_REDRAW;
     303      } else res |= CVR_REDRAW;
     304
     305      RestoreOS2TIB();
     306      return (MRESULT)res;
     307    }
     308#else
    289309      RestoreOS2TIB();
    290310      return (MRESULT)(CVR_ALIGNLEFT | CVR_ALIGNTOP);
     311#endif
    291312
    292313    case WM_SETFOCUS:
  • trunk/src/user32/win32wbase.cpp

    r2483 r2489  
    1 /* $Id: win32wbase.cpp,v 1.143 2000-01-20 16:48:56 cbratschi Exp $ */
     1/* $Id: win32wbase.cpp,v 1.144 2000-01-21 13:30:35 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    105105  OS2Hwnd          = 0;
    106106  OS2HwndFrame     = 0;
    107   hMenu            = 0;
    108107  hSysMenu         = 0;
    109108  Win32Hwnd        = 0;
     
    122121  win32wndproc     = 0;
    123122  hInstance        = 0;
    124   windowId         = 0xFFFFFFFF;        //default = -1
     123  dwIDMenu         = 0; //0xFFFFFFFF; //default -1
    125124  userData         = 0;
    126125  contextHelpId    = 0;
     
    10551054    //set new window rectangle
    10561055    setWindowRect(lpWndPos->x, lpWndPos->y, lpWndPos->x + lpWndPos->cx, lpWndPos->y + lpWndPos->cy);
    1057     if (getParent()) mapWin32Rect(getParent()->getOS2WindowHandle(),OSLIB_HWND_DESKTOP,&rectWindow);
    10581056    newWindowRect= rectWindow;
    10591057  }
     
    14141412            DWORD lParam;
    14151413
    1416             if (dwStyle & WS_CHILD)
    1417             {
    1418               lParam = MAKELONG(rectClient.left,rectClient.top);
    1419             } else
    1420             {
    1421               POINT point;
    1422 
    1423               point.x = rectClient.left;
    1424               point.y = rectClient.top;
    1425               if (getParent()) ClientToScreen(getParent()->getWindowHandle(),&point);
    1426 
    1427               lParam = MAKELONG(point.x, point.y);
    1428             }
    1429             SendInternalMessageA(WM_MOVE, 0, lParam);
     1414                if(getParent()) {//in parent coordinates
     1415                    POINT point;
     1416
     1417                    point.x = rectClient.left;
     1418                    point.y = rectClient.top;
     1419                    MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1);
     1420
     1421                    lParam = MAKELONG(point.x, point.y);
     1422                }
     1423                else {//in screen coordinates
     1424                    lParam = MAKELONG(rectWindow.left+rectClient.left, rectWindow.top+rectClient.top);
     1425                }
     1426                SendInternalMessageA(WM_MOVE, 0, lParam);
    14301427        }
    14311428        if (!(wpos->flags & SWP_NOSIZE) && !(wpos->flags & SWP_NOCLIENTSIZE))
     
    27222719//******************************************************************************
    27232720//******************************************************************************
    2724 VOID Win32BaseWindow::updateWindowStyle(DWORD oldExStyle,DWORD oldStyle)
    2725 {
    2726   if(IsWindowDestroyed()) return;
    2727 
    2728   if ((dwStyle & 0xFFFF0000) != (oldStyle & 0xFFFF0000))
    2729   {
    2730         FrameUpdateClient(this);
    2731   }
    2732 }
    2733 //******************************************************************************
    2734 //******************************************************************************
    27352721LONG Win32BaseWindow::SetWindowLongA(int index, ULONG value, BOOL fUnicode)
    27362722{
     
    27512737                SendInternalMessageA(WM_STYLECHANGING,GWL_EXSTYLE,(LPARAM)&ss);
    27522738                setExStyle(ss.styleNew);
    2753                 updateWindowStyle(ss.styleOld,getStyle());
    27542739                SendInternalMessageA(WM_STYLECHANGED,GWL_EXSTYLE,(LPARAM)&ss);
    27552740                return ss.styleOld;
     
    27682753                SendInternalMessageA(WM_STYLECHANGING,GWL_STYLE,(LPARAM)&ss);
    27692754                setStyle(ss.styleNew);
    2770                 updateWindowStyle(dwExStyle,ss.styleOld);
    27712755                SendInternalMessageA(WM_STYLECHANGED,GWL_STYLE,(LPARAM)&ss);
    27722756#ifdef DEBUG
     
    28782862void Win32BaseWindow::setWindowId(DWORD id)
    28792863{
    2880     windowId = id;
    2881     dprintf(("Set window ID to %x", id));
    2882     OSLibSetWindowID(OS2HwndFrame, id);
     2864    dwIDMenu = id;
    28832865}
    28842866//******************************************************************************
  • trunk/src/user32/win32wbase.h

    r2469 r2489  
    1 /* $Id: win32wbase.h,v 1.72 2000-01-18 20:08:17 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.73 2000-01-21 13:30:35 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    157157       WNDPROC  getWindowProc()                 { return win32wndproc; };
    158158         void   setWindowProc(WNDPROC newproc)  { win32wndproc = newproc; };
    159         DWORD   getWindowId()                   { return windowId; };
     159        DWORD   getWindowId()                   { return dwIDMenu; };
    160160         void   setWindowId(DWORD id);
    161161         ULONG  getWindowHeight()               { return rectWindow.bottom - rectWindow.top; };
     
    188188         void   setFlags(DWORD newflags)        { flags = newflags; };
    189189
    190          HMENU  GetMenu()                           { return hMenu; };
    191          VOID   SetMenu(HMENU newMenu)              { hMenu = newMenu; };
     190         HMENU  GetMenu()                           { return dwIDMenu; };
     191         VOID   SetMenu(HMENU newMenu)              { dwIDMenu = newMenu; };
    192192         void   SetSysMenu(HMENU hSystemMenu)       { hSysMenu = hSystemMenu; };
    193193         HMENU  GetSysMenu()                        { return hSysMenu; }
     
    306306        HWND    OS2Hwnd;
    307307        HWND    OS2HwndFrame;
    308         HMENU   hMenu;
    309308        HMENU   hSysMenu;
    310309        HWND    Win32Hwnd;
     
    320319//Moved in ChildWindow class
    321320/////   Win32BaseWindow *parent;                    //GWL_HWNDPARENT
    322         ULONG   windowId;               //GWL_ID
     321        ULONG   dwIDMenu;               //GWL_ID
    323322        ULONG   userData;               //GWL_USERDATA
    324323
Note: See TracChangeset for help on using the changeset viewer.