Exemple #1
0
func writeLicense(project, version, author string, f, cl, b col.Colour, g []string, Text *string) {
	//
	pre()
	post()
	w, h := uint(len(g[0])), uint(25) /* == len (license), see func init */ +6
	l, c := (NLines()-h)/2, (NColumns()-w)/2
	//  l0, c0:= l, c
	//  scr.Save (l, c, width, height)
	licenseBox.Wd(w)
	licenseBox.Colours(cl, b)
	emptyLine := str.Clr(w)
	licenseBox.Write(emptyLine, l, c)
	l++
	var s string
	str.Set(&s, project+" v. "+version)
	str.Center(&s, w)
	licenseBox.Write(s, l, c)
	l++
	licenseBox.Write(emptyLine, l, c)
	l++
	str.Set(&s, "(c) "+author)
	str.Center(&s, w)
	licenseBox.Colours(f, b)
	licenseBox.Write(s, l, c)
	l++ // l, c = 30, 52
	licenseBox.Colours(cl, b)
	licenseBox.Write(emptyLine, l, c)
	l++
	for i := 0; i < len(g); i++ {
		licenseBox.Write(g[i], l, c)
		l++
	}
	licenseBox.Write(emptyLine, l, c)
	l++
	licenseBox.Colours(f, b)
	/*
	   var line string
	   if DocExists {
	     str.Set (&line, "ausführliche Bedienungshinweise: siehe Dokumentation")
	   } else {
	     line = env.Parameter (0)
	     if line == "murus" {
	       line = str.Clr (w)
	     } else {
	       str.Set (&line, "kurze Bedienungshinweise: F1-Taste")
	     }
	   }
	   if ! str.Empty (line) { str.Center (&line, w) }
	   licenseBox.Write (line, l, c); l ++
	   licenseBox.Write (emptyLine, l, c)
	*/
	//  kbd.Wait (true)
	//  scr.Restore (l0, c0, w, height)
}
Exemple #2
0
func writeHeadline(project, version, author string, f, b col.Colour) {
	//
	pre()
	n := NColumns()
	Text := project + "       (c) " + author + "   v. " + version
	str.Center(&Text, n)
	licenseBox.Wd(n)
	licenseBox.Colours(f, b)
	licenseBox.Write(Text, 0, 0)
	post()
}
Exemple #3
0
func init() {
	//
	scr.Switch(scr.TXT)
	cF, cB = col.LightMagenta, col.Black
	// scr.Colours (cF, cB)
	lengthF, timeF = col.Red, col.LightBlue
	trackTimeF, ctrlF = col.Colour3(191, 191, 255), col.Colour3(63, 111, 255)
	for c := cdker.Controller(0); c < cdker.NCtrl; c++ {
		ctrlText[c] = cdker.Ctrltext[c]
		str.Center(&ctrlText[c], wr)
		lv[c] = l0 + 3*uint(c)
	}
	timeText = [2]string{"tracktime", "total time"}
	str.Center(&timeText[0], wr)
	str.Center(&timeText[1], wr)
	lt = [2]uint{l1 + 2, l1 + 2 + 3}
	bx = box.New()
	bx.Wd(wr)
	bx.Colours(col.HintF, col.HintB)
	bx.Colours(trackTimeF, cB)
	bx.Write(" track", l1, cr+wr-6-2)
	cw, lh := scr.NX1(), scr.NY1()
	bx.Colours(cF, cB)
	bx.Wd(wr)
	for c := cdker.Controller(0); c < cdker.NCtrl; c++ {
		ctrlBar[c] = pbar.New(true)
		ctrlBar[c].Def(cdker.MaxVol)
		ctrlBar[c].SetColours(ctrlF, cB)
		ctrlBar[c].Locate(cr*cw, lv[c]*lh, wr*cw, lh)
		bx.Write(ctrlText[c], lv[c]+1, cr)
	}
	for i := 0; i < 2; i++ {
		timeBar[i] = pbar.New(true)
		timeBar[i].SetColours(ctrlF, cB)
		timeBar[i].Locate(cr*cw, lt[i]*lh, wr*cw, lh)
		bx.Write(timeText[i], lt[i]+1, cr)
	}
	scr.MouseCursor(true)
	scr.WarpMouse(lv[cdker.All]+1, cr+wr/4)
}
Exemple #4
0
func hint(s string) {
	//
	delHint()
	pre()
	w := NColumns()
	str.Lat1(&s)
	str.Center(&s, w)
	l := NLines() - 1
	Save(l, 0, w, 1)
	hintbox.Wd(w)
	hintbox.Write(s, l, 0)
	hintWritten = true
	post()
}
Exemple #5
0
func confirmed() bool {
	//
	pre()
	s := "Sind Sie sicher?  j(a / n(ein"
	w := NColumns()
	str.Center(&s, w)
	l := NLines() - 1
	Save(l, 0, w, 1)
	errorbox.Wd(w)
	errorbox.Write(s, l, 0)
	b, _, _ := kbd.Read()
	a := b&' ' == 'J'
	Restore(l, 0, w, 1)
	post()
	return a
}
Exemple #6
0
func error(s string, n uint) {
	//
	pre()
	if n > 0 {
		s += " " + nat.String(n) + " "
	}
	str.Lat1(&s)
	str.Center(&s, NColumns())
	l := NLines() - 1
	Save(l, 0, NColumns(), 1)
	errorbox.Wd(NColumns())
	errorbox.Write(s, l, 0)
	kbd.Wait(false)
	Restore(l, 0, NColumns(), 1)
	post()
}