more variable name fixes

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-30 09:19:49 -07:00
parent 1015f66ab5
commit ef28b8fc2b
3 changed files with 18 additions and 13 deletions

12
area.go
View File

@ -20,7 +20,7 @@ func findFB(button *GuiButton) *GuiButton {
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)
// There should be another way to do this (?)
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{
String: ah.Attrstr,
DefaultFont: ah.Button.FB.Font(),
@ -70,7 +70,7 @@ func (ah AreaHandler) Draw(a *ui.Area, p *ui.AreaDrawParams) {
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) {
log.Println("GOT MouseEvent() ah.Button =", ah.Button)
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()")
}
func (ah AreaHandler) DragBroken(a *ui.Area) {
func (ah GuiArea) DragBroken(a *ui.Area) {
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()")
if (ke.Key == 10) {
log.Println("GOT ENTER")

View File

@ -22,8 +22,8 @@ func ShowSplashBox(wm *GuiWindow, newText *ui.AttributedString) *ui.Box {
newbox := ui.NewVerticalBox()
newbox.SetPadded(true)
// initialize the AreaHandler{}
wm.AH = new(AreaHandler)
// initialize the GuiArea{}
wm.AH = new(GuiArea)
wm.AH.WM = wm
wm.AH.Attrstr = newText
makeSplashArea(wm, wm.AH)

View File

@ -44,6 +44,7 @@ type GuiData struct {
// windows, all tabs, across all goroutines
// This is "GLOBAL"
AllButtons []GuiButton
ButtonMap map[*GuiButton][]func (*GuiButton)
// A map of all the entry boxes
AllEntries []*GuiEntry
@ -80,17 +81,21 @@ type GuiEntry struct {
Action string // what type of button
}
type GuiBox struct {
EntryMap map[string][]*GuiEntry
AH *GuiArea
}
type GuiWindow struct {
W *ui.Window
T *ui.Tab
Box1 *ui.Box
Box2 *ui.Box
EntryMap map[string][]*GuiEntry
C *pb.Config
AH *AreaHandler
AH *GuiArea
Action string
}
@ -109,7 +114,7 @@ type GuiButton struct {
W *ui.Window
T *ui.Tab
AH *AreaHandler
AH *GuiArea
// git.wit.com/wit/gui stuff
WM *GuiWindow
@ -123,7 +128,7 @@ type GuiButton struct {
// AREA STRUCTURES START
type AreaHandler struct{
type GuiArea struct{
Button *GuiButton
Attrstr *ui.AttributedString
Area *ui.Area