Merge pull request #106 from dareg/master

Border.Label -> BorderLabel
This commit is contained in:
Zack Guo 2016-10-14 10:04:22 -04:00 committed by GitHub
commit 797aea3560
9 changed files with 17 additions and 17 deletions

View File

@ -31,7 +31,7 @@ func main() {
par2.Height = 5
par2.Width = 37
par2.Y = 0
par2.Border.Label = "Keys"
par2.BorderLabel = "Keys"
par2.Border.FgColor = termui.ColorYellow
tab1.AddBlocks(par2)
@ -39,7 +39,7 @@ func main() {
bc := termui.NewBarChart()
data := []int{3, 2, 5, 3, 9, 5, 3, 2, 5, 8, 3, 2, 4, 5, 3, 2, 5, 7, 5, 3, 2, 6, 7, 4, 6, 3, 6, 7, 8, 3, 6, 4, 5, 3, 2, 4, 6, 4, 8, 5, 9, 4, 3, 6, 5, 3, 6}
bclabels := []string{"S0", "S1", "S2", "S3", "S4", "S5"}
bc.Border.Label = "Bar Chart"
bc.BorderLabel = "Bar Chart"
bc.Data = data
bc.Width = 26
bc.Height = 10

View File

@ -23,12 +23,12 @@ func main() {
p := ui.NewPar(":PRESS q TO QUIT DEMO")
p.Height = 3
p.Width = 50
p.Border.Label = "Text Box"
p.BorderLabel = "Text Box"
strs := []string{"[0] gizak/termui", "[1] editbox.go", "[2] iterrupt.go", "[3] keyboard.go", "[4] output.go", "[5] random_out.go", "[6] dashboard.go", "[7] nsf/termbox-go"}
list := ui.NewList()
list.Items = strs
list.Border.Label = "List"
list.BorderLabel = "List"
list.Height = 7
list.Width = 25
list.Y = 4
@ -38,7 +38,7 @@ func main() {
g.Width = 50
g.Height = 3
g.Y = 11
g.Border.Label = "Gauge"
g.BorderLabel = "Gauge"
spark := ui.NewSparkline()
spark.Title = "srv 0:"
@ -52,7 +52,7 @@ func main() {
sp := ui.NewSparklines(spark, spark1)
sp.Width = 25
sp.Height = 7
sp.Border.Label = "Sparkline"
sp.BorderLabel = "Sparkline"
sp.Y = 4
sp.X = 25
@ -66,7 +66,7 @@ func main() {
return ps
})()
lc.Border.Label = "Line Chart"
lc.BorderLabel = "Line Chart"
lc.Data = sinps
lc.Width = 50
lc.Height = 11
@ -77,7 +77,7 @@ func main() {
bc := ui.NewBarChart()
bcdata := []int{3, 2, 5, 3, 9, 5, 3, 2, 5, 8, 3, 2, 4, 5, 3, 2, 5, 7, 5, 3, 2, 6, 7, 4, 6, 3, 6, 7, 8, 3, 6, 4, 5, 3, 2, 4, 6, 4, 8, 5, 9, 4, 3, 6, 5, 3, 6}
bclabels := []string{"S0", "S1", "S2", "S3", "S4", "S5"}
bc.Border.Label = "Bar Chart"
bc.BorderLabel = "Bar Chart"
bc.Width = 26
bc.Height = 10
bc.X = 51
@ -85,7 +85,7 @@ func main() {
bc.DataLabels = bclabels
lc1 := ui.NewLineChart()
lc1.Border.Label = "Line Chart"
lc1.BorderLabel = "Line Chart"
rndwalk := (func() []float64 {
n := 150
d := make([]float64, n)

View File

@ -212,7 +212,7 @@ func NewCpuTabElems(width int) *CpuTabElems {
lc.Height = 12
lc.X = 0
lc.Mode = "dot"
lc.Border.Label = "CPU"
lc.BorderLabel = "CPU"
return &CpuTabElems{GMap: make(map[string]*termui.Gauge),
LChart: lc}
}
@ -222,7 +222,7 @@ func (cte *CpuTabElems) AddGauge(key string, Y int, width int) *termui.Gauge {
cte.GMap[key].Width = width
cte.GMap[key].Height = 3
cte.GMap[key].Y = Y
cte.GMap[key].Border.Label = key
cte.GMap[key].BorderLabel = key
cte.GMap[key].Percent = 0 //int(val.user + val.nice + val.system)
return cte.GMap[key]
}

View File

@ -11,7 +11,7 @@ import "fmt"
bc := termui.NewBarChart()
data := []int{3, 2, 5, 3, 9, 5}
bclabels := []string{"S0", "S1", "S2", "S3", "S4", "S5"}
bc.Border.Label = "Bar Chart"
bc.BorderLabel = "Bar Chart"
bc.Data = data
bc.Width = 26
bc.Height = 10

View File

@ -16,7 +16,7 @@ import (
g.Percent = 40
g.Width = 50
g.Height = 3
g.Border.Label = "Slim Gauge"
g.BorderLabel = "Slim Gauge"
g.BarColor = termui.ColorRed
g.PercentColor = termui.ColorBlue
*/

View File

@ -39,7 +39,7 @@ var rSingleBraille = [4]rune{'\u2880', '⠠', '⠐', '⠈'}
// because one braille char can represent two data points.
/*
lc := termui.NewLineChart()
lc.Border.Label = "braille-mode Line Chart"
lc.BorderLabel = "braille-mode Line Chart"
lc.Data = [1.2, 1.3, 1.5, 1.7, 1.5, 1.6, 1.8, 2.0]
lc.Width = 50
lc.Height = 12

View File

@ -24,7 +24,7 @@ import "strings"
ls := termui.NewList()
ls.Items = strs
ls.ItemFgColor = termui.ColorYellow
ls.Border.Label = "List"
ls.BorderLabel = "List"
ls.Height = 7
ls.Width = 25
ls.Y = 0

View File

@ -16,7 +16,7 @@ import (
data[0] := []int{3, 2, 5, 7, 9, 4}
data[1] := []int{7, 8, 5, 3, 1, 6}
bclabels := []string{"S0", "S1", "S2", "S3", "S4", "S5"}
bc.Border.Label = "Bar Chart"
bc.BorderLabel = "Bar Chart"
bc.Data = data
bc.Width = 26
bc.Height = 10

2
par.go
View File

@ -9,7 +9,7 @@ package termui
par := termui.NewPar("Simple Text")
par.Height = 3
par.Width = 17
par.Border.Label = "Label"
par.BorderLabel = "Label"
*/
type Par struct {
Block