Changeset 2076 for trunk/src


Ignore:
Timestamp:
Dec 14, 1999, 8:13:20 PM (26 years ago)
Author:
sandervl
Message:

MDI changes + WM_INITMENU support added + disabled experimental support for CS_PARENTDC style

Location:
trunk/src/user32
Files:
6 edited

Legend:

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

    r2016 r2076  
    1 /* $Id: dc.cpp,v 1.27 1999-12-07 20:43:39 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.28 1999-12-14 19:13:18 sandervl Exp $ */
    22
    33/*
     
    610610   if (hwnd)
    611611   {
    612       wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
    613       if (flags & DCX_WINDOW_W)
    614          hWindow = wnd->getOS2FrameWindowHandle();
    615       else
    616          hWindow = wnd->getOS2WindowHandle();
     612        wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
     613        if(wnd == NULL) {
     614                dprintf (("ERROR: User32: GetDCEx bad window handle %X!!!!!", hwnd));
     615                O32_SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);
     616                return 0;
     617        }
     618//SvL: Experimental change (doesn't work right)
     619#if 0
     620        if(wnd->fHasParentDC() && wnd->getParent()) {
     621                wnd = wnd->getParent();
     622        }
     623#endif
     624        if (flags & DCX_WINDOW_W)
     625                hWindow = wnd->getOS2FrameWindowHandle();
     626        else
     627                hWindow = wnd->getOS2WindowHandle();
    617628   }
    618629   else
  • trunk/src/user32/pmwindow.cpp

    r1981 r2076  
    1 /* $Id: pmwindow.cpp,v 1.63 1999-12-05 14:31:41 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.64 1999-12-14 19:13:19 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    781781
    782782    case WM_INITMENU:
     783        win32wnd->MsgInitMenu((HWND)mp2);
     784        break;
     785
    783786    case WM_MENUSELECT:
    784787    case WM_MENUEND:
  • trunk/src/user32/win32class.cpp

    r2041 r2076  
    1 /* $Id: win32class.cpp,v 1.9 1999-12-09 11:00:02 sandervl Exp $ */
     1/* $Id: win32class.cpp,v 1.10 1999-12-14 19:13:19 sandervl Exp $ */
    22/*
    33 * Win32 Window Class Managment Code for OS/2
     
    107107  windowStyle           = wndclass->style;
    108108  WINPROC_SetProc((HWINDOWPROC *)&windowProc, wndclass->lpfnWndProc, (isUnicode) ? WIN_PROC_32W : WIN_PROC_32A, WIN_PROC_CLASS);
     109  dprintf2(("Window class ptr %x", windowProc));
    109110
    110111  //User data class words/longs
     
    392393 ULONG rc;
    393394
     395  if(classNameA) {
     396        dprintf2(("Win32WndClass::setClassLongA %s: %d %x", classNameA, index, lNewVal));
     397  }
     398  else  dprintf2(("Win32WndClass::setClassLongA %d: %d %x", classAtom, index, lNewVal));
    394399  switch(index) {
    395400        case GCL_CBCLSEXTRA: //TODO (doesn't affect allocated classes, so what does it do?)
  • trunk/src/user32/win32wbase.cpp

    r2040 r2076  
    1 /* $Id: win32wbase.cpp,v 1.109 1999-12-09 10:59:04 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.110 1999-12-14 19:13:19 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    147147  fCreated         = FALSE;
    148148  fTaskList        = FALSE;
     149  fParentDC        = FALSE;
    149150
    150151  windowNameA      = NULL;
     
    270271BOOL Win32BaseWindow::IsWindowUnicode()
    271272{
     273//    dprintf2(("IsWindowUnicode %x %d", getWindowHandle(), WINPROC_GetProcType(getWindowProc()) == WIN_PROC_32W));
    272274    return (WINPROC_GetProcType(getWindowProc()) == WIN_PROC_32W);
    273275}
     
    440442  }
    441443
    442   WINPROC_SetProc((HWINDOWPROC *)&win32wndproc, windowClass->getWindowProc(), (isUnicode) ? WIN_PROC_32W : WIN_PROC_32A, WIN_PROC_WINDOW);
     444  WINPROC_SetProc((HWINDOWPROC *)&win32wndproc, windowClass->getWindowProc(), WINPROC_GetProcType(windowClass->getWindowProc()), WIN_PROC_WINDOW);
    443445  hInstance = cs->hInstance;
    444446  dwStyle   = cs->style & ~WS_VISIBLE;
     
    634636  if(windowClass->getStyle() & CS_OWNDC) {
    635637    dprintf(("Class with CS_OWNDC style"));
    636 //  ownDC = GetWindowDC(getWindowHandle());
     638//    ownDC = GetWindowDC(getWindowHandle());
    637639  }
    638640  else
    639641  if (windowClass->getStyle() & CS_PARENTDC)  {
    640642    dprintf(("ERROR: Class with CS_PARENTDC style -> NOT IMPLEMENTED!"));
     643    fParentDC = TRUE;
    641644    ownDC = 0;
    642645  }
     
    12211224}
    12221225//******************************************************************************
     1226//TODO: Depending on menu type, we should send WM_INITMENU or WM_INITPOPUPMENU
     1227//TODO: PM sends it for each submenu that gets activated; Windows only for the first
     1228//      submenu; once the menu bar is active, moving the cursor doesn't generate other
     1229//      WM_INITMENU msgs. Not really a problem, but might need to fix this later on.
     1230//******************************************************************************
     1231void Win32BaseWindow::MsgInitMenu(HWND hMenu)
     1232{
     1233    SendInternalMessageA(WM_INITMENU, (WPARAM)hMenu, 0);
     1234}
     1235//******************************************************************************
    12231236//******************************************************************************
    12241237ULONG Win32BaseWindow::MsgPaint(ULONG tmp1, BOOL select)
     
    22232236                if(parentwindow) {
    22242237                        if(Msg == WM_CREATE || Msg == WM_DESTROY) {
    2225                                 parentwindow->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), (LPARAM)window->getWindowHandle());
     2238                                parentwindow->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, getWindowId()), (LPARAM)getWindowHandle());
    22262239                        }
    2227                         else    parentwindow->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), lParam );
     2240                        else    parentwindow->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, getWindowId()), lParam );
    22282241                }
    22292242        }
     
    29742987 LONG oldval;
    29752988
    2976     dprintf2(("SetWindowLongA %x %d %x", getWindowHandle(), index, value));
     2989    dprintf2(("SetWindowLong%c %x %d %x", (fUnicode) ? 'W' : 'A', getWindowHandle(), index, value));
    29772990    switch(index) {
    29782991        case GWL_EXSTYLE:
  • trunk/src/user32/win32wbase.h

    r2033 r2076  
    1 /* $Id: win32wbase.h,v 1.52 1999-12-09 00:53:38 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.53 1999-12-14 19:13:20 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    9898         char  *MsgGetText();
    9999         ULONG  MsgContextMenu(ULONG x,ULONG y);
    100 
     100         void   MsgInitMenu(HWND hMenu);
    101101         VOID   updateWindowStyle(DWORD oldExStyle,DWORD oldStyle);
    102102
     
    121121virtual  BOOL   isMDIClient();
    122122virtual  BOOL   isMDIChild();
     123
     124         BOOL   fHasParentDC()                  { return fParentDC; };
    123125
    124126Win32BaseWindow *getParent();
     
    186188         BOOL   IsWindowVisible();
    187189         //Created with CreateWindowExA or ExW
    188          BOOL   IsUnicode()                     { return isUnicode; };
     190//         BOOL   IsUnicode()                   { return isUnicode; };
    189191         //Window procedure type
    190192         BOOL   IsWindowUnicode();     
     
    306308        BOOL    fCreated;
    307309        BOOL    fTaskList;              //should be listed in PM tasklist or not
     310        BOOL    fParentDC;
    308311
    309312        PVOID   pOldFrameProc;
  • trunk/src/user32/win32wmdichild.cpp

    r2033 r2076  
    1 /* $Id: win32wmdichild.cpp,v 1.10 1999-12-09 00:53:38 sandervl Exp $ */
     1/* $Id: win32wmdichild.cpp,v 1.11 1999-12-14 19:13:20 sandervl Exp $ */
    22/*
    33 * Win32 MDI Child Window Class for OS/2
     
    347347    className = (LPSTR)cs->szClass;
    348348    /* Find the class atom */
    349     if (!(classAtom = (client->IsUnicode() ? GlobalFindAtomW((LPWSTR)cs->szClass) :
    350                                              GlobalFindAtomA(cs->szClass))))
    351 
     349    classAtom = GlobalFindAtomA(cs->szClass);
     350    if(classAtom == 0)
    352351    {
    353352        if (!HIWORD(cs->szClass))
    354353        {
    355             if(!client->IsUnicode())
    356             {
    357                 sprintf(tmpClassA,"#%d", (int) className);
    358                 classAtom = GlobalFindAtomA(tmpClassA);
    359                 className = tmpClassA;
    360             }
    361             else
    362             {
    363               sprintf(tmpClassA,"#%d", (int) className);
    364               AsciiToUnicode(tmpClassA, tmpClassW);
    365               classAtom = GlobalFindAtomW(tmpClassW);
    366               className = (LPSTR)tmpClassW;
    367             }
     354            sprintf(tmpClassA,"#%d", (int) className);
     355            classAtom = GlobalFindAtomA(tmpClassA);
     356            className = tmpClassA;
    368357        }
    369358        if (!classAtom)
     
    380369    createstruct.lpszClass = className;
    381370
    382     newchild = new Win32MDIChildWindow(&createstruct, classAtom, client->IsUnicode());
     371    newchild = new Win32MDIChildWindow(&createstruct, classAtom, FALSE);
    383372
    384373    if(newchild && GetLastError() == 0)
Note: See TracChangeset for help on using the changeset viewer.