From 55c614a8ed08c8dcb23312b958ed1756d9b9fd17 Mon Sep 17 00:00:00 2001 From: a_kovalenko Date: Wed, 16 Jun 2004 19:53:40 +0000 Subject: win/tkWinButton.c: Add a 3D highlight to disabled *buttons and labels, the same way as it's now done for disabled menu entries. --- ChangeLog | 5 +++++ win/tkWinButton.c | 26 +++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9aed660..e391276 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-06-15 Anton Kovalenko + + * 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 * 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, -- cgit v0.12