diff options
author | mdejong <mdejong> | 2003-12-26 22:29:07 (GMT) |
---|---|---|
committer | mdejong <mdejong> | 2003-12-26 22:29:07 (GMT) |
commit | 31c8cfb4eb684b0c2899f7d8093288cfb46fe8c4 (patch) | |
tree | f8aca03992af22d29cc2c82877f1639b88bfc179 | |
parent | 27f3695532a8ecf6d52803e8ef8dd81c319677b0 (diff) | |
download | tk-31c8cfb4eb684b0c2899f7d8093288cfb46fe8c4.zip tk-31c8cfb4eb684b0c2899f7d8093288cfb46fe8c4.tar.gz tk-31c8cfb4eb684b0c2899f7d8093288cfb46fe8c4.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.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | win/tkWinMenu.c | 16 |
2 files changed, 24 insertions, 2 deletions
@@ -1,6 +1,16 @@ 2003-12-26 Mo DeJong <mdejong@users.sourceforge.net> * 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. + +2003-12-26 Mo DeJong <mdejong@users.sourceforge.net> + + * win/tkWinMenu.c (DrawMenuEntryAccelerator, DrawMenuEntryArrow): Move the unused menu arrow drawing code in DrawMenuEntryAccelerator into a new function named DrawMenuEntryArrow. 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); |