summaryrefslogtreecommitdiff
path: root/iup/src/win/iupwin_val.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_val.c
parentccc8261e4d48de89da4ddfe7b55e378ae0cd6f47 (diff)
Upgrading to iup 3.1
Diffstat (limited to 'iup/src/win/iupwin_val.c')
-rwxr-xr-xiup/src/win/iupwin_val.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/iup/src/win/iupwin_val.c b/iup/src/win/iupwin_val.c
index 706c612..5c956d9 100755
--- a/iup/src/win/iupwin_val.c
+++ b/iup/src/win/iupwin_val.c
@@ -56,6 +56,13 @@ void iupdrvValGetMinSize(Ihandle* ih, int *w, int *h)
}
}
+static int winValSetBgColorAttrib(Ihandle *ih, const char *value)
+{
+ (void)value;
+ iupdrvPostRedraw(ih);
+ return 1;
+}
+
static int winValSetStepAttrib(Ihandle* ih, const char* value)
{
int linesize;
@@ -110,18 +117,6 @@ static int winValSetValueAttrib(Ihandle* ih, const char* value)
/*********************************************************************************************/
-static int winValCtlColor(Ihandle* ih, HDC hdc, LRESULT *result)
-{
- COLORREF cr;
- if (iupwinGetParentBgColor(ih, &cr))
- {
- SetDCBrushColor(hdc, cr);
- *result = (LRESULT)GetStockObject(DC_BRUSH);
- return 1;
- }
- return 0;
-}
-
static int winValCustomScroll(Ihandle* ih, int msg)
{
double old_val = ih->data->val;
@@ -190,6 +185,19 @@ static void winValIncPageValue(Ihandle *ih, int dir)
winValCustomScroll(ih, 0);
}
+static int winValCtlColor(Ihandle* ih, HDC hdc, LRESULT *result)
+{
+ COLORREF cr;
+ if (iupwinGetParentBgColor(ih, &cr))
+ {
+ SetBkColor(hdc, cr);
+ SetDCBrushColor(hdc, cr);
+ *result = (LRESULT)GetStockObject(DC_BRUSH);
+ return 1;
+ }
+ return 0;
+}
+
static int winValProc(Ihandle* ih, UINT msg, WPARAM wp, LPARAM lp, LRESULT *result)
{
(void)lp;
@@ -240,7 +248,7 @@ static int winValProc(Ihandle* ih, UINT msg, WPARAM wp, LPARAM lp, LRESULT *resu
static int winValMapMethod(Ihandle* ih)
{
- DWORD dwStyle = WS_CHILD | TBS_AUTOTICKS;
+ DWORD dwStyle = WS_CHILD | WS_CLIPSIBLINGS | TBS_AUTOTICKS;
int show_ticks;
if (!ih->parent)
@@ -312,4 +320,7 @@ void iupdrvValInitClass(Iclass* ic)
iupClassRegisterAttribute(ic, "STEP", iupValGetStepAttrib, winValSetStepAttrib, "0.01", NULL, IUPAF_NO_INHERIT); /* force new default value */
iupClassRegisterAttribute(ic, "TICKSPOS", NULL, NULL, "NORMAL", NULL, IUPAF_NOT_MAPPED);
+
+ /* Visual */
+ iupClassRegisterAttribute(ic, "BGCOLOR", NULL, winValSetBgColorAttrib, IUPAF_SAMEASSYSTEM, "DLGBGCOLOR", IUPAF_DEFAULT);
}