diff options
Diffstat (limited to 'toolkit/andlabs/add.go')
| -rw-r--r-- | toolkit/andlabs/add.go | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/toolkit/andlabs/add.go b/toolkit/andlabs/add.go index 1bcead7..9d40b4f 100644 --- a/toolkit/andlabs/add.go +++ b/toolkit/andlabs/add.go @@ -16,11 +16,6 @@ func actionDump(b bool, a *toolkit.Action) { } func add(a toolkit.Action) { - if (andlabs[a.WidgetId] != nil) { - log(debugError, "add() error. can't make a widget that already exists. id =", a.WidgetId) - actionDump(debugError, &a) - return - } if (a.WidgetType == toolkit.Root) { rootNode = addWidget(&a, nil) return @@ -100,70 +95,6 @@ func add(a toolkit.Action) { // -- (0,0) -- (1,0) -- (1,0) -- // -- (0,1) -- (1,1) -- (1,1) -- // ----------------------------- -func place(a *toolkit.Action, t *andlabsT, newt *andlabsT) bool { - log(debugAction, "place() START", a.WidgetType, a.Name) - - // add the structure to the array - if (andlabs[a.WidgetId] == nil) { - log(logInfo, "place() MAPPED", a.WidgetId, a.ParentId) - andlabs[a.WidgetId] = newt - newt.WidgetType = a.WidgetType - } else { - log(debugError, "place() DO WHAT?", a.WidgetId, a.ParentId) - log(debugError, "place() THIS IS BAD") - } - log(logInfo, "place() DONE MAPPED", a.WidgetId, a.ParentId) - - if (newt.uiControl == nil) { - log(debugError, "place() ERROR uiControl == nil", a.ParentId) - return false - } - - where := andlabs[a.ParentId] - if (where == nil) { - log(debugError, "place() ERROR where == nil", a.ParentId) - return false - } - - log(logInfo, "place() switch", where.WidgetType) - switch where.WidgetType { - case toolkit.Grid: - log(debugGrid, "place() Grid try at Parent X,Y =", a.X, a.Y) - newt.gridX = a.X - newt.gridY = a.Y - log(debugGrid, "place() Grid try at gridX,gridY", newt.gridX, newt.gridY) - // at the very end, subtract 1 from X & Y since andlabs/ui starts counting at zero - t.uiGrid.Append(newt.uiControl, - newt.gridY - 1, newt.gridX - 1, 1, 1, - false, ui.AlignFill, false, ui.AlignFill) - return true - case toolkit.Group: - if (t.uiBox == nil) { - t.uiGroup.SetChild(newt.uiControl) - log(debugGrid, "place() hack Group to use this as the box?", a.Name, a.WidgetType) - t.uiBox = newt.uiBox - } else { - t.uiBox.Append(newt.uiControl, stretchy) - } - return true - case toolkit.Tab: - t.uiTab.Append(a.Text, newt.uiControl) - t.boxC += 1 - return true - case toolkit.Box: - log(logInfo, "place() uiBox =", t.uiBox) - log(logInfo, "place() uiControl =", newt.uiControl) - t.uiBox.Append(newt.uiControl, stretchy) - t.boxC += 1 - return true - case toolkit.Window: - t.uiWindow.SetChild(newt.uiControl) - return true - default: - log(debugError, "place() how?", a.ParentId) - } - return false -} func (p *node) place(n *node) bool { log(logInfo, "place() START", n.WidgetType, n.Name) |
