diff options
author | hobbs <hobbs> | 2009-09-14 23:40:42 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2009-09-14 23:40:42 (GMT) |
commit | 08d5c1f6924bfa0886bd4d5d98c2aa42c4d2b512 (patch) | |
tree | 9e2f1b56c7f5c7c5faecaef7cbae85075e01588b /win/tkWinMenu.c | |
parent | 4d3756c7f955148c645bb6b6ae0dca935044acb8 (diff) | |
download | tk-08d5c1f6924bfa0886bd4d5d98c2aa42c4d2b512.zip tk-08d5c1f6924bfa0886bd4d5d98c2aa42c4d2b512.tar.gz tk-08d5c1f6924bfa0886bd4d5d98c2aa42c4d2b512.tar.bz2 |
* generic/tkMenuDraw.c (TkPostSubmenu): Fix reposting of submenu in
* win/tkWinMenu.c (TkWinHandleMenuEvent): torn off Windows menu.
[Bug 873613]
(DrawMenuEntryArrow): Draw Win menu arrow after being torn
off. [Bug 873608]
Diffstat (limited to 'win/tkWinMenu.c')
-rw-r--r-- | win/tkWinMenu.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 84bd49d..6b9bad9 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -10,7 +10,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.59.2.2 2009/05/21 23:01:33 patthoyts Exp $ + * RCS: @(#) $Id: tkWinMenu.c,v 1.59.2.3 2009/09/14 23:40:42 hobbs Exp $ */ #define OEMRESOURCE @@ -50,6 +50,10 @@ #define MENU_SYSTEM_MENU MENU_PLATFORM_FLAG1 #define MENU_RECONFIGURE_PENDING MENU_PLATFORM_FLAG2 +#ifndef WM_UNINITMENUPOPUP +#define WM_UNINITMENUPOPUP 0x0125 +#endif + static int indicatorDimensions[2]; /* The dimensions of the indicator space in a * menu entry. Calculated at init time to save @@ -992,6 +996,19 @@ TkWinHandleMenuEvent( Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); switch (*pMessage) { + case WM_UNINITMENUPOPUP: + hashEntryPtr = Tcl_FindHashEntry(&tsdPtr->winMenuTable, + (char *) *pwParam); + if (hashEntryPtr != NULL) { + menuPtr = (TkMenu *) Tcl_GetHashValue(hashEntryPtr); + if ((menuPtr->menuRefPtr != NULL) + && (menuPtr->menuRefPtr->parentEntryPtr != NULL)) { + TkPostSubmenu(menuPtr->interp, + menuPtr->menuRefPtr->parentEntryPtr->menuPtr, NULL); + } + } + break; + case WM_INITMENU: TkMenuInit(); hashEntryPtr = Tcl_FindHashEntry(&tsdPtr->winMenuTable, @@ -1775,8 +1792,7 @@ DrawMenuEntryArrow( COLORREF oldBgColor; RECT rect; - if (!drawArrow || (mePtr->type != CASCADE_ENTRY) - || (mePtr->state != ENTRY_DISABLED)) { + if (!drawArrow || (mePtr->type != CASCADE_ENTRY)) { return; } @@ -1795,7 +1811,8 @@ DrawMenuEntryArrow( gc->background = activeBgColor->pixel; } - gc->foreground = GetSysColor(COLOR_GRAYTEXT); + gc->foreground = GetSysColor((mePtr->state == ENTRY_DISABLED) ? + COLOR_GRAYTEXT : COLOR_MENUTEXT); rect.top = y + GetSystemMetrics(SM_CYBORDER); rect.bottom = y + height - GetSystemMetrics(SM_CYBORDER); |