Changeset 1671 for trunk/src


Ignore:
Timestamp:
Nov 9, 1999, 8:23:17 PM (26 years ago)
Author:
sandervl
Message:

dprintf2 addition + Rene Pronk's mnemonics changes

Location:
trunk/src/user32
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/Makefile

    r1629 r1671  
    1 # $Id: Makefile,v 1.42 1999-11-08 13:44:13 sandervl Exp $
     1# $Id: Makefile,v 1.43 1999-11-09 19:23:16 sandervl Exp $
    22
    33#
     
    1818CFLAGS = $(CFLAGS) -I$(PDWIN32_INCLUDE)
    1919CXXFLAGS = $(CXXFLAGS) -I$(PDWIN32_INCLUDE)
     20
     21!ifdef DEBUGALL
     22CFLAGS = $(CFLAGS) -DDEBUG_ENABLELOG_LEVEL2
     23CXXFLAGS = $(CXXFLAGS) -DDEBUG_ENABLELOG_LEVEL2
     24!endif
    2025
    2126RC = $(PDWIN32_TOOLS)\wrc
     
    153158
    154159clean:
    155         $(RM) *.obj *.lib *.dll *.map *.pch *.res
     160        $(RM) *.obj *.lib *.dll *.map *.pch *.res *.lrf resource.asm
    156161        $(RM) $(PDWIN32_BIN)\$(TARGET).dll
    157162        $(RM) $(PDWIN32_LIB)\$(TARGET).lib
  • trunk/src/user32/pmwindow.cpp

    r1629 r1671  
    1 /* $Id: pmwindow.cpp,v 1.52 1999-11-08 13:44:14 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.53 1999-11-09 19:23:16 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    672672        ULONG flags = SHORT1FROMMP(mp1);
    673673        BOOL keyWasPressed, fTranslated = FALSE, fRunDefWndProc = FALSE;
     674
    674675        char c;
    675676
     
    679680
    680681        dprintf(("PM: WM_CHAR: %x %x %d %x", SHORT1FROMMP(mp2), SHORT2FROMMP(mp2), repeatCount, scanCode));
     682        dprintf(("PM: WM_CHAR: %x", flags));
    681683        // both WM_KEYUP & WM_KEYDOWN want a virtual key, find the right Win32 virtual key
    682684        // given the OS/2 virtual key and OS/2 character
    683685
    684         if (((SHORT1FROMMP (mp1) & KC_CHAR) == KC_CHAR) ||
    685             ((SHORT1FROMMP (mp1) & KC_LONEKEY) == KC_LONEKEY))
     686        //if (((SHORT1FROMMP (mp1) & KC_CHAR) == KC_CHAR) ||
     687        //    ((SHORT1FROMMP (mp1) & KC_LONEKEY) == KC_LONEKEY))
     688        c = 0;
     689        if ((SHORT1FROMMP (mp1) & 0xFF) != 0)
    686690        {
    687691            c = SHORT1FROMMP (mp2);
     
    705709
    706710VirtualKeyFound:
     711        dprintf (("VIRTUALKEYFOUND:(%x)", virtualKey));
    707712
    708713        if(!(SHORT1FROMMP(mp1) & KC_ALT))
     
    720725            else {
    721726                // send WM_KEYDOWN message
    722                 if (win32wnd->MsgKeyDown (repeatCount, scanCode, virtualKey, keyWasPressed))
     727                if (win32wnd->MsgKeyDown (repeatCount, scanCode,
     728                                          virtualKey, keyWasPressed))
    723729                    fRunDefWndProc = TRUE;
    724730            }
     
    731737                // send WM_SYSKEYUP message
    732738
     739                dprintf(("PMWINDOW_WM_SYSKEYUP: vkey:(%x)", virtualKey));
    733740                if(win32wnd->MsgSysKeyUp (repeatCount, scanCode, virtualKey)) {
    734741                    fRunDefWndProc = TRUE;
     
    737744            else {
    738745                // send WM_SYSKEYDOWN message
     746                dprintf(("PMWINDOW_WM_SYSKEYDOWN: vkey:(%x)", virtualKey));
    739747                if (win32wnd->MsgSysKeyDown (repeatCount, scanCode, virtualKey, keyWasPressed))
    740748                    fRunDefWndProc = TRUE;
     
    749757        //NOTE: These actually need to be posted so that the next message retrieved by GetMessage contains
    750758        //      the newly generated WM_CHAR message.
    751         if(fTranslated && !((flags & KC_KEYUP) == KC_KEYUP)) {//TranslatedMessage was called before DispatchMessage, so send WM_CHAR messages
     759        if(fTranslated && !((flags & KC_KEYUP) == KC_KEYUP))
     760        {//TranslatedMessage was called before DispatchMessage, so send WM_CHAR messages
    752761            ULONG keyflags = 0, vkey = 0;
    753762            ULONG fl = SHORT1FROMMP(mp1);
  • trunk/src/user32/user32.cpp

    r1629 r1671  
    1 /* $Id: user32.cpp,v 1.51 1999-11-08 13:44:14 sandervl Exp $ */
     1/* $Id: user32.cpp,v 1.52 1999-11-09 19:23:16 sandervl Exp $ */
    22
    33/*
     
    9999BOOL WIN32API CopyRect( PRECT lprcDst, const RECT * lprcSrc)
    100100{
    101 //    ddprintf(("USER32:  CopyRect\n"));
     101    dprintf2(("USER32:  CopyRect\n"));
    102102    if (!lprcDst || !lprcSrc) {
    103103        SetLastError(ERROR_INVALID_PARAMETER);
     
    113113BOOL WIN32API EqualRect( const RECT *lprc1, const RECT *lprc2)
    114114{
    115 #ifdef DEBUG
    116     WriteLog("USER32:  EqualRect\n");
    117 #endif
     115    dprintf2(("USER32:  EqualRect\n"));
    118116    if (!lprc1 || !lprc2)
    119117    {
     
    131129BOOL WIN32API InflateRect( PRECT lprc, int dx, int  dy)
    132130{
    133 #ifdef DEBUG
    134     WriteLog("USER32:  InflateRect\n");
    135 #endif
     131    dprintf(("USER32:  InflateRect\n"));
    136132    if (!lprc)
    137133    {
     
    151147BOOL WIN32API IntersectRect( PRECT lprcDst, const RECT * lprcSrc1, const RECT * lprcSrc2)
    152148{
    153 #ifdef DEBUG
    154 ////    WriteLog("USER32:  IntersectRect\n");
    155 #endif
     149    dprintf2(("USER32:  IntersectRect\n"));
    156150    if (!lprcDst || !lprcSrc1 || !lprcSrc2)
    157151    {
     
    191185BOOL WIN32API OffsetRect( PRECT lprc, int x, int  y)
    192186{
    193 #ifdef DEBUG
    194 ////    WriteLog("USER32:  OffsetRect\n");
    195 #endif
     187    dprintf2(("USER32:  OffsetRect\n"));
    196188    if (!lprc)
    197189    {
     
    211203BOOL WIN32API PtInRect( const RECT *lprc, POINT pt)
    212204{
    213 #ifdef DEBUG1
    214     WriteLog("USER32:  PtInRect\n");
    215 #endif
     205    dprintf2(("USER32:  PtInRect\n"));
    216206    if (!lprc)
    217207    {
     
    260250BOOL WIN32API SubtractRect( PRECT lprcDest, const RECT * lprcSrc1, const RECT * lprcSrc2)
    261251{
    262 #ifdef DEBUG
    263     WriteLog("USER32:  SubtractRect");
    264 #endif
     252    dprintf2(("USER32:  SubtractRect"));
    265253    RECT tmp;
    266254
     
    303291BOOL WIN32API UnionRect( PRECT lprcDst, const RECT *lprcSrc1, const RECT *lprcSrc2)
    304292{
    305 #ifdef DEBUG
    306     WriteLog("USER32:  UnionRect\n");
    307 #endif
     293    dprintf2(("USER32:  UnionRect\n"));
    308294    if (!lprcDst || !lprcSrc1 || !lprcSrc2)
    309295    {
     
    341327BOOL WIN32API ClipCursor(const RECT * lpRect)
    342328{
    343 #ifdef DEBUG
    344     WriteLog("USER32:  ClipCursor\n");
    345 #endif
     329    dprintf(("USER32:  ClipCursor\n"));
    346330    return O32_ClipCursor(lpRect);
    347331}
     
    350334HCURSOR WIN32API CreateCursor( HINSTANCE hInst, int xHotSpot, int yHotSpot, int nWidth, int nHeight, const VOID *pvANDPlane, const VOID *pvXORPlane)
    351335{
    352 #ifdef DEBUG
    353     WriteLog("USER32:  CreateCursor\n");
    354 #endif
     336    dprintf(("USER32:  CreateCursor\n"));
    355337    return O32_CreateCursor(hInst,xHotSpot,yHotSpot,nWidth,nHeight,pvANDPlane,pvXORPlane);
    356338}
     
    359341BOOL WIN32API DestroyCursor( HCURSOR hCursor)
    360342{
    361 #ifdef DEBUG
    362     WriteLog("USER32:  DestroyCursor\n");
    363 #endif
     343    dprintf(("USER32:  DestroyCursor\n"));
    364344    return O32_DestroyCursor(hCursor);
    365345}
     
    368348BOOL WIN32API GetClipCursor( LPRECT lpRect)
    369349{
    370 #ifdef DEBUG
    371     WriteLog("USER32:  GetClipCursor\n");
    372 #endif
     350    dprintf(("USER32:  GetClipCursor\n"));
    373351    return O32_GetClipCursor(lpRect);
    374352}
     
    377355HCURSOR WIN32API GetCursor(void)
    378356{
    379 #ifdef DEBUG
    380 ////    WriteLog("USER32:  GetCursor\n");
    381 #endif
     357    dprintf2(("USER32:  GetCursor\n"));
    382358    return O32_GetCursor();
    383359}
     
    388364    BOOL rc;
    389365    POINT point;
    390 #ifdef DEBUG
    391 ////    WriteLog("USER32:  GetCursorPos\n");
    392 #endif
     366
     367    dprintf2(("USER32:  GetCursorPos\n"));
     368
    393369    if (!lpPoint) return FALSE;
    394370    if (OSLibWinQueryPointerPos(OSLIB_HWND_DESKTOP,&point)) //POINT == POINTL
     
    422398  {
    423399    return LoadCursorA(NULL,lpFileName);
    424   } else
     400  }
     401  else
    425402  {
    426403    dprintf(("USER32:LoadCursorFromFileA (%s) not implemented.\n",
     
    476453BOOL WIN32API SetCursorPos( int X, int Y)
    477454{
    478 #ifdef DEBUG
    479     WriteLog("USER32:  SetCursorPos\n");
    480 #endif
     455    dprintf(("USER32:  SetCursorPos %d %d", X,Y));
    481456    return O32_SetCursorPos(X,Y);
    482457}
     
    512487int WIN32API ShowCursor( BOOL bShow)
    513488{
    514 #ifdef DEBUG
    515     WriteLog("USER32:  ShowCursor\n");
    516 #endif
     489    dprintf2(("USER32:  ShowCursor %d", bShow));
    517490    return O32_ShowCursor(bShow);
    518491}
     
    547520UINT WIN32API GetDoubleClickTime(void)
    548521{
    549 #ifdef DEBUG
    550     WriteLog("USER32:  GetDoubleClickTime\n");
    551 #endif
     522    dprintf(("USER32:  GetDoubleClickTime\n"));
    552523    return O32_GetDoubleClickTime();
    553524}
     
    845816        break;
    846817    }
    847 #ifdef DEBUG
    848     WriteLog("USER32:  GetSystemMetrics %d returned %d\n", nIndex, rc);
    849 #endif
     818    dprintf(("USER32:  GetSystemMetrics %d returned %d\n", nIndex, rc));
    850819    return(rc);
    851820}
     
    949918        break;
    950919  }
    951 #ifdef DEBUG
    952   WriteLog("USER32:  SystemParametersInfoA %d, returned %d\n", uiAction, rc);
    953 #endif
     920  dprintf(("USER32:  SystemParametersInfoA %d, returned %d\n", uiAction, rc));
    954921  return(rc);
    955922}
     
    11331100WORD WIN32API GetAsyncKeyState(INT nVirtKey)
    11341101{
    1135 #ifdef DEBUG
    1136 ////    WriteLog("USER32:  GetAsyncKeyState Not implemented\n");
    1137 #endif
     1102    dprintf2(("USER32:  GetAsyncKeyState Not implemented\n"));
    11381103    return 0;
    11391104}
     
    11851150int WIN32API GetKeyboardLayoutList(int nBuff, HKL *lpList)
    11861151{
    1187 #ifdef DEBUG
    1188   WriteLog("USER32:  GetKeyboardLayoutList, not implemented\n");
    1189 #endif
     1152  dprintf(("USER32:  GetKeyboardLayoutList, not implemented\n"));
    11901153  return(0);
    11911154}
     
    12571220{
    12581221//SvL: Hehe. 32 MB logfile for Opera after a minute.
    1259 #ifdef DEBUG
    1260 //    WriteLog("USER32:  GetKeyState %d\n", nVirtKey);
    1261 #endif
     1222    dprintf2(("USER32:  GetKeyState %d\n", nVirtKey));
    12621223    return O32_GetKeyState(nVirtKey);
    12631224}
  • trunk/src/user32/win32wbase.cpp

    r1629 r1671  
    1 /* $Id: win32wbase.cpp,v 1.77 1999-11-08 13:44:15 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.78 1999-11-09 19:23:17 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    10361036
    10371037    if(ISMOUSE_CAPTURED()) {
    1038         if(DInputMouseHandler(getWindowHandle(), MOUSEMSG_BUTTON, ncx, ncy, msg))
    1039                 return 0;
     1038    if(DInputMouseHandler(getWindowHandle(), MOUSEMSG_BUTTON, ncx, ncy, msg))
     1039        return 0;
    10401040    }
    10411041
     
    11071107    }
    11081108
    1109     if(fClick) 
     1109    if(fClick)
    11101110    {
    11111111     HWND hwndTop;
    11121112
    11131113        /* Activate the window if needed */
    1114         if(isSubclassedOS2Wnd()) {
    1115                 Win32BaseWindow *parentwnd = GetWindowFromOS2FrameHandle(OSLibWinQueryWindow(OS2Hwnd, QWOS_PARENT));
    1116                 if(parentwnd) {
    1117                         hwndTop = (parentwnd->GetTopParent()) ? parentwnd->GetTopParent()->getWindowHandle() : 0;
    1118                 }
    1119                 else    hwndTop = 0;
    1120         }
    1121         else    hwndTop = (GetTopParent()) ? GetTopParent()->getWindowHandle() : 0;
     1114    if(isSubclassedOS2Wnd()) {
     1115        Win32BaseWindow *parentwnd = GetWindowFromOS2FrameHandle(OSLibWinQueryWindow(OS2Hwnd, QWOS_PARENT));
     1116        if(parentwnd) {
     1117            hwndTop = (parentwnd->GetTopParent()) ? parentwnd->GetTopParent()->getWindowHandle() : 0;
     1118        }
     1119        else    hwndTop = 0;
     1120    }
     1121    else    hwndTop = (GetTopParent()) ? GetTopParent()->getWindowHandle() : 0;
    11221122
    11231123        if (hwndTop && getWindowHandle() != GetActiveWindow())
     
    11541154
    11551155    if(ISMOUSE_CAPTURED()) {
    1156         POINT point = {x,y};
    1157        
     1156    POINT point = {x,y};
     1157
    11581158        MapWindowPoints(getWindowHandle(), HWND_DESKTOP, &point, 1);
    1159         if(DInputMouseHandler(getWindowHandle(), MOUSEMSG_MOVE, point.x, point.y, keystate))
    1160                 return 0;
     1159    if(DInputMouseHandler(getWindowHandle(), MOUSEMSG_MOVE, point.x, point.y, keystate))
     1160        return 0;
    11611161    }
    11621162
     
    15651565
    15661566    case WM_SYSKEYDOWN:
    1567         if(HIWORD(lParam) & KEYDATA_ALT)
    1568         {
    1569             if(wParam == VK_F4) /* try to close the window */
    1570             {
    1571                 Win32BaseWindow *window = GetTopParent();
    1572                 if(window && !(window->getClass()->getStyle() & CS_NOCLOSE) )
    1573                     window->PostMessageA(WM_SYSCOMMAND, SC_CLOSE, 0);
     1567        if(wParam == VK_F4) /* try to close the window */
     1568        {
     1569            Win32BaseWindow *window = GetTopParent();
     1570            if(window && !(window->getClass()->getStyle() & CS_NOCLOSE))
     1571                window->PostMessageA(WM_SYSCOMMAND, SC_CLOSE, 0);
     1572        }
     1573
     1574        Win32BaseWindow *siblingWindow;
     1575        HWND sibling;
     1576        char nameBuffer [40], mnemonic;
     1577        int nameLength;
     1578
     1579        GetWindowTextA (nameBuffer, 40);
     1580
     1581        // search all sibling to see it this key is their mnemonic
     1582        sibling = GetWindow (GW_HWNDFIRST);
     1583        while (sibling != 0) {
     1584          siblingWindow = GetWindowFromHandle (sibling);
     1585          nameLength = siblingWindow->GetWindowTextA (nameBuffer, 40);
     1586
     1587          // find the siblings mnemonic
     1588          mnemonic = '\0';
     1589          for (int i=0 ; i<nameLength ; i++) {
     1590            if (nameBuffer [i] == '&') {
     1591              mnemonic = nameBuffer [i+1];
     1592              if ((mnemonic >= 'a') && (mnemonic <= 'z'))
     1593                mnemonic -= 32; // make it uppercase
     1594              break;  // stop searching
    15741595            }
    1575         }
     1596          }
     1597
     1598          // key matches siblings mnemonic, send mouseclick
     1599          if (mnemonic == (char) wParam) {
     1600            siblingWindow->SendMessageA (BM_CLICK, 0, 0);
     1601          }
     1602
     1603          sibling = siblingWindow->GetNextWindow (GW_HWNDNEXT);
     1604        }
     1605
    15761606        return 0;
    15771607
     
    25012531{
    25022532    if(wndname == NULL)
    2503       return FALSE; 
     2533      return FALSE;
    25042534
    25052535    if(fUnicode) {
Note: See TracChangeset for help on using the changeset viewer.