0.3.5 Working on add beads dialog. /JL
This commit is contained in:
@@ -20,12 +20,46 @@ func (mv *MyMainWindow) addBeads(name string, data Serie, id int, bg walk.Brush)
|
|||||||
dlg.SetX(mv.MainWindow.X() + 100)
|
dlg.SetX(mv.MainWindow.X() + 100)
|
||||||
dlg.SetY(mv.MainWindow.Y() + 100)
|
dlg.SetY(mv.MainWindow.Y() + 100)
|
||||||
cmp, _ := walk.NewComposite(dlg)
|
cmp, _ := walk.NewComposite(dlg)
|
||||||
cmp.SetLayout(walk.NewVBoxLayout())
|
cmp.SetLayout(walk.NewHBoxLayout())
|
||||||
cmp.Layout().SetMargins(walk.Margins{0, 0, 0, 0})
|
cmp.Layout().SetMargins(walk.Margins{0, 0, 0, 0})
|
||||||
|
cmp.SetAlignment(walk.AlignHCenterVCenter)
|
||||||
lbl, _ := walk.NewTextLabel(cmp)
|
lbl, _ := walk.NewTextLabel(cmp)
|
||||||
lbl.SetText(name + " - " + strconv.Itoa(id))
|
lbl.SetText(name + " - " + strconv.Itoa(id))
|
||||||
lbl.SetAlignment(walk.AlignHCenterVCenter)
|
|
||||||
cmp.SetBackground(bg)
|
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()
|
dlg.Show()
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ type MyMainWindow struct {
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
AppName string = "BeadImager"
|
AppName string = "BeadImager"
|
||||||
Version string = "0.3.4"
|
Version string = "0.3.5"
|
||||||
CopyRight string = "©2022 Jan Lerking"
|
CopyRight string = "©2022 Jan Lerking"
|
||||||
STD_MESS string = "Ready"
|
STD_MESS string = "Ready"
|
||||||
LogFile string = "BeadImager.log"
|
LogFile string = "BeadImager.log"
|
||||||
|
|||||||
Reference in New Issue
Block a user