示例#1
0
文件: fm.go 项目: toophy/vu
// simpleLayout creates a 2x2 form with 10 pixel gaps.
func (fm *fmtag) simpleLayout(eng vu.Eng, ww, wh int) *layout {
	lo := &layout{}
	plan := []string{
		"ab",
		"cd",
	}
	lo.form = form.New(plan, ww, wh, "gap 5 5", "pad 5 5 5 5")
	lo.visualize(eng)
	return lo
}
示例#2
0
文件: fm.go 项目: toophy/vu
// grabLayout creates a form where the base size dictates the max size
// that non-grabby rows and columns will grow to.
func (fm *fmtag) grabLayout(eng vu.Eng) *layout {
	lo := &layout{}
	plan := []string{
		"abc",
		"def",
		"ghi",
	}
	lo.form = form.New(plan, 200, 200, "grabx 1", "graby 1", "gap 5 5", "pad 5 5 5 5")
	lo.visualize(eng)
	return lo
}
示例#3
0
文件: fm.go 项目: toophy/vu
// doubleLayout creates a form within a form to create a more complex layout.
func (fm *fmtag) doubleLayout(eng vu.Eng) *layout {
	lo := &layout{}
	plan := []string{
		"abc",
		"def",
		"ghi",
	}
	lo.form = form.New(plan, 200, 200, "grabx 1", "graby 1", "gap 5 5", "pad 5 5 5 5")
	lo.visualize(eng)
	lo.lo = fm.interiorLayout(eng, lo.form.Section("e"))
	return lo
}
示例#4
0
文件: fm.go 项目: toophy/vu
// interior layout is part of doubleLayout.
// It creates a second form inside the middle section of the first form.
func (fm *fmtag) interiorLayout(eng vu.Eng, s form.Section) *layout {
	lo := &layout{}
	w, h := s.Size()
	iw, ih := int(lin.Round(w, 0)), int(lin.Round(h, 0))
	plan := []string{
		"pqr",
		"pqr",
		"stu",
	}
	lo.form = form.New(plan, iw, ih, "gap 5 5")
	lo.visualize(eng)
	return lo
}
示例#5
0
文件: fm.go 项目: toophy/vu
// largeLayout creates a form with multiple spanning sections and
// a single spanning section.
func (fm *fmtag) largeLayout(eng vu.Eng, ww, wh int) *layout {
	lo := &layout{}
	plan := []string{
		"aabbbccd",
		"exxfyyyg",
		"exxhyyyg",
		"ixxhyyyg",
		"jklhmmnn",
	}
	lo.form = form.New(plan, ww, wh, "gap 5 5", "grabx 0", "graby 0", "pad 5 5 5 5")
	lo.visualize(eng)
	return lo
}