summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authora_kovalenko <a_kovalenko>2004-06-16 19:53:40 (GMT)
committera_kovalenko <a_kovalenko>2004-06-16 19:53:40 (GMT)
commit55c614a8ed08c8dcb23312b958ed1756d9b9fd17 (patch)
treea0ece84e8828add7a91d5c7709ece3a750b6dd2a
parent1ba9b61e4f973310a63d5406d99ec5f80934dc60 (diff)
downloadtk-55c614a8ed08c8dcb23312b958ed1756d9b9fd17.zip
tk-55c614a8ed08c8dcb23312b958ed1756d9b9fd17.tar.gz
tk-55c614a8ed08c8dcb23312b958ed1756d9b9fd17.tar.bz2
win/tkWinButton.c: Add a 3D highlight to disabled *buttons and
labels, the same way as it's now done for disabled menu entries.
-rw-r--r--ChangeLog5
-rw-r--r--win/tkWinButton.c26
2 files changed, 30 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9aed660..e391276 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-06-15 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * win/tkWinButton.c: Add a 3D highlight to disabled *buttons and
+ labels, the same way as it's now done for disabled menu entries.
+
2004-06-15 Donal K. Fellows <donal.k.fellows@man.ac.uk>
* doc/image.n: Enhanced the documentation to take into account the
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index 5b12e0c..d9b10b5 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.25 2004/02/18 00:40:24 hobbs Exp $
+ * RCS: @(#) $Id: tkWinButton.c,v 1.26 2004/06/16 19:53:40 a_kovalenko Exp $
*/
#define OEMRESOURCE
@@ -544,6 +544,19 @@ TkpDisplayButton(clientData)
imageXOffset, imageYOffset, 1);
XSetClipOrigin(butPtr->display, gc, 0, 0);
}
+ if ((butPtr->state == STATE_DISABLED) &&
+ (butPtr->disabledFg != NULL)) {
+ COLORREF oldFgColor = gc->foreground;
+ gc->foreground = GetSysColor(COLOR_3DHILIGHT);
+ Tk_DrawTextLayout(butPtr->display, pixmap, gc,
+ butPtr->textLayout, x + textXOffset + 1,
+ y + textYOffset + 1, 0, -1);
+ Tk_UnderlineTextLayout(butPtr->display, pixmap, gc,
+ butPtr->textLayout, x + textXOffset + 1,
+ y + textYOffset + 1,
+ butPtr->underline);
+ gc->foreground = oldFgColor;
+ }
Tk_DrawTextLayout(butPtr->display, pixmap, gc,
butPtr->textLayout, x + textXOffset, y + textYOffset, 0, -1);
@@ -594,6 +607,17 @@ TkpDisplayButton(clientData)
x += offset;
y += offset;
}
+ if ((butPtr->state == STATE_DISABLED) &&
+ (butPtr->disabledFg != NULL)) {
+ COLORREF oldFgColor = gc->foreground;
+ gc->foreground = GetSysColor(COLOR_3DHILIGHT);
+ Tk_DrawTextLayout(butPtr->display, pixmap, gc,
+ butPtr->textLayout,
+ x + 1, y + 1, 0, -1);
+ Tk_UnderlineTextLayout(butPtr->display, pixmap, gc,
+ butPtr->textLayout, x + 1, y + 1, butPtr->underline);
+ gc->foreground = oldFgColor;
+ }
Tk_DrawTextLayout(butPtr->display, pixmap, gc, butPtr->textLayout,
x, y, 0, -1);
Tk_UnderlineTextLayout(butPtr->display, pixmap, gc,