summaryrefslogtreecommitdiffstats
path: root/win/tkWinButton.c
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2002-07-24 19:15:09 (GMT)
committerhobbs <hobbs@noemail.net>2002-07-24 19:15:09 (GMT)
commit6c363b7d4177689aca72d16cd4a2e2c0d0459e77 (patch)
tree8b3551c71176e11c423468f2e599277430dc759b /win/tkWinButton.c
parent160ec632becde664db87acb44e25c81ac0738848 (diff)
downloadtk-6c363b7d4177689aca72d16cd4a2e2c0d0459e77.zip
tk-6c363b7d4177689aca72d16cd4a2e2c0d0459e77.tar.gz
tk-6c363b7d4177689aca72d16cd4a2e2c0d0459e77.tar.bz2
* win/tkWinButton.c (TkpDisplayButton): corrected display of focus
ring around the actual text when the button is a compound button. [Bug #583691] FossilOrigin-Name: 4ba93c3151325a3fd36ee294b4f71d0749bf5ab0
Diffstat (limited to 'win/tkWinButton.c')
-rw-r--r--win/tkWinButton.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index 8c86197..a2b063b 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.16 2002/06/17 10:54:29 drh Exp $
+ * RCS: @(#) $Id: tkWinButton.c,v 1.17 2002/07/24 19:15:10 hobbs Exp $
*/
#define OEMRESOURCE
@@ -353,6 +353,8 @@ TkpDisplayButton(clientData)
* it is a flavor of button, so we offset
* the text to make the button appear to
* move up and down as the relief changes. */
+ int textXOffset = 0, textYOffset = 0; /* text offsets for use with
+ * compound buttons and focus ring */
DWORD *boxesPalette;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
@@ -434,12 +436,10 @@ TkpDisplayButton(clientData)
haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0);
if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
- int imageXOffset, imageYOffset, textXOffset, textYOffset, fullWidth,
+ int imageXOffset, imageYOffset, fullWidth,
fullHeight;
imageXOffset = 0;
imageYOffset = 0;
- textXOffset = 0;
- textYOffset = 0;
fullWidth = 0;
fullHeight = 0;
@@ -573,7 +573,8 @@ TkpDisplayButton(clientData)
/*
* Draw the focus ring. If this is a push button then we need to
* put it around the inner edge of the border, otherwise we put it
- * around the text.
+ * around the text. The text offsets are only non-zero when this
+ * is a compound button.
*/
if (drawRing && butPtr->flags & GOT_FOCUS && butPtr->type != TYPE_LABEL) {
@@ -584,10 +585,10 @@ TkpDisplayButton(clientData)
rect.right = Tk_Width(tkwin) - rect.left;
rect.bottom = Tk_Height(tkwin) - rect.top;
} else {
- rect.top = y-1;
- rect.left = x-1;
- rect.right = x+butPtr->textWidth + 1;
- rect.bottom = y+butPtr->textHeight + 2;
+ rect.top = y-1 + textYOffset;
+ rect.left = x-1 + textXOffset;
+ rect.right = x+butPtr->textWidth + 1 + textXOffset;
+ rect.bottom = y+butPtr->textHeight + 2 + textYOffset;
}
SetTextColor(dc, gc->foreground);
SetBkColor(dc, gc->background);