Пример #1
0
func txEdRun(c *cmdapp.Command, args []string) {
	cmd = c
	openLocal(c)
	title := fmt.Sprintf("%s: please wait", c.Name)
	m := widget.NewMainWindow("main", title)
	geo := m.Property(sparta.Geometry).(image.Rectangle)
	widget.NewButton(m, "upTax", "up", image.Rect(5, 5, 5+(sparta.WidthUnit*10), 5+(3*sparta.HeightUnit/2)))
	widget.NewButton(m, "val", "validate", image.Rect(10+(sparta.WidthUnit*10), 5, 10+(sparta.WidthUnit*20), 5+(3*sparta.HeightUnit/2)))
	widget.NewButton(m, "upVal", "up", image.Rect(270, 5, 270+(sparta.WidthUnit*10), 5+(3*sparta.HeightUnit/2)))
	widget.NewButton(m, "syn", "syn ->", image.Rect(205, 10+(3*sparta.HeightUnit/2), 205+(sparta.WidthUnit*10), 10+(6*sparta.HeightUnit/2)))
	widget.NewButton(m, "move", "move ->", image.Rect(205, 15+(6*sparta.HeightUnit/2), 205+(sparta.WidthUnit*10), 15+(9*sparta.HeightUnit/2)))

	l := widget.NewList(m, "taxonList", image.Rect(5, 10+(3*sparta.HeightUnit/2), 200, geo.Dy()-10))
	wnd["taxonList"] = l

	s := widget.NewList(m, "validList", image.Rect(210+(sparta.WidthUnit*10), 10+(3*sparta.HeightUnit/2), 405+(sparta.WidthUnit*10), geo.Dy()-10))
	wnd["validList"] = s

	m.Capture(sparta.Configure, txEdConf)
	m.Capture(sparta.Command, txEdComm)
	sparta.Block(nil)

	go func() {
		txEdInitList(m, l, nil, 0, true)
		txEdInitList(m, s, nil, 0, false)
		txEdSetCaption(m)
		sparta.Unblock(nil)
	}()

	sparta.Run()
}
Пример #2
0
func spNavRun(c *cmdapp.Command, args []string) {
	cmd = c
	var db jdh.DB
	openLocal(c)
	db = localDB

	title := fmt.Sprintf("%s: please wait", c.Name)
	m := widget.NewMainWindow("main", title)
	geo := m.Property(sparta.Geometry).(image.Rectangle)
	widget.NewButton(m, "upTax", "up", image.Rect(5, 5, 5+(sparta.WidthUnit*10), 5+(3*sparta.HeightUnit/2)))

	dy := geo.Dy() - 10 - (10 + (3 * sparta.HeightUnit / 2))

	l := widget.NewList(m, "taxonList", image.Rect(5, 10+(3*sparta.HeightUnit/2), 200, (dy/2)+10+(3*sparta.HeightUnit/2)))
	wnd["taxonList"] = l

	s := widget.NewList(m, "speList", image.Rect(210, 10+(3*sparta.HeightUnit/2), 410, (dy/2)+10+(3*sparta.HeightUnit/2)))
	wnd["speList"] = s

	tx := widget.NewCanvas(m, "info", image.Rect(5, (dy/2)+20+(3*sparta.HeightUnit/2), geo.Dx()-10, geo.Dy()-10))
	tx.SetProperty(sparta.Border, true)
	tx.Capture(sparta.Expose, spNavInfoExpose)
	wnd["info"] = tx

	m.Capture(sparta.Configure, spNavConf)
	m.Capture(sparta.Command, spNavComm)
	sparta.Block(nil)

	go func() {
		spNavInitTaxList(m, l, db, nil, 0)
		sparta.Unblock(nil)
	}()

	sparta.Run()
}
Пример #3
0
func txNavRun(c *cmdapp.Command, args []string) {
	cmd = c
	var db jdh.DB
	if len(extDBFlag) != 0 {
		openExt(c, extDBFlag, "")
		db = extDB
	} else {
		openLocal(c)
		db = localDB
	}

	title := fmt.Sprintf("%s: please wait", c.Name)
	m := widget.NewMainWindow("main", title)
	geo := m.Property(sparta.Geometry).(image.Rectangle)
	widget.NewButton(m, "upTax", "up", image.Rect(5, 5, 5+(sparta.WidthUnit*10), 5+(3*sparta.HeightUnit/2)))
	tx := widget.NewCanvas(m, "info", image.Rect(210, 10+(3*sparta.HeightUnit/2), geo.Dx()-10, geo.Dy()-10))
	tx.SetProperty(sparta.Border, true)
	tx.Capture(sparta.Expose, txNavInfoExpose)
	wnd["info"] = tx
	l := widget.NewList(m, "taxonList", image.Rect(5, 10+(3*sparta.HeightUnit/2), 200, geo.Dy()-10))
	wnd["taxonList"] = l

	m.Capture(sparta.Configure, txNavConf)
	m.Capture(sparta.Command, txNavComm)
	sparta.Block(nil)
	go txNavInitList(m, l, db, nil, 0)

	sparta.Run()
}