summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2002-08-30 15:36:12 (GMT)
committerdas <das>2002-08-30 15:36:12 (GMT)
commitea6da1ae5353546664b9c446808a68b1c552c6de (patch)
tree3dc04bc46c563017d648dad92fb6e1c48f28908d
parent87c8b231c8ceda0f5f252005298c67175413eb75 (diff)
downloadtk-ea6da1ae5353546664b9c446808a68b1c552c6de.zip
tk-ea6da1ae5353546664b9c446808a68b1c552c6de.tar.gz
tk-ea6da1ae5353546664b9c446808a68b1c552c6de.tar.bz2
merged with trunk at tag macosx-8-4-merge-2002-08-30-trunkmacosx_8_4_merge_2002_08_30_branch
-rw-r--r--ChangeLog14
-rw-r--r--doc/checkbutton.n10
-rw-r--r--doc/radiobutton.n11
-rw-r--r--mac/tkMacButton.c9
-rw-r--r--unix/tkUnixButton.c35
-rw-r--r--win/Makefile.in30
-rw-r--r--win/tkWinButton.c35
-rw-r--r--win/winMain.c18
8 files changed, 103 insertions, 59 deletions
diff --git a/ChangeLog b/ChangeLog
index e5bd716..6781dda 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2002-08-27 D. Richard Hipp <drh@hwaci.com>
+
+ * doc/checkbutton.n: [Bug 582457] Fix the -offrelief option so
+ * doc/radiobutton.n: that when -offrelief is flat and -relief is
+ * mac/tkMacButton.c: sunken and -overrelief is raised, buttons
+ * unix/tkUnixButton.c: work look toolbar buttons under Windows.
+ * win/tkWinButton.c: See also: TIP #82.
+
+2002-08-26 Don Porter <dgp@users.sf.net>
+
+ * win/Makefile.in: Removed dependence on the (parts of) the
+ * win/winMain.c: tcltest executable on Windows. It was not
+ used, and the dependency complicated the Makefile. [Bug 592638].
+
2002-08-20 Don Porter <dgp@users.sf.net>
* README: Bumped version number to 8.4b3 to distinguish
diff --git a/doc/checkbutton.n b/doc/checkbutton.n
index 2ac2d84..07a1bb4 100644
--- a/doc/checkbutton.n
+++ b/doc/checkbutton.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: checkbutton.n,v 1.4.6.1 2002/08/20 20:27:00 das Exp $
+'\" RCS: @(#) $Id: checkbutton.n,v 1.4.6.2 2002/08/30 15:36:13 das Exp $
'\"
.so man.macros
.TH checkbutton n 4.4 Tk "Tk Built-In Commands"
@@ -46,7 +46,13 @@ selected and raised otherwise.
.VS 8.4
.OP \-offrelief offRelief OffRelief
Specifies the relief for the checkbutton when the indicator is not drawn and
-the checkbutton is off. The default value is "raised".
+the checkbutton is off. The default value is "raised". By setting this option
+to "flat" and setting -indicatoron to false and -overrelief to raised,
+the effect is achieved
+of having a flat button that raises on mouse-over and which is
+depressed when activated. This is the behavior typically exhibited by
+the Bold, Italic, and Underline checkbuttons on the toolbar of a
+word-processor, for example.
.VE 8.4
.OP \-offvalue offValue Value
Specifies value to store in the button's associated variable whenever
diff --git a/doc/radiobutton.n b/doc/radiobutton.n
index 8254656..58079c1 100644
--- a/doc/radiobutton.n
+++ b/doc/radiobutton.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: radiobutton.n,v 1.4.6.1 2002/08/20 20:27:00 das Exp $
+'\" RCS: @(#) $Id: radiobutton.n,v 1.4.6.2 2002/08/30 15:36:13 das Exp $
'\"
.so man.macros
.TH radiobutton n 4.4 Tk "Tk Built-In Commands"
@@ -56,7 +56,14 @@ displaying when the widget is selected.
.VS 8.4
.OP \-offrelief offRelief OffRelief
Specifies the relief for the checkbutton when the indicator is not drawn and
-the checkbutton is off. The default value is "raised".
+the checkbutton is off. The default value is "raised". By setting this option
+to "flat" and setting -indicatoron to false and -overrelief to raised,
+the effect is achieved
+of having a flat button that raises on mouse-over and which is
+depressed when activated. This is the behavior typically exhibited by
+the Align-Left, Align-Right, and Center radiobuttons on the toolbar of a
+word-processor, for example.
+
.VE 8.4
.VS 8.4
.OP \-overrelief overRelief OverRelief
diff --git a/mac/tkMacButton.c b/mac/tkMacButton.c
index dd2d945..47f46c2 100644
--- a/mac/tkMacButton.c
+++ b/mac/tkMacButton.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: tkMacButton.c,v 1.14.4.2 2002/08/20 20:27:10 das Exp $
+ * RCS: @(#) $Id: tkMacButton.c,v 1.14.4.3 2002/08/30 15:36:13 das Exp $
*/
#include "tkButton.h"
@@ -227,8 +227,11 @@ TkpDisplayButton(
if ((butPtr->type >= TYPE_CHECK_BUTTON) && !butPtr->indicatorOn) {
if (!TkMacHaveAppearance() || !hasImageOrBitmap) {
- 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;
+ }
}
}
diff --git a/unix/tkUnixButton.c b/unix/tkUnixButton.c
index 21b2d2d..0329fdd 100644
--- a/unix/tkUnixButton.c
+++ b/unix/tkUnixButton.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: tkUnixButton.c,v 1.8.4.1 2002/08/20 20:27:18 das Exp $
+ * RCS: @(#) $Id: tkUnixButton.c,v 1.8.4.2 2002/08/30 15:36:13 das Exp $
*/
#include "tkButton.h"
@@ -115,13 +115,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;
+ }
}
offset = (butPtr->type == TYPE_BUTTON) && !Tk_StrictMotif(butPtr->tkwin);
diff --git a/win/Makefile.in b/win/Makefile.in
index 78d293e..1a4eab0 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -4,7 +4,7 @@
# "autoconf" program (constructs like "@foo@" will get replaced in the
# actual Makefile.
#
-# RCS: @(#) $Id: Makefile.in,v 1.44.2.3 2002/08/20 20:27:18 das Exp $
+# RCS: @(#) $Id: Makefile.in,v 1.44.2.4 2002/08/30 15:36:13 das Exp $
TCLVERSION = @TCL_VERSION@
VERSION = @TK_VERSION@
@@ -115,7 +115,6 @@ BITMAP_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)/bitmaps')
XLIB_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)/xlib')
TCL_GENERIC_NATIVE = $(shell $(CYGPATH) '$(TCL_GENERIC_DIR)')
TCL_SRC_DIR_NATIVE = $(shell $(CYGPATH) '$(TCL_SRC_DIR)')
-TCL_BIN_DIR_NATIVE = $(shell $(CYGPATH) '$(TCL_BIN_DIR)')
RC_DIR_NATIVE = $(shell $(CYGPATH) '$(RC_DIR)')
DLLSUFFIX = @DLLSUFFIX@
@@ -130,7 +129,6 @@ SHARED_LIBRARIES = $(TK_DLL_FILE) $(TK_STUB_LIB_FILE)
STATIC_LIBRARIES = $(TK_LIB_FILE)
WISH = wish$(VER)${EXESUFFIX}
-TCLTEST = $(TCL_BIN_DIR)/tcltest${EXEEXT}
TKTEST = tktest${EXEEXT}
CAT32 = cat32$(EXEEXT)
MAN2TCL = man2tcl$(EXEEXT)
@@ -223,21 +221,7 @@ INSTALL_DATA = ${INSTALL}
WISH_OBJS = \
winMain.$(OBJEXT)
-TCLTEST_OBJS = \
- ${TCL_BIN_DIR}/tclThreadTest.$(OBJEXT)
-
-TCLTEST_OBJS_NATIVE = \
- "${TCL_BIN_DIR_NATIVE}/tclThreadTest.$(OBJEXT)"
-
TKTEST_OBJS = \
- $(TCLTEST_OBJS) \
- testMain.$(OBJEXT) \
- tkSquare.$(OBJEXT) \
- tkTest.$(OBJEXT) \
- tkWinTest.$(OBJEXT)
-
-TKTEST_OBJS_NATIVE = \
- $(TCLTEST_OBJS_NATIVE) \
testMain.$(OBJEXT) \
tkSquare.$(OBJEXT) \
tkTest.$(OBJEXT) \
@@ -534,14 +518,8 @@ $(WISH): $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(WISH_OBJS) wish.$(RES)
tktest : $(TKTEST)
-# This rule is executed if the user tried to run tktest without first
-# building tcltest in the Tcl bin directory. Just do it for them.
-$(TCLTEST):
- cd ${TCL_BIN_DIR} ; \
- $(MAKE) tcltest
-
-$(TKTEST): $(TCLTEST) $(TK_LIB_FILE) $(TKTEST_OBJS) wish.$(RES) $(CAT32)
- $(CC) $(CFLAGS) $(TKTEST_OBJS_NATIVE) $(TCL_LIB_FILE) \
+$(TKTEST): $(TK_LIB_FILE) $(TKTEST_OBJS) wish.$(RES) $(CAT32)
+ $(CC) $(CFLAGS) $(TKTEST_OBJS) $(TCL_LIB_FILE) \
$(TK_LIB_FILE) $(LIBS) \
wish.$(RES) $(CC_EXENAME) $(LDFLAGS_WINDOW)
@@ -585,8 +563,6 @@ tkWinTest.$(OBJEXT): tkWinTest.c
tkSquare.$(OBJEXT): tkSquare.c
$(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME)
-tclThreadTest.$(OBJEXT): $(TCL_BIN_DIR)/tclThreadTest.$(OBJEXT)
-
# Add the object extension to the implicit rules. By default .obj is not
# automatically added.
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index 41ea7d5..f5a3570 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.12.4.3 2002/08/20 20:27:19 das Exp $
+ * RCS: @(#) $Id: tkWinButton.c,v 1.12.4.4 2002/08/30 15:36:13 das 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;
+ }
}
/*
diff --git a/win/winMain.c b/win/winMain.c
index 2d24a4f..d8436b6 100644
--- a/win/winMain.c
+++ b/win/winMain.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: winMain.c,v 1.11 2001/08/04 00:29:43 hobbs Exp $
+ * RCS: @(#) $Id: winMain.c,v 1.11.2.1 2002/08/30 15:36:13 das Exp $
*/
#include <tk.h>
@@ -38,11 +38,6 @@ static void WishPanic _ANSI_ARGS_(TCL_VARARGS(CONST char *,format));
extern int Tktest_Init(Tcl_Interp *interp);
#endif /* TK_TEST */
-#ifdef TCL_TEST
-extern int TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp));
-extern int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp));
-#endif /* TCL_TEST */
-
static BOOL consoleRequired = TRUE;
/*
@@ -189,17 +184,6 @@ Tcl_AppInit(interp)
}
}
-#ifdef TCL_TEST
- if (Tcltest_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "Tcltest", Tcltest_Init,
- (Tcl_PackageInitProc *) NULL);
- if (TclObjTest_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
-#endif /* TCL_TEST */
-
#ifdef TK_TEST
if (Tktest_Init(interp) == TCL_ERROR) {
goto error;