more variable name fixes
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
58e76c3b8e
commit
1015f66ab5
|
@ -36,13 +36,13 @@ func AddAccountQuestionBox(wm *GuiWindow) *ui.Box {
|
||||||
return vbox
|
return vbox
|
||||||
}
|
}
|
||||||
|
|
||||||
func generateSubdomain(b *ButtonMap) {
|
func generateSubdomain(b *GuiButton) {
|
||||||
log.Println("generateSubdomain START")
|
log.Println("generateSubdomain START")
|
||||||
subdomain.SetText("cust00013.wit.dev")
|
subdomain.SetText("cust00013.wit.dev")
|
||||||
log.Println("generateSubdomain END")
|
log.Println("generateSubdomain END")
|
||||||
}
|
}
|
||||||
|
|
||||||
func addSubdomain(b *ButtonMap) {
|
func addSubdomain(b *GuiButton) {
|
||||||
log.Println("generateSubdomain START")
|
log.Println("generateSubdomain START")
|
||||||
sub := subdomain.Text()
|
sub := subdomain.Text()
|
||||||
log.Println("generateSubdomain subdomain =", sub)
|
log.Println("generateSubdomain subdomain =", sub)
|
||||||
|
|
4
area.go
4
area.go
|
@ -8,8 +8,8 @@ import _ "github.com/andlabs/ui/winmanifest"
|
||||||
|
|
||||||
import "github.com/davecgh/go-spew/spew"
|
import "github.com/davecgh/go-spew/spew"
|
||||||
|
|
||||||
func findFB(button *ButtonMap) *ButtonMap {
|
func findFB(button *GuiButton) *GuiButton {
|
||||||
var a *ButtonMap
|
var a *GuiButton
|
||||||
for key, foo := range Data.AllButtons {
|
for key, foo := range Data.AllButtons {
|
||||||
log.Println("findFB() Data.AllButtons key, foo=", key, foo)
|
log.Println("findFB() Data.AllButtons key, foo=", key, foo)
|
||||||
if &foo == button {
|
if &foo == button {
|
||||||
|
|
6
debug.go
6
debug.go
|
@ -80,7 +80,7 @@ func addDebuggingButtons(wm *GuiWindow, vbox *ui.Box) {
|
||||||
vbox.Append(CreateButton(wm, nil, nil, "Load test.json config file", "CONFIG", nil), false)
|
vbox.Append(CreateButton(wm, nil, nil, "Load test.json config file", "CONFIG", nil), false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func runTestHide(b *ButtonMap) {
|
func runTestHide(b *GuiButton) {
|
||||||
/*
|
/*
|
||||||
log.Println("runTestHide START")
|
log.Println("runTestHide START")
|
||||||
Data.Window1.Box1.Hide()
|
Data.Window1.Box1.Hide()
|
||||||
|
@ -91,7 +91,7 @@ func runTestHide(b *ButtonMap) {
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
func runPingClick(b *ButtonMap) {
|
func runPingClick(b *GuiButton) {
|
||||||
log.Println("runPingClick START")
|
log.Println("runPingClick START")
|
||||||
log.Println("runTestExecClick b.VM", b.VM)
|
log.Println("runTestExecClick b.VM", b.VM)
|
||||||
hostname := "localhost"
|
hostname := "localhost"
|
||||||
|
@ -105,7 +105,7 @@ func runPingClick(b *ButtonMap) {
|
||||||
log.Println("runPingClick END")
|
log.Println("runPingClick END")
|
||||||
}
|
}
|
||||||
|
|
||||||
func runTestExecClick(b *ButtonMap) {
|
func runTestExecClick(b *GuiButton) {
|
||||||
log.Println("runTestExecClick START")
|
log.Println("runTestExecClick START")
|
||||||
if runtime.GOOS == "linux" {
|
if runtime.GOOS == "linux" {
|
||||||
go runSimpleCommand("xterm -report-fonts")
|
go runSimpleCommand("xterm -report-fonts")
|
||||||
|
|
16
gui.go
16
gui.go
|
@ -123,7 +123,7 @@ func ErrorWindow(wm *GuiWindow, msg1 string, msg2 string) {
|
||||||
// in the AllButtons %map
|
// in the AllButtons %map
|
||||||
// TODO: clean up the text above
|
// TODO: clean up the text above
|
||||||
// TODO: remove this all together going only to main()
|
// TODO: remove this all together going only to main()
|
||||||
func mouseClick(b *ButtonMap) {
|
func mouseClick(b *GuiButton) {
|
||||||
log.Println("gui.mouseClick() START")
|
log.Println("gui.mouseClick() START")
|
||||||
if (b == nil) {
|
if (b == nil) {
|
||||||
log.Println("\tgui.mouseClick() START b = nil")
|
log.Println("\tgui.mouseClick() START b = nil")
|
||||||
|
@ -167,7 +167,7 @@ func mouseClick(b *ButtonMap) {
|
||||||
// This routine MUST be here as this is how the andlabs/ui works
|
// This routine MUST be here as this is how the andlabs/ui works
|
||||||
// This is the raw routine passed to every button in andlabs libui / ui
|
// This is the raw routine passed to every button in andlabs libui / ui
|
||||||
//
|
//
|
||||||
// There is a []ButtonMap which has all the buttons. We search
|
// There is a []GuiButton which has all the buttons. We search
|
||||||
// for the button and then call the function below
|
// for the button and then call the function below
|
||||||
//
|
//
|
||||||
func defaultButtonClick(button *ui.Button) {
|
func defaultButtonClick(button *ui.Button) {
|
||||||
|
@ -183,7 +183,7 @@ func defaultButtonClick(button *ui.Button) {
|
||||||
log.Println("\tdefaultButtonClick() Data.AllButtons[key].Action =", Data.AllButtons[key].Action)
|
log.Println("\tdefaultButtonClick() Data.AllButtons[key].Action =", Data.AllButtons[key].Action)
|
||||||
if Data.AllButtons[key].custom != nil {
|
if Data.AllButtons[key].custom != nil {
|
||||||
log.Println("\tdefaultButtonClick() DOING CUSTOM FUNCTION")
|
log.Println("\tdefaultButtonClick() DOING CUSTOM FUNCTION")
|
||||||
var tmp ButtonMap
|
var tmp GuiButton
|
||||||
tmp = Data.AllButtons[key]
|
tmp = Data.AllButtons[key]
|
||||||
// spew.Dump(tmp)
|
// spew.Dump(tmp)
|
||||||
Data.AllButtons[key].custom(&tmp)
|
Data.AllButtons[key].custom(&tmp)
|
||||||
|
@ -200,7 +200,7 @@ func defaultButtonClick(button *ui.Button) {
|
||||||
mouseClick(nil)
|
mouseClick(nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func AddButton(b *ButtonMap, name string) *ui.Button {
|
func AddButton(b *GuiButton, name string) *ui.Button {
|
||||||
newB := ui.NewButton(name)
|
newB := ui.NewButton(name)
|
||||||
newB.OnClicked(defaultButtonClick)
|
newB.OnClicked(defaultButtonClick)
|
||||||
|
|
||||||
|
@ -210,11 +210,11 @@ func AddButton(b *ButtonMap, name string) *ui.Button {
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateButton(wm *GuiWindow, a *pb.Account, vm *pb.Event_VM,
|
func CreateButton(wm *GuiWindow, a *pb.Account, vm *pb.Event_VM,
|
||||||
name string, action string, custom func(*ButtonMap)) *ui.Button {
|
name string, action string, custom func(*GuiButton)) *ui.Button {
|
||||||
newUiB := ui.NewButton(name)
|
newUiB := ui.NewButton(name)
|
||||||
newUiB.OnClicked(defaultButtonClick)
|
newUiB.OnClicked(defaultButtonClick)
|
||||||
|
|
||||||
var newB ButtonMap
|
var newB GuiButton
|
||||||
newB.B = newUiB
|
newB.B = newUiB
|
||||||
newB.T = wm.T
|
newB.T = wm.T
|
||||||
newB.Account = a
|
newB.Account = a
|
||||||
|
@ -227,11 +227,11 @@ func CreateButton(wm *GuiWindow, a *pb.Account, vm *pb.Event_VM,
|
||||||
return newUiB
|
return newUiB
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateFontButton(wm *GuiWindow, action string) *ButtonMap {
|
func CreateFontButton(wm *GuiWindow, action string) *GuiButton {
|
||||||
newB := ui.NewFontButton()
|
newB := ui.NewFontButton()
|
||||||
|
|
||||||
// create a 'fake' button entry for the mouse clicks
|
// create a 'fake' button entry for the mouse clicks
|
||||||
var newBM ButtonMap
|
var newBM GuiButton
|
||||||
newBM.Action = action
|
newBM.Action = action
|
||||||
newBM.FB = newB
|
newBM.FB = newB
|
||||||
newBM.AH = wm.AH
|
newBM.AH = wm.AH
|
||||||
|
|
|
@ -259,7 +259,7 @@ func InitWindow(wm *GuiWindow) {
|
||||||
wm.W.SetBorderless(false)
|
wm.W.SetBorderless(false)
|
||||||
|
|
||||||
// create a 'fake' button entry for the mouse clicks
|
// create a 'fake' button entry for the mouse clicks
|
||||||
var newBM ButtonMap
|
var newBM GuiButton
|
||||||
newBM.Action = "QUIT"
|
newBM.Action = "QUIT"
|
||||||
newBM.W = wm.W
|
newBM.W = wm.W
|
||||||
newBM.WM = wm
|
newBM.WM = wm
|
||||||
|
|
14
structs.go
14
structs.go
|
@ -22,7 +22,7 @@ type GuiData struct {
|
||||||
|
|
||||||
// a fallback default function to handle mouse events
|
// a fallback default function to handle mouse events
|
||||||
// if nothing else is defined to handle them
|
// if nothing else is defined to handle them
|
||||||
MouseClick func(*ButtonMap)
|
MouseClick func(*GuiButton)
|
||||||
|
|
||||||
// account entry textboxes
|
// account entry textboxes
|
||||||
Config *pb.Config
|
Config *pb.Config
|
||||||
|
@ -43,7 +43,7 @@ type GuiData struct {
|
||||||
// A map of all buttons everywhere on all
|
// A map of all buttons everywhere on all
|
||||||
// windows, all tabs, across all goroutines
|
// windows, all tabs, across all goroutines
|
||||||
// This is "GLOBAL"
|
// This is "GLOBAL"
|
||||||
AllButtons []ButtonMap
|
AllButtons []GuiButton
|
||||||
|
|
||||||
// A map of all the entry boxes
|
// A map of all the entry boxes
|
||||||
AllEntries []*GuiEntry
|
AllEntries []*GuiEntry
|
||||||
|
@ -71,7 +71,7 @@ type GuiEntry struct {
|
||||||
Account *pb.Account
|
Account *pb.Account
|
||||||
VM *pb.Event_VM
|
VM *pb.Event_VM
|
||||||
|
|
||||||
B *ButtonMap
|
B *GuiButton
|
||||||
FB *ui.FontButton
|
FB *ui.FontButton
|
||||||
A *ui.Area
|
A *ui.Area
|
||||||
W *ui.Window
|
W *ui.Window
|
||||||
|
@ -101,7 +101,7 @@ type FontString struct {
|
||||||
W font.Weight
|
W font.Weight
|
||||||
}
|
}
|
||||||
|
|
||||||
type ButtonMap struct {
|
type GuiButton struct {
|
||||||
// andlabs/ui stuff
|
// andlabs/ui stuff
|
||||||
B *ui.Button
|
B *ui.Button
|
||||||
FB *ui.FontButton
|
FB *ui.FontButton
|
||||||
|
@ -118,13 +118,13 @@ type ButtonMap struct {
|
||||||
Action string // what type of button
|
Action string // what type of button
|
||||||
|
|
||||||
// a callback function for the main application
|
// a callback function for the main application
|
||||||
custom func (*ButtonMap)
|
custom func (*GuiButton)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// AREA STRUCTURES START
|
// AREA STRUCTURES START
|
||||||
type AreaHandler struct{
|
type AreaHandler struct{
|
||||||
Button *ButtonMap
|
Button *GuiButton
|
||||||
Attrstr *ui.AttributedString
|
Attrstr *ui.AttributedString
|
||||||
Area *ui.Area
|
Area *ui.Area
|
||||||
WM *GuiWindow
|
WM *GuiWindow
|
||||||
|
@ -178,7 +178,7 @@ type HumanCellData struct {
|
||||||
Color color.RGBA
|
Color color.RGBA
|
||||||
ColorID int
|
ColorID int
|
||||||
VM *pb.Event_VM
|
VM *pb.Event_VM
|
||||||
Button *ButtonMap
|
Button *GuiButton
|
||||||
}
|
}
|
||||||
|
|
||||||
type HumanMap struct {
|
type HumanMap struct {
|
||||||
|
|
4
vmBox.go
4
vmBox.go
|
@ -53,7 +53,7 @@ func CreateVmBox(wm *GuiWindow, tab *ui.Tab, vm *pb.Event_VM) {
|
||||||
AddBoxToTab(vm.Name, tab, vbox)
|
AddBoxToTab(vm.Name, tab, vbox)
|
||||||
}
|
}
|
||||||
|
|
||||||
func createAddVmBox(wm *GuiWindow, tab *ui.Tab, name string, b *ButtonMap) {
|
func createAddVmBox(wm *GuiWindow, tab *ui.Tab, name string, b *GuiButton) {
|
||||||
log.Println("createAddVmBox() START")
|
log.Println("createAddVmBox() START")
|
||||||
vbox := ui.NewVerticalBox()
|
vbox := ui.NewVerticalBox()
|
||||||
vbox.SetPadded(true)
|
vbox.SetPadded(true)
|
||||||
|
@ -75,7 +75,7 @@ func createAddVmBox(wm *GuiWindow, tab *ui.Tab, name string, b *ButtonMap) {
|
||||||
hboxButtons.SetPadded(true)
|
hboxButtons.SetPadded(true)
|
||||||
vbox.Append(hboxButtons, false)
|
vbox.Append(hboxButtons, false)
|
||||||
|
|
||||||
var newb ButtonMap
|
var newb GuiButton
|
||||||
newb.Action = "CREATE"
|
newb.Action = "CREATE"
|
||||||
newb.VM = b.VM
|
newb.VM = b.VM
|
||||||
newb.Account = b.Account
|
newb.Account = b.Account
|
||||||
|
|
Loading…
Reference in New Issue