diff options
author | drh <drh@sqlite.org> | 2001-11-27 04:36:18 (GMT) |
---|---|---|
committer | drh <drh@sqlite.org> | 2001-11-27 04:36:18 (GMT) |
commit | 3be7b28beca41a79f04ec5937636395f5feb9fdf (patch) | |
tree | bd16e4fc309a9e60acfd8f0621256e8a82dff601 /win/tkWinMenu.c | |
parent | 2c38d7f94081181c16b469516ddb54c703d54516 (diff) | |
download | tk-3be7b28beca41a79f04ec5937636395f5feb9fdf.zip tk-3be7b28beca41a79f04ec5937636395f5feb9fdf.tar.gz tk-3be7b28beca41a79f04ec5937636395f5feb9fdf.tar.bz2 |
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.
Diffstat (limited to 'win/tkWinMenu.c')
-rw-r--r-- | win/tkWinMenu.c | 11 |
1 files changed, 9 insertions, 2 deletions
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, |