summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/grid.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-03-23 12:35:12 -0500
committerJeff Carr <[email protected]>2023-03-23 12:35:12 -0500
commitd4787a1ebdd08359746516dbb72f1feaf95be5b6 (patch)
treecb81756d61096ccf74af7c8cc9a15e4e00fe1da7 /toolkit/andlabs/grid.go
parent6a848bf40474365cc1c0b4da9e2f7e3e10b4d627 (diff)
Squashed commit of the following:v0.7.3
boxes now exist and are tracked in the binary tree create for group and grid works gocui plugin no longer works. TODO: fix in next release converted everything from plugin to Action() can remove send() tab and window are now action() flags moved to action() ready for new release pad() margion() border() all work move worked! go.wit.com attept 578th try adds an early grid widget. won't work until chan andlabs/ui grid (X,Y) works right actually can put things in places in a grid Queue() means shit doesn't look right on grids lots of fucking around. why am I wasting time on image? wow. the crazy doAppend() thing is gone implement Action Show() and Hide() Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/grid.go')
-rw-r--r--toolkit/andlabs/grid.go77
1 files changed, 9 insertions, 68 deletions
diff --git a/toolkit/andlabs/grid.go b/toolkit/andlabs/grid.go
index 47a70e3..f009ab3 100644
--- a/toolkit/andlabs/grid.go
+++ b/toolkit/andlabs/grid.go
@@ -12,80 +12,21 @@ import (
// -- (1,1) -- (2,1) -- (3,1) --
// -- (1,2) -- (2,1) -- (3,1) --
// -----------------------------
-func newGrid(parentW *toolkit.Widget, w *toolkit.Widget) {
+func newGrid(a *toolkit.Action) {
var newt *andlabsT
- log(debugToolkit, "NewGrid()", w.Name)
+ log(debugToolkit, "newGrid()", a.Widget.Name, "to", a.Where.Type)
- t := mapToolkits[parentW]
- if (t == nil) {
- listMap(debugError)
- log(debugError, "ERROR newGrid() listMap()")
- log(debugError, "ERROR FFFFFFFFFFFF listMap()")
- log(debugError, "ERROR FFFFFFFFFFFF listMap()")
- return
- }
-
- log(debugToolkit, "NewGrid()", w.Name)
- if t.broken() {
- return
- }
+ t := mapToolkits[a.Where]
newt = new(andlabsT)
c := ui.NewGrid()
newt.uiGrid = c
- newt.uiBox = t.uiBox
- newt.tw = w
- t.doAppend(toolkit.Grid, newt, nil)
- mapWidgetsToolkits(w, newt)
-}
+ newt.uiControl = c
+ newt.tw = a.Widget
+ newt.gridX = 0
+ newt.gridY = 0
-func doGrid(p *toolkit.Widget, c *toolkit.Widget) {
- if broken(c) {
- return
- }
- if (c.Action == "New") {
- newGrid(p, c)
- return
- }
- ct := mapToolkits[c]
- if (ct == nil) {
- log(debugError, "Trying to do something on a widget that doesn't work or doesn't exist or something", c)
- return
- }
- if ct.broken() {
- log(debugError, "Grid() ct.broken", ct)
- return
- }
- if (ct.uiGrid == nil) {
- log(debugError, "Grid() uiGrid == nil", ct)
- return
- }
- log(debugChange, "Going to attempt:", c.Action)
- switch c.Action {
- case "Enable":
- ct.uiGrid.Enable()
- case "Disable":
- ct.uiGrid.Disable()
- case "Show":
- ct.uiGrid.Show()
- case "Hide":
- log(debugError, "trying Hide on grid")
- ct.uiGrid.Hide()
- case "SetMargin":
- log(debugError, "trying SetMargin on grid")
- ct.uiGrid.SetPadded(c.B)
- case "Set":
- log(debugError, "Can I use 'Set' to place a *Node in a Grid?")
- /*
- case "AddGrid":
- log(true, "how do I add a thing to a grid?")
- dump(p, c, true)
- newt.uiGrid.Append(button1,
- 0, 2, 1, 1,
- false, ui.AlignFill, false, ui.AlignFill)
- */
- default:
- log(debugError, "Can't do", c.Action, "to a Grid")
- }
+ place(a, t, newt)
+ mapWidgetsToolkits(a, newt)
}