more uneeded referencial code

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-29 11:32:07 -07:00
parent bde27292ea
commit 5f84f5d2c7
2 changed files with 11 additions and 8 deletions

15
area.go
View File

@ -24,7 +24,7 @@ func makeSplashArea(ah *AreaHandler) {
// 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("AREA") newB := CreateFontButton("AREA")
ah.FontButton = newB.FB // ah.FontButton = newB.FB
time.Sleep(200 * time.Millisecond) time.Sleep(200 * time.Millisecond)
tmp := findFB(newB) tmp := findFB(newB)
@ -45,14 +45,14 @@ func makeSplashArea(ah *AreaHandler) {
log.Println("makeSplashArea() tmp =", tmp, "newB", newB) log.Println("makeSplashArea() tmp =", tmp, "newB", newB)
// log.Println("makeSplashArea() ah =", ah) // log.Println("makeSplashArea() ah =", ah)
log.Println("makeSplashArea() ah.FontButton =", ah.FontButton) // log.Println("makeSplashArea() ah.FontButton =", ah.FontButton)
// DefaultFont: ah.FontButton.Font(), // DefaultFont: ah.FontButton.Font(),
ah.Attrstr = makeAttributedString() ah.Attrstr = makeAttributedString()
ah.Area = ui.NewArea(ah) ah.Area = ui.NewArea(ah)
newB.A = ah.Area newB.A = ah.Area
Data.AllButtons[1].A = ah.Area Data.AllButtons[1].A = ah.Area
ah.FontButton = Data.AllButtons[1].FB // ah.FontButton = Data.AllButtons[1].FB
ah.Button = &Data.AllButtons[1] ah.Button = &Data.AllButtons[1]
if (Data.Debug) { if (Data.Debug) {
@ -84,7 +84,7 @@ func appendWithAttributes(newText *ui.AttributedString, what string, attrs ...ui
func (ah AreaHandler) Draw(a *ui.Area, p *ui.AreaDrawParams) { func (ah AreaHandler) 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.FontButton.Font(), DefaultFont: ah.Button.FB.Font(),
Width: p.AreaWidth, Width: p.AreaWidth,
Align: ui.DrawTextAlign(1), Align: ui.DrawTextAlign(1),
}) })
@ -94,17 +94,20 @@ func (ah AreaHandler) Draw(a *ui.Area, p *ui.AreaDrawParams) {
func (ah AreaHandler) MouseEvent(a *ui.Area, me *ui.AreaMouseEvent) { func (ah AreaHandler) MouseEvent(a *ui.Area, me *ui.AreaMouseEvent) {
if (Data.Debug) { if (Data.Debug) {
log.Println("GOT MouseEvent()") log.Println("GOT MouseEvent() ah.Button =", ah.Button)
spew.Dump(me) spew.Dump(me)
} }
if (me.Down == 1) { if (me.Down == 1) {
log.Println("GOT MOUSE DOWN") log.Println("GOT MOUSE DOWN")
log.Println("GOT MOUSE DOWN ah.Button =", ah.Button)
log.Println("GOT MOUSE UP ah.Button.FB =", ah.Button.FB)
} }
if (me.Up == 1) { if (me.Up == 1) {
log.Println("GOT MOUSE UP") log.Println("GOT MOUSE UP")
// log.Println("GOT MOUSE UP ah", ah) // log.Println("GOT MOUSE UP ah", ah)
log.Println("GOT MOUSE UP ah.FontButton =", ah.FontButton) // log.Println("GOT MOUSE UP ah.FontButton =", ah.FontButton)
log.Println("GOT MOUSE UP ah.Button =", ah.Button) log.Println("GOT MOUSE UP ah.Button =", ah.Button)
log.Println("GOT MOUSE UP ah.Button.FB =", ah.Button.FB)
mouseClick(ah.Button) mouseClick(ah.Button)
} }
} }

View File

@ -95,7 +95,7 @@ type EntryMap struct {
Action string // what type of button Action string // what type of button
// custom callback function to your main application // custom callback function to your main application
custom func (*EntryMap) // custom func (*EntryMap)
} }
type ButtonMap struct { type ButtonMap struct {
@ -119,7 +119,7 @@ type AreaHandler struct{
Button *ButtonMap Button *ButtonMap
Attrstr *ui.AttributedString Attrstr *ui.AttributedString
Area *ui.Area Area *ui.Area
FontButton *ui.FontButton // FontButton *ui.FontButton
// FB func () *ButtonMap // FB func () *ButtonMap
} }
// AREA STRUCTURES END // AREA STRUCTURES END