diff options
author | hobbs <hobbs> | 2006-05-26 21:42:37 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2006-05-26 21:42:37 (GMT) |
commit | 1d978de4e1de61828c9d9b3cba8b21c036837168 (patch) | |
tree | 5aac48db249ca66565857d3720c3e7e6811c2819 | |
parent | 50e884ca4cd2d1ad9d46720564706e89c6df6b93 (diff) | |
download | tk-1d978de4e1de61828c9d9b3cba8b21c036837168.zip tk-1d978de4e1de61828c9d9b3cba8b21c036837168.tar.gz tk-1d978de4e1de61828c9d9b3cba8b21c036837168.tar.bz2 |
* macosx/tkMacOSXButton.c (TkMacOSXDrawControl): correct redraw
for direct transition from disabled to active state. [Bug 706446]
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | macosx/tkMacOSXButton.c | 50 |
2 files changed, 33 insertions, 22 deletions
@@ -1,3 +1,8 @@ +2006-05-26 Jeff Hobbs <jeffh@ActiveState.com> + + * macosx/tkMacOSXButton.c (TkMacOSXDrawControl): correct redraw + for direct transition from disabled to active state. [Bug 706446] + 2006-05-25 Jeff Hobbs <jeffh@ActiveState.com> * win/tkWinMenu.c (TkWinMenuKeyObjCmd): get eventPtr after we know diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index aa53cdb..1555941 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXButton.c,v 1.18 2006/03/24 14:58:01 das Exp $ + * RCS: @(#) $Id: tkMacOSXButton.c,v 1.19 2006/05/26 21:42:37 hobbs Exp $ */ #include "tkMacOSXInt.h" @@ -1019,33 +1019,39 @@ TkMacOSXDrawControl( } else { SetControlValue(mbPtr->control, 0); } - + if (!Tk_MacOSXIsAppInFront() || butPtr->state == STATE_DISABLED) { - HiliteControl(mbPtr->control, kControlInactivePart); - } else if (butPtr->state == STATE_ACTIVE) { - if (mbPtr->params.isBevel) { - HiliteControl(mbPtr->control, kControlButtonPart); - } else { - switch (butPtr->type) { - case TYPE_BUTTON: - HiliteControl(mbPtr->control, kControlButtonPart); - break; - case TYPE_RADIO_BUTTON: - HiliteControl(mbPtr->control, kControlRadioButtonPart); - break; - case TYPE_CHECK_BUTTON: - HiliteControl(mbPtr->control, kControlCheckBoxPart); - break; - } - } + HiliteControl(mbPtr->control, kControlInactivePart); } else { - HiliteControl(mbPtr->control, kControlNoPart); + /* + * Use NoPart for normal and to ensure correct direct transition from + * disabled to active -state. [Bug 706446] + */ + HiliteControl(mbPtr->control, kControlNoPart); + + if (butPtr->state == STATE_ACTIVE) { + if (mbPtr->params.isBevel) { + HiliteControl(mbPtr->control, kControlButtonPart); + } else { + switch (butPtr->type) { + case TYPE_BUTTON: + HiliteControl(mbPtr->control, kControlButtonPart); + break; + case TYPE_RADIO_BUTTON: + HiliteControl(mbPtr->control, kControlRadioButtonPart); + break; + case TYPE_CHECK_BUTTON: + HiliteControl(mbPtr->control, kControlCheckBoxPart); + break; + } + } + } } UpdateControlColors(mbPtr); - + if ((butPtr->type == TYPE_BUTTON) ) { Boolean isDefault; - + if (butPtr->defaultState == STATE_ACTIVE) { isDefault = true; } else { |