From 3be7b28beca41a79f04ec5937636395f5feb9fdf Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 27 Nov 2001 04:36:18 +0000 Subject: Change the behavior of menus on windows to be more consistent with native windows menus. Disabled menu entries show their active background color on mouseover and keyboard traversal. --- ChangeLog | 6 ++++++ win/tkWinMenu.c | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d59207a..39a1938 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-11-26 D. Richard Hipp + + * win/tkWinMenu.c: disabled menu items show the activebackground + color in their background. This change makes menu behavior + consistent with what native windows does. + 2001-11-24 Mo DeJong * unix/Makefile.in: Add comments to better describe diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index f612690..f1c07d7 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinMenu.c,v 1.16 2001/10/12 13:30:32 tmh Exp $ + * RCS: @(#) $Id: tkWinMenu.c,v 1.17 2001/11/27 04:36:18 drh Exp $ */ #define OEMRESOURCE @@ -1078,6 +1078,12 @@ TkWinHandleMenuEvent(phwnd, pMessage, pwParam, plParam, plResult) } else { TkActivateMenuEntry(menuPtr, -1); } + } else { + if (itemPtr->itemState & ODS_SELECTED) { + mePtr->entryFlags |= ENTRY_PLATFORM_FLAG1; + } else { + mePtr->entryFlags &= ~ENTRY_PLATFORM_FLAG1; + } } tkfont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr); @@ -2408,7 +2414,8 @@ DrawMenuEntryBackground( int width, /* width of rectangle to draw */ int height) /* height of rectangle to draw */ { - if (mePtr->state == ENTRY_ACTIVE) { + if (mePtr->state == ENTRY_ACTIVE + || (mePtr->entryFlags & ENTRY_PLATFORM_FLAG1)!=0 ) { bgBorder = activeBorder; } Tk_Fill3DRectangle(menuPtr->tkwin, d, bgBorder, -- cgit v0.12