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
|
||||
}
|
||||
|
||||
func generateSubdomain(b *ButtonMap) {
|
||||
func generateSubdomain(b *GuiButton) {
|
||||
log.Println("generateSubdomain START")
|
||||
subdomain.SetText("cust00013.wit.dev")
|
||||
log.Println("generateSubdomain END")
|
||||
}
|
||||
|
||||
func addSubdomain(b *ButtonMap) {
|
||||
func addSubdomain(b *GuiButton) {
|
||||
log.Println("generateSubdomain START")
|
||||
sub := subdomain.Text()
|
||||
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"
|
||||
|
||||
func findFB(button *ButtonMap) *ButtonMap {
|
||||
var a *ButtonMap
|
||||
func findFB(button *GuiButton) *GuiButton {
|
||||
var a *GuiButton
|
||||
for key, foo := range Data.AllButtons {
|
||||
log.Println("findFB() Data.AllButtons key, foo=", key, foo)
|
||||
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)
|
||||
}
|
||||
|
||||
func runTestHide(b *ButtonMap) {
|
||||
func runTestHide(b *GuiButton) {
|
||||
/*
|
||||
log.Println("runTestHide START")
|
||||
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("runTestExecClick b.VM", b.VM)
|
||||
hostname := "localhost"
|
||||
|
@ -105,7 +105,7 @@ func runPingClick(b *ButtonMap) {
|
|||
log.Println("runPingClick END")
|
||||
}
|
||||
|
||||
func runTestExecClick(b *ButtonMap) {
|
||||
func runTestExecClick(b *GuiButton) {
|
||||
log.Println("runTestExecClick START")
|
||||
if runtime.GOOS == "linux" {
|
||||
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
|
||||
// TODO: clean up the text above
|
||||
// TODO: remove this all together going only to main()
|
||||
func mouseClick(b *ButtonMap) {
|
||||
func mouseClick(b *GuiButton) {
|
||||
log.Println("gui.mouseClick() START")
|
||||
if (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 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
|
||||
//
|
||||
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)
|
||||
if Data.AllButtons[key].custom != nil {
|
||||
log.Println("\tdefaultButtonClick() DOING CUSTOM FUNCTION")
|
||||
var tmp ButtonMap
|
||||
var tmp GuiButton
|
||||
tmp = Data.AllButtons[key]
|
||||
// spew.Dump(tmp)
|
||||
Data.AllButtons[key].custom(&tmp)
|
||||
|
@ -200,7 +200,7 @@ func defaultButtonClick(button *ui.Button) {
|
|||
mouseClick(nil)
|
||||
}
|
||||
|
||||
func AddButton(b *ButtonMap, name string) *ui.Button {
|
||||
func AddButton(b *GuiButton, name string) *ui.Button {
|
||||
newB := ui.NewButton(name)
|
||||
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,
|
||||
name string, action string, custom func(*ButtonMap)) *ui.Button {
|
||||
name string, action string, custom func(*GuiButton)) *ui.Button {
|
||||
newUiB := ui.NewButton(name)
|
||||
newUiB.OnClicked(defaultButtonClick)
|
||||
|
||||
var newB ButtonMap
|
||||
var newB GuiButton
|
||||
newB.B = newUiB
|
||||
newB.T = wm.T
|
||||
newB.Account = a
|
||||
|
@ -227,11 +227,11 @@ func CreateButton(wm *GuiWindow, a *pb.Account, vm *pb.Event_VM,
|
|||
return newUiB
|
||||
}
|
||||
|
||||
func CreateFontButton(wm *GuiWindow, action string) *ButtonMap {
|
||||
func CreateFontButton(wm *GuiWindow, action string) *GuiButton {
|
||||
newB := ui.NewFontButton()
|
||||
|
||||
// create a 'fake' button entry for the mouse clicks
|
||||
var newBM ButtonMap
|
||||
var newBM GuiButton
|
||||
newBM.Action = action
|
||||
newBM.FB = newB
|
||||
newBM.AH = wm.AH
|
||||
|
|
|
@ -259,7 +259,7 @@ func InitWindow(wm *GuiWindow) {
|
|||
wm.W.SetBorderless(false)
|
||||
|
||||
// create a 'fake' button entry for the mouse clicks
|
||||
var newBM ButtonMap
|
||||
var newBM GuiButton
|
||||
newBM.Action = "QUIT"
|
||||
newBM.W = wm.W
|
||||
newBM.WM = wm
|
||||
|
|
14
structs.go
14
structs.go
|
@ -22,7 +22,7 @@ type GuiData struct {
|
|||
|
||||
// a fallback default function to handle mouse events
|
||||
// if nothing else is defined to handle them
|
||||
MouseClick func(*ButtonMap)
|
||||
MouseClick func(*GuiButton)
|
||||
|
||||
// account entry textboxes
|
||||
Config *pb.Config
|
||||
|
@ -43,7 +43,7 @@ type GuiData struct {
|
|||
// A map of all buttons everywhere on all
|
||||
// windows, all tabs, across all goroutines
|
||||
// This is "GLOBAL"
|
||||
AllButtons []ButtonMap
|
||||
AllButtons []GuiButton
|
||||
|
||||
// A map of all the entry boxes
|
||||
AllEntries []*GuiEntry
|
||||
|
@ -71,7 +71,7 @@ type GuiEntry struct {
|
|||
Account *pb.Account
|
||||
VM *pb.Event_VM
|
||||
|
||||
B *ButtonMap
|
||||
B *GuiButton
|
||||
FB *ui.FontButton
|
||||
A *ui.Area
|
||||
W *ui.Window
|
||||
|
@ -101,7 +101,7 @@ type FontString struct {
|
|||
W font.Weight
|
||||
}
|
||||
|
||||
type ButtonMap struct {
|
||||
type GuiButton struct {
|
||||
// andlabs/ui stuff
|
||||
B *ui.Button
|
||||
FB *ui.FontButton
|
||||
|
@ -118,13 +118,13 @@ type ButtonMap struct {
|
|||
Action string // what type of button
|
||||
|
||||
// a callback function for the main application
|
||||
custom func (*ButtonMap)
|
||||
custom func (*GuiButton)
|
||||
}
|
||||
|
||||
|
||||
// AREA STRUCTURES START
|
||||
type AreaHandler struct{
|
||||
Button *ButtonMap
|
||||
Button *GuiButton
|
||||
Attrstr *ui.AttributedString
|
||||
Area *ui.Area
|
||||
WM *GuiWindow
|
||||
|
@ -178,7 +178,7 @@ type HumanCellData struct {
|
|||
Color color.RGBA
|
||||
ColorID int
|
||||
VM *pb.Event_VM
|
||||
Button *ButtonMap
|
||||
Button *GuiButton
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
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")
|
||||
vbox := ui.NewVerticalBox()
|
||||
vbox.SetPadded(true)
|
||||
|
@ -75,7 +75,7 @@ func createAddVmBox(wm *GuiWindow, tab *ui.Tab, name string, b *ButtonMap) {
|
|||
hboxButtons.SetPadded(true)
|
||||
vbox.Append(hboxButtons, false)
|
||||
|
||||
var newb ButtonMap
|
||||
var newb GuiButton
|
||||
newb.Action = "CREATE"
|
||||
newb.VM = b.VM
|
||||
newb.Account = b.Account
|
||||
|
|
Loading…
Reference in New Issue