Added the framework for tabs, added necessary assistant routines for tabs, and implemented those assistant routines on the Windows backend.

This commit is contained in:
Pietro Gagliardi 2014-07-25 12:45:56 -04:00
parent 5e9b60a795
commit d515bd74c6
3 changed files with 34 additions and 0 deletions

24
redo/containers.go Normal file
View File

@ -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()
}

View File

@ -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
}

View File

@ -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 {