summaryrefslogtreecommitdiff
path: root/structs.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-05-30 09:58:05 -0700
committerJeff Carr <[email protected]>2019-05-30 09:58:05 -0700
commit469c7bdd508b25577512704689fd3457aa045ce0 (patch)
tree1319e8f10395f90972980022df90022e32b71889 /structs.go
parent2b7c2022be24a454c79a613332487fe7faea508e (diff)
more variable name changes
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'structs.go')
-rw-r--r--structs.go156
1 files changed, 84 insertions, 72 deletions
diff --git a/structs.go b/structs.go
index 0476f6c..b857b1d 100644
--- a/structs.go
+++ b/structs.go
@@ -16,9 +16,7 @@ import pb "git.wit.com/wit/witProtobuf"
var Data GuiData
type GuiData struct {
- State string
- // Width int
- // Height int
+ State string // used like a state machine
// a fallback default function to handle mouse events
// if nothing else is defined to handle them
@@ -56,11 +54,28 @@ type GuiData struct {
EntryPass *ui.Entry
}
-type TableColumnData struct {
- Index int
- CellType string
- Heading string
- Color string
+// Note: every mouse click is handled
+// as a 'Button' regardless of where
+// the user clicks it. You could probably
+// call this 'GuiMouseClick'
+type GuiButton struct {
+ // andlabs/ui stuff
+ B *ui.Button
+ FB *ui.FontButton
+ A *ui.Area
+ W *ui.Window
+ T *ui.Tab
+
+ AH *GuiArea
+
+ // git.wit.com/wit/gui stuff
+ WM *GuiWindow
+ Account *pb.Account
+ VM *pb.Event_VM
+ Action string // what type of button
+
+ // a callback function for the main application
+ custom func (*GuiButton)
}
type GuiEntry struct {
@@ -82,9 +97,9 @@ type GuiEntry struct {
}
type GuiBox struct {
+ W *GuiWindow
EntryMap map[string][]*GuiEntry
- AH *GuiArea
-
+ A *GuiArea
}
type GuiWindow struct {
@@ -99,66 +114,55 @@ type GuiWindow struct {
Action string
}
+//
+// AREA STRUCTURES START
+// AREA STRUCTURES START
+// AREA STRUCTURES START
+//
+type GuiArea struct{
+ WM *GuiWindow
+ Button *GuiButton
+
+ UiAttrstr *ui.AttributedString
+ UiArea *ui.Area
+}
+
type FontString struct {
S string
Size int
F font.Face
W font.Weight
}
-
-type GuiButton struct {
- // andlabs/ui stuff
- B *ui.Button
- FB *ui.FontButton
- A *ui.Area
- W *ui.Window
- T *ui.Tab
-
- AH *GuiArea
-
- // git.wit.com/wit/gui stuff
- WM *GuiWindow
- Account *pb.Account
- VM *pb.Event_VM
- Action string // what type of button
-
- // a callback function for the main application
- custom func (*GuiButton)
-}
-
-
-// AREA STRUCTURES START
-type GuiArea struct{
- Button *GuiButton
- Attrstr *ui.AttributedString
- Area *ui.Area
- WM *GuiWindow
-}
+//
+// AREA STRUCTURES END
+// AREA STRUCTURES END
// AREA STRUCTURES END
+//
//
// TABLE DATA STRUCTURES START
+// TABLE DATA STRUCTURES START
+// TABLE DATA STRUCTURES START
//
-type CellData struct {
- Index int
- HumanID int
- Name string // what type of cell is this?
-}
+//
+// This is the structure that andlabs/ui uses to pass information
+// to the GUI. This is the "authoritative" data.
+//
+type TableData struct {
+ RowCount int // This is the number of 'rows' which really means data elements not what the human sees
+ RowWidth int // This is how wide each row is
+ Rows []RowData // This is all the table data by row
+ generatedColumnTypes []ui.TableValue // generate this dynamically
-// hmm. will this stand the test of time?
-type RowData struct {
- Name string // what kind of row is this?
- Status string // status of the row?
-/*
- // TODO: These may or may not be implementable
- click func() // what function to call if the user clicks on it
- doubleclick func() // what function to call if the user double clicks on it
-*/
- HumanData [20]HumanCellData
+ Cells [20]CellData
+ Human [20]HumanMap
- // The VM from the protobuf
- VM *pb.Event_VM
+ Account *pb.Account // what account this table is for
+
+ lastRow int
+ lastColumn int
+ parentTab *ui.Tab
}
//
@@ -174,7 +178,7 @@ type RowData struct {
// This makes a map so that we can say "give me the value at
// row 4 and column 2" and find the fields that are needed
//
-// TODO: add back image support and the progress bar
+// TODO: re-add images and the progress bar (works in andlabs/ui)
//
type HumanCellData struct {
Name string // what kind of row is this?
@@ -192,24 +196,32 @@ type HumanMap struct {
ColorID int
}
-//
-// This is the structure that andlabs/ui uses to pass information
-// to the GUI. This is the "authoritative" data.
-//
-type TableData struct {
- RowCount int // This is the number of 'rows' which really means data elements not what the human sees
- RowWidth int // This is how wide each row is
- Rows []RowData // This is all the table data by row
- generatedColumnTypes []ui.TableValue // generate this dynamically
+type TableColumnData struct {
+ Index int
+ CellType string
+ Heading string
+ Color string
+}
- Cells [20]CellData
- Human [20]HumanMap
+type CellData struct {
+ Index int
+ HumanID int
+ Name string // what type of cell is this?
+}
- Account *pb.Account // what account this table is for
+// hmm. will this stand the test of time?
+type RowData struct {
+ Name string // what kind of row is this?
+ Status string // status of the row?
+/*
+ // TODO: These may or may not be implementable
+ click func() // what function to call if the user clicks on it
+ doubleclick func() // what function to call if the user double clicks on it
+*/
+ HumanData [20]HumanCellData
- lastRow int
- lastColumn int
- parentTab *ui.Tab
+ // The VM from the protobuf
+ VM *pb.Event_VM
}
//