clean up more mouse click handling. Almost finished.
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
80608e070d
commit
25757a812f
9
gui.go
9
gui.go
|
@ -134,6 +134,14 @@ func mouseClick(b *ButtonMap) {
|
||||||
createAddVmBox(Data.cloudTab, "Create New Virtual Machine")
|
createAddVmBox(Data.cloudTab, "Create New Virtual Machine")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (b.Action == "SHOW VM") {
|
||||||
|
Data.CurrentVM = b.VM
|
||||||
|
if (Data.Debug) {
|
||||||
|
go ui.Main(ShowVM)
|
||||||
|
} else {
|
||||||
|
createVmBox(Data.cloudTab, b.VM)
|
||||||
|
}
|
||||||
|
}
|
||||||
if (b.Action == "ADD") {
|
if (b.Action == "ADD") {
|
||||||
log.Println("\tgui.mouseClick() SHOULD ADD VM HERE?")
|
log.Println("\tgui.mouseClick() SHOULD ADD VM HERE?")
|
||||||
}
|
}
|
||||||
|
@ -194,7 +202,6 @@ func CreateButton(a *pb.Account, vm *pb.Event_VM,
|
||||||
newmap.VM = vm
|
newmap.VM = vm
|
||||||
newmap.Action = action
|
newmap.Action = action
|
||||||
newmap.custom = custom
|
newmap.custom = custom
|
||||||
// newmap.aTab = Data.CurrentTab
|
|
||||||
Data.AllButtons = append(Data.AllButtons, newmap)
|
Data.AllButtons = append(Data.AllButtons, newmap)
|
||||||
|
|
||||||
return newB
|
return newB
|
||||||
|
|
|
@ -65,8 +65,9 @@ type GuiDataStructure struct {
|
||||||
// This is "GLOBAL"
|
// This is "GLOBAL"
|
||||||
AllButtons []ButtonMap
|
AllButtons []ButtonMap
|
||||||
|
|
||||||
// a tab (maybe the one the user is playing with?)
|
|
||||||
// a VM (maybe the one the user is playing with?)
|
// a VM (maybe the one the user is playing with?)
|
||||||
|
// if opening a new window, this is a trick to
|
||||||
|
// pass it in
|
||||||
CurrentVM *pb.Event_VM
|
CurrentVM *pb.Event_VM
|
||||||
|
|
||||||
// All the tabs
|
// All the tabs
|
||||||
|
@ -162,6 +163,8 @@ type HumanCellData struct {
|
||||||
TextID int
|
TextID int
|
||||||
Color color.RGBA
|
Color color.RGBA
|
||||||
ColorID int
|
ColorID int
|
||||||
|
VM *pb.Event_VM
|
||||||
|
Button *ButtonMap
|
||||||
}
|
}
|
||||||
|
|
||||||
type HumanMap struct {
|
type HumanMap struct {
|
||||||
|
|
|
@ -97,18 +97,15 @@ func (mh *TableData) SetCellValue(m *ui.TableModel, row, column int, value ui.Ta
|
||||||
func defaultSetCellValue(mh *TableData, row int, column int) {
|
func defaultSetCellValue(mh *TableData, row int, column int) {
|
||||||
if (mh.Cells[column].Name == "BUTTON") {
|
if (mh.Cells[column].Name == "BUTTON") {
|
||||||
humanID := mh.Cells[column].HumanID
|
humanID := mh.Cells[column].HumanID
|
||||||
vmname := mh.Rows[row].HumanData[humanID].Text
|
log.Println("defaultSetCellValue() FOUND THE TABLE BUTTON ", row, humanID)
|
||||||
log.Println("vmname =", vmname)
|
|
||||||
log.Println("defaultSetCellValue() FOUND THE BUTTON!!!!!!! Button was pressed START", row, column)
|
button := mh.Rows[row].HumanData[humanID].Button
|
||||||
// Data.CurrentVM = fmt.Sprintf("%s",vmname)
|
if (button != nil) {
|
||||||
Data.CurrentVM = mh.Rows[row].VM
|
mouseClick(button)
|
||||||
log.Println("User last clicked on Data.CurrentVM =", mh.Rows[row].VM)
|
return
|
||||||
|
}
|
||||||
if (Data.Debug) {
|
if (Data.Debug) {
|
||||||
go ui.Main(ShowVM)
|
panic("defaultSetCellValue() GOT AN UNKNOWN BUTTON CLICK IN TABLE")
|
||||||
} else {
|
|
||||||
// AddVmConfigureTab(vmname, mh.Rows[row].PbVM)
|
|
||||||
// createVmBox(Data.cloudTab, buttonVmClick, mh.Rows[row].PbVM)
|
|
||||||
createVmBox(Data.cloudTab, mh.Rows[row].VM)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue