From b623f5953691b2a0614e6f1f4def86bdbb9a4113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 8 Aug 2020 11:53:00 +0200 Subject: New upstream version 5.2.0Beta2.1 --- app/wlib/mswlib/mswbutt.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'app/wlib/mswlib/mswbutt.c') diff --git a/app/wlib/mswlib/mswbutt.c b/app/wlib/mswlib/mswbutt.c index d213695..16f31c1 100644 --- a/app/wlib/mswlib/mswbutt.c +++ b/app/wlib/mswlib/mswbutt.c @@ -37,11 +37,7 @@ int kludge12 = 0; ***************************************************************************** */ - - static XWNDPROC oldButtProc = NULL; -static XWNDPROC newButtProc; - struct wButton_t { WOBJ_COMMON @@ -88,9 +84,9 @@ static void drawButton( COLORREF colF; #define LEFT (0) -#define RIGHT (bm->w+10) +#define RIGHT (LONG)ceil(bm->w*scaleIcon+10) #define TOP (0) -#define BOTTOM (bm->h+10) +#define BOTTOM (LONG)ceil(bm->h*scaleIcon+10) /* get the lightest and the darkest color to use */ colL = GetSysColor( COLOR_BTNHIGHLIGHT ); @@ -239,6 +235,7 @@ static LRESULT buttPush( wControl_p b, HWND hWnd, UINT message, WPARAM wParam, L DRAWITEMSTRUCT * di = (DRAWITEMSTRUCT *)lParam; wBool_t selected; + switch (message) { case WM_COMMAND: if (bb->action /*&& !bb->busy*/) { @@ -253,8 +250,8 @@ static LRESULT buttPush( wControl_p b, HWND hWnd, UINT message, WPARAM wParam, L break; mi->CtlType = ODT_BUTTON; mi->CtlID = wParam; - mi->itemWidth = bb->w; - mi->itemHeight = bb->h; + mi->itemWidth = (UINT)ceil(bb->w*scaleIcon); + mi->itemHeight = (UINT)ceil(bb->h*scaleIcon); } return 0L; case WM_DRAWITEM: @@ -369,8 +366,8 @@ wButton_p wButtonCreate( b->selected = 0; mswComputePos( (wControl_p)b, x, y ); if (b->option&BO_ICON) { - width = bm->w+10; - h = bm->h+10; + width = (wPos_t)ceil(bm->w*scaleIcon)+10; + h = (int)ceil(bm->h*scaleIcon)+10; b->icon = bm; } else { width = (wPos_t)(width*mswScale); @@ -405,5 +402,9 @@ wButton_p wButtonCreate( } if ( !mswThickFont ) SendMessage( b->hWnd, WM_SETFONT, (WPARAM)mswLabelFont, 0L ); + + + InvalidateRect(b->hWnd, &rect, TRUE); + return b; } -- cgit v1.2.3