0.3.5 Working on add beads dialog. /JL

This commit is contained in:
2022-12-21 10:40:10 +01:00
parent 3fa09049eb
commit 9481032fed
2 changed files with 37 additions and 3 deletions

View File

@@ -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

View File

@@ -30,7 +30,7 @@ type MyMainWindow struct {
const (
AppName string = "BeadImager"
Version string = "0.3.4"
Version string = "0.3.5"
CopyRight string = "©2022 Jan Lerking"
STD_MESS string = "Ready"
LogFile string = "BeadImager.log"