0.0.24 Added info image to colors. /JL
This commit is contained in:
@@ -12,6 +12,7 @@ type (
|
|||||||
Checkbox *walk.CheckBox
|
Checkbox *walk.CheckBox
|
||||||
backgroundColor walk.Brush
|
backgroundColor walk.Brush
|
||||||
tooltip walk.ToolTip
|
tooltip walk.ToolTip
|
||||||
|
info *walk.ImageView
|
||||||
warning *walk.ImageView
|
warning *walk.ImageView
|
||||||
Brand string
|
Brand string
|
||||||
Series string
|
Series string
|
||||||
@@ -48,6 +49,9 @@ func LoadBeads(mw *MyMainWindow) {
|
|||||||
bc.inStock = bead.InStock
|
bc.inStock = bead.InStock
|
||||||
bc.onHand = bead.OnHand
|
bc.onHand = bead.OnHand
|
||||||
mw.beads = append(mw.beads, bc)
|
mw.beads = append(mw.beads, bc)
|
||||||
|
if bead.OnHand <= 200 {
|
||||||
|
bc.warning.SetVisible(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -76,13 +80,18 @@ func NewBeadColor(mw *MyMainWindow, name string, id int, red byte, green byte, b
|
|||||||
log.Println("Setting checkbox name")
|
log.Println("Setting checkbox name")
|
||||||
color.Checkbox.SetText(name)
|
color.Checkbox.SetText(name)
|
||||||
log.Println("Checkbox name set")
|
log.Println("Checkbox name set")
|
||||||
|
walk.NewHSpacer(cm)
|
||||||
|
color.info, err = walk.NewImageView(cm)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("Error creating image view: ", err)
|
||||||
|
}
|
||||||
|
color.info.SetImage(walk.IconInformation())
|
||||||
color.warning, err = walk.NewImageView(cm)
|
color.warning, err = walk.NewImageView(cm)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("Error creating image view: ", err)
|
log.Println("Error creating image view: ", err)
|
||||||
}
|
}
|
||||||
color.warning.SetImage(walk.IconInformation())
|
color.warning.SetImage(walk.IconWarning())
|
||||||
color.warning.SetVisible(false)
|
color.warning.SetVisible(false)
|
||||||
walk.NewHSpacer(cm)
|
|
||||||
lbl, _ := walk.NewLabel(cm)
|
lbl, _ := walk.NewLabel(cm)
|
||||||
lbl.SetText(fmt.Sprint("Color ID: ", id))
|
lbl.SetText(fmt.Sprint("Color ID: ", id))
|
||||||
cm.SetBackground(color.backgroundColor)
|
cm.SetBackground(color.backgroundColor)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ type MyMainWindow struct {
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
AppName string = "BeadImager"
|
AppName string = "BeadImager"
|
||||||
Version string = "0.0.23"
|
Version string = "0.0.24"
|
||||||
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