start moving the area text back to the main program

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-29 15:46:21 -07:00
parent 8df7549d32
commit 0009d89fd5
5 changed files with 15 additions and 28 deletions

View File

@ -25,7 +25,7 @@ func makeSplashArea(ah *AreaHandler) {
// There should be another way to do this (?)
newB := CreateFontButton("AREA")
ah.Attrstr = makeAttributedString()
// ah.Attrstr = makeAttributedString()
ah.Area = ui.NewArea(ah)
newB.A = ah.Area
Data.AllButtons[1].A = ah.Area

View File

@ -82,7 +82,7 @@ func runTestHide(b *ButtonMap) {
log.Println("runTestHide START")
Data.Window1.Box1.Hide()
Data.Window1.Box2.Hide()
time.Sleep(2000 * time.Millisecond)
// time.Sleep(2000 * time.Millisecond)
Data.State = "HIDE"
log.Println("runTestHide END")
}

View File

@ -208,7 +208,7 @@ func ShowMainTab() {
}
func GoMainWindow() {
Data.Window1 = new(WindowMap)
// Data.Window1 = new(WindowMap)
ui.Main(makeCloudWindow)
}
@ -235,8 +235,8 @@ func makeCloudWindow() {
Data.Window1.W.SetChild(Data.Window1.T)
Data.Window1.W.SetMargined(true)
text := makeAttributedString()
Data.Window1.Box1 = ShowSplashBox(text)
// text := makeAttributedString()
Data.Window1.Box1 = ShowSplashBox(Data.Window1.AreaText)
Data.Window1.T.Append("WIT Splash", Data.Window1.Box1)
Data.Window1.T.SetMargined(0, true)

View File

@ -49,29 +49,7 @@ func ShowSplashBox(newText *ui.AttributedString) *ui.Box {
okButton := CreateButton(nil, nil, "OK", "AREA", nil)
newbox.Append(okButton, false)
newbox.Append(CreateButton(nil, nil, "NEWTEXT", "NEWTEXT", nil), false)
return newbox
}
func makeAttributedString() *ui.AttributedString {
newText := ui.NewAttributedString("")
appendWithAttributes(newText, "Welcome to the Cloud Control Panel\n", ui.TextSize(16), ui.TextColor{0.0, 0.0, 0.8, .8}) // "RGBT"
appendWithAttributes(newText, "(alpha)\n\n", ui.TextSize(10))
appendWithAttributes(newText, "This control panel was designed to be an interface to your 'private' cloud. ", ui.TextWeightBold)
appendWithAttributes(newText, "The concept of a private cloud means that you can use a providers system, or, seemlessly, use your own hardware in your own datacenter. ", ui.TextWeightBold)
newText.AppendUnattributed("\n")
newText.AppendUnattributed("\n")
appendWithAttributes(newText, "This control panel requires:\n")
newText.AppendUnattributed("\n")
appendWithAttributes(newText, "IPv6\n")
appendWithAttributes(newText, "newText, Your hostname in DNS\n")
newText.AppendUnattributed("\n\n\n\n\n")
appendWithAttributes(newText, "<click or press any key>\n", ui.TextSize(10))
return newText
}

View File

@ -1,6 +1,7 @@
package gui
import "image/color"
import "golang.org/x/image/font"
import "github.com/andlabs/ui"
import _ "github.com/andlabs/ui/winmanifest"
@ -92,6 +93,14 @@ type WindowMap struct {
Box2 *ui.Box
AH *AreaHandler
AreaText *ui.AttributedString
}
type FontString struct {
S string
Size int
F font.Face
W font.Weight
}
type ButtonMap struct {