more variable name fixes
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
1015f66ab5
commit
ef28b8fc2b
12
area.go
12
area.go
|
@ -20,7 +20,7 @@ func findFB(button *GuiButton) *GuiButton {
|
||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeSplashArea(wm *GuiWindow, ah *AreaHandler) {
|
func makeSplashArea(wm *GuiWindow, ah *GuiArea) {
|
||||||
// make this button just to get the default font (but don't display the button)
|
// make this button just to get the default font (but don't display the button)
|
||||||
// There should be another way to do this (?)
|
// There should be another way to do this (?)
|
||||||
newB := CreateFontButton(wm, "AREA")
|
newB := CreateFontButton(wm, "AREA")
|
||||||
|
@ -59,7 +59,7 @@ func appendWithAttributes(newText *ui.AttributedString, what string, attrs ...ui
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ah AreaHandler) Draw(a *ui.Area, p *ui.AreaDrawParams) {
|
func (ah GuiArea) Draw(a *ui.Area, p *ui.AreaDrawParams) {
|
||||||
tl := ui.DrawNewTextLayout(&ui.DrawTextLayoutParams{
|
tl := ui.DrawNewTextLayout(&ui.DrawTextLayoutParams{
|
||||||
String: ah.Attrstr,
|
String: ah.Attrstr,
|
||||||
DefaultFont: ah.Button.FB.Font(),
|
DefaultFont: ah.Button.FB.Font(),
|
||||||
|
@ -70,7 +70,7 @@ func (ah AreaHandler) Draw(a *ui.Area, p *ui.AreaDrawParams) {
|
||||||
defer tl.Free()
|
defer tl.Free()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ah AreaHandler) MouseEvent(a *ui.Area, me *ui.AreaMouseEvent) {
|
func (ah GuiArea) MouseEvent(a *ui.Area, me *ui.AreaMouseEvent) {
|
||||||
if (Data.Debug) {
|
if (Data.Debug) {
|
||||||
log.Println("GOT MouseEvent() ah.Button =", ah.Button)
|
log.Println("GOT MouseEvent() ah.Button =", ah.Button)
|
||||||
spew.Dump(me)
|
spew.Dump(me)
|
||||||
|
@ -88,15 +88,15 @@ func (ah AreaHandler) MouseEvent(a *ui.Area, me *ui.AreaMouseEvent) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ah AreaHandler) MouseCrossed(a *ui.Area, left bool) {
|
func (ah GuiArea) MouseCrossed(a *ui.Area, left bool) {
|
||||||
log.Println("GOT MouseCrossed()")
|
log.Println("GOT MouseCrossed()")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ah AreaHandler) DragBroken(a *ui.Area) {
|
func (ah GuiArea) DragBroken(a *ui.Area) {
|
||||||
log.Println("GOT DragBroken()")
|
log.Println("GOT DragBroken()")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ah AreaHandler) KeyEvent(a *ui.Area, ke *ui.AreaKeyEvent) (handled bool) {
|
func (ah GuiArea) KeyEvent(a *ui.Area, ke *ui.AreaKeyEvent) (handled bool) {
|
||||||
log.Println("GOT KeyEvent()")
|
log.Println("GOT KeyEvent()")
|
||||||
if (ke.Key == 10) {
|
if (ke.Key == 10) {
|
||||||
log.Println("GOT ENTER")
|
log.Println("GOT ENTER")
|
||||||
|
|
|
@ -22,8 +22,8 @@ func ShowSplashBox(wm *GuiWindow, newText *ui.AttributedString) *ui.Box {
|
||||||
newbox := ui.NewVerticalBox()
|
newbox := ui.NewVerticalBox()
|
||||||
newbox.SetPadded(true)
|
newbox.SetPadded(true)
|
||||||
|
|
||||||
// initialize the AreaHandler{}
|
// initialize the GuiArea{}
|
||||||
wm.AH = new(AreaHandler)
|
wm.AH = new(GuiArea)
|
||||||
wm.AH.WM = wm
|
wm.AH.WM = wm
|
||||||
wm.AH.Attrstr = newText
|
wm.AH.Attrstr = newText
|
||||||
makeSplashArea(wm, wm.AH)
|
makeSplashArea(wm, wm.AH)
|
||||||
|
|
15
structs.go
15
structs.go
|
@ -44,6 +44,7 @@ type GuiData struct {
|
||||||
// windows, all tabs, across all goroutines
|
// windows, all tabs, across all goroutines
|
||||||
// This is "GLOBAL"
|
// This is "GLOBAL"
|
||||||
AllButtons []GuiButton
|
AllButtons []GuiButton
|
||||||
|
ButtonMap map[*GuiButton][]func (*GuiButton)
|
||||||
|
|
||||||
// A map of all the entry boxes
|
// A map of all the entry boxes
|
||||||
AllEntries []*GuiEntry
|
AllEntries []*GuiEntry
|
||||||
|
@ -80,17 +81,21 @@ type GuiEntry struct {
|
||||||
Action string // what type of button
|
Action string // what type of button
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GuiBox struct {
|
||||||
|
EntryMap map[string][]*GuiEntry
|
||||||
|
AH *GuiArea
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
type GuiWindow struct {
|
type GuiWindow struct {
|
||||||
W *ui.Window
|
W *ui.Window
|
||||||
T *ui.Tab
|
T *ui.Tab
|
||||||
Box1 *ui.Box
|
Box1 *ui.Box
|
||||||
Box2 *ui.Box
|
Box2 *ui.Box
|
||||||
|
|
||||||
EntryMap map[string][]*GuiEntry
|
|
||||||
|
|
||||||
C *pb.Config
|
C *pb.Config
|
||||||
|
|
||||||
AH *AreaHandler
|
AH *GuiArea
|
||||||
Action string
|
Action string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +114,7 @@ type GuiButton struct {
|
||||||
W *ui.Window
|
W *ui.Window
|
||||||
T *ui.Tab
|
T *ui.Tab
|
||||||
|
|
||||||
AH *AreaHandler
|
AH *GuiArea
|
||||||
|
|
||||||
// git.wit.com/wit/gui stuff
|
// git.wit.com/wit/gui stuff
|
||||||
WM *GuiWindow
|
WM *GuiWindow
|
||||||
|
@ -123,7 +128,7 @@ type GuiButton struct {
|
||||||
|
|
||||||
|
|
||||||
// AREA STRUCTURES START
|
// AREA STRUCTURES START
|
||||||
type AreaHandler struct{
|
type GuiArea struct{
|
||||||
Button *GuiButton
|
Button *GuiButton
|
||||||
Attrstr *ui.AttributedString
|
Attrstr *ui.AttributedString
|
||||||
Area *ui.Area
|
Area *ui.Area
|
||||||
|
|
Loading…
Reference in New Issue