Ignore:
Timestamp:
Aug 2, 2001, 10:36:35 PM (24 years ago)
Author:
umoeller
Message:

Misc changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/comctl.c

    r81 r91  
    310310 *@@added V0.9.0 [umoeller]
    311311 *@@changed V0.9.2 (2000-02-28) [umoeller]: menu was displayed even if button was disabled; fixed
     312 *@@changed V0.9.14 (2001-07-31) [umoeller]: fixed WM_MENUEND submenu quirk
    312313 */
    313314
     
    486487        case WM_MENUEND:
    487488        {
    488             BOOL fUnHilite = TRUE;
    489             // _Pmpf(("WM_MENUEND"));
    490             // At this point, the menu has been
    491             // destroyed already.
    492             // Since WM_BUTTON1UP handles the
    493             // default case that the user presses
    494             // the menu button a second time while
    495             // the menu is open, we only need
    496             // to handle the case that the user
    497             // c)   presses some key on the menu (ESC, menu selection) or
    498             // a)   selects a menu item (which
    499             //      dismisses the menu) or
    500             // b)   clicks anywhere else.
    501 
    502             // Case a) if mouse button 1 is not currently down
    503             if ((WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000) == 0)
    504                 // button 1 _not_ down:
    505                 // must be keyboard
    506                 fUnHilite = TRUE;
    507             else
    508                 // button 1 _is_ down:
    509                 // query window under mouse pointer
    510                 ;
    511 
    512             if (fUnHilite)
     489            if ((HWND)mp2 == pmbd->hwndMenu) // V0.9.14 (2001-07-31) [umoeller]
    513490            {
    514                 // _Pmpf(("  Unsinking menu WM_MENUEND"));
    515                 pmbd->fButtonSunk = FALSE;
    516                 WinSendMsg(hwndButton,
    517                            BM_SETHILITE,
    518                            (MPARAM)FALSE,
    519                            (MPARAM)0);
    520             }
    521             pmbd->hwndMenu = NULLHANDLE;
     491                BOOL fUnHilite = TRUE;
     492                // _Pmpf(("WM_MENUEND"));
     493                // At this point, the menu has been
     494                // destroyed already.
     495                // Since WM_BUTTON1UP handles the
     496                // default case that the user presses
     497                // the menu button a second time while
     498                // the menu is open, we only need
     499                // to handle the case that the user
     500                // c)   presses some key on the menu (ESC, menu selection) or
     501                // a)   selects a menu item (which
     502                //      dismisses the menu) or
     503                // b)   clicks anywhere else.
     504
     505                // Case a) if mouse button 1 is not currently down
     506                if ((WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000) == 0)
     507                    // button 1 _not_ down:
     508                    // must be keyboard
     509                    fUnHilite = TRUE;
     510                else
     511                    // button 1 _is_ down:
     512                    // query window under mouse pointer
     513                    ;
     514
     515                if (fUnHilite)
     516                {
     517                    // _Pmpf(("  Unsinking menu WM_MENUEND"));
     518                    pmbd->fButtonSunk = FALSE;
     519                    WinSendMsg(hwndButton,
     520                               BM_SETHILITE,
     521                               (MPARAM)FALSE,
     522                               (MPARAM)0);
     523                }
     524                pmbd->hwndMenu = NULLHANDLE;
     525            } // end if ((HWND)mp1 == pmbd->pmbd->hwndMenu) // V0.9.14 (2001-07-31) [umoeller]
    522526        break; }
    523527
Note: See TracChangeset for help on using the changeset viewer.