0.2.5 Beads onhand updating working. /JL
This commit is contained in:
19
color.go
19
color.go
@@ -40,6 +40,15 @@ func ShowBeads(mw *MyMainWindow, serie string) {
|
|||||||
for _, s := range bead.Series {
|
for _, s := range bead.Series {
|
||||||
if s.Name == serie {
|
if s.Name == serie {
|
||||||
bead.Color.SetVisible(true)
|
bead.Color.SetVisible(true)
|
||||||
|
bead.InfoTooltip.SetText(bead.info, "Approx. "+fmt.Sprint(s.onHand)+" left on hand")
|
||||||
|
bead.WarningTooltip.SetText(bead.warning, "Only "+fmt.Sprint(s.onHand)+" left on hand")
|
||||||
|
if s.onHand <= 200 {
|
||||||
|
bead.warning.SetVisible(true)
|
||||||
|
bead.info.SetVisible(false)
|
||||||
|
} else {
|
||||||
|
bead.warning.SetVisible(false)
|
||||||
|
bead.info.SetVisible(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,6 +68,7 @@ func CreateBeadsGroup(mw *MyMainWindow) {
|
|||||||
mw.colors, _ = walk.NewScrollView(gb)
|
mw.colors, _ = walk.NewScrollView(gb)
|
||||||
mw.colors.SetLayout(walk.NewVBoxLayout())
|
mw.colors.SetLayout(walk.NewVBoxLayout())
|
||||||
LoadBeads(mw)
|
LoadBeads(mw)
|
||||||
|
ShowBeads(mw, mw.serie_combo.Text())
|
||||||
}
|
}
|
||||||
|
|
||||||
func LoadBeads(mw *MyMainWindow) {
|
func LoadBeads(mw *MyMainWindow) {
|
||||||
@@ -76,15 +86,6 @@ func LoadBeads(mw *MyMainWindow) {
|
|||||||
se.inStock = s.InStock
|
se.inStock = s.InStock
|
||||||
se.onHand = s.OnHand
|
se.onHand = s.OnHand
|
||||||
bc.Series = append(bc.Series, se)
|
bc.Series = append(bc.Series, se)
|
||||||
bc.InfoTooltip.SetText(bc.info, "Approx. "+fmt.Sprint(se.onHand)+" left on hand")
|
|
||||||
bc.WarningTooltip.SetText(bc.warning, "Only "+fmt.Sprint(se.onHand)+" left on hand")
|
|
||||||
if se.onHand <= 200 {
|
|
||||||
bc.warning.SetVisible(true)
|
|
||||||
bc.info.SetVisible(false)
|
|
||||||
} else {
|
|
||||||
bc.warning.SetVisible(false)
|
|
||||||
bc.info.SetVisible(true)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
bc.Brand = brand.BrandName
|
bc.Brand = brand.BrandName
|
||||||
bc.Name = bead.ColorName
|
bc.Name = bead.ColorName
|
||||||
|
2
main.go
2
main.go
@@ -30,7 +30,7 @@ type MyMainWindow struct {
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
AppName string = "BeadImager"
|
AppName string = "BeadImager"
|
||||||
Version string = "0.2.4"
|
Version string = "0.2.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"
|
||||||
|
16
pallette.go
16
pallette.go
@@ -35,13 +35,8 @@ type (
|
|||||||
|
|
||||||
Colorstruct struct {
|
Colorstruct struct {
|
||||||
Series struct {
|
Series struct {
|
||||||
XMLName xml.Name `xml:"series"`
|
XMLName xml.Name `xml:"series"`
|
||||||
Serie []struct {
|
Serie []SerieData `xml:"serie"`
|
||||||
XMLName xml.Name `xml:"serie"`
|
|
||||||
Name string `xml:"name,attr"`
|
|
||||||
InStock bool `xml:"inStock"`
|
|
||||||
OnHand int `xml:"onHand"`
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ColorIndex int `xml:"colorIndex,attr"`
|
ColorIndex int `xml:"colorIndex,attr"`
|
||||||
ColorName string `xml:"colorname"`
|
ColorName string `xml:"colorname"`
|
||||||
@@ -57,6 +52,13 @@ type (
|
|||||||
Disabled bool `xml:"disabled"`
|
Disabled bool `xml:"disabled"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SerieData struct {
|
||||||
|
XMLName xml.Name `xml:"serie"`
|
||||||
|
Name string `xml:"name,attr"`
|
||||||
|
InStock bool `xml:"inStock"`
|
||||||
|
OnHand int `xml:"onHand"`
|
||||||
|
}
|
||||||
|
|
||||||
Pegboards struct {
|
Pegboards struct {
|
||||||
Boards []Pegboard
|
Boards []Pegboard
|
||||||
}
|
}
|
||||||
|
@@ -33,6 +33,10 @@
|
|||||||
<type>Square 14x14</type>
|
<type>Square 14x14</type>
|
||||||
<size>14</size>
|
<size>14</size>
|
||||||
</pegboard>
|
</pegboard>
|
||||||
|
<pegboard serie="Midi">
|
||||||
|
<type>Round 29</type>
|
||||||
|
<size>29</size>
|
||||||
|
</pegboard>
|
||||||
<pegboard serie="Maxi">
|
<pegboard serie="Maxi">
|
||||||
<type>Square 16x16</type>
|
<type>Square 16x16</type>
|
||||||
<size>16</size>
|
<size>16</size>
|
||||||
@@ -1094,7 +1098,7 @@
|
|||||||
</serie>
|
</serie>
|
||||||
<serie name="Midi">
|
<serie name="Midi">
|
||||||
<inStock>true</inStock>
|
<inStock>true</inStock>
|
||||||
<onHand>100</onHand>
|
<onHand>500</onHand>
|
||||||
</serie>
|
</serie>
|
||||||
<serie name="Maxi">
|
<serie name="Maxi">
|
||||||
<inStock>true</inStock>
|
<inStock>true</inStock>
|
||||||
@@ -1121,7 +1125,7 @@
|
|||||||
</serie>
|
</serie>
|
||||||
<serie name="Midi">
|
<serie name="Midi">
|
||||||
<inStock>true</inStock>
|
<inStock>true</inStock>
|
||||||
<onHand>100</onHand>
|
<onHand>500</onHand>
|
||||||
</serie>
|
</serie>
|
||||||
<serie name="Maxi">
|
<serie name="Maxi">
|
||||||
<inStock>true</inStock>
|
<inStock>true</inStock>
|
||||||
@@ -1148,7 +1152,7 @@
|
|||||||
</serie>
|
</serie>
|
||||||
<serie name="Midi">
|
<serie name="Midi">
|
||||||
<inStock>true</inStock>
|
<inStock>true</inStock>
|
||||||
<onHand>100</onHand>
|
<onHand>500</onHand>
|
||||||
</serie>
|
</serie>
|
||||||
<serie name="Maxi">
|
<serie name="Maxi">
|
||||||
<inStock>true</inStock>
|
<inStock>true</inStock>
|
||||||
|
Reference in New Issue
Block a user