summaryrefslogtreecommitdiff
path: root/iup/src/win/iupwin_dialog.c
diff options
context:
space:
mode:
Diffstat (limited to 'iup/src/win/iupwin_dialog.c')
-rwxr-xr-xiup/src/win/iupwin_dialog.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/iup/src/win/iupwin_dialog.c b/iup/src/win/iupwin_dialog.c
index 39fdc0c..c13b88d 100755
--- a/iup/src/win/iupwin_dialog.c
+++ b/iup/src/win/iupwin_dialog.c
@@ -102,9 +102,9 @@ void iupdrvDialogGetDecoration(Ihandle* ih, int *border, int *caption, int *menu
else
{
int has_titlebar = iupAttribGetBoolean(ih, "MAXBOX") ||
- iupAttribGetBoolean(ih, "MINBOX") ||
- iupAttribGetBoolean(ih, "MENUBOX") ||
- IupGetAttribute(ih, "TITLE"); /* must use IupGetAttribute to check from the native implementation */
+ iupAttribGetBoolean(ih, "MINBOX") ||
+ iupAttribGetBoolean(ih, "MENUBOX") ||
+ IupGetAttribute(ih, "TITLE"); /* must use IupGetAttribute to check from the native implementation */
*caption = 0;
if (has_titlebar)
@@ -118,14 +118,17 @@ void iupdrvDialogGetDecoration(Ihandle* ih, int *border, int *caption, int *menu
*border = 0;
if (iupAttribGetBoolean(ih, "RESIZE"))
{
+ /* has_border */
*border = GetSystemMetrics(SM_CXFRAME); /* Thickness of the sizing border around the perimeter of a window */
} /* that can be resized, in pixels. */
else if (has_titlebar)
{
+ /* has_border */
*border = GetSystemMetrics(SM_CXFIXEDFRAME); /* Thickness of the frame around the perimeter of a window */
} /* that has a caption but is not sizable, in pixels. */
else if (iupAttribGetBoolean(ih, "BORDER"))
{
+ /* has_border */
*border = GetSystemMetrics(SM_CXBORDER);
}
}
@@ -712,28 +715,27 @@ static int winDialogMapMethod(Ihandle* ih)
}
if (iupAttribGetBoolean(ih, "RESIZE"))
+ {
dwStyle |= WS_THICKFRAME;
+ has_border = 1;
+ }
else
iupAttribSetStr(ih, "MAXBOX", "NO"); /* Must also remove this to RESIZE=NO work */
-
if (iupAttribGetBoolean(ih, "MAXBOX"))
{
dwStyle |= WS_MAXIMIZEBOX;
has_titlebar = 1;
}
-
if (iupAttribGetBoolean(ih, "MINBOX"))
{
dwStyle |= WS_MINIMIZEBOX;
has_titlebar = 1;
}
-
if (iupAttribGetBoolean(ih, "MENUBOX"))
{
dwStyle |= WS_SYSMENU;
has_titlebar = 1;
}
-
if (iupAttribGetBoolean(ih, "BORDER") || has_titlebar)
has_border = 1;
@@ -815,10 +817,7 @@ static int winDialogMapMethod(Ihandle* ih)
if (iupAttribGetBoolean(ih, "DIALOGFRAME") && native_parent)
dwExStyle |= WS_EX_DLGMODALFRAME; /* this will hide the MENUBOX but not the close button */
- if (iupAttribGetBoolean(ih, "COMPOSITED"))
- dwExStyle |= WS_EX_COMPOSITED;
- else
- dwStyle |= WS_CLIPCHILDREN;
+ iupwinGetNativeParentStyle(ih, &dwExStyle, &dwStyle);
if (iupAttribGetBoolean(ih, "HELPBUTTON"))
dwExStyle |= WS_EX_CONTEXTHELP;
@@ -878,7 +877,6 @@ static int winDialogMapMethod(Ihandle* ih)
/* Reset attributes handled during creation that */
/* also can be changed later, and can be consulted from the native system. */
iupAttribSetStr(ih, "TITLE", NULL);
- iupAttribSetStr(ih, "BORDER", NULL);
/* Ignore VISIBLE before mapping */
iupAttribSetStr(ih, "VISIBLE", NULL);
@@ -956,7 +954,7 @@ static int winDialogSetBgColorAttrib(Ihandle* ih, const char* value)
{
iupAttribStoreStr(ih, "_IUPWIN_BACKGROUND_COLOR", value);
iupAttribSetStr(ih, "_IUPWIN_BACKGROUND_BITMAP", NULL);
- RedrawWindow(ih->handle, NULL, NULL, RDW_ERASE|RDW_ERASENOW); /* force a WM_ERASEBKGND now */
+ RedrawWindow(ih->handle, NULL, NULL, RDW_INVALIDATE|RDW_ERASE|RDW_ALLCHILDREN); /* post WM_ERASEBKGND and WM_PAINT */
return 1;
}
return 0;
@@ -973,7 +971,7 @@ static int winDialogSetBackgroundAttrib(Ihandle* ih, const char* value)
{
iupAttribSetStr(ih, "_IUPWIN_BACKGROUND_COLOR", NULL);
iupAttribSetStr(ih, "_IUPWIN_BACKGROUND_BITMAP", (char*)hBitmap);
- RedrawWindow(ih->handle, NULL, NULL, RDW_ERASE|RDW_ERASENOW); /* force a WM_ERASEBKGND now */
+ RedrawWindow(ih->handle, NULL, NULL, RDW_INVALIDATE|RDW_ERASE|RDW_ALLCHILDREN); /* post WM_ERASEBKGND and WM_PAINT */
return 1;
}
}