summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/controlgallery.go222
-rw-r--r--examples/drawtext.go167
-rw-r--r--examples/histogram.go253
-rw-r--r--examples/table.go450
4 files changed, 1092 insertions, 0 deletions
diff --git a/examples/controlgallery.go b/examples/controlgallery.go
new file mode 100644
index 0000000..d77bebe
--- /dev/null
+++ b/examples/controlgallery.go
@@ -0,0 +1,222 @@
+// 12 august 2018
+
+// +build OMIT
+
+package main
+
+import (
+ "github.com/andlabs/ui"
+)
+
+var mainwin *ui.Window
+
+func makeBasicControlsPage() ui.Control {
+ vbox := ui.NewVerticalBox()
+ vbox.SetPadded(true)
+
+ hbox := ui.NewHorizontalBox()
+ hbox.SetPadded(true)
+ vbox.Append(hbox, false)
+
+ hbox.Append(ui.NewButton("Button"), false)
+ hbox.Append(ui.NewCheckbox("Checkbox"), false)
+
+ vbox.Append(ui.NewLabel("This is a label. Right now, labels can only span one line."), false)
+
+ vbox.Append(ui.NewHorizontalSeparator(), false)
+
+ group := ui.NewGroup("Entries")
+ group.SetMargined(true)
+ vbox.Append(group, true)
+
+group.SetChild(ui.NewNonWrappingMultilineEntry())
+
+ entryForm := ui.NewForm()
+ entryForm.SetPadded(true)
+ group.SetChild(entryForm)
+
+ entryForm.Append("Entry", ui.NewEntry(), false)
+ entryForm.Append("Password Entry", ui.NewPasswordEntry(), false)
+ entryForm.Append("Search Entry", ui.NewSearchEntry(), false)
+ entryForm.Append("Multiline Entry", ui.NewMultilineEntry(), true)
+ entryForm.Append("Multiline Entry No Wrap", ui.NewNonWrappingMultilineEntry(), true)
+
+ return vbox
+}
+
+func makeNumbersPage() ui.Control {
+ hbox := ui.NewHorizontalBox()
+ hbox.SetPadded(true)
+
+ group := ui.NewGroup("Numbers")
+ group.SetMargined(true)
+ hbox.Append(group, true)
+
+ vbox := ui.NewVerticalBox()
+ vbox.SetPadded(true)
+ group.SetChild(vbox)
+
+ spinbox := ui.NewSpinbox(0, 100)
+ slider := ui.NewSlider(0, 100)
+ pbar := ui.NewProgressBar()
+ spinbox.OnChanged(func(*ui.Spinbox) {
+ slider.SetValue(spinbox.Value())
+ pbar.SetValue(spinbox.Value())
+ })
+ slider.OnChanged(func(*ui.Slider) {
+ spinbox.SetValue(slider.Value())
+ pbar.SetValue(slider.Value())
+ })
+ vbox.Append(spinbox, false)
+ vbox.Append(slider, false)
+ vbox.Append(pbar, false)
+
+ ip := ui.NewProgressBar()
+ ip.SetValue(-1)
+ vbox.Append(ip, false)
+
+ group = ui.NewGroup("Lists")
+ group.SetMargined(true)
+ hbox.Append(group, true)
+
+ vbox = ui.NewVerticalBox()
+ vbox.SetPadded(true)
+ group.SetChild(vbox)
+
+ cbox := ui.NewCombobox()
+ cbox.Append("Combobox Item 1")
+ cbox.Append("Combobox Item 2")
+ cbox.Append("Combobox Item 3")
+ vbox.Append(cbox, false)
+
+ ecbox := ui.NewEditableCombobox()
+ ecbox.Append("Editable Item 1")
+ ecbox.Append("Editable Item 2")
+ ecbox.Append("Editable Item 3")
+ vbox.Append(ecbox, false)
+
+ rb := ui.NewRadioButtons()
+ rb.Append("Radio Button 1")
+ rb.Append("Radio Button 2")
+ rb.Append("Radio Button 3")
+ vbox.Append(rb, false)
+
+ return hbox
+}
+
+func makeDataChoosersPage() ui.Control {
+ hbox := ui.NewHorizontalBox()
+ hbox.SetPadded(true)
+
+ vbox := ui.NewVerticalBox()
+ vbox.SetPadded(true)
+ hbox.Append(vbox, false)
+
+ vbox.Append(ui.NewDatePicker(), false)
+ vbox.Append(ui.NewTimePicker(), false)
+ vbox.Append(ui.NewDateTimePicker(), false)
+ vbox.Append(ui.NewFontButton(), false)
+ vbox.Append(ui.NewColorButton(), false)
+
+ hbox.Append(ui.NewVerticalSeparator(), false)
+
+ vbox = ui.NewVerticalBox()
+ vbox.SetPadded(true)
+ hbox.Append(vbox, true)
+
+ grid := ui.NewGrid()
+ grid.SetPadded(true)
+ vbox.Append(grid, false)
+
+ button := ui.NewButton("Open File")
+ entry := ui.NewEntry()
+ entry.SetReadOnly(true)
+ button.OnClicked(func(*ui.Button) {
+ filename := ui.OpenFile(mainwin)
+ if filename == "" {
+ filename = "(cancelled)"
+ }
+ entry.SetText(filename)
+ })
+ grid.Append(button,
+ 0, 0, 1, 1,
+ false, ui.AlignFill, false, ui.AlignFill)
+ grid.Append(entry,
+ 1, 0, 1, 1,
+ true, ui.AlignFill, false, ui.AlignFill)
+
+ button = ui.NewButton("Save File")
+ entry2 := ui.NewEntry()
+ entry2.SetReadOnly(true)
+ button.OnClicked(func(*ui.Button) {
+ filename := ui.SaveFile(mainwin)
+ if filename == "" {
+ filename = "(cancelled)"
+ }
+ entry2.SetText(filename)
+ })
+ grid.Append(button,
+ 0, 1, 1, 1,
+ false, ui.AlignFill, false, ui.AlignFill)
+ grid.Append(entry2,
+ 1, 1, 1, 1,
+ true, ui.AlignFill, false, ui.AlignFill)
+
+ msggrid := ui.NewGrid()
+ msggrid.SetPadded(true)
+ grid.Append(msggrid,
+ 0, 2, 2, 1,
+ false, ui.AlignCenter, false, ui.AlignStart)
+
+ button = ui.NewButton("Message Box")
+ button.OnClicked(func(*ui.Button) {
+ ui.MsgBox(mainwin,
+ "This is a normal message box.",
+ "More detailed information can be shown here.")
+ })
+ msggrid.Append(button,
+ 0, 0, 1, 1,
+ false, ui.AlignFill, false, ui.AlignFill)
+ button = ui.NewButton("Error Box")
+ button.OnClicked(func(*ui.Button) {
+ ui.MsgBoxError(mainwin,
+ "This message box describes an error.",
+ "More detailed information can be shown here.")
+ })
+ msggrid.Append(button,
+ 1, 0, 1, 1,
+ false, ui.AlignFill, false, ui.AlignFill)
+
+ return hbox
+}
+
+func setupUI() {
+ mainwin = ui.NewWindow("libui Control Gallery", 640, 480, true)
+ mainwin.OnClosing(func(*ui.Window) bool {
+ ui.Quit()
+ return true
+ })
+ ui.OnShouldQuit(func() bool {
+ mainwin.Destroy()
+ return true
+ })
+
+ tab := ui.NewTab()
+ mainwin.SetChild(tab)
+ mainwin.SetMargined(true)
+
+ tab.Append("Basic Controls", makeBasicControlsPage())
+ tab.SetMargined(0, true)
+
+ tab.Append("Numbers and Lists", makeNumbersPage())
+ tab.SetMargined(1, true)
+
+ tab.Append("Data Choosers", makeDataChoosersPage())
+ tab.SetMargined(2, true)
+
+ mainwin.Show()
+}
+
+func main() {
+ ui.Main(setupUI)
+}
diff --git a/examples/drawtext.go b/examples/drawtext.go
new file mode 100644
index 0000000..a32b14b
--- /dev/null
+++ b/examples/drawtext.go
@@ -0,0 +1,167 @@
+// 19 august 2018
+
+// +build OMIT
+
+package main
+
+// TODO probably a bug in libui: changing the font away from skia leads to a crash
+
+import (
+ "github.com/andlabs/ui"
+)
+
+var (
+ fontButton *ui.FontButton
+ alignment *ui.Combobox
+
+ attrstr *ui.AttributedString
+)
+
+func appendWithAttributes(what string, attrs ...ui.Attribute) {
+ start := len(attrstr.String())
+ end := start + len(what)
+ attrstr.AppendUnattributed(what)
+ for _, a := range attrs {
+ attrstr.SetAttribute(a, start, end)
+ }
+}
+
+func makeAttributedString() {
+ attrstr = ui.NewAttributedString(
+ "Drawing strings with package ui is done with the ui.AttributedString and ui.DrawTextLayout objects.\n" +
+ "ui.AttributedString lets you have a variety of attributes: ")
+
+ appendWithAttributes("font family", ui.TextFamily("Courier New"))
+ attrstr.AppendUnattributed(", ")
+
+ appendWithAttributes("font size", ui.TextSize(18))
+ attrstr.AppendUnattributed(", ")
+
+ appendWithAttributes("font weight", ui.TextWeightBold)
+ attrstr.AppendUnattributed(", ")
+
+ appendWithAttributes("font italicness", ui.TextItalicItalic)
+ attrstr.AppendUnattributed(", ")
+
+ appendWithAttributes("font stretch", ui.TextStretchCondensed)
+ attrstr.AppendUnattributed(", ")
+
+ appendWithAttributes("text color", ui.TextColor{0.75, 0.25, 0.5, 0.75})
+ attrstr.AppendUnattributed(", ")
+
+ appendWithAttributes("text background color", ui.TextBackground{0.5, 0.5, 0.25, 0.5})
+ attrstr.AppendUnattributed(", ")
+
+ appendWithAttributes("underline style", ui.UnderlineSingle)
+ attrstr.AppendUnattributed(", ")
+
+ attrstr.AppendUnattributed("and ")
+ appendWithAttributes("underline color",
+ ui.UnderlineDouble,
+ ui.UnderlineColorCustom{1.0, 0.0, 0.5, 1.0})
+ attrstr.AppendUnattributed(". ")
+
+ attrstr.AppendUnattributed("Furthermore, there are attributes allowing for ")
+ appendWithAttributes("special underlines for indicating spelling errors",
+ ui.UnderlineSuggestion,
+ ui.UnderlineColorSpelling)
+ attrstr.AppendUnattributed(" (and other types of errors) ")
+
+ attrstr.AppendUnattributed("and control over OpenType features such as ligatures (for instance, ")
+ appendWithAttributes("afford", ui.OpenTypeFeatures{
+ ui.ToOpenTypeTag('l', 'i', 'g', 'a'): 0,
+ })
+ attrstr.AppendUnattributed(" vs. ")
+ appendWithAttributes("afford", ui.OpenTypeFeatures{
+ ui.ToOpenTypeTag('l', 'i', 'g', 'a'): 1,
+ })
+ attrstr.AppendUnattributed(").\n")
+
+ attrstr.AppendUnattributed("Use the controls opposite to the text to control properties of the text.")
+}
+
+type areaHandler struct{}
+
+func (areaHandler) Draw(a *ui.Area, p *ui.AreaDrawParams) {
+ tl := ui.DrawNewTextLayout(&ui.DrawTextLayoutParams{
+ String: attrstr,
+ DefaultFont: fontButton.Font(),
+ Width: p.AreaWidth,
+ Align: ui.DrawTextAlign(alignment.Selected()),
+ })
+ defer tl.Free()
+ p.Context.Text(tl, 0, 0)
+}
+
+func (areaHandler) MouseEvent(a *ui.Area, me *ui.AreaMouseEvent) {
+ // do nothing
+}
+
+func (areaHandler) MouseCrossed(a *ui.Area, left bool) {
+ // do nothing
+}
+
+func (areaHandler) DragBroken(a *ui.Area) {
+ // do nothing
+}
+
+func (areaHandler) KeyEvent(a *ui.Area, ke *ui.AreaKeyEvent) (handled bool) {
+ // reject all keys
+ return false
+}
+
+func setupUI() {
+ makeAttributedString()
+
+ mainwin := ui.NewWindow("libui Text-Drawing Example", 640, 480, true)
+ mainwin.SetMargined(true)
+ mainwin.OnClosing(func(*ui.Window) bool {
+ mainwin.Destroy()
+ ui.Quit()
+ return false
+ })
+ ui.OnShouldQuit(func() bool {
+ mainwin.Destroy()
+ return true
+ })
+
+ hbox := ui.NewHorizontalBox()
+ hbox.SetPadded(true)
+ mainwin.SetChild(hbox)
+
+ vbox := ui.NewVerticalBox()
+ vbox.SetPadded(true)
+ hbox.Append(vbox, false)
+
+ area := ui.NewArea(areaHandler{})
+
+ fontButton = ui.NewFontButton()
+ fontButton.OnChanged(func(*ui.FontButton) {
+ area.QueueRedrawAll()
+ })
+ vbox.Append(fontButton, false)
+
+ form := ui.NewForm()
+ form.SetPadded(true)
+ // TODO on OS X if this is set to 1 then the window can't resize; does the form not have the concept of stretchy trailing space?
+ vbox.Append(form, false)
+
+ alignment = ui.NewCombobox()
+ // note that the items match with the values of the uiDrawTextAlign values
+ alignment.Append("Left")
+ alignment.Append("Center")
+ alignment.Append("Right")
+ alignment.SetSelected(0) // start with left alignment
+ alignment.OnSelected(func(*ui.Combobox) {
+ area.QueueRedrawAll()
+ })
+ form.Append("Alignment", alignment, false)
+
+ hbox.Append(area, true)
+
+ mainwin.Show()
+}
+
+func main() {
+ ui.Main(setupUI)
+}
diff --git a/examples/histogram.go b/examples/histogram.go
new file mode 100644
index 0000000..610d65a
--- /dev/null
+++ b/examples/histogram.go
@@ -0,0 +1,253 @@
+// 12 august 2018
+
+// +build OMIT
+
+package main
+
+import (
+ "math/rand"
+ "time"
+
+ "github.com/andlabs/ui"
+)
+
+var (
+ histogram *ui.Area
+ datapoints [10]*ui.Spinbox
+ colorButton *ui.ColorButton
+
+ currentPoint = -1
+)
+
+// some metrics
+const (
+ xoffLeft = 20 // histogram margins
+ yoffTop = 20
+ xoffRight = 20
+ yoffBottom = 20
+ pointRadius = 5
+)
+
+// helper to quickly set a brush color
+func mkSolidBrush(color uint32, alpha float64) *ui.DrawBrush {
+ brush := new(ui.DrawBrush)
+ brush.Type = ui.DrawBrushTypeSolid
+ component := uint8((color >> 16) & 0xFF)
+ brush.R = float64(component) / 255
+ component = uint8((color >> 8) & 0xFF)
+ brush.G = float64(component) / 255
+ component = uint8(color & 0xFF)
+ brush.B = float64(component) / 255
+ brush.A = alpha
+ return brush
+}
+
+// and some colors
+// names and values from https://msdn.microsoft.com/en-us/library/windows/desktop/dd370907%28v=vs.85%29.aspx
+const (
+ colorWhite = 0xFFFFFF
+ colorBlack = 0x000000
+ colorDodgerBlue = 0x1E90FF
+)
+
+func pointLocations(width, height float64) (xs, ys [10]float64) {
+ xincr := width / 9 // 10 - 1 to make the last point be at the end
+ yincr := height / 100
+ for i := 0; i < 10; i++ {
+ // get the value of the point
+ n := datapoints[i].Value()
+ // because y=0 is the top but n=0 is the bottom, we need to flip
+ n = 100 - n
+ xs[i] = xincr * float64(i)
+ ys[i] = yincr * float64(n)
+ }
+ return xs, ys
+}
+
+func constructGraph(width, height float64, extend bool) *ui.DrawPath {
+ xs, ys := pointLocations(width, height)
+ path := ui.DrawNewPath(ui.DrawFillModeWinding)
+
+ path.NewFigure(xs[0], ys[0])
+ for i := 1; i < 10; i++ {
+ path.LineTo(xs[i], ys[i])
+ }
+
+ if extend {
+ path.LineTo(width, height)
+ path.LineTo(0, height)
+ path.CloseFigure()
+ }
+
+ path.End()
+ return path
+}
+
+func graphSize(clientWidth, clientHeight float64) (graphWidth, graphHeight float64) {
+ return clientWidth - xoffLeft - xoffRight,
+ clientHeight - yoffTop - yoffBottom
+}
+
+type areaHandler struct{}
+
+func (areaHandler) Draw(a *ui.Area, p *ui.AreaDrawParams) {
+ // fill the area with white
+ brush := mkSolidBrush(colorWhite, 1.0)
+ path := ui.DrawNewPath(ui.DrawFillModeWinding)
+ path.AddRectangle(0, 0, p.AreaWidth, p.AreaHeight)
+ path.End()
+ p.Context.Fill(path, brush)
+ path.Free()
+
+ graphWidth, graphHeight := graphSize(p.AreaWidth, p.AreaHeight)
+
+ sp := &ui.DrawStrokeParams{
+ Cap: ui.DrawLineCapFlat,
+ Join: ui.DrawLineJoinMiter,
+ Thickness: 2,
+ MiterLimit: ui.DrawDefaultMiterLimit,
+ }
+
+ // draw the axes
+ brush = mkSolidBrush(colorBlack, 1.0)
+ path = ui.DrawNewPath(ui.DrawFillModeWinding)
+ path.NewFigure(xoffLeft, yoffTop)
+ path.LineTo(xoffLeft, yoffTop + graphHeight)
+ path.LineTo(xoffLeft + graphWidth, yoffTop + graphHeight)
+ path.End()
+ p.Context.Stroke(path, brush, sp)
+ path.Free()
+
+ // now transform the coordinate space so (0, 0) is the top-left corner of the graph
+ m := ui.DrawNewMatrix()
+ m.Translate(xoffLeft, yoffTop)
+ p.Context.Transform(m)
+
+ // now get the color for the graph itself and set up the brush
+ graphR, graphG, graphB, graphA := colorButton.Color()
+ brush.Type = ui.DrawBrushTypeSolid
+ brush.R = graphR
+ brush.G = graphG
+ brush.B = graphB
+ // we set brush.A below to different values for the fill and stroke
+
+ // now create the fill for the graph below the graph line
+ path = constructGraph(graphWidth, graphHeight, true)
+ brush.A = graphA / 2
+ p.Context.Fill(path, brush)
+ path.Free()
+
+ // now draw the histogram line
+ path = constructGraph(graphWidth, graphHeight, false)
+ brush.A = graphA
+ p.Context.Stroke(path, brush, sp)
+ path.Free()
+
+ // now draw the point being hovered over
+ if currentPoint != -1 {
+ xs, ys := pointLocations(graphWidth, graphHeight)
+ path = ui.DrawNewPath(ui.DrawFillModeWinding)
+ path.NewFigureWithArc(
+ xs[currentPoint], ys[currentPoint],
+ pointRadius,
+ 0, 6.23, // TODO pi
+ false)
+ path.End()
+ // use the same brush as for the histogram lines
+ p.Context.Fill(path, brush)
+ path.Free()
+ }
+}
+
+func inPoint(x, y float64, xtest, ytest float64) bool {
+ // TODO switch to using a matrix
+ x -= xoffLeft
+ y -= yoffTop
+ return (x >= xtest - pointRadius) &&
+ (x <= xtest + pointRadius) &&
+ (y >= ytest - pointRadius) &&
+ (y <= ytest + pointRadius)
+}
+
+func (areaHandler) MouseEvent(a *ui.Area, me *ui.AreaMouseEvent) {
+ graphWidth, graphHeight := graphSize(me.AreaWidth, me.AreaHeight)
+ xs, ys := pointLocations(graphWidth, graphHeight)
+
+ currentPoint = -1
+ for i := 0; i < 10; i++ {
+ if inPoint(me.X, me.Y, xs[i], ys[i]) {
+ currentPoint = i
+ break
+ }
+ }
+
+ // TODO only redraw the relevant area
+ histogram.QueueRedrawAll()
+}
+
+func (areaHandler) MouseCrossed(a *ui.Area, left bool) {
+ // do nothing
+}
+
+func (areaHandler) DragBroken(a *ui.Area) {
+ // do nothing
+}
+
+func (areaHandler) KeyEvent(a *ui.Area, ke *ui.AreaKeyEvent) (handled bool) {
+ // reject all keys
+ return false
+}
+
+func setupUI() {
+ mainwin := ui.NewWindow("libui Histogram Example", 640, 480, true)
+ mainwin.SetMargined(true)
+ mainwin.OnClosing(func(*ui.Window) bool {
+ mainwin.Destroy()
+ ui.Quit()
+ return false
+ })
+ ui.OnShouldQuit(func() bool {
+ mainwin.Destroy()
+ return true
+ })
+
+ hbox := ui.NewHorizontalBox()
+ hbox.SetPadded(true)
+ mainwin.SetChild(hbox)
+
+ vbox := ui.NewVerticalBox()
+ vbox.SetPadded(true)
+ hbox.Append(vbox, false)
+
+ histogram = ui.NewArea(areaHandler{})
+
+ rand.Seed(time.Now().Unix())
+ for i := 0; i < 10; i++ {
+ datapoints[i] = ui.NewSpinbox(0, 100)
+ datapoints[i].SetValue(rand.Intn(101))
+ datapoints[i].OnChanged(func(*ui.Spinbox) {
+ histogram.QueueRedrawAll()
+ })
+ vbox.Append(datapoints[i], false)
+ }
+
+ colorButton = ui.NewColorButton()
+ // TODO inline these
+ brush := mkSolidBrush(colorDodgerBlue, 1.0)
+ colorButton.SetColor(brush.R,
+ brush.G,
+ brush.B,
+ brush.A)
+ colorButton.OnChanged(func(*ui.ColorButton) {
+ histogram.QueueRedrawAll()
+ })
+ vbox.Append(colorButton, false)
+
+ hbox.Append(histogram, true)
+
+ mainwin.Show()
+}
+
+func main() {
+ ui.Main(setupUI)
+}
diff --git a/examples/table.go b/examples/table.go
new file mode 100644
index 0000000..41cde9f
--- /dev/null
+++ b/examples/table.go
@@ -0,0 +1,450 @@
+// 26 august 2018
+
+// +build OMIT
+
+// TODO possible bugs in libui:
+// - the checkboxes on macOS retain their values when they shouldn't
+// - the table on GTK+ is very thin; the scrolled window needs hexpand=TRUE
+
+package main
+
+import (
+ "fmt"
+ "image"
+ _ "image/png"
+ "image/draw"
+ "bytes"
+
+ "github.com/andlabs/ui"
+)
+
+type modelHandler struct {
+ row9Text string
+ yellowRow int
+ checkStates [15]int
+}
+
+func newModelHandler() *modelHandler {
+ m := new(modelHandler)
+ m.row9Text = "You can edit this one"
+ m.yellowRow = -1
+ return m
+}
+
+func (mh *modelHandler) ColumnTypes(m *ui.TableModel) []ui.TableValue {
+ return []ui.TableValue{
+ ui.TableString(""), // column 0 text
+ ui.TableString(""), // column 1 text
+ ui.TableString(""), // column 2 text
+ ui.TableColor{}, // row background color
+ ui.TableColor{}, // column 1 text color
+ ui.TableImage{}, // column 1 image
+ ui.TableString(""), // column 4 button text
+ ui.TableInt(0), // column 3 checkbox state
+ ui.TableInt(0), // column 5 progress
+ }
+}
+
+func (mh *modelHandler) NumRows(m *ui.TableModel) int {
+ return 15
+}
+
+var img [2]*ui.Image
+
+func (mh *modelHandler) CellValue(m *ui.TableModel, row, column int) ui.TableValue {
+ if column == 3 {
+ if row == mh.yellowRow {
+ return ui.TableColor{1, 1, 0, 1}
+ }
+ if row == 3 {
+ return ui.TableColor{1, 0, 0, 1}
+ }
+ if row == 11 {
+ return ui.TableColor{0, 0.5, 1, 0.5}
+ }
+ return nil
+ }
+ if column == 4 {
+ if (row % 2) == 1 {
+ return ui.TableColor{0.5, 0, 0.75, 1}
+ }
+ return nil
+ }
+ if column == 5 {
+ if row < 8 {
+ return ui.TableImage{img[0]}
+ }
+ return ui.TableImage{img[1]}
+ }
+ if column == 7 {
+ return ui.TableInt(mh.checkStates[row])
+ }
+ if column == 8 {
+ if row == 0 {
+ return ui.TableInt(0)
+ }
+ if row == 13 {
+ return ui.TableInt(100)
+ }
+ if row == 14 {
+ return ui.TableInt(-1)
+ }
+ return ui.TableInt(50)
+ }
+ switch column {
+ case 0:
+ return ui.TableString(fmt.Sprintf("Row %d", row))
+ case 2:
+ if row == 9 {
+ return ui.TableString(mh.row9Text)
+ }
+ return ui.TableString("Editing this won't change anything")
+ case 1:
+ return ui.TableString("Colors!")
+ case 6:
+ return ui.TableString("Make Yellow")
+ }
+ panic("unreachable")
+}
+
+func (mh *modelHandler) SetCellValue(m *ui.TableModel, row, column int, value ui.TableValue) {
+ if row == 9 && column == 2 {
+ mh.row9Text = string(value.(ui.TableString))
+ }
+ if column == 6 { // row background color
+ prevYellowRow := mh.yellowRow
+ mh.yellowRow = row
+ if prevYellowRow != -1 {
+ m.RowChanged(prevYellowRow)
+ }
+ m.RowChanged(mh.yellowRow)
+ }
+ if column == 7 { // checkboxes
+ mh.checkStates[row] = int(value.(ui.TableInt))
+ }
+}
+
+func appendImageNamed(i *ui.Image, which string) {
+ b := rawImages[which]
+ img, _, err := image.Decode(bytes.NewReader(b))
+ if err != nil {
+ panic(err)
+ }
+ nr, ok := img.(*image.RGBA)
+ if !ok {
+ i2 := image.NewRGBA(img.Bounds())
+ draw.Draw(i2, i2.Bounds(), img, img.Bounds().Min, draw.Src)
+ nr = i2
+ }
+ i.Append(nr)
+}
+
+func setupUI() {
+ mainwin := ui.NewWindow("libui Control Gallery", 640, 480, true)
+ mainwin.OnClosing(func(*ui.Window) bool {
+ ui.Quit()
+ return true
+ })
+ ui.OnShouldQuit(func() bool {
+ mainwin.Destroy()
+ return true
+ })
+
+ img[0] = ui.NewImage(16, 16)
+ appendImageNamed(img[0], "andlabs_16x16test_24june2016.png")
+ appendImageNamed(img[0], "andlabs_32x32test_24june2016.png")
+ img[1] = ui.NewImage(16, 16)
+ appendImageNamed(img[1], "tango-icon-theme-0.8.90_16x16_x-office-spreadsheet.png")
+ appendImageNamed(img[1], "tango-icon-theme-0.8.90_32x32_x-office-spreadsheet.png")
+
+ mh := newModelHandler()
+ model := ui.NewTableModel(mh)
+
+ table := ui.NewTable(&ui.TableParams{
+ Model: model,
+ RowBackgroundColorModelColumn: 3,
+ })
+ mainwin.SetChild(table)
+ mainwin.SetMargined(true)
+
+ table.AppendTextColumn("Column 1",
+ 0, ui.TableModelColumnNeverEditable, nil)
+
+ table.AppendImageTextColumn("Column 2",
+ 5,
+ 1, ui.TableModelColumnNeverEditable, &ui.TableTextColumnOptionalParams{
+ ColorModelColumn: 4,
+ });
+ table.AppendTextColumn("Editable",
+ 2, ui.TableModelColumnAlwaysEditable, nil)
+
+ table.AppendCheckboxColumn("Checkboxes",
+ 7, ui.TableModelColumnAlwaysEditable)
+ table.AppendButtonColumn("Buttons",
+ 6, ui.TableModelColumnAlwaysEditable)
+
+ table.AppendProgressBarColumn("Progress Bar",
+ 8)
+
+ mainwin.Show()
+}
+
+func main() {
+ ui.Main(setupUI)
+}
+
+var rawImages = map[string][]byte{
+ "andlabs_16x16test_24june2016.png": []byte{
+ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+ 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10,
+ 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff, 0x61, 0x00, 0x00, 0x00,
+ 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
+ 0x00, 0xca, 0x49, 0x44, 0x41, 0x54, 0x38, 0x11, 0xa5, 0x93, 0xb1, 0x0d,
+ 0xc2, 0x40, 0x0c, 0x45, 0x1d, 0xc4, 0x14, 0x0c, 0x12, 0x41, 0x0f, 0x62,
+ 0x12, 0x46, 0x80, 0x8a, 0x2e, 0x15, 0x30, 0x02, 0x93, 0x20, 0x68, 0x11,
+ 0x51, 0x06, 0x61, 0x0d, 0x88, 0x2d, 0x7f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xae, 0x42, 0x60, 0x82,
+},
+ "andlabs_32x32test_24june2016.png": []byte{
+ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+ 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20,
+ 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x00,
+ 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
+ 0x01, 0x6a, 0x49, 0x44, 0x41, 0x54, 0x58, 0x09, 0xc5, 0x97, 0xc1, 0x0d,
+ 0xc2, 0x30, 0x0c, 0x45, 0x03, 0x62, 0x0a, 0x06, 0x41, 0x70, 0x07, 0x31,
+ 0x09, 0x23, 0xc0, 0x89, 0x05, 0x80, 0x11, 0x98, 0x04, 0xc1, 0x15, 0x81,
+ 0x18, 0x84, 0x35, 0x00, 0x57, 0xfd, 0x8d, 0x13, 0x92, 0x3a, 0x4e, 0x03,
+ 0x8d, 0x54, 0x39, 0x35, 0xb1, 0xff, 0x8b, 0xed, 0x1e, 0x18, 0xec, 0xae,
+ 0xdb, 0x97, 0xe9, 0x71, 0x8d, 0x48, 0x7b, 0x33, 0xb9, 0xf5, 0x82, 0xb0,
+ 0x7f, 0xcc, 0x4c, 0x05, 0x50, 0xa9, 0x2f, 0x26, 0x32, 0xc4, 0xf9, 0x21,
+ 0x9f, 0xa1, 0x13, 0x8a, 0x5c, 0x16, 0x40, 0x4a, 0x9e, 0x92, 0x14, 0x78,
+ 0x8a, 0x5c, 0x43, 0xc4, 0xf4, 0x65, 0x3b, 0x01, 0x3c, 0x57, 0x27, 0x43,
+ 0x4f, 0x97, 0x95, 0x0d, 0x40, 0xc2, 0xe3, 0xe3, 0xb2, 0x7a, 0xba, 0x40,
+ 0xd8, 0x19, 0x50, 0x5c, 0x03, 0xe2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x14, 0xf3, 0xd5, 0x82, 0x9c, 0x9e,
+ 0x87, 0x12, 0x73, 0x1f, 0x87, 0xf0, 0x67, 0xc2, 0x01, 0x28, 0x75, 0x6b,
+ 0x2e, 0x8e, 0x3d, 0x84, 0x7d, 0x8d, 0x68, 0x0b, 0x10, 0xf8, 0x6b, 0xdb,
+ 0x00, 0xf8, 0x64, 0xbf, 0x12, 0xe6, 0xed, 0x20, 0x8d, 0x0a, 0xe0, 0x5f,
+ 0xe2, 0xb8, 0x14, 0x87, 0x68, 0x2a, 0x80, 0x1f, 0xff, 0x6d, 0x07, 0x7d,
+ 0xff, 0x3d, 0x7f, 0x03, 0x93, 0xca, 0x91, 0xa9, 0x89, 0x2a, 0x2e, 0xd2,
+ 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
+},
+ "tango-icon-theme-0.8.90_16x16_x-office-spreadsheet.png": []byte{
+ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+ 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10,
+ 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff, 0x61, 0x00, 0x00, 0x00,
+ 0x06, 0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0,
+ 0xbd, 0xa7, 0x93, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00,
+ 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18,
+ 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 0x4d, 0x45, 0x07, 0xd5, 0x04, 0x16,
+ 0x14, 0x0d, 0x09, 0xd9, 0x88, 0x44, 0xfa, 0x00, 0x00, 0x02, 0x4d, 0x49,
+ 0x44, 0x41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0x41, 0x66, 0xc3, 0x64, 0x7a, 0x4a, 0xd0,
+ 0x33, 0xfb, 0x8a, 0x0a, 0x55, 0x7d, 0x71, 0x6d, 0x61, 0x21, 0x50, 0xea,
+ 0x7f, 0x30, 0xd2, 0xdd, 0x7d, 0x49, 0x5f, 0x5a, 0xba, 0xe9, 0x4e, 0x26,
+ 0x55, 0xe7, 0xcf, 0x4c, 0xb9, 0x6d, 0x83, 0x90, 0x65, 0xc3, 0xa5, 0x28,
+ 0xcb, 0x07, 0xbb, 0xba, 0x6e, 0x9d, 0x1a, 0x1a, 0x9a, 0x00, 0xf8, 0x05,
+ 0xf4, 0xf5, 0x23, 0xe9, 0x30, 0xeb, 0x2d, 0xf9, 0x00, 0x00, 0x00, 0x00,
+ 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
+},
+ "tango-icon-theme-0.8.90_32x32_x-office-spreadsheet.png": []byte{
+ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+ 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20,
+ 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x00,
+ 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64,
+ 0x88, 0x00, 0x00, 0x05, 0xa5, 0x49, 0x44, 0x41, 0x54, 0x58, 0x85, 0xe5,
+ 0x97, 0xcd, 0x6b, 0x54, 0x57, 0x18, 0xc6, 0x7f, 0xe7, 0xde, 0x3b, 0x93,
+ 0x51, 0x67, 0x92, 0x8c, 0x66, 0x32, 0x6a, 0x26, 0x4d, 0x94, 0x18, 0x27,
+ 0xa9, 0x50, 0xbf, 0x5a, 0x2d, 0x94, 0x76, 0xd1, 0x85, 0x05, 0x41, 0x8b,
+ 0x60, 0x75, 0x53, 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