diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-24 21:26:53 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-24 21:26:53 +0200 |
commit | df247efec654e512242e4f4f1b0212034f9e01fe (patch) | |
tree | 25c02e16957f3aa613af30c140fd8e8a3d52fda6 /app/wlib/mswlib/mswbutt.c | |
parent | d0b6a8a4ec298024f14f704f9e40a6f9d324ccf3 (diff) | |
parent | a5ade52caa489cf0a713e0f02b764000d203140e (diff) |
Merge branch 'release/debian/1%5.2.0Beta2.1-1' into masterdebian/1%5.2.0Beta2.1-1
Diffstat (limited to 'app/wlib/mswlib/mswbutt.c')
-rw-r--r-- | app/wlib/mswlib/mswbutt.c | 21 |
1 files changed, 11 insertions, 10 deletions
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; } |