summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-10-31 08:55:03 (GMT)
committervincentdarley <vincentdarley>2003-10-31 08:55:03 (GMT)
commit4631886b5f09a22a0d26c13faf27b039e18e0a66 (patch)
treef6dce72fdb54ee77ca8b0cef792c2e266f08a8f8
parentee12f4c1b1ab10bb0ab1b123cee53625e47ef551 (diff)
downloadtk-4631886b5f09a22a0d26c13faf27b039e18e0a66.zip
tk-4631886b5f09a22a0d26c13faf27b039e18e0a66.tar.gz
tk-4631886b5f09a22a0d26c13faf27b039e18e0a66.tar.bz2
compound menu entries
-rw-r--r--ChangeLog5
-rw-r--r--win/tkWinMenu.c28
2 files changed, 28 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index bff6d78..13fe3ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-10-31 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * win/tkWinMenu.c: more correct placing of images in compound
+ menu entries.
+
2003-10-30 Jeff Hobbs <jeffh@ActiveState.com>
* generic/tkImgPhoto.c (ImgPhotoBlendComplexAlpha): add alpha
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index 696fe8d..7f3f866 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.23 2003/04/15 01:06:09 mdejong Exp $
+ * RCS: @(#) $Id: tkWinMenu.c,v 1.24 2003/10/31 08:55:03 vincentdarley Exp $
*/
#define OEMRESOURCE
@@ -2037,10 +2037,28 @@ DrawMenuEntryLabel(
break;
}
case COMPOUND_LEFT: {
- textXOffset = imageWidth + 2;
- textYOffset = 0;
- imageXOffset = 0;
- imageYOffset = 0;
+ /*
+ * The standard image position on Windows is
+ * in the indicator space to the left of
+ * the entries. Of course if this entry is
+ * a radio/check button, we can't do that
+ * because the indicator space will be used.
+ */
+ if ((mePtr->type == CHECK_BUTTON_ENTRY)
+ || (mePtr->type == RADIO_BUTTON_ENTRY)) {
+ textXOffset = imageWidth + 2;
+ textYOffset = 0;
+ imageXOffset = 0;
+ imageYOffset = 0;
+ } else {
+ textXOffset = imageWidth + 2 - indicatorSpace;
+ if (textXOffset < 0) {
+ textXOffset = 0;
+ }
+ textYOffset = 0;
+ imageXOffset = -indicatorSpace;
+ imageYOffset = 0;
+ }
break;
}
case COMPOUND_RIGHT: {