コード例 #1
0
ファイル: imp.go プロジェクト: CaptainSoOmA/Uni
func New(o Object) *Imp {
	//
	x := new(Imp)
	switch o.(type) {
	case *enum.Imp:
		x.Object, x.typ = enum.New(enum.Enum(o.(*enum.Imp).Typ())), Enumerator
	case *tval.Imp:
		x.Object, x.typ = tval.New(), TruthValue
	case *char.Imp:
		x.Object, x.typ = char.New(), Character
	case *text.Imp:
		x.Object, x.typ = text.New(o.(*text.Imp).Len()), Text
	case *bnat.Imp:
		x.Object, x.typ = bnat.New(o.(*bnat.Imp).Startval()), Natural
	case *breal.Imp:
		x.Object, x.typ = breal.New(4), Real
	case *clk.Imp:
		x.Object, x.typ = clk.New(), Clocktime
	case *day.Imp:
		x.Object, x.typ = day.New(), Calendarday
	case *euro.Imp:
		x.Object, x.typ = euro.New(), Euro
	case *cntry.Imp:
		x.Object, x.typ = cntry.New(), Country
	case *pers.Imp:
		x.Object, x.typ = pers.New(), Person
	case *phone.Imp:
		x.Object, x.typ = phone.New(), PhoneNumber
	case *addr.Imp:
		x.Object, x.typ = addr.New(), Address
	default:
		ker.Panic("atom.New: parameter does not characterize an atom.Atomtype")
	}
	return x
}
コード例 #2
0
ファイル: imp.go プロジェクト: CaptainSoOmA/Uni
func New() *Imp {
	//
	x := new(Imp)
	x.person = pers.New()
	x.placeOfBirth = text.New(lenPlace)
	x.nationality = cntry.New()
	x.address = addr.New()
	x.legalGuardian = pers.New()
	x.legalGuardian.SetFormat(pers.LongT)
	x.addressLG = addr.New()
	x.langSeq = langs.New()
	x.religion = enum.New(enum.Religion)
	x.format = Short
	x.SetColours(col.LightCyan, col.Black)
	return x
}
コード例 #3
0
ファイル: imp.go プロジェクト: CaptainSoOmA/Uni
func New() *Imp {
	//
	x := new(Imp)
	x.Imp = mol.New()
	a := atom.New(pers.New())
	a.SetFormat(pers.LongTB)
	a.SetColours(col.Yellow, col.Black)
	x.Ins(a, 0, 0)
	a = atom.New(addr.New())
	a.SetColours(col.LightGreen, col.Black)
	x.Ins(a, 2, 0)
	return x
}
コード例 #4
0
ファイル: sel.go プロジェクト: CaptainSoOmA/Uni
func Selected(l, c uint) *Imp {
	//
	cF, cH := col.ScreenF, col.ScreenB
	col.Contrast(&cH)
	n := uint(0)
	z, s := scr.MousePos()
	x := new(Imp)
	sel.Select1(name, uint(NAtomtypes), M, &n, z, s, cF, cH)
	if n < uint(NAtomtypes) {
		x.typ = Atomtype(n)
	} else {
		return nil
	}
	switch x.typ {
	case Enumerator:
		e := enum.Title // TODO e per select-menue aussuchen
		x.Object = enum.New(e)
	case TruthValue:
		x.Object = tval.New()
	case Character:
		x.Object = char.New()
	case Text:
		n := uint(10) // TODO n editieren
		x.Object = text.New(n)
	case Natural:
		n := uint(10) // TODO n editieren
		x.Object = bnat.New(n)
	case Real:
		n := uint(6) // TODO n editieren
		x.Object = breal.New(n)
	case Clocktime:
		x.Object = clk.New()
	case Calendarday:
		x.Object = day.New()
	case Euro:
		x.Object = euro.New()
	case Country:
		x.Object = cntry.New()
	case Person:
		x.Object = pers.New()
	case PhoneNumber:
		x.Object = phone.New()
	case Address:
		x.Object = addr.New()
	}
	return New(x)
}