diff options
author | mdejong <mdejong@noemail.net> | 2003-12-26 22:29:07 (GMT) |
---|---|---|
committer | mdejong <mdejong@noemail.net> | 2003-12-26 22:29:07 (GMT) |
commit | 8a21919dbfec42977a09bebb4b3fbf11237d5aa7 (patch) | |
tree | f8aca03992af22d29cc2c82877f1639b88bfc179 /win/tkWinMenu.c | |
parent | 25227efe593024e331327521db4f146831760c1f (diff) | |
download | tk-8a21919dbfec42977a09bebb4b3fbf11237d5aa7.zip tk-8a21919dbfec42977a09bebb4b3fbf11237d5aa7.tar.gz tk-8a21919dbfec42977a09bebb4b3fbf11237d5aa7.tar.bz2 |
* win/tkWinMenu.c (DrawMenuEntryAccelerator,
DrawMenuEntryLabel): When drawing the label
text and accelerator text for a disabled
menu entry be sure to draw a 3D highlight.
The only exception to this is when a
disabled menu entry is highlighted, in that
case do not draw a 3D hightlight.
FossilOrigin-Name: 61e90b11eb87d5673eb9cb52087bfe7cd8a30d5b
Diffstat (limited to 'win/tkWinMenu.c')
-rw-r--r-- | win/tkWinMenu.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 57c9d41..c15cd4c 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.27 2003/12/26 20:46:03 mdejong Exp $ + * RCS: @(#) $Id: tkWinMenu.c,v 1.28 2003/12/26 22:29:07 mdejong Exp $ */ #define OEMRESOURCE @@ -1622,7 +1622,8 @@ DrawMenuEntryAccelerator(menuPtr, mePtr, d, gc, tkfont, fmPtr, COLORREF oldFgColor = gc->foreground; gc->foreground = GetSysColor(COLOR_3DHILIGHT); - if (mePtr->accelPtr != NULL) { + if ((mePtr->accelPtr != NULL) && + ((mePtr->entryFlags & ENTRY_PLATFORM_FLAG1) == 0)) { Tk_DrawChars(menuPtr->display, d, gc, tkfont, accel, mePtr->accelLength, leftEdge + 1, baseline + 1); } @@ -2158,6 +2159,17 @@ DrawMenuEntryLabel( if (mePtr->labelLength > 0) { int baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2; char *label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL); + /* Win 95/98 systems draw disabled menu text with a + * 3D highlight, unless the menu item is highlighted */ + if ((mePtr->state == ENTRY_DISABLED) && + ((mePtr->entryFlags & ENTRY_PLATFORM_FLAG1) == 0)){ + COLORREF oldFgColor = gc->foreground; + gc->foreground = GetSysColor(COLOR_3DHILIGHT); + Tk_DrawChars(menuPtr->display, d, gc, tkfont, label, + mePtr->labelLength, leftEdge + textXOffset + 1, + baseline + textYOffset + 1); + gc->foreground = oldFgColor; + } Tk_DrawChars(menuPtr->display, d, gc, tkfont, label, mePtr->labelLength, leftEdge + textXOffset, baseline + textYOffset); |