summaryrefslogtreecommitdiffstats
path: root/win/tkWinButton.c
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/tkWinButton.c
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/tkWinButton.c')
-rw-r--r--win/tkWinButton.c13
1 files changed, 10 insertions, 3 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) {