Changed uiParentSetChild() to uiParentSetMainControl(). Backend changes incoming.

This commit is contained in:
Pietro Gagliardi 2015-04-17 13:43:01 -04:00
parent 797408fe6e
commit 9f0729de1c
8 changed files with 10 additions and 12 deletions

View File

@ -41,7 +41,7 @@ static void tabAddPage(uiTab *t, const char *name, uiControl *child)
NSTabViewItem *i;
content = uiNewParent(0);
uiParentSetChild(content, child);
uiParentSetMainControl(content, child);
i = [[NSTabViewItem alloc] initWithIdentifier:nil];
[i setLabel:toNSString(name)];

View File

@ -93,7 +93,7 @@ static void windowOnClosing(uiWindow *w, int (*f)(uiWindow *, void *), void *dat
static void windowSetChild(uiWindow *w, uiControl *c)
{
uiParentSetChild(D.content, c);
uiParentSetMainControl(D.content, c);
}
static int windowMargined(uiWindow *ww)

View File

@ -14,7 +14,7 @@ i entry
w = NewWindow()
p = NewParent(w.Handle)
w.SetChild(c)
p.SetChild(c)
p.SetMainControl(c)
c.SetParent(p)
d.SetParent(p)
e.SetParent(p)
@ -34,7 +34,7 @@ g.Hide()
p.Update()
c.Resize()
w.SetChild(i)
p.SetChild(i)
p.SetMainControl(i)
c.SetParent(NULL)
d.SetParent(NULL)
...
@ -43,7 +43,7 @@ w.SetChild(i)
p.Update()
i.Resize()
w.SetChild(NULL)
p.SetChild(NULL)
p.SetMainControl(NULL)
i.SetParent(NULL)
p.Update()
w.SetChild(i)
@ -53,5 +53,4 @@ w.Destroy()
i.Destroy()
TODO
- rename these methods
- p.DeferUpdate()/p.EndDeferUpdate()

3
ui.idl
View File

@ -62,8 +62,7 @@ interface Parent {
// TODO destroy
// TODO object destruction debug handler
func Handle(void) uintptr_t;
// TODO rename and clean this up
func SetChild(c *Control);
func SetMainControl(c *Control);
func SetMargins(left intmax_t, top intmax_t, right intmax_t, bottom intmax_t);
// TODO Resize?
func Update(void);

View File

@ -32,7 +32,7 @@ static void tabAddPage(uiTab *tt, const char *name, uiControl *child)
}
content = uiNewParent((uintptr_t) (t->container));
uiParentSetChild(content, child);
uiParentSetMainControl(content, child);
uiParentUpdate(content);
gtk_notebook_set_tab_label_text(t->notebook, GTK_WIDGET(uiParentHandle(content)), name);

View File

@ -88,7 +88,7 @@ static void windowSetChild(uiWindow *ww, uiControl *c)
{
struct window *w = (struct window *) ww;
uiParentSetChild(w->content, c);
uiParentSetMainControl(w->content, c);
uiParentUpdate(w->content);
}

View File

@ -131,7 +131,7 @@ void tabAddPage(uiTab *tt, const char *name, uiControl *child)
n = SendMessageW(t->hwnd, TCM_GETITEMCOUNT, 0, 0);
parent = uiNewParent((uintptr_t) (t->hwnd));
uiParentSetChild(parent, child);
uiParentSetMainControl(parent, child);
uiParentUpdate(parent);
if (n != 0) // if this isn't the first page, we have to hide the other controls
ShowWindow(uiParentHWND(parent), SW_HIDE);

View File

@ -144,7 +144,7 @@ static void windowSetChild(uiWindow *ww, uiControl *c)
{
struct window *w = (struct window *) ww;
uiParentSetChild(w->content, c);
uiParentSetMainControl(w->content, c);
// don't call uiParentUpdate(); instead, synthesize a resize
// otherwise, we'll have a 0x0 content area at first
SendMessageW(w->hwnd, msgUpdateChild, 0, 0);