0.3.4 Added dialog for adding beads. /JL

This commit is contained in:
2022-12-21 00:36:16 +01:00
parent 39f280e10e
commit 3fa09049eb
3 changed files with 37 additions and 1 deletions
+25
View File
@@ -2,10 +2,35 @@ package main
import (
"log"
"strconv"
"github.com/lxn/walk"
)
func (mv *MyMainWindow) addBeads(name string, data Serie, id int, bg walk.Brush) error {
log.Println("Adding beads...")
dlg, err := walk.NewDialog(mv.MainWindow)
if err != nil {
return err
}
dlg.SetTitle("Add Beads")
dlg.SetLayout(walk.NewVBoxLayout())
dlg.SetSize(walk.Size{Width: 300, Height: 200})
dlg.SetMinMaxSize(walk.Size{Width: 300, Height: 200}, walk.Size{Width: 300, Height: 200})
dlg.SetX(mv.MainWindow.X() + 100)
dlg.SetY(mv.MainWindow.Y() + 100)
cmp, _ := walk.NewComposite(dlg)
cmp.SetLayout(walk.NewVBoxLayout())
cmp.Layout().SetMargins(walk.Margins{0, 0, 0, 0})
lbl, _ := walk.NewTextLabel(cmp)
lbl.SetText(name + " - " + strconv.Itoa(id))
lbl.SetAlignment(walk.AlignHCenterVCenter)
cmp.SetBackground(bg)
dlg.Show()
return nil
}
func (mw *MyMainWindow) openImage() error {
dlg := new(walk.FileDialog)