Changeset 6008 for trunk/src


Ignore:
Timestamp:
Jun 14, 2001, 1:30:57 PM (24 years ago)
Author:
sandervl
Message:

dispatch untranslated msgs + frame control button changes (manually change restore/min/max)

Location:
trunk/src/user32
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/USER32.DEF

    r5993 r6008  
    1 ; $Id: USER32.DEF,v 1.56 2001-06-13 10:29:44 sandervl Exp $
     1; $Id: USER32.DEF,v 1.57 2001-06-14 11:30:55 sandervl Exp $
    22
    33LIBRARY USER32 INITINSTANCE TERMINSTANCE
     
    2222    _WinQueryPointerClipRect    = PMMERGE.5433
    2323    _WinSetPointerClipRect      = PMMERGE.5434
     24    DspInitSystemDriverName     = PMGPI.656
    2425
    2526;;;; Present in WGSS50
  • trunk/src/user32/oslibmsg.cpp

    r5805 r6008  
    1 /* $Id: oslibmsg.cpp,v 1.38 2001-05-25 19:59:29 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.39 2001-06-14 11:30:55 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    273273        } while (eaten);
    274274  }
    275 
    276   OS2ToWinMsgTranslate((PVOID)teb, &os2msg, pMsg, isUnicode, MSG_REMOVE);
     275  if(OS2ToWinMsgTranslate((PVOID)teb, &os2msg, pMsg, isUnicode, MSG_REMOVE) == FALSE) {
     276      //dispatch untranslated message immediately
     277      WinDispatchMsg(teb->o.odin.hab, &os2msg);
     278      //and get the next one
     279      return OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax, isUnicode);
     280  }
     281
    277282  memcpy(&teb->o.odin.os2msg, &os2msg, sizeof(QMSG));
    278283  memcpy(&teb->o.odin.winmsg, pMsg, sizeof(MSG));
  • trunk/src/user32/oslibmsgtranslate.cpp

    r5935 r6008  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.53 2001-06-09 14:50:18 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.54 2001-06-14 11:30:55 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    575575            break;
    576576        default:
     577            dprintf(("Unknown/unsupported SC command %d", SHORT1FROMMP(os2Msg->mp1)));
    577578            goto dummymessage;
    578579        }
  • trunk/src/user32/oslibwin.cpp

    r5993 r6008  
    1 /* $Id: oslibwin.cpp,v 1.100 2001-06-13 10:29:44 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.101 2001-06-14 11:30:55 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    199199          i++;
    200200      }
     201      else return; //no titlebar -> no frame controls
    201202  }
    202203  if((dwStyle & WS_MINIMIZEBOX_W) || (dwStyle & WS_MAXIMIZEBOX_W) || (dwStyle & WS_SYSMENU_W)) {
     
    881882    else dwWinStyle &= ~WS_MINIMIZED;
    882883
     884    if(dwStyle & WS_MAXIMIZE_W) {
     885         dwWinStyle |= WS_MAXIMIZED;
     886    }
     887    else dwWinStyle &= ~WS_MAXIMIZED;
     888
    883889    if(dwWinStyle != dwOldWinStyle) {
    884890         WinSetWindowULong(hwndFrame, QWL_STYLE, dwWinStyle);
  • trunk/src/user32/pmwindow.cpp

    r5993 r6008  
    1 /* $Id: pmwindow.cpp,v 1.135 2001-06-13 10:29:45 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.136 2001-06-14 11:30:56 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    1515#define INCL_GPICONTROL         /* GPI control Functions        */
    1616#define INCL_DOSPROCESS
     17#define INCL_DOSMODULEMGR
    1718#define INCL_WINTRACKRECT
    1819
     
    5152//#define USE_CALCVALIDRECT
    5253
    53 HMQ  hmq = 0;                             /* Message queue handle         */
    54 HAB  hab = 0;
    55 
    56 RECTL desktopRectl = {0};
    57 ULONG ScreenWidth = 0;
    58 ULONG ScreenHeight = 0;
    59 ULONG ScreenBitsPerPel = 0;
    60 BOOL  fOS2Look = FALSE;
     54HMQ     hmq = 0;                             /* Message queue handle         */
     55HAB     hab = 0;
     56RECTL   desktopRectl = {0};
     57ULONG   ScreenWidth  = 0;
     58ULONG   ScreenHeight = 0;
     59ULONG   ScreenBitsPerPel = 0;
     60BOOL    fOS2Look = FALSE;
     61HBITMAP hbmFrameMenu[3] = {0};
    6162
    6263static PFNWP pfnFrameWndProc = NULL;
     
    6465MRESULT EXPENTRY Win32WindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
    6566MRESULT EXPENTRY Win32FrameWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
     67void FrameReplaceMenuItem(HWND hwndMenu, ULONG nIndex, ULONG idOld, ULONG   idNew,
     68                          HBITMAP hbmNew);
     69
     70VOID APIENTRY DspInitSystemDriverName(PSZ pszDriverName, ULONG lenDriverName);
    6671
    6772//******************************************************************************
     
    146151    /* create memory device context */
    147152    hdc = DevOpenDC(hab, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&dop, NULLHANDLE);
     153
     154    fOS2Look = PROFILE_GetOdinIniBool(ODINSYSTEM_SECTION, "OS2Look", FALSE);
     155    if(fOS2Look)
     156    {
     157        CHAR szDisplay[30];
     158        HMODULE hModDisplay;
     159
     160        SYSCOLOR_Init(FALSE); //use OS/2 colors
     161
     162        DspInitSystemDriverName(szDisplay, sizeof(szDisplay));
     163        DosQueryModuleHandle(szDisplay, &hModDisplay);
     164
     165        hbmFrameMenu[0] = GpiLoadBitmap(hdc, hModDisplay, SBMP_MINBUTTON, 0, 0);
     166        hbmFrameMenu[1] = GpiLoadBitmap(hdc, hModDisplay, SBMP_MAXBUTTON, 0, 0);
     167        hbmFrameMenu[2] = GpiLoadBitmap(hdc, hModDisplay, SBMP_RESTOREBUTTON, 0, 0);
     168    }
     169
    148170    DevQueryCaps(hdc, CAPS_COLOR_BITCOUNT, 1, (PLONG)&ScreenBitsPerPel);
    149171    DevCloseDC(hdc);
    150 
    151     fOS2Look = PROFILE_GetOdinIniBool(ODINSYSTEM_SECTION, "OS2Look", FALSE);
    152     if(fOS2Look) {
    153         SYSCOLOR_Init(FALSE); //use OS/2 colors
    154     }
    155172
    156173    dprintf(("InitPM: Desktop (%d,%d) bpp %d", ScreenWidth, ScreenHeight, ScreenBitsPerPel));
     
    164181{
    165182    if(fLooks) {
     183        CHAR szDisplay[30];
     184        HMODULE hModDisplay;
     185
    166186        SYSCOLOR_Init(FALSE); //use OS/2 colors
     187
     188        if(hbmFrameMenu[0] == 0)
     189        {
     190            CHAR szDisplay[30];
     191            HMODULE hModDisplay;
     192            HDC   hdc;              /* Device-context handle                */
     193            DEVOPENSTRUC dop = {NULL, "DISPLAY", NULL, NULL, NULL, NULL,
     194                                NULL, NULL, NULL};
     195
     196            /* create memory device context */
     197            hdc = DevOpenDC(hab, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&dop, NULLHANDLE);
     198
     199            DspInitSystemDriverName(szDisplay, sizeof(szDisplay));
     200            DosQueryModuleHandle(szDisplay, &hModDisplay);
     201
     202            hbmFrameMenu[0] = GpiLoadBitmap(hdc, hModDisplay, SBMP_MINBUTTON, 0, 0);
     203            hbmFrameMenu[1] = GpiLoadBitmap(hdc, hModDisplay, SBMP_MAXBUTTON, 0, 0);
     204            hbmFrameMenu[2] = GpiLoadBitmap(hdc, hModDisplay, SBMP_RESTOREBUTTON, 0, 0);
     205            DevCloseDC(hdc);
     206        }
    167207    }
    168208    fOS2Look = fLooks;
     
    439479
    440480    case WM_SYSCOMMAND:
     481        dprintf(("OS2: WM_SYSCOMMAND %x", hwnd));
    441482        win32wnd->DispatchMsgA(pWinMsg);
    442483        break;
     
    763804        win32wnd->MsgPosChanging((LPARAM)&wp);
    764805
     806        if(win32wnd->getOldStyle() != win32wnd->getStyle()) {
     807             OSLibSetWindowStyle(win32wnd->getOS2FrameWindowHandle(), win32wnd->getOS2WindowHandle(), win32wnd->getStyle(), win32wnd->getExStyle());
     808             if(fOS2Look) {
     809                 DWORD dwOldStyle = win32wnd->getOldStyle();
     810                 DWORD dwStyle    = win32wnd->getStyle();
     811                 
     812                 if((dwOldStyle & WS_MINIMIZE_W) && !(dwStyle & WS_MINIMIZE_W)) {
     813                     //SC_RESTORE -> SC_MINIMIZE
     814                     FrameReplaceMenuItem(WinWindowFromID(hwnd, FID_MINMAX), 0, SC_RESTORE, SC_MINIMIZE, hbmFrameMenu[0]);
     815                 }
     816                 else
     817                 if((dwOldStyle & WS_MAXIMIZE_W) && !(dwStyle & WS_MAXIMIZE_W)) {
     818                     //SC_RESTORE -> SC_MAXIMIZE
     819                     FrameReplaceMenuItem(WinWindowFromID(hwnd, FID_MINMAX), MIT_END, SC_RESTORE, SC_MAXIMIZE, hbmFrameMenu[1]);
     820                 }
     821                 else
     822                 if(!(dwOldStyle & WS_MINIMIZE_W) && (dwStyle & WS_MINIMIZE_W)) {
     823                     //SC_MINIMIZE -> SC_RESTORE
     824                     FrameReplaceMenuItem(WinWindowFromID(hwnd, FID_MINMAX), 0, SC_MINIMIZE, SC_RESTORE, hbmFrameMenu[2]);
     825                 }
     826                 else
     827                 if(!(dwOldStyle & WS_MAXIMIZE_W) && (dwStyle & WS_MAXIMIZE_W)) {
     828                     //SC_MAXIMIZE -> SC_RESTORE
     829                     FrameReplaceMenuItem(WinWindowFromID(hwnd, FID_MINMAX), MIT_END, SC_MAXIMIZE, SC_RESTORE, hbmFrameMenu[2]);
     830                 }
     831             }
     832        }
     833
    765834        if ((wp.hwndInsertAfter != wpOld.hwndInsertAfter) ||
    766835            (wp.x != wpOld.x) || (wp.y != wpOld.y) || (wp.cx != wpOld.cx) || (wp.cy != wpOld.cy) || (wp.flags != wpOld.flags))
     
    12811350        break;
    12821351
     1352    case WM_SYSCOMMAND:
     1353        dprintf(("PMFRAME: WM_SYSCOMMAND %x", win32wnd->getWindowHandle()));
     1354        win32wnd->DispatchMsgA(pWinMsg);
     1355        break;
     1356
    12831357    default:
    12841358        goto RunDefFrameWndProc;
     
    13681442//******************************************************************************
    13691443//******************************************************************************
     1444void FrameReplaceMenuItem(HWND hwndMenu, ULONG nIndex, ULONG idOld, ULONG   idNew,
     1445                          HBITMAP hbmNew)
     1446{
     1447    MENUITEM mi;
     1448
     1449    if (!hwndMenu)
     1450        return;
     1451
     1452    WinEnableWindowUpdate(hwndMenu, FALSE);
     1453
     1454    if (WinSendMsg(hwndMenu, MM_QUERYITEM, MPFROM2SHORT(idOld, TRUE), MPFROMP(&mi)))
     1455    {
     1456        WinSendMsg(hwndMenu, MM_REMOVEITEM, (MPARAM)idOld, 0);
     1457        mi.afStyle     = MIS_BITMAP | MIS_SYSCOMMAND;
     1458        mi.afAttribute = 0;
     1459        mi.hwndSubMenu = 0;
     1460        mi.id    = idNew;
     1461        mi.hItem = (ULONG)hbmNew;
     1462        WinSendMsg(hwndMenu, MM_INSERTITEM, (MPARAM)&mi, 0);
     1463    }
     1464    WinEnableWindowUpdate(hwndMenu, TRUE);
     1465
     1466    WinInvalidateRect(hwndMenu, NULL, TRUE);
     1467}
     1468//******************************************************************************
     1469//******************************************************************************
  • trunk/src/user32/win32wbase.cpp

    r6001 r6008  
    1 /* $Id: win32wbase.cpp,v 1.268 2001-06-13 17:28:07 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.269 2001-06-14 11:30:56 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    140140  dwExStyle        = 0;
    141141  dwStyle          = 0;
     142  dwOldStyle       = 0;
    142143  win32wndproc     = 0;
    143144  hInstance        = 0;
     
    453454
    454455    WINPROC_SetProc((HWINDOWPROC *)&win32wndproc, windowClass->getWindowProc(), WINPROC_GetProcType(windowClass->getWindowProc()), WIN_PROC_WINDOW);
    455     hInstance = cs->hInstance;
    456     dwStyle   = cs->style & ~WS_VISIBLE;
    457     dwExStyle = cs->dwExStyle;
     456    hInstance  = cs->hInstance;
     457    dwStyle    = cs->style & ~WS_VISIBLE;
     458    dwOldStyle = dwStyle;
     459    dwExStyle  = cs->dwExStyle;
    458460
    459461    hwndLinkAfter = ((cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD) ? HWND_BOTTOM : HWND_TOP;
     
    22622264    wasVisible = (getStyle() & WS_VISIBLE) != 0;
    22632265
     2266    dwOldStyle = getStyle();
     2267
    22642268    switch(nCmdShow)
    22652269    {
     
    23182322    case SW_SHOWDEFAULT: /* FIXME: should have its own handler */
    23192323    case SW_RESTORE:
    2320          //TODO: WIN_RESTORE_MAX flag!!!!!!!!!!!!!!
    23212324         swp |= SWP_SHOWWINDOW | SWP_FRAMECHANGED;
    23222325
     
    24852488    if(getParent()) {
    24862489          OSLibMapWINDOWPOStoSWP(&wpos, &swp, &swpOld, getParent()->getClientHeight(),
    2487                                       OS2HwndFrame);
     2490                                 OS2HwndFrame);
    24882491    }
    24892492    else  OSLibMapWINDOWPOStoSWP(&wpos, &swp, &swpOld, OSLibQueryScreenHeight(), OS2HwndFrame);
  • trunk/src/user32/win32wbase.h

    r5973 r6008  
    1 /* $Id: win32wbase.h,v 1.119 2001-06-12 17:02:42 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.120 2001-06-14 11:30:57 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    150150
    151151         DWORD  getStyle()                      { return dwStyle; };
     152         DWORD  getOldStyle()                   { return dwOldStyle; };
    152153         void   setStyle(DWORD newstyle)        { dwStyle = newstyle; };
    153154         DWORD  getExStyle()                    { return dwExStyle; };
     
    347348        ULONG   dwExStyle;              //GWL_EXSTYLE
    348349        ULONG   dwStyle;                //GWL_STYLE
     350        ULONG   dwOldStyle;             //Used to determine which frame control buttons to change (OS/2 mode)
    349351      WNDPROC   win32wndproc;           //GWL_WNDPROC
    350352        ULONG   hInstance;              //GWL_HINSTANCE
Note: See TracChangeset for help on using the changeset viewer.