2022-11-14 14:30:28 -06:00
|
|
|
package main
|
2022-10-17 11:56:43 -05:00
|
|
|
|
2023-02-25 14:05:25 -06:00
|
|
|
import "git.wit.org/wit/gui/toolkit"
|
2022-10-17 11:56:43 -05:00
|
|
|
|
|
|
|
import "github.com/andlabs/ui"
|
|
|
|
import _ "github.com/andlabs/ui/winmanifest"
|
|
|
|
|
|
|
|
// stores the raw toolkit internals
|
2022-11-14 14:30:28 -06:00
|
|
|
type andlabsT struct {
|
2022-10-17 11:56:43 -05:00
|
|
|
id string
|
|
|
|
|
|
|
|
Name string
|
2023-03-23 12:35:12 -05:00
|
|
|
// Type toolkit.WidgetType
|
2022-10-17 11:56:43 -05:00
|
|
|
Width int
|
|
|
|
Height int
|
2023-02-25 14:05:25 -06:00
|
|
|
tw *toolkit.Widget
|
2023-03-01 11:35:36 -06:00
|
|
|
parent *andlabsT
|
2022-10-17 11:56:43 -05:00
|
|
|
|
2023-03-23 12:35:12 -05:00
|
|
|
uiControl ui.Control
|
|
|
|
|
2022-10-17 11:56:43 -05:00
|
|
|
uiBox *ui.Box
|
|
|
|
uiButton *ui.Button
|
2022-10-20 06:55:42 -05:00
|
|
|
uiCombobox *ui.Combobox
|
2022-10-21 11:40:08 -05:00
|
|
|
uiCheckbox *ui.Checkbox
|
2022-10-17 11:56:43 -05:00
|
|
|
uiEntry *ui.Entry
|
2022-10-17 22:39:03 -05:00
|
|
|
uiGroup *ui.Group
|
2022-10-17 11:56:43 -05:00
|
|
|
uiLabel *ui.Label
|
|
|
|
uiSlider *ui.Slider
|
|
|
|
uiSpinbox *ui.Spinbox
|
|
|
|
uiTab *ui.Tab
|
|
|
|
uiWindow *ui.Window
|
2023-03-01 11:35:36 -06:00
|
|
|
uiMultilineEntry *ui.MultilineEntry
|
|
|
|
uiEditableCombobox *ui.EditableCombobox
|
2023-03-03 14:41:38 -06:00
|
|
|
uiGrid *ui.Grid
|
2023-03-23 12:35:12 -05:00
|
|
|
uiImage *ui.Image
|
|
|
|
gridX int
|
|
|
|
gridY int
|
2022-10-20 06:55:42 -05:00
|
|
|
|
|
|
|
// used as a counter to work around limitations of widgets like combobox
|
|
|
|
// this is probably fucked up and in many ways wrong because of unsafe goroutine threading
|
|
|
|
// but it's working for now due to the need for need for a correct interaction layer betten toolkits
|
|
|
|
c int
|
2023-03-23 12:35:12 -05:00
|
|
|
i int
|
|
|
|
b bool
|
|
|
|
s string
|
2022-10-20 06:55:42 -05:00
|
|
|
val map[int]string
|
2023-03-23 12:35:12 -05:00
|
|
|
|
|
|
|
// andlabs/ui only accesses widget id numbers
|
|
|
|
boxC int // how many things on in a box
|
|
|
|
boxW map[int]int // find a widget in a box
|
2022-10-20 06:55:42 -05:00
|
|
|
text string
|
2022-10-17 22:39:03 -05:00
|
|
|
}
|