diff options
author | ericm <ericm> | 2000-04-13 20:51:54 (GMT) |
---|---|---|
committer | ericm <ericm> | 2000-04-13 20:51:54 (GMT) |
commit | 632bd53901793dc9ae455dd2d727d322b42ba814 (patch) | |
tree | 4c7ba8719dc8e0aeecedc7253381f219dd4704be | |
parent | 7233c9b1c8ef6e343cb81fe1791ef276b1173b89 (diff) | |
download | tk-632bd53901793dc9ae455dd2d727d322b42ba814.zip tk-632bd53901793dc9ae455dd2d727d322b42ba814.tar.gz tk-632bd53901793dc9ae455dd2d727d322b42ba814.tar.bz2 |
* win/tkWinMenu.c: Corrected code that created separator items on
menus; originally, it requested that the system be responsible for
drawing those items, so it would ignore configuration items like
the widget background. Now, we draw the separators ourselves (as
we do with every other kind of menu item already). [Bug: 1166].
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | win/tkWinMenu.c | 171 |
2 files changed, 89 insertions, 88 deletions
@@ -1,5 +1,11 @@ 2000-04-13 Eric Melski <ericm@scriptics.com> + * win/tkWinMenu.c: Corrected code that created separator items on + menus; originally, it requested that the system be responsible for + drawing those items, so it would ignore configuration items like + the widget background. Now, we draw the separators ourselves (as + we do with every other kind of menu item already). [Bug: 1166]. + * win/tkWin3d.c: * unix/tkUnix3d.c: Applied patch from [RFE: 2501]: adds more sophisticated smarts to TkpGetShadows, so that the highlight of a diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index f918b71..e379faa 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.7 2000/03/31 09:24:27 hobbs Exp $ + * RCS: @(#) $Id: tkWinMenu.c,v 1.8 2000/04/13 20:51:55 ericm Exp $ */ #define OEMRESOURCE @@ -570,98 +570,93 @@ ReconfigureWindowsMenu( continue; } - if (mePtr->type == SEPARATOR_ENTRY) { - flags |= MF_SEPARATOR; + itemText = GetEntryText(mePtr); + if ((menuPtr->menuType == MENUBAR) + || (menuPtr->menuFlags & MENU_SYSTEM_MENU)) { + Tcl_UtfToExternalDString(NULL, itemText, -1, &translatedText); + lpNewItem = Tcl_DStringValue(&translatedText); } else { - itemText = GetEntryText(mePtr); - if ((menuPtr->menuType == MENUBAR) - || (menuPtr->menuFlags & MENU_SYSTEM_MENU)) { - Tcl_UtfToExternalDString(NULL, itemText, -1, &translatedText); - lpNewItem = Tcl_DStringValue(&translatedText); - } else { - lpNewItem = (LPCTSTR) mePtr; - flags |= MF_OWNERDRAW; - } - - /* - * Set enabling and disabling correctly. - */ - - if (mePtr->state == ENTRY_DISABLED) { - flags |= MF_DISABLED; - } - - /* - * Set the check mark for check entries and radio entries. - */ - - if (((mePtr->type == CHECK_BUTTON_ENTRY) - || (mePtr->type == RADIO_BUTTON_ENTRY)) - && (mePtr->entryFlags & ENTRY_SELECTED)) { - flags |= MF_CHECKED; - } - - if (mePtr->columnBreak) { - flags |= MF_MENUBREAK; + lpNewItem = (LPCTSTR) mePtr; + flags |= MF_OWNERDRAW; + } + + /* + * Set enabling and disabling correctly. + */ + + if (mePtr->state == ENTRY_DISABLED) { + flags |= MF_DISABLED; + } + + /* + * Set the check mark for check entries and radio entries. + */ + + if (((mePtr->type == CHECK_BUTTON_ENTRY) + || (mePtr->type == RADIO_BUTTON_ENTRY)) + && (mePtr->entryFlags & ENTRY_SELECTED)) { + flags |= MF_CHECKED; + } + + if (mePtr->columnBreak) { + flags |= MF_MENUBREAK; + } + + itemID = (int) mePtr->platformEntryData; + if ((mePtr->type == CASCADE_ENTRY) + && (mePtr->childMenuRefPtr != NULL) + && (mePtr->childMenuRefPtr->menuPtr != NULL)) { + HMENU childMenuHdl = (HMENU) mePtr->childMenuRefPtr->menuPtr + ->platformData; + if (childMenuHdl != NULL) { + itemID = (UINT) childMenuHdl; + flags |= MF_POPUP; } - - itemID = (int) mePtr->platformEntryData; - if ((mePtr->type == CASCADE_ENTRY) - && (mePtr->childMenuRefPtr != NULL) - && (mePtr->childMenuRefPtr->menuPtr != NULL)) { - HMENU childMenuHdl = (HMENU) mePtr->childMenuRefPtr->menuPtr - ->platformData; - if (childMenuHdl != NULL) { - itemID = (UINT) childMenuHdl; - flags |= MF_POPUP; - } - if ((menuPtr->menuType == MENUBAR) - && !(mePtr->childMenuRefPtr->menuPtr->menuFlags - & MENU_SYSTEM_MENU)) { - Tcl_DString ds; - TkMenuReferences *menuRefPtr; - TkMenu *systemMenuPtr = mePtr->childMenuRefPtr - ->menuPtr; - - Tcl_DStringInit(&ds); - Tcl_DStringAppend(&ds, - Tk_PathName(menuPtr->masterMenuPtr->tkwin), -1); - Tcl_DStringAppend(&ds, ".system", 7); - - menuRefPtr = TkFindMenuReferences(menuPtr->interp, - Tcl_DStringValue(&ds)); - - Tcl_DStringFree(&ds); - - if ((menuRefPtr != NULL) - && (menuRefPtr->menuPtr != NULL) - && (menuPtr->parentTopLevelPtr != NULL) - && (systemMenuPtr->masterMenuPtr - == menuRefPtr->menuPtr)) { - HMENU systemMenuHdl = - (HMENU) systemMenuPtr->platformData; - HWND wrapper = TkWinGetWrapperWindow(menuPtr - ->parentTopLevelPtr); - if (wrapper != NULL) { - DestroyMenu(systemMenuHdl); - systemMenuHdl = GetSystemMenu(wrapper, FALSE); - systemMenuPtr->menuFlags |= MENU_SYSTEM_MENU; - systemMenuPtr->platformData = - (TkMenuPlatformData) systemMenuHdl; - if (!(systemMenuPtr->menuFlags - & MENU_RECONFIGURE_PENDING)) { - systemMenuPtr->menuFlags - |= MENU_RECONFIGURE_PENDING; - Tcl_DoWhenIdle(ReconfigureWindowsMenu, - (ClientData) systemMenuPtr); - } + if ((menuPtr->menuType == MENUBAR) + && !(mePtr->childMenuRefPtr->menuPtr->menuFlags + & MENU_SYSTEM_MENU)) { + Tcl_DString ds; + TkMenuReferences *menuRefPtr; + TkMenu *systemMenuPtr = mePtr->childMenuRefPtr->menuPtr; + + Tcl_DStringInit(&ds); + Tcl_DStringAppend(&ds, + Tk_PathName(menuPtr->masterMenuPtr->tkwin), -1); + Tcl_DStringAppend(&ds, ".system", 7); + + menuRefPtr = TkFindMenuReferences(menuPtr->interp, + Tcl_DStringValue(&ds)); + + Tcl_DStringFree(&ds); + + if ((menuRefPtr != NULL) + && (menuRefPtr->menuPtr != NULL) + && (menuPtr->parentTopLevelPtr != NULL) + && (systemMenuPtr->masterMenuPtr + == menuRefPtr->menuPtr)) { + HMENU systemMenuHdl = + (HMENU) systemMenuPtr->platformData; + HWND wrapper = TkWinGetWrapperWindow(menuPtr + ->parentTopLevelPtr); + if (wrapper != NULL) { + DestroyMenu(systemMenuHdl); + systemMenuHdl = GetSystemMenu(wrapper, FALSE); + systemMenuPtr->menuFlags |= MENU_SYSTEM_MENU; + systemMenuPtr->platformData = + (TkMenuPlatformData) systemMenuHdl; + if (!(systemMenuPtr->menuFlags + & MENU_RECONFIGURE_PENDING)) { + systemMenuPtr->menuFlags + |= MENU_RECONFIGURE_PENDING; + Tcl_DoWhenIdle(ReconfigureWindowsMenu, + (ClientData) systemMenuPtr); } } } - if (mePtr->childMenuRefPtr->menuPtr->menuFlags - & MENU_SYSTEM_MENU) { - systemMenu++; - } + } + if (mePtr->childMenuRefPtr->menuPtr->menuFlags + & MENU_SYSTEM_MENU) { + systemMenu++; } } if (!systemMenu) { |