diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/tkWinButton.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/win/tkWinButton.c b/win/tkWinButton.c index a60fec2..e0998b5 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -565,6 +565,11 @@ TkpDisplayButton( return; } + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padXPtr, &butPtr->padX); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padYPtr, &butPtr->padY); + border = butPtr->normalBorder; if ((butPtr->state == STATE_DISABLED) && (butPtr->disabledFg != NULL)) { gc = butPtr->disabledGC; @@ -623,7 +628,7 @@ TkpDisplayButton( if (butPtr->type == TYPE_LABEL) { defaultWidth = butPtr->highlightWidth; - offset = 0; + offset = 0; } else if (butPtr->type == TYPE_BUTTON) { defaultWidth = ((butPtr->defaultState == DEFAULT_ACTIVE) ? butPtr->highlightWidth : 0); @@ -924,19 +929,19 @@ TkpDisplayButton( if (relief != TK_RELIEF_FLAT) { Tk_Draw3DRectangle(tkwin, pixmap, border, defaultWidth, defaultWidth, - Tk_Width(tkwin) - 2*defaultWidth, - Tk_Height(tkwin) - 2*defaultWidth, + Tk_Width(tkwin) - 2 * defaultWidth, + Tk_Height(tkwin) - 2 * defaultWidth, butPtr->borderWidth, relief); } if (defaultWidth != 0) { - int highlightColor; + int highlightColor; dc = TkWinGetDrawableDC(butPtr->display, pixmap, &state); - if (butPtr->type == TYPE_LABEL) { - highlightColor = (int) Tk_3DBorderColor(butPtr->highlightBorder)->pixel; - } else { - highlightColor = (int) butPtr->highlightColorPtr->pixel; - } + if (butPtr->type == TYPE_LABEL) { + highlightColor = (int) Tk_3DBorderColor(butPtr->highlightBorder)->pixel; + } else { + highlightColor = (int) butPtr->highlightColorPtr->pixel; + } TkWinFillRect(dc, 0, 0, Tk_Width(tkwin), defaultWidth, highlightColor); TkWinFillRect(dc, 0, 0, defaultWidth, Tk_Height(tkwin), @@ -1000,9 +1005,9 @@ TkpComputeButtonGeometry( ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - if (butPtr->highlightWidth < 0) { - butPtr->highlightWidth = 0; - } + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); + butPtr->inset = butPtr->highlightWidth + butPtr->borderWidth; butPtr->indicatorSpace = 0; @@ -1195,6 +1200,9 @@ TkpComputeButtonGeometry( * because otherwise it is not really a compound button. */ + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXPtr, &butPtr->padX); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYPtr, &butPtr->padY); + if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) { switch ((enum compound) butPtr->compound) { case COMPOUND_TOP: @@ -1265,8 +1273,8 @@ TkpComputeButtonGeometry( height = butPtr->height; } - width += 2*butPtr->padX; - height += 2*butPtr->padY; + width += 2 * butPtr->padX; + height += 2 * butPtr->padY; } else if (haveImage) { if (butPtr->width > 0) { width = butPtr->width; @@ -1449,7 +1457,7 @@ ButtonProc( * causes all buttons to fire once a second, so we need to make sure * that we are not dealing with the chromium life check. */ - if (wParam != 0 || lParam != 0) { + if (wParam != 0 || lParam != 0) { int code; Tcl_Interp *interp = butPtr->info.interp; |