summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorhobbs <hobbs>2004-02-18 00:40:23 (GMT)
committerhobbs <hobbs>2004-02-18 00:40:23 (GMT)
commitf349a3827b7c3d5876b0531780396c6acda15450 (patch)
tree7f16efd14fa17fc03ce82796e8314678aa3d6e1e /win
parent4549e3fbc8a24a6ba2228d48dcea4dba5e49c506 (diff)
downloadtk-f349a3827b7c3d5876b0531780396c6acda15450.zip
tk-f349a3827b7c3d5876b0531780396c6acda15450.tar.gz
tk-f349a3827b7c3d5876b0531780396c6acda15450.tar.bz2
* doc/checkbutton.n: TIP#110 implementation
* doc/radiobutton.n: Tristate Checkbutton and Radiobuttons * generic/tkButton.c: * generic/tkButton.h: * library/demos/check.tcl: * library/demos/radio.tcl: * macosx/tkMacOSXButton.c: * macosx/tkMacOSXDefault.h: * tests/button.test: * unix/tkUnixButton.c: * unix/tkUnixDefault.h: * win/tkWinButton.c: * win/tkWinDefault.h:
Diffstat (limited to 'win')
-rw-r--r--win/tkWinButton.c13
-rw-r--r--win/tkWinDefault.h3
2 files changed, 12 insertions, 4 deletions
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index b10f35f..5b12e0c 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.24 2004/01/13 02:06:01 davygrvy Exp $
+ * RCS: @(#) $Id: tkWinButton.c,v 1.25 2004/02/18 00:40:24 hobbs Exp $
*/
#define OEMRESOURCE
@@ -530,6 +530,9 @@ TkpDisplayButton(clientData)
if ((butPtr->selectImage != NULL) && (butPtr->flags & SELECTED)) {
Tk_RedrawImage(butPtr->selectImage, 0, 0,
width, height, pixmap, imageXOffset, imageYOffset);
+ } else if ((butPtr->tristateImage != NULL) && (butPtr->flags & TRISTATED)) {
+ Tk_RedrawImage(butPtr->tristateImage, 0, 0,
+ width, height, pixmap, imageXOffset, imageYOffset);
} else {
Tk_RedrawImage(butPtr->image, 0, 0,
width, height, pixmap, imageXOffset, imageYOffset);
@@ -566,6 +569,10 @@ TkpDisplayButton(clientData)
(butPtr->flags & SELECTED)) {
Tk_RedrawImage(butPtr->selectImage, 0, 0, width, height,
pixmap, imageXOffset, imageYOffset);
+ } else if ((butPtr->tristateImage != NULL) &&
+ (butPtr->flags & TRISTATED)) {
+ Tk_RedrawImage(butPtr->tristateImage, 0, 0, width, height,
+ pixmap, imageXOffset, imageYOffset);
} else {
Tk_RedrawImage(butPtr->image, 0, 0, width, height, pixmap,
imageXOffset, imageYOffset);
@@ -638,7 +645,7 @@ TkpDisplayButton(clientData)
x -= butPtr->indicatorSpace;
y -= butPtr->indicatorDiameter / 2;
- xSrc = (butPtr->flags & SELECTED) ? tsdPtr->boxWidth : 0;
+ xSrc = (butPtr->flags & (SELECTED|TRISTATED)) ? tsdPtr->boxWidth : 0;
if (butPtr->state == STATE_ACTIVE) {
xSrc += tsdPtr->boxWidth*2;
}
@@ -668,7 +675,7 @@ TkpDisplayButton(clientData)
border, TK_3D_LIGHT2));
boxesPalette[PAL_BOTTOM_OUTER] = FlipColor(TkWinGetBorderPixels(tkwin,
border, TK_3D_LIGHT_GC));
- if (butPtr->state == STATE_DISABLED) {
+ if ((butPtr->state == STATE_DISABLED) || (butPtr->flags & TRISTATED)) {
boxesPalette[PAL_INTERIOR] = FlipColor(TkWinGetBorderPixels(tkwin,
border, TK_3D_LIGHT2));
} else if (butPtr->selectBorder != NULL) {
diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h
index 51bb74c..1e3e2bf 100644
--- a/win/tkWinDefault.h
+++ b/win/tkWinDefault.h
@@ -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: tkWinDefault.h,v 1.17 2003/10/31 09:02:18 vincentdarley Exp $
+ * RCS: @(#) $Id: tkWinDefault.h,v 1.18 2004/02/18 00:40:24 hobbs Exp $
*/
#ifndef _TKWINDEFAULT
@@ -93,6 +93,7 @@
#define DEF_BUTTON_TAKE_FOCUS (char *) NULL
#define DEF_BUTTON_TEXT ""
#define DEF_BUTTON_TEXT_VARIABLE ""
+#define DEF_BUTTON_TRISTATE_VALUE ""
#define DEF_BUTTON_UNDERLINE "-1"
#define DEF_BUTTON_VALUE ""
#define DEF_BUTTON_WIDTH "0"