Added nested and empty tabs to the test program, and fixed up relevant documentation.
This commit is contained in:
parent
8ee7b2b809
commit
0cf86eeb03
|
@ -64,19 +64,13 @@ func NewPasswordField() TextField {
|
||||||
|
|
||||||
// Tab is a Control that contains multiple pages of tabs, each containing a single Control.
|
// Tab is a Control that contains multiple pages of tabs, each containing a single Control.
|
||||||
// You can add and remove tabs from the Tab at any time.
|
// You can add and remove tabs from the Tab at any time.
|
||||||
//
|
// The appearance of a Tab with no tabs is implementation-defined.
|
||||||
// [TODO if each tab of your Tab is going to have the same content Controls, then use LikeTab instead, to conserve resources]
|
|
||||||
type Tab interface {
|
type Tab interface {
|
||||||
Control
|
Control
|
||||||
|
|
||||||
// Append adds a new tab to Tab.
|
// Append adds a new tab to Tab.
|
||||||
// The tab is added to the end of the current list of tabs.
|
// The tab is added to the end of the current list of tabs.
|
||||||
Append(name string, control Control)
|
Append(name string, control Control)
|
||||||
|
|
||||||
// Delete removes the given tab.
|
|
||||||
// It panics if index is out of range.
|
|
||||||
// Delete(index int)
|
|
||||||
//TODO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewTab creates a new Tab with no tabs.
|
// NewTab creates a new Tab with no tabs.
|
||||||
|
|
|
@ -10,6 +10,13 @@ Table
|
||||||
table_darwin.m: constructor
|
table_darwin.m: constructor
|
||||||
table_unix.c: goTableModel_get_column_type(), goTableModel_get_value()
|
table_unix.c: goTableModel_get_column_type(), goTableModel_get_value()
|
||||||
multiple selection
|
multiple selection
|
||||||
|
Tab
|
||||||
|
// [TODO if each tab of your Tab is going to have the same content Controls, then use LikeTab instead, to conserve resources]
|
||||||
|
Delete()
|
||||||
|
// Delete removes the given tab.
|
||||||
|
// It panics if index is out of range.
|
||||||
|
// After Delete(), the effect of accessing the Control of the deleted tab or any of its children is undefned. [TODO reword?]
|
||||||
|
investigate close buttons (especially for LikeTab)
|
||||||
|
|
||||||
so I don't forget, some TODOs:
|
so I don't forget, some TODOs:
|
||||||
windows
|
windows
|
||||||
|
|
|
@ -70,7 +70,7 @@ LONG tabGetTabHeight(HWND hwnd)
|
||||||
LONG tallest;
|
LONG tallest;
|
||||||
|
|
||||||
n = SendMessageW(hwnd, TCM_GETITEMCOUNT, 0, 0);
|
n = SendMessageW(hwnd, TCM_GETITEMCOUNT, 0, 0);
|
||||||
/* if there are no tabs, then the control just draws a box over the full window rect, reserving no space for tabs (TODO check on windows xp and 7); this is handled here */
|
/* if there are no tabs, then the control just draws a box over the full window rect, reserving no space for tabs; this is handled with the next line */
|
||||||
tallest = 0;
|
tallest = 0;
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
if (SendMessageW(hwnd, TCM_GETITEMRECT, (WPARAM) i, (LPARAM) (&r)) == FALSE)
|
if (SendMessageW(hwnd, TCM_GETITEMRECT, (WPARAM) i, (LPARAM) (&r)) == FALSE)
|
||||||
|
|
|
@ -31,6 +31,7 @@ var ddata = []dtype{
|
||||||
type testwin struct {
|
type testwin struct {
|
||||||
t Tab
|
t Tab
|
||||||
w Window
|
w Window
|
||||||
|
nt Tab
|
||||||
a Area
|
a Area
|
||||||
spw *Stack
|
spw *Stack
|
||||||
sph *Stack
|
sph *Stack
|
||||||
|
@ -64,6 +65,11 @@ func (tw *testwin) make(done chan struct{}) {
|
||||||
done <- struct{}{}
|
done <- struct{}{}
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
tw.t.Append("Blank Tab", NewTab())
|
||||||
|
tw.nt = NewTab()
|
||||||
|
tw.nt.Append("Tab 1", Space())
|
||||||
|
tw.nt.Append("Tab 2", Space())
|
||||||
|
tw.t.Append("Tab", tw.nt)
|
||||||
tw.t.Append("Space", Space())
|
tw.t.Append("Space", Space())
|
||||||
tw.a = NewArea(200, 200, &areaHandler{})
|
tw.a = NewArea(200, 200, &areaHandler{})
|
||||||
tw.t.Append("Area", tw.a)
|
tw.t.Append("Area", tw.a)
|
||||||
|
|
Loading…
Reference in New Issue