diff options
author | hobbs <hobbs> | 2004-05-03 23:23:42 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2004-05-03 23:23:42 (GMT) |
commit | 162fff4cc2568413ef5612360c1882c0a6726b07 (patch) | |
tree | 24b95de3649b4f79162ee5bcf244300f7d17e2e3 | |
parent | 8ed8369046f67b8ccdc3cd88a1a3db545024748b (diff) | |
download | tk-162fff4cc2568413ef5612360c1882c0a6726b07.zip tk-162fff4cc2568413ef5612360c1882c0a6726b07.tar.gz tk-162fff4cc2568413ef5612360c1882c0a6726b07.tar.bz2 |
* win/tkWinMenu.c, unix/tkUnixMenu.c (DrawMenuEntryLabel): place
images of compound menu entries in indicator space if not a radio
of checkbutton. [Bug #756952] (eserte)
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | unix/tkUnixMenu.c | 15 | ||||
-rw-r--r-- | win/tkWinMenu.c | 16 |
3 files changed, 33 insertions, 2 deletions
@@ -1,5 +1,9 @@ 2004-05-03 Jeff Hobbs <jeffh@ActiveState.com> + * win/tkWinMenu.c, unix/tkUnixMenu.c (DrawMenuEntryLabel): place + images of compound menu entries in indicator space if not a radio + of checkbutton. [Bug #756952] (eserte) + * win/tkWinX.c: fix drawing of unicode chars in menu * win/tkWinInt.h (TkWinProcs): titles. [Bug #904371] (riefenstahl) * win/tkWinMenu.c (ReconfigureWindowsMenu): diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c index 930a973..cec9ad6 100644 --- a/unix/tkUnixMenu.c +++ b/unix/tkUnixMenu.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixMenu.c,v 1.7 2002/02/22 13:13:13 dkf Exp $ + * RCS: @(#) $Id: tkUnixMenu.c,v 1.7.2.1 2004/05/03 23:23:42 hobbs Exp $ */ #include "tkPort.h" @@ -762,10 +762,23 @@ DrawMenuEntryLabel(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, y, width, height) break; } case COMPOUND_LEFT: { + /* + * Position image in the indicator space to the left of the + * entries, unless this entry is a radio|check button because + * then the indicator space will be used. + */ textXOffset = imageWidth + 2; textYOffset = 0; imageXOffset = 0; imageYOffset = 0; + if ((mePtr->type != CHECK_BUTTON_ENTRY) + && (mePtr->type != RADIO_BUTTON_ENTRY)) { + textXOffset -= indicatorSpace; + if (textXOffset < 0) { + textXOffset = 0; + } + imageXOffset = -indicatorSpace; + } break; } case COMPOUND_RIGHT: { diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 0d89cbe..aea7d73 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.21.2.1 2004/05/03 22:40:58 hobbs Exp $ + * RCS: @(#) $Id: tkWinMenu.c,v 1.21.2.2 2004/05/03 23:23:42 hobbs Exp $ */ #define OEMRESOURCE @@ -1976,10 +1976,24 @@ DrawMenuEntryLabel( break; } case COMPOUND_LEFT: { + /* + * The standard image position on Windows is in the indicator + * space to the left of the entries, unless this entry is a + * radio|check button because then the indicator space will + * be used. + */ textXOffset = imageWidth + 2; textYOffset = 0; imageXOffset = 0; imageYOffset = 0; + if ((mePtr->type != CHECK_BUTTON_ENTRY) + && (mePtr->type != RADIO_BUTTON_ENTRY)) { + textXOffset -= indicatorSpace; + if (textXOffset < 0) { + textXOffset = 0; + } + imageXOffset = -indicatorSpace; + } break; } case COMPOUND_RIGHT: { |