More uiContainer work on Windows. This might actually do it for that file for now!

This commit is contained in:
Pietro Gagliardi 2015-04-27 10:41:19 -04:00
parent 81a526017a
commit 36789edde5
1 changed files with 11 additions and 0 deletions

View File

@ -8,6 +8,7 @@ HWND initialParent;
struct container { struct container {
HWND hwnd; HWND hwnd;
uiContainer *parent; uiContainer *parent;
int hidden;
}; };
// from https://msdn.microsoft.com/en-us/library/windows/desktop/dn742486.aspx#sizingandspacing and https://msdn.microsoft.com/en-us/library/windows/desktop/bb226818%28v=vs.85%29.aspx // from https://msdn.microsoft.com/en-us/library/windows/desktop/dn742486.aspx#sizingandspacing and https://msdn.microsoft.com/en-us/library/windows/desktop/bb226818%28v=vs.85%29.aspx
@ -163,11 +164,19 @@ static void containerResize(uiControl *cc, intmax_t x, intmax_t y, intmax_t widt
logLastError("error resizing uiContainer in containerResize()"); logLastError("error resizing uiContainer in containerResize()");
} }
static int containerVisible(uiControl *cc)
{
struct container *c = (struct container *) (cc->Internal);
return !c->hidden;
}
static void containerShow(uiControl *cc) static void containerShow(uiControl *cc)
{ {
struct container *c = (struct container *) (cc->Internal); struct container *c = (struct container *) (cc->Internal);
ShowWindow(c->hwnd, SW_SHOW); ShowWindow(c->hwnd, SW_SHOW);
c->hidden = 0;
} }
static void containerHide(uiControl *cc) static void containerHide(uiControl *cc)
@ -175,6 +184,7 @@ static void containerHide(uiControl *cc)
struct container *c = (struct container *) (cc->Internal); struct container *c = (struct container *) (cc->Internal);
ShowWindow(c->hwnd, SW_HIDE); ShowWindow(c->hwnd, SW_HIDE);
c->hidden = 1;
} }
static void containerEnable(uiControl *cc) static void containerEnable(uiControl *cc)
@ -219,6 +229,7 @@ void uiMakeContainer(uiContainer *cc)
uiControl(cc)->SetParent = containerSetParent; uiControl(cc)->SetParent = containerSetParent;
// PreferredSize() is provided by subclasses // PreferredSize() is provided by subclasses
uiControl(cc)->Resize = containerResize; uiControl(cc)->Resize = containerResize;
uiControl(cc)->Visible = containerVisible;
uiControl(cc)->Show = containerShow; uiControl(cc)->Show = containerShow;
uiControl(cc)->Hide = containerHide; uiControl(cc)->Hide = containerHide;
uiControl(cc)->Enable = containerEnable; uiControl(cc)->Enable = containerEnable;