diff options
Diffstat (limited to 'redo')
| -rw-r--r-- | redo/containers.go | 24 | ||||
| -rw-r--r-- | redo/controls.go | 2 | ||||
| -rw-r--r-- | redo/controls_windows.go | 8 |
3 files changed, 34 insertions, 0 deletions
diff --git a/redo/containers.go b/redo/containers.go new file mode 100644 index 0000000..428e2a7 --- /dev/null +++ b/redo/containers.go @@ -0,0 +1,24 @@ +// 25 july 2014 + +package ui + +// 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. +// TODO rename? +type Tab interface { + Control + + // Append adds a new tab to Tab. + // The tab is added to the end of the current list of tabs. + 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. +func NewTab() Tab { + return newTab() +} diff --git a/redo/controls.go b/redo/controls.go index cc87486..984f868 100644 --- a/redo/controls.go +++ b/redo/controls.go @@ -9,6 +9,8 @@ type Control interface { parent(*window) // TODO enable/disable (public) // TODO show/hide (public) + containerShow() // for Windows, where all controls need ot belong to an overlapped window, not to a container control; these respect programmer settings + containerHide() controlSizing } diff --git a/redo/controls_windows.go b/redo/controls_windows.go index 8c77140..c517074 100644 --- a/redo/controls_windows.go +++ b/redo/controls_windows.go @@ -30,6 +30,14 @@ func (w *widgetbase) parent(win *window) { // TODO new control does not show up until window is resized } +func (w *widgetbase) containerShow() { + C.ShowWindow(w.hwnd, C.SW_SHOW) +} + +func (w *widgetbase) containerHide() { + C.ShowWindow(w.hwnd, C.SW_HIDE) +} + // don't embed these as exported; let each Control decide if it should func (w *widgetbase) text() string { |
