0.3.5 Working on add beads dialog. /JL
This commit is contained in:
38
dialog.go
38
dialog.go
@@ -20,12 +20,46 @@ func (mv *MyMainWindow) addBeads(name string, data Serie, id int, bg walk.Brush)
|
||||
dlg.SetX(mv.MainWindow.X() + 100)
|
||||
dlg.SetY(mv.MainWindow.Y() + 100)
|
||||
cmp, _ := walk.NewComposite(dlg)
|
||||
cmp.SetLayout(walk.NewVBoxLayout())
|
||||
cmp.SetLayout(walk.NewHBoxLayout())
|
||||
cmp.Layout().SetMargins(walk.Margins{0, 0, 0, 0})
|
||||
cmp.SetAlignment(walk.AlignHCenterVCenter)
|
||||
lbl, _ := walk.NewTextLabel(cmp)
|
||||
lbl.SetText(name + " - " + strconv.Itoa(id))
|
||||
lbl.SetAlignment(walk.AlignHCenterVCenter)
|
||||
cmp.SetBackground(bg)
|
||||
gr, _ := walk.NewGroupBox(dlg)
|
||||
gr.SetTitle("Beads")
|
||||
fm, _ := walk.NewComposite(gr)
|
||||
fm.SetLayout(walk.NewVBoxLayout())
|
||||
fm.Layout().SetMargins(walk.Margins{0, 0, 0, 0})
|
||||
br, _ := walk.NewSolidColorBrush(walk.RGB(255, 255, 255))
|
||||
fm.SetBackground(br)
|
||||
bgr, _ := walk.NewComposite(fm)
|
||||
bgr.SetLayout(walk.NewHBoxLayout())
|
||||
lbl, _ = walk.NewTextLabel(bgr)
|
||||
lbl.SetText("Grams:")
|
||||
lbl.SetAlignment(walk.AlignHCenterVNear)
|
||||
walk.NewHSpacer(bgr)
|
||||
le, _ := walk.NewNumberEdit(bgr)
|
||||
le.SetDecimals(0)
|
||||
le.SetRange(0, 1000)
|
||||
bnr, _ := walk.NewComposite(fm)
|
||||
bnr.SetLayout(walk.NewHBoxLayout())
|
||||
lbl, _ = walk.NewTextLabel(bgr)
|
||||
lbl.SetText("Number:")
|
||||
lbl.SetAlignment(walk.AlignHCenterVNear)
|
||||
walk.NewHSpacer(bnr)
|
||||
ne, _ := walk.NewNumberEdit(bnr)
|
||||
ne.SetDecimals(0)
|
||||
ne.SetRange(0, 100000)
|
||||
bc, _ := walk.NewComposite(dlg)
|
||||
bc.SetLayout(walk.NewHBoxLayout())
|
||||
ab, _ := walk.NewPushButton(bc)
|
||||
ab.SetText("Add")
|
||||
dlg.SetDefaultButton(ab)
|
||||
walk.NewHSpacer(bc)
|
||||
cb, _ := walk.NewPushButton(bc)
|
||||
cb.SetText("Cancel")
|
||||
dlg.SetCancelButton(cb)
|
||||
|
||||
dlg.Show()
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user