2015-04-13 14:15:33 -05:00
In the interest of making sure that everything in ui is consistent, here is a glossary of various conflicting terms and what they mean to the library. These are disjunct from the terminology used by each backend's native platform; context should be used to differentiate where appropriate.
2015-04-13 14:46:16 -05:00
Instead of a traditional glossary, let's look at things the way ui does them:
We have
a uiWindow w
which has a T t
2015-04-13 17:05:34 -05:00
which has a uiControl
and an H h, which is an OS resource
2015-04-13 14:46:16 -05:00
a uiControl c
We call
uiWindowSetChild(w, c)
What happens:
w instructs t that c should be the child it keeps track of
2015-04-13 17:05:34 -05:00
t.SetControl(c)
2015-04-13 14:46:16 -05:00
t instructs c that it should add its children to the OS object h backing t
2015-04-13 17:05:34 -05:00
c.SetTHING(t)
2015-04-13 14:46:16 -05:00
t instructs c to lay itself out
2015-04-13 17:05:34 -05:00
c.Resize()
2015-04-13 14:46:16 -05:00
We now say
c is really a uiStack
We call
uiStackAppend(c, d, 2)
What happens:
2015-04-13 17:05:34 -05:00
c asks t to add d to h
t.Host(d)
t gives d h to add itself too
d.SetHost(h)
2015-04-13 14:46:16 -05:00
c asks t to let it lay itself out
2015-04-13 17:05:34 -05:00
t.Update()
2015-04-13 14:46:16 -05:00
t tells c to lay itself out
2015-04-13 17:05:34 -05:00
c.Resize()
2015-04-13 14:46:16 -05:00
We call
uiStackDelete(c, 4)
What happens:
2015-04-13 17:05:34 -05:00
c asks t to remove its fifth child from h
t.Unhost(c.children[4])
t tells c's fifth child to unhost itself
c.children[4].UnsetHost()
2015-04-13 14:46:16 -05:00
c instructs t to tell it to lay itself out
2015-04-13 17:05:34 -05:00
t.Update()
2015-04-13 14:46:16 -05:00
t tells c to lay itself out
2015-04-13 17:05:34 -05:00
c.Resize()
2015-04-13 14:46:16 -05:00
We do
resize the window
What happens:
2015-04-13 17:05:34 -05:00
w resizes t, which resizes h
t.Resize()
resizing h triggers a relayout of c
c.Resize()
2015-04-13 14:46:16 -05:00
We do
uiWindowSetChild(w, e)
What happens:
2015-04-13 17:05:34 -05:00
w instructs t to stop tracking c
t.UnsetControl(c)
2015-04-13 14:46:16 -05:00
t instructs c to remove its children from h
2015-04-13 17:05:34 -05:00
c.UnsetTHING()
t.Unhost(d)
d.Unhost()
w instrcuts t to start tracking e
t.SetControl(e)
2015-04-13 14:46:16 -05:00
t instructs e to add its children to h
2015-04-13 17:05:34 -05:00
e.SetTHING(t)
2015-04-13 14:46:16 -05:00
t instructs e to be laid out
2015-04-13 17:05:34 -05:00
e.Resize()
2015-04-13 14:46:16 -05:00
We do
uiWindowDestroy(w)
What happens
w instructs t to tell e to destroy itself
2015-04-13 17:05:34 -05:00
t.Destroy()
t tells e to unhook itself
e.UnsetTHING()
t tells e to destroy itself
e.Destroy()
2015-04-13 14:46:16 -05:00
t destroys h, then itself
w destroys itself
Therefore, we need a name for T and H
We also need a term for uiStack and uiGrid
The above uses 'children' for their children
2015-04-13 17:05:34 -05:00
CURRENT PLAN
T/THING will be called a 'parent'
H will be called a 'host'
a parent has a host, but it will NOT be accessed directly by children
instead it will use the named methods
uiStack and uiGrid, etc. will be called 'containers'