diff options
author | hobbs <hobbs> | 2004-02-18 00:40:23 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2004-02-18 00:40:23 (GMT) |
commit | ee5eb79df9969c680caabe8692dbd5d2be2e1f58 (patch) | |
tree | 7f16efd14fa17fc03ce82796e8314678aa3d6e1e /win/tkWinButton.c | |
parent | 0768731d255663dc1e17a376707278f969b34bc6 (diff) | |
download | tk-ee5eb79df9969c680caabe8692dbd5d2be2e1f58.zip tk-ee5eb79df9969c680caabe8692dbd5d2be2e1f58.tar.gz tk-ee5eb79df9969c680caabe8692dbd5d2be2e1f58.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.c | 13 |
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) { |