summaryrefslogtreecommitdiffstats
path: root/win/tkWinButton.c
diff options
context:
space:
mode:
authordrh <drh@sqlite.org>2002-08-28 01:08:06 (GMT)
committerdrh <drh@sqlite.org>2002-08-28 01:08:06 (GMT)
commit62d94160aed093a9505d60181a1509e69bd02bb6 (patch)
tree5960f61fed46a9f73cf486909c92874ca51c7171 /win/tkWinButton.c
parentcba98af9a6ea332576939b71f74b5ffbdb4c61f3 (diff)
downloadtk-62d94160aed093a9505d60181a1509e69bd02bb6.zip
tk-62d94160aed093a9505d60181a1509e69bd02bb6.tar.gz
tk-62d94160aed093a9505d60181a1509e69bd02bb6.tar.bz2
Fix for bug #582457: make radio and checkbuttons work like Windows whenmacosx_8_4_premerge_2002_08_31_trunkmacosx_8_4_merge_2002_08_30_trunk
-relief is sunken, -offrelief is flat, and -overrelief is raised.
Diffstat (limited to 'win/tkWinButton.c')
-rw-r--r--win/tkWinButton.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index a2b063b..4ca5054 100644
--- a/win/tkWinButton.c
+++ b/win/tkWinButton.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: tkWinButton.c,v 1.17 2002/07/24 19:15:10 hobbs Exp $
+ * RCS: @(#) $Id: tkWinButton.c,v 1.18 2002/08/28 01:08:06 drh Exp $
*/
#define OEMRESOURCE
@@ -383,13 +383,40 @@ TkpDisplayButton(clientData)
/*
* Override the relief specified for the button if this is a
- * checkbutton or radiobutton and there's no indicator.
+ * checkbutton or radiobutton and there's no indicator. The new
+ * relief is as follows:
+ * If the button is select --> "sunken"
+ * If relief==overrelief --> relief
+ * Otherwise --> overrelief
+ *
+ * The effect we are trying to achieve is as follows:
+ *
+ * value mouse-over? --> relief
+ * ------- ------------ --------
+ * off no flat
+ * off yes raised
+ * on no sunken
+ * on yes sunken
+ *
+ * This is accomplished by configuring the checkbutton or radiobutton
+ * like this:
+ *
+ * -indicatoron 0 -overrelief raised -offrelief flat
+ *
+ * Bindings (see library/button.tcl) will copy the -overrelief into
+ * -relief on mouseover. Hence, we can tell if we are in mouse-over by
+ * comparing relief against overRelief. This is an aweful kludge, but
+ * it gives use the desired behavior while keeping the code backwards
+ * compatible.
*/
relief = butPtr->relief;
if ((butPtr->type >= TYPE_CHECK_BUTTON) && !butPtr->indicatorOn) {
- relief = (butPtr->flags & SELECTED) ? TK_RELIEF_SUNKEN
- : butPtr->offRelief;
+ if (butPtr->flags & SELECTED) {
+ relief = TK_RELIEF_SUNKEN;
+ } else if (butPtr->overRelief != relief) {
+ relief = butPtr->offRelief;
+ }
}
/*