示例#1
0
文件: imp.go 项目: CaptainSoOmA/Uni
func New() *Imp {
	//
	x := new(Imp)
	x.Imp = day.New()
	x.list = seq.New()
	return x
}
示例#2
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
}
示例#3
0
文件: main.go 项目: CaptainSoOmA/Uni
func main() {
	//
	cF, cB := col.Black, col.LightWhite
	col.ScreenF, col.ScreenB = cF, cB
	scr.Switch(scr.TXT)
	/*
	   if scr.Switchable (scr.WXGA) {
	     scr.Switch (scr.WXGA)
	     scr.SwitchFontsize (font.Huge)
	   } else if scr.Switchable (scr.WSVGA) {
	     scr.Switch (scr.WSVGA)
	     scr.SwitchFontsize (font.Big)
	   } else {
	     scr.Cls ()
	   }
	*/
	help = make([]string, 1)
	help[0] = "Bedienungsanleitung siehe Handbuch S. 18 - 23"
	actualDay = day.New()
	actualDay.Actualize()
	period = day.Yearly
	day.WeekdayF, day.WeekdayB = cF, cB
	day.HolidayB = cB
	day.WeekdayNameF, day.WeekdayNameB = col.Magenta, cB
	//  errh.DocAvail = true
	scr.MouseCursor(true)
	for !editiert() {
	}
	cal.Terminate()
	ker.Terminate()
}
示例#4
0
文件: imp.go 项目: CaptainSoOmA/Uni
func New () *Imp {
//
  x:= new (Imp)
  x.Imp = day.New ()
  x.Actualize ()
  return x
}
示例#5
0
文件: imp.go 项目: CaptainSoOmA/Uni
func New() *Imp {
	//
	x := new(Imp)
	d := day.New()
	x.file = pseq.New(d)
	x.dayset = set.New(d)
	return x
}
示例#6
0
文件: imp.go 项目: CaptainSoOmA/Uni
func New() *Imp {
	//
	x := new(Imp)
	x.surname = text.New(lenName)
	x.firstName = text.New(lenFirstName)
	x.fm = tval.New()
	x.fm.SetFormat("m", "w")
	x.bd = day.New()
	x.ti = enum.New(enum.Title)
	x.fmt = LongB
	return x
}
示例#7
0
文件: imp.go 项目: CaptainSoOmA/Uni
func Want(y, m, d uint) {
	//
	wanted := day.New()
	wanted.SetFormat(day.Yymmdd)
	if wanted.Set(d, m, 2000+y) {
		if v.Less(wanted) {
			errh.Error("Your murus "+v.String()+" is outdated. You need "+wanted.String()+".", 0)
			ker.Halt(-1)
		}
	} else {
		ker.Panic("parameters for v.Want are nonsense")
	}
}
示例#8
0
文件: imp.go 项目: CaptainSoOmA/Uni
func (R *Imp) programmErzeugen() {
	//
	programmdatei = pseq.New(byte(0))
	heute := day.New()
	heute.SetFormat(day.Dd)
	heute.Actualize()
	programmdatei.Name(env.User() + "-" + heute.String() + ".go") // TODO aktuelle Zeit ?
	programmdatei.Clr()
	scr.Cls()
	scr.Colours(col.Yellow, col.DarkBlue)
	prog("package main" + LF + LF + "import . \"murus/robo\"" + LF)
	prog("func main () {" + LF + "//")
	Robo.Trav(func(a obj.Any) { prog("  " + rob.Aktionstext[a.(rob.Aktion)] + "()") })
	prog("  Fertig()" + LF + "}")
	programmdatei.Terminate()
}
示例#9
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)
}
示例#10
0
文件: main.go 项目: CaptainSoOmA/Uni
func clearAll(D *day.Imp) {
	//
	switch period {
	case day.Monthly, day.Weekly:
		if D.Empty() {
			return
		}
	default:
		return
	}
	D1 := day.New()
	D1.Copy(D)
	D1.SetBeginning(period)
	cal.SetFormat(period)
	for D.Equiv(D1, period) {
		l, c := pos(D1)
		errh.Error("Tag Nr.", D1.OrdDay())
		cal.ClearDay(D1, l0+l, c0+c)
		D1.Inc(day.Daily)
	}
}
示例#11
0
文件: main.go 项目: CaptainSoOmA/Uni
func writeAll(D *day.Imp) {
	//
	switch period {
	case day.Monthly, day.Weekly:
		if D.Empty() {
			return
		}
	default:
		return
	}
	D1 := day.New()
	D1.Copy(D)
	D1.SetBeginning(period)
	cal.SetFormat(period)
	for D.Equiv(D1, period) {
		l, c := pos(D1)
		cal.Seek(D1)
		cal.SetFormat(period) // weil Seek über Define <- Clone das Format mitkopiert
		cal.WriteDay(l0+l, c0+c)
		D1.Inc(day.Daily)
	}
}
示例#12
0
文件: imp.go 项目: CaptainSoOmA/Uni
package fuday

// (c) Christian Maurer   v. 130309 - license see murus.go

import (
  "murus/nat"; "murus/day"
)
type
  Imp struct {
             *day.Imp
             }
var (
  tmp, tmp1, tmp2 *day.Imp = day.New(), day.New(), day.New()
)


func New () *Imp {
//
  x:= new (Imp)
  x.Imp = day.New ()
  x.Actualize ()
  return x
}


func (x *Imp) set (d *day.Imp) {
//
  x.Imp.Copy (d)
}

示例#13
0
文件: imp.go 项目: CaptainSoOmA/Uni
func init() { var _ Atom = New(day.New()) }
示例#14
0
文件: imp.go 项目: CaptainSoOmA/Uni
func New() *Imp {
	//
	return &Imp{day.New(), clk.New()}
}
示例#15
0
文件: imp.go 项目: CaptainSoOmA/Uni
// (c) Christian Maurer - license see murus.go

import (
	"murus/col"
	"murus/day"
	"murus/errh"
	"murus/ker"
)

const ( // v.
	yy = 13
	mm = 5
	dd = 27
)

var v *day.Imp = day.New()

func Colours() (col.Colour, col.Colour, col.Colour) {
	//
	return col.Yellow, col.LightYellow, col.DarkGreen
	return col.MurusF, col.Colour3(0, 16, 128), col.MurusB
}

func String() string {
	//
	return v.String()
}

func Want(y, m, d uint) {
	//
	wanted := day.New()
示例#16
0
文件: imp.go 项目: CaptainSoOmA/Uni
	"murus/day"
	"murus/errh"
	"murus/kbd"
	"murus/ker"
	. "murus/obj"
	"murus/piset"
	"murus/termin/page"
	"murus/termin/word"
)

const pack = "cal"

var (
	content    *piset.Imp
	globalPage *page.Imp = page.New()
	globalDay  *day.Imp  = day.New()
)

func SetFormat(p day.Period) {
	//
	globalPage.SetFormat(p)
}

func Seek(d *day.Imp) {
	//
	globalPage.Set(d)
	if content.Ex(globalPage) { // richtige Seite gefunden
		globalPage = content.Get().(*page.Imp)
	} else {
		globalPage.Clr()
	}
示例#17
0
文件: main.go 项目: CaptainSoOmA/Uni
func editiert() bool {
	//
	scr.Cls()
	l0, c0 = 0, 0
	dc = 0
	switch period {
	case day.Decadic:
		actualDay.SetFormat(day.Yyyy)
		actualDay.SetColours(day.YearnumberF, day.YearnumberB)
	case day.Yearly:

	case day.HalfYearly, day.Quarterly:
		ker.Stop("termin.main", 1)
	case day.Monthly:
		l0, c0 = 3, 5
		dc = 12 // 11 dayattr + 1
		actualDay.SetAttribute(setWeekdayColours)
		actualDay.SetFormat(day.Wd)
		actualDay.WriteWeek(true, 3, l0, 2)
		actualDay.WriteWeek(true, 3, l0, 2+6*dc+3)
	case day.Weekly:
		l0, c0 = 2, 2
		dc = 11 // 7 x 11 == 77 < 80
		actualDay.SetAttribute(setWeekdayColours)
		actualDay.SetFormat(day.Wd)
		actualDay.WriteWeek(false, dc, l0, c0)
	case day.Daily:
		cal.Edit(actualDay, l0, c0)
	}
	switch period {
	case day.Weekly, day.Monthly, day.Quarterly, day.Yearly:
		dayattr.WriteActual(l1, c1)
	}
	var startDate = day.New()
	var Original = day.New()
loop:
	for {
		switch period {
		case day.Yearly:
			actualDay.SetFormat(day.Dd)
		case day.Quarterly, day.HalfYearly:
			errh.Error("nicht erreichbarer Punkt", 3)
		case day.Weekly, day.Monthly:
			actualDay.SetFormat(day.Dd_mm_)
		}
		if !actualDay.Equiv(startDate, period) {
			//      clearAll (startDate) // alte Zusatzinformationen löschen
			startDate.Copy(actualDay)
			switch period {
			case day.Yearly:
				dayattr.WriteActual(l1, c1)
				actualDay.SetFormat(day.Dd)
			case day.Monthly, day.Weekly:
				if period == day.Monthly {
					actualDay.SetColours(day.MonthF, day.MonthB)
				} else {
					actualDay.SetColours(day.WeekdayNameF, day.WeekdayNameB)
				}
				actualDay.SetFormat(day.Yyyy)
				actualDay.SetColours(day.YearnumberF, day.YearnumberB)
				actualDay.Write(0, 0)
				actualDay.Write(0, 80-4)
				if period == day.Monthly {
					actualDay.SetFormat(day.M)
				} else {
					actualDay.SetFormat(day.WN)
				}
				actualDay.SetColours(day.MonthF, day.MonthB)
				actualDay.Write(0, 30)
				actualDay.SetFormat(day.Dd_mm_)
			}
			actualDay.SetAttribute(dayattr.Attrib)
			write()
			writeAll(actualDay)
		}
		l, c := pos(actualDay)
		dayattr.Attrib(actualDay)
		Original.Copy(actualDay)
		switch period {
		case day.Daily:

		case day.Weekly:
			actualDay.Edit(l0+l, c0+c+3)
		case day.Monthly, day.Quarterly, day.HalfYearly, day.Yearly:
			actualDay.Edit(l0+l, c0+c)
		case day.Decadic:
			actualDay.Edit(0, 0)
		}
		if actualDay.Empty() {
			actualDay.Copy(Original)
		}
		var d uint
		C := kbd.LastCommand(&d)
		//    actualDay.Write (l0 + l, c0 + c)
		switch C {
		case kbd.Enter:
			for {
				if period == day.Daily {
					return false
				} else {
					period--
					if period == day.HalfYearly {
						period--
					}
					if period == day.Quarterly {
						period--
					}
				}
				if d == 0 {
					return false
				} else {
					d--
				}
			}
		case kbd.Esc, kbd.Back:
			for {
				if period == day.Decadic {
					break loop
				} else {
					period++
					if period == day.Quarterly {
						period++
					}
					if period == day.HalfYearly {
						period++
					}
				}
				if d == 0 {
					return false
				} else {
					d--
				}
			}
		case kbd.Tab:
			dayattr.Change(d == 0)
			write()
			dayattr.WriteActual(l1, c1)
			C = kbd.Enter // see above
		case kbd.Help:
			errh.WriteHelp(help)
		case kbd.LookFor:
			dayattr.Normalize()
			dayattr.WriteActual(l1, c1)
			cal.EditWord(l1, c1+1+8)
			dayattr.Clr()
			cal.LookFor(func(a Any) { dayattr.Actualize(a.(*day.Imp), true) })
			write()
			if period == day.Weekly {
				writeAll(actualDay)
			}
			C = kbd.Enter // so "actualDay" is not influenced
		case kbd.Mark, kbd.Demark:
			dayattr.Actualize(actualDay, C == kbd.Mark)
			dayattr.Attrib(actualDay)
			actualDay.Write(l0+l, c0+c)
			C = kbd.Down
		case kbd.PrintScr: // TODO Zusatzinformationen
			switch period {
			case day.Yearly:
				actualDay.PrintYear(0, 0)
				prt.GoPrint()
				/*
				   case day.Monthly:
				     actualDay.PrintMonth (true, 1, 3, dc, l0, c0)
				     prt.Printout()
				   case day.Daily:
				     cal.Print (0, 0)
				     prt.Printout()
				*/
			}
			/*  case kbd.Here: // , kbd.There, kbd.This:
			      switch period { case day.Yearly:
			        // day.mitMausImJahrAendern (actualDay)
			      case day.Monthly:
			        l0 = 3, c0 = 5; dc = 12
			//        day.mitMausImMonatAendern (actualDay, true, 1, 3, dc, l0, c0)
			      case day.Weekly:
			        l0 = 2, c0 = 2; dc = 11
			//        day.mitMausInWocheAendern (actualDay, false, dc, l0, c0)
			      } */
		default:
			if period == day.Decadic {
				if d == 0 {
					d = 3
				} else {
					d = 5
				}
			}
		}
		switch C {
		case kbd.Here, kbd.There, kbd.This:
			if period == day.Yearly {
				switch C {
				case kbd.Here:
					period = day.Monthly
				case kbd.There:
					period = day.Weekly
				case kbd.This:
					period = day.Daily
				}
				C = kbd.Enter
				return false
			}
		default:
			actualDay.Change(C, d)
		}
	}
	return true
}