summaryrefslogtreecommitdiff
path: root/iup/src/win/iupwin_label.c
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2010-06-15 00:59:57 -0700
committerPixel <pixel@nobis-crew.org>2010-06-15 00:59:57 -0700
commiteed0eb6a476d54ce19aeff137984aa981d9e3976 (patch)
tree807891636efd2f87dcbd261e971216269973ae07 /iup/src/win/iupwin_label.c
parentccc8261e4d48de89da4ddfe7b55e378ae0cd6f47 (diff)
Upgrading to iup 3.1
Diffstat (limited to 'iup/src/win/iupwin_label.c')
-rwxr-xr-xiup/src/win/iupwin_label.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/iup/src/win/iupwin_label.c b/iup/src/win/iupwin_label.c
index d5a1f53..95dd10c 100755
--- a/iup/src/win/iupwin_label.c
+++ b/iup/src/win/iupwin_label.c
@@ -173,7 +173,7 @@ static int winLabelSetAlignmentAttrib(Ihandle* ih, const char* value)
else /* "ATOP" */
ih->data->vert_alignment = IUP_ALIGN_ATOP;
- iupdrvDisplayRedraw(ih);
+ iupdrvRedrawNow(ih);
}
return 0;
}
@@ -197,7 +197,7 @@ static int winLabelSetPaddingAttrib(Ihandle* ih, const char* value)
iupStrToIntInt(value, &ih->data->horiz_padding, &ih->data->vert_padding, 'x');
if (ih->handle && ih->data->type != IUP_LABEL_SEP_HORIZ && ih->data->type != IUP_LABEL_SEP_VERT)
- iupdrvDisplayRedraw(ih);
+ iupdrvRedrawNow(ih);
return 0;
}
@@ -211,7 +211,7 @@ static int winLabelSetWordWrapAttrib(Ihandle* ih, const char* value)
else
ih->data->text_style &= ~DT_WORDBREAK;
- iupdrvDisplayRedraw(ih);
+ iupdrvRedrawNow(ih);
}
return 1;
@@ -226,7 +226,7 @@ static int winLabelSetEllipsisAttrib(Ihandle* ih, const char* value)
else
ih->data->text_style &= ~DT_END_ELLIPSIS;
- iupdrvDisplayRedraw(ih);
+ iupdrvRedrawNow(ih);
}
return 1;
@@ -240,12 +240,24 @@ static int winLabelSetFgColorAttrib(Ihandle* ih, const char* value)
if (iupStrToRGB(value, &r, &g, &b))
{
ih->data->fgcolor = RGB(r,g,b);
- iupdrvDisplayRedraw(ih);
+
+ if (ih->handle)
+ iupdrvRedrawNow(ih);
}
}
return 1;
}
+static int winLabelSetUpdateAttrib(Ihandle* ih, const char* value)
+{
+ (void)value;
+
+ if (ih->handle)
+ iupdrvPostRedraw(ih); /* Post a redraw */
+
+ return 1;
+}
+
static int winLabelProc(Ihandle* ih, UINT msg, WPARAM wp, LPARAM lp, LRESULT *result)
{
switch (msg)
@@ -257,6 +269,7 @@ static int winLabelProc(Ihandle* ih, UINT msg, WPARAM wp, LPARAM lp, LRESULT *re
*result = WVR_HREDRAW|WVR_VREDRAW;
return 1;
}
+ break;
}
}
@@ -266,7 +279,7 @@ static int winLabelProc(Ihandle* ih, UINT msg, WPARAM wp, LPARAM lp, LRESULT *re
static int winLabelMapMethod(Ihandle* ih)
{
char* value;
- DWORD dwStyle = WS_CHILD |
+ DWORD dwStyle = WS_CHILD | WS_CLIPSIBLINGS |
SS_NOTIFY; /* SS_NOTIFY is necessary because of the base messages */
if (!ih->parent)
@@ -330,7 +343,7 @@ void iupdrvLabelInitClass(Iclass* ic)
/* IupLabel only */
iupClassRegisterAttribute(ic, "ALIGNMENT", winLabelGetAlignmentAttrib, winLabelSetAlignmentAttrib, IUPAF_SAMEASSYSTEM, "ALEFT:ACENTER", IUPAF_NO_INHERIT);
- iupClassRegisterAttribute(ic, "IMAGE", NULL, NULL, NULL, NULL, IUPAF_NO_DEFAULTVALUE|IUPAF_NO_INHERIT);
+ iupClassRegisterAttribute(ic, "IMAGE", NULL, winLabelSetUpdateAttrib, NULL, NULL, IUPAF_NO_DEFAULTVALUE|IUPAF_NO_INHERIT);
iupClassRegisterAttribute(ic, "PADDING", iupLabelGetPaddingAttrib, winLabelSetPaddingAttrib, IUPAF_SAMEASSYSTEM, "0x0", IUPAF_NOT_MAPPED);
/* IupLabel Windows and GTK only */