2015-04-27 10:50:22 -05:00
|
|
|
// 27 april 2015
|
|
|
|
#include "uipriv_windows.h"
|
|
|
|
|
2015-05-10 11:36:14 -05:00
|
|
|
int binHasOSParent(uiBin *b)
|
2015-04-27 10:50:22 -05:00
|
|
|
{
|
2015-04-30 16:49:38 -05:00
|
|
|
HWND hwnd;
|
2015-04-27 10:50:22 -05:00
|
|
|
|
2015-04-30 16:49:38 -05:00
|
|
|
hwnd = (HWND) uiControlHandle(uiControl(b));
|
2015-05-10 11:36:14 -05:00
|
|
|
return GetAncestor(hwnd, GA_PARENT) != initialParent;
|
2015-04-27 10:50:22 -05:00
|
|
|
}
|
|
|
|
|
2015-05-10 11:36:14 -05:00
|
|
|
void binSetOSParent(uiBin *b, uintptr_t osParent)
|
2015-04-27 10:50:22 -05:00
|
|
|
{
|
2015-05-10 11:36:14 -05:00
|
|
|
HWND hwnd;
|
|
|
|
HWND parent = (HWND) osParent;
|
2015-04-27 10:50:22 -05:00
|
|
|
|
2015-05-10 11:36:14 -05:00
|
|
|
hwnd = (HWND) uiControlHandle(uiControl(b));
|
|
|
|
if (SetParent(hwnd, parent) == 0)
|
|
|
|
logLastError("error setting bin OS parent in binSetOSParent()");
|
2015-04-27 10:50:22 -05:00
|
|
|
}
|
|
|
|
|
2015-05-10 11:36:14 -05:00
|
|
|
void binRemoveOSParent(uiBin *b)
|
2015-04-27 10:50:22 -05:00
|
|
|
{
|
2015-05-10 11:36:14 -05:00
|
|
|
binSetOSParent(b, (uintptr_t) initialParent);
|
2015-04-27 10:50:22 -05:00
|
|
|
}
|
|
|
|
|
2015-05-10 11:36:14 -05:00
|
|
|
void binResizeRoot(uiBin *b, intmax_t x, intmax_t y, intmax_t width, intmax_t height)
|
2015-04-27 10:50:22 -05:00
|
|
|
{
|
2015-05-10 11:36:14 -05:00
|
|
|
HWND hwnd;
|
2015-04-27 10:50:22 -05:00
|
|
|
|
2015-05-10 11:36:14 -05:00
|
|
|
hwnd = (HWND) uiControlHandle(uiControl(b));
|
|
|
|
moveWindow(hwnd, x, y, width, height);
|
2015-04-27 10:50:22 -05:00
|
|
|
uiContainerUpdate(uiContainer(b));
|
|
|
|
}
|
2015-04-27 19:23:52 -05:00
|
|
|
|
2015-05-10 11:36:14 -05:00
|
|
|
void binTranslateMargins(uiBin *b, intmax_t *left, intmax_t *top, intmax_t *right, intmax_t *bottom, uiSizing *d)
|
2015-04-27 19:23:52 -05:00
|
|
|
{
|
2015-05-10 11:36:14 -05:00
|
|
|
*left = uiWindowsDlgUnitsToX(*left, d->Sys->BaseX);
|
|
|
|
*top = uiWindowsDlgUnitsToY(*top, d->Sys->BaseY);
|
|
|
|
*right = uiWindowsDlgUnitsToX(*right, d->Sys->BaseX);
|
|
|
|
*bottom = uiWindowsDlgUnitsToY(*bottom, d->Sys->BaseY);
|
2015-04-27 19:23:52 -05:00
|
|
|
}
|