Changeset 9607 for trunk/src


Ignore:
Timestamp:
Jan 4, 2003, 1:21:44 PM (23 years ago)
Author:
sandervl
Message:

fix for alt key & menu activation; fixed color of highlighted menubar item

Location:
trunk/src/user32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/menu.c

    r9605 r9607  
    12341234        if (lpitem->fState & MF_HILITE)
    12351235        {
     1236#ifdef __WIN32OS2__
     1237            if(!fOS2Look)
     1238#else
    12361239            if(TWEAK_WineLook == WIN98_LOOK)
     1240#endif
    12371241            {
    12381242                if(menuBar)
    12391243                    DrawEdge(hdc, &rect, BDR_SUNKENOUTER, BF_RECT);
    12401244                else
    1241 #if 0 //def __WIN32OS2__
    1242                     if(!fOS2Look)
    1243                          FillRect( hdc, &rect, GetOS2ColorBrush(PMSYSCLR_MENUHILITEBGND) );
    1244                     else FillRect( hdc, &rect, GetSysColorBrush(COLOR_HIGHLIGHT) );
    1245 #else
    12461245                    FillRect(hdc, &rect, GetSysColorBrush(COLOR_HIGHLIGHT));
    1247 #endif
    12481246            }
    12491247            else /* Not Win98 Look */
     
    13041302    if (lpitem->fState & MF_HILITE)
    13051303    {
     1304#ifdef __WIN32OS2__
     1305        if(!fOS2Look)
     1306#else
    13061307        if(TWEAK_WineLook == WIN98_LOOK)
     1308#endif
    13071309        {
    13081310            if(menuBar) {
     
    13141316                else
    13151317                    SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));
    1316 #if 0 //def __WIN32OS2__
    1317                 if(!fOS2Look)
    1318                      SetBkColor(hdc, GetOS2Color(PMSYSCLR_MENUHILITEBGND));
    1319                 else SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));
    1320 #else
    13211318                SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));
    1322 #endif
    13231319            }
    13241320        }
  • trunk/src/user32/oslibmsgtranslate.cpp

    r9598 r9607  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.97 2003-01-03 16:35:54 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.98 2003-01-04 12:21:44 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    646646#endif
    647647
    648 #ifdef ALTGR_HACK
    649    
    650 
    651         if (usPMScanCode == PMSCAN_ALTRIGHT)
    652         {
    653           // Turn message into CTRL-event
    654           // The original PM message is still saved inside
    655           // the TEB, the next call to TranslateMessage()
    656           // will then generate the required additional message
    657           // for the ALTGR-event.
    658           winMsg->wParam = VK_LCONTROL_W;
    659           winMsg->lParam = repeatCount & 0x0FFFF;
    660           winMsg->lParam |= WINSCAN_CTRLLEFT << 16
    661                             |  WIN_KEY_DONTCARE;
    662          
    663           if (flags & KC_KEYUP)
    664           {
    665             winMsg->message = WINWM_SYSKEYUP;
    666             winMsg->lParam |= WIN_KEY_ALTHELD;                      // bit 29, alt was pressed
    667             winMsg->lParam |= WIN_KEY_PREVSTATE;                    // bit 30, previous state, always 1 for a WM_KEYUP message
    668             winMsg->lParam |= 1 << 31;                              // bit 31, transition state, always 1 for WM_KEYUP
    669            
    670             // Note: altgr affects the alt-key state in windows!
    671             // The overlay causes GetKeyState/GetAsyncKeyState to return
    672             // the correct states
    673             KeySetOverlayKeyState(VK_LCONTROL_W, KEYOVERLAYSTATE_DONTCARE);
    674             KeySetOverlayKeyState(VK_CONTROL_W, KEYOVERLAYSTATE_DONTCARE);
    675           }
    676           else
    677           {
    678             winMsg->lParam |= WIN_KEY_ALTHELD;
    679             if (keyWasPressed)
    680               winMsg->lParam |= WIN_KEY_PREVSTATE;     // bit 30, previous state, 1 means key was pressed
    681             winMsg->message = WINWM_KEYDOWN;
    682            
    683             // Note: altgr affects the alt-key state in windows!
    684             // The overlay causes GetKeyState/GetAsyncKeyState to return
    685             // the correct states
    686             KeySetOverlayKeyState(VK_LCONTROL_W, KEYOVERLAYSTATE_DOWN);
    687             KeySetOverlayKeyState(VK_CONTROL_W, KEYOVERLAYSTATE_DOWN);
    688             KeySetOverlayKeyState(VK_RMENU_W, KEYOVERLAYSTATE_DOWN);
    689             KeySetOverlayKeyState(VK_MENU_W, KEYOVERLAYSTATE_DOWN);
    690            
    691             // Note: when CTRL comes up, windows keeps ALTGR still down!
    692             // KeySetOverlayKeyState(VK_RMENU_W, KEYOVERLAYSTATE_DOWN);
    693           }
    694         }     
    695 #endif
    696648
    697649        //@PF This looks ugly but this is just what we have in win32 both in win98/win2k
     
    811763          }
    812764        }
    813 
    814 #ifdef ALTGR_HACK
    815         // it's a PMSCAN_ALTRIGHT WM_CHAR message?
    816         // and not previously translated?
    817         if(fMsgRemoved && usPMScanCode == PMSCAN_ALTRIGHT && !(teb->o.odin.fTranslated))
    818         {
    819             dprintf(("Queue ALTRIGHT message"));
    820             // special ALTRIGHT treatment:
    821             // we try to insert another WM_KEYDOWN or WM_KEYUP instead of
    822             // the usual WM_CHAR which is expected here.
    823             // -> experimental
    824             // it's really an OS/2-style WM_CHAR message?
    825             MSG extramsg;
    826             memcpy(&extramsg, winMsg, sizeof(MSG));
    827    
    828             // AltGr is not released with WINWM_SYSKEYUP, but WINWM_KEYUP
    829             if(flags & KC_KEYUP)
    830             {
    831                 extramsg.message = WINWM_KEYUP;
    832             }
    833             extramsg.wParam = VK_RMENU_W;
    834    
    835             // mask out message bits and scan code
    836             extramsg.lParam &= (0xDC00FFFF);
    837             extramsg.lParam |= (WINSCAN_ALTRIGHT & 0x1FF) << 16;
    838 ////            extramsg.lParam |= WIN_KEY_EXTENDED;
    839             if (!(flags & KC_KEYUP))
    840                 extramsg.lParam |= WIN_KEY_ALTHELD;
    841  
    842             // insert message into the queue
    843             setThreadQueueExtraCharMessage(teb, &extramsg);
    844         }
    845 #endif
    846765        break;
    847766    }
  • trunk/src/user32/win32wbase.cpp

    r9590 r9607  
    1 /* $Id: win32wbase.cpp,v 1.350 2003-01-02 17:02:05 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.351 2003-01-04 12:21:44 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    18911891    }
    18921892
     1893    case WM_KEYDOWN:
     1894        if(wParam == VK_F10) iF10Key = VK_F10;
     1895        break;
     1896
    18931897    case WM_SYSKEYDOWN:
    18941898    {
     
    19992003        if (((wParam == VK_MENU) && iMenuSysKey) ||
    20002004            ((wParam == VK_F10) && iF10Key))
    2001               ::SendMessageW( GetTopWindow(), WM_SYSCOMMAND, SC_KEYMENU, 0L );
     2005              ::SendMessageW( GetTopParent(), WM_SYSCOMMAND, SC_KEYMENU, 0L );
    20022006        iMenuSysKey = iF10Key = 0;
    20032007        break;
Note: See TracChangeset for help on using the changeset viewer.