summaryrefslogtreecommitdiff
path: root/app/wlib/mswlib/mswbutt.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/wlib/mswlib/mswbutt.c')
-rw-r--r--app/wlib/mswlib/mswbutt.c21
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;
}