func init() { // name[suchwort] = "Suchwort" name[ferien] = "Ferien " name[casetta] = "Casetta " bx = box.New() bx.Wd(length) workdayAF, workdayAB = col.LightWhite, col.Blue holidayAF, holidayAB = col.LightWhite, col.Red bx.Colours(workdayAF, workdayAB) // day.Attribute (Attrib) for a := 0; a < nAttrs; a++ { set[a] = pdays.New() set[a].Name(name[a]) } }
func defined() (string, bool) { // bx := box.New() bx.Wd(6) bx.Colours(col.LightCyan, col.Black) bx.Write("Welt:", 1, 0) const n = 12 bx.Wd(n) name := str.Clr(n) name = "" errh.Hint("Namen der Welt eingeben Programmende: leere Eingabe") bx.Edit(&name, 1, 6) str.RemSpaces(&name) errh.DelHint() return name, !str.Empty(name) }
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) }
func April1st() { col.ScreenF, col.ScreenB = col.White, col.Black scr.Cls() scr.MouseCursor(false) scr.Colour(col.White) scr.Write("Found evil software: \" \"", 7, x0) doof(7, 22) scr.Colour(col.White) scr.Write("Remove (yes/no) ?", y0, x0) b := box.New() b.Wd(3) t := "yes" b.Edit(&t, y0, 23) scr.WarpMouseGr(2*int(scr.NX()), 2*int(scr.NY())) b.Colours(col.LightOrange, col.Black) b.Write("yes", y0, 23) doodle(col.LightWhite, 2) doodle(col.LightWhite, 2) doodle(col.LightYellow, 5) doodle(col.Yellow, 3) doodle(col.LightOrange, 5) doodle(col.Orange, 8) doodle(col.LightRed, 3) // TODO erase all (f + "*.tmp") t = str.Clr(70) scr.Write(t, y0, x0) scr.Write(t, y0+1, x0) col.ScreenF, col.ScreenB = col.LightGreen, col.DarkBlue scr.Cls() scr.Write("The murus-tool has removed \" \" - your disk is reformatted :-)", y0, x0) doof(y0, 28) scr.Colour(col.LightWhite) scr.Write("Please install Linux, TeX, mercurial, Go and murus completely new !", y0+2, x0) ker.Sleep(20) ker.Terminate() }
lenShort = lenName + lenFirstName + 2 // ", " ) type ( Imp struct { surname, firstName *text.Imp fm *tval.Imp // True == f, False == m bd *day.Imp ti *enum.Imp fmt Format } ) var ( bx, shbx *box.Imp = box.New(), box.New() pbx = pbox.New() ) func (x *Imp) imp(Y Object) *Imp { // y, ok := Y.(*Imp) if !ok { TypeNotEqPanic(x, Y) } return y } func New() *Imp { // x := new(Imp)
undefined = uint(tenMillions * hundred) nDigits = 7 // höchstens 9.999.999 Euro length = nDigits + 1 /* Komma */ + 2 ) type ( Imp struct { cent uint cF, cB col.Colour fo font.Font } Texte [length]byte ) var ( bx *box.Imp = box.New() pbx *pbox.Imp = pbox.New() ) func (x *Imp) impc(Y Any) uint { // y, ok := Y.(*Imp) if !ok { TypeNotEqPanic(x, Y) } return y.cent } func New() *Imp { // x := new(Imp)
"murus/errh" "murus/font" . "murus/obj" "murus/pbox" "murus/str" ) //const // LaengeHilfetext = 2 + NAttrs * (Wd + 1) type Imp struct { a Attr } var ( txt [NAttrs]string bx, setbx *box.Imp = box.New(), box.New() pbx *pbox.Imp = pbox.New() Hilfetext string cF, cB, cMF, cMB col.Colour = col.LightWhite, col.Green, col.LightWhite, col.Green fmt Format ) func New() *Imp { // x := new(Imp) x.a = 0 return x } func (x *Imp) Empty() bool { //
func main() { // if !scr.MouseEx() { return } var symbol [Nfigure]byte symbol[line] = 'S' // "Strecke" symbol[rectangle] = 'R' // "Rechteck" symbol[circle] = 'K' // "Kreis" symbol[ellipse] = 'E' // "Ellipse" X, Y := 0, 0 X1, Y1 := scr.NX(), scr.NY() // Farbe, Papier:= col.LightWhite, col.Black Farbe, Papier := col.Black, col.LightWhite col.ScreenF, col.ScreenB = Farbe, Papier scr.Cls() paintColour := Farbe scr.Colour(paintColour) // Staerke = 3 bx := box.New() bx.Wd(20) bx.Colours(Papier, Farbe) Name := env.Par(1) if str.Empty(Name) { Name = "temp" } scr.Save(0, 0, 20, 1) for { bx.Edit(&Name, 0, 0) if !str.Empty(Name) { str.RemSpaces(&Name) break } } scr.Restore(0, 0, 20, 1) img.Get(Name, uint(X), uint(Y)) scr.MouseCursor(true) Figur := figure(rectangle) var x, y, x0, y0 int loop: for { scr.Colour(paintColour) Zeichen, Kommando, T := kbd.Read() switch Kommando { case kbd.None: x, y = scr.MousePosGr() scr.SwitchTransparence(true) scr.Write1Gr(Zeichen, x, y-int(scr.NY1())) // scr.WarpMouse (x + scr.NX1(), y) case kbd.Esc: break loop case kbd.Back: switch T { case 0: x, y = scr.MousePosGr() x -= int(scr.NX1()) scr.Colour(Papier) scr.Write1Gr(' ', x, y-int(scr.NY1())) // scr.RectangleFull (x, y - scr.NY1(), x + scr.NX1(), y) // scr.WarpMouseGr (x, y) scr.Colour(paintColour) default: scr.Cls() } /* case kbd.Ins: img.Write (X, Y, X1, Y1 - 16, Name) box.Edit (Feld, Name, scr.Zeilenzahl () - 1, 0) img.Get (X, Y, Name) */ case kbd.Help: paintColour = sel.Colour() // case kbd.LookFor: // Staerke = Strichstaerken.Staerke() case kbd.Enter: if T > 0 { x0, y0 = scr.MousePosGr() // scr.Fill1 (x0, y0) } case kbd.PrintScr: img.Print(uint(X), uint(Y), X1, Y1-16) case kbd.Tab: if T == 0 { if Figur+1 < Nfigure { Figur++ } else { Figur = figure(0) } } else { if Figur > 0 { Figur-- } else { Figur = figure(Nfigure - 1) } } scr.Colours(col.White, Papier) scr.Write1(symbol[Figur], scr.NY()-1, 0) case kbd.Here: x0, y0 = scr.MousePosGr() scr.CircleFull(x0, y0, 3/2) case kbd.Pull: x, y = scr.MousePosGr() scr.Line(x0, y0, x, y) x0, y0 = x, y case kbd.Hither: x, y = scr.MousePosGr() scr.Line(x0, y0, x, y) case kbd.There: x0, y0 = scr.MousePosGr() x, y = x0, y0 case kbd.Push: paint(Figur, inv, x0, y0, x, y) x, y = scr.MousePosGr() paint(Figur, inv, x0, y0, x, y) case kbd.Thither: paint(Figur, inv, x0, y0, x, y) // scr.Colour (paintColour) x, y = scr.MousePosGr() paint(Figur, border, x0, y0, x, y) x0, y0 = x, y case kbd.This: x0, y0 = scr.MousePosGr() x, y = x0, y0 case kbd.Move: scr.LineInv(x0, y0, x, y) x, y = scr.MousePosGr() scr.LineInv(x0, y0, x, y) case kbd.Thus: scr.LineInv(x0, y0, x, y) x, y = scr.MousePosGr() scr.Line(x0, y0, x, y) x0, y0 = x, y } } scr.Save(0, 0, 20, 1) for { bx.Edit(&Name, 0, 0) // TODO make sure, that "Name" is x{x|y} where x is letter, y is digit if !str.Empty(Name) { str.RemSpaces(&Name) break } } scr.Restore(0, 0, 20, 1) img.Put(Name, uint(X), uint(Y), X1, Y1) ker.Terminate() }
package errh // (c) Christian Maurer v. 130309 - license see murus.go import ( // "murus/env" "murus/box" "murus/col" "murus/kbd" "murus/nat" . "murus/scr" "murus/str" ) var ( hintbox, errorbox, licenseBox, choiceBox *box.Imp = box.New(), box.New(), box.New(), box.New() hintWritten, hintPosWritten/* , DocExists */ bool hintwidth uint transparent bool // actualFontsize FontSizes license []string ) func wait() { // TODO -> kbd, other name // loop: for { _, c, _ := kbd.Read() switch c { case kbd.Enter, kbd.Esc, kbd.Back, kbd.Here, kbd.There: break loop
maxTimeCode = _H * _MS * _MS ) type Imp struct { hour, // <= _H // 24 for the empty clocktime minute, // < _MS second uint // < _MS fmt Format cF, cB col.Colour font font.Font } var ( textlength [NFormats]uint currentTime, clock *Imp = New(), New() bx, clockbx *box.Imp = box.New(), box.New() line, column uint pbx *pbox.Imp = pbox.New() ) func (x *Imp) imp(Y Object) *Imp { // y, ok := Y.(*Imp) if !ok { TypeNotEqPanic(x, Y) } return y } func New() *Imp { //
"os" ) const pack = "host" type Imp struct { ip net.IP // []net.IP name []string // maximal length max see some header-file in /usr/include[/...] fmt Format fg, bg col.Colour marked bool } var localHost = New() var ll [NFormats]uint = [NFormats]uint{32, 39} // 32: nackte Willkür var bx = box.New() func (x *Imp) imp(Y Object) *Imp { // y, ok := Y.(*Imp) if !ok { TypeNotEqPanic(x, Y) } return y } func New() *Imp { // x := new(Imp) x.fmt = Hostname x.fg, x.bg = col.ScreenF, col.ScreenB
import ( "murus/box" "murus/col" "murus/env" "murus/errh" "murus/files" "murus/kbd" "murus/ker" . "murus/obj" "murus/scr" "murus/str" ) const pack = "sel" var bx, mbx box.Box = box.New(), box.New() func select_(write WritingCol, n, h, w uint, i *uint, l, c uint, f, b col.Colour) { // if n == 0 { ker.Stop(pack, 1) } if n == 1 { *i = 0 return } if h == 0 { ker.Stop(pack, 2) } if h > n { h = n