当前位置: 首页>>代码示例>>Golang>>正文


Golang box.New函数代码示例

本文整理汇总了Golang中murus/box.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了New函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: init

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])
	}
}
开发者ID:CaptainSoOmA,项目名称:Uni,代码行数:16,代码来源:imp.go

示例2: defined

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)
}
开发者ID:CaptainSoOmA,项目名称:Uni,代码行数:16,代码来源:main.go

示例3: init

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)
}
开发者ID:CaptainSoOmA,项目名称:Uni,代码行数:40,代码来源:imp.go

示例4: April1st

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()
}
开发者ID:CaptainSoOmA,项目名称:Uni,代码行数:36,代码来源:april.go

示例5: imp

	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)
开发者ID:CaptainSoOmA,项目名称:Uni,代码行数:31,代码来源:imp.go

示例6: impc

	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)
开发者ID:CaptainSoOmA,项目名称:Uni,代码行数:31,代码来源:imp.go

示例7: New

	"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 {
	//
开发者ID:CaptainSoOmA,项目名称:Uni,代码行数:31,代码来源:imp.go

示例8: main

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)
//.........这里部分代码省略.........
开发者ID:CaptainSoOmA,项目名称:Uni,代码行数:101,代码来源:main.go

示例9: wait

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
开发者ID:CaptainSoOmA,项目名称:Uni,代码行数:31,代码来源:imp.go

示例10: imp

	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 {
	//
开发者ID:CaptainSoOmA,项目名称:Uni,代码行数:31,代码来源:imp.go

示例11: select_

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
开发者ID:CaptainSoOmA,项目名称:Uni,代码行数:31,代码来源:imp.go


注:本文中的murus/box.New函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。