Documentation ¶
Index ¶
- Constants
- type ATable
- func (at *ATable) AddCellAlignment(idxRow, idxCol int, alignment Alignment)
- func (at *ATable) AddColAlignDefTheme()
- func (at *ATable) AddColAlignment(colIdx int, alignment Alignment)
- func (at *ATable) Draw(buf *Buffer)
- func (at *ATable) GetCellAlignment(idxRow, idxCol int) Alignment
- func (at *ATable) UseCellAlignment()
- type Banner
- type BarChart
- type Button
- type DialogBox
- type DrawDirection
- type FnHlpRowMarker
- type FnKBHandler
- type Frame
- type Gauge
- type Image
- type List
- func (self *List) Draw(buf *Buffer)
- func (self *List) ScrollAmount(amount int)
- func (self *List) ScrollBottom()
- func (self *List) ScrollDown()
- func (self *List) ScrollHalfPageDown()
- func (self *List) ScrollHalfPageUp()
- func (self *List) ScrollPageDown()
- func (self *List) ScrollPageUp()
- func (self *List) ScrollTop()
- func (self *List) ScrollUp()
- type ListES
- func (self *ListES) Draw(buf *Buffer)
- func (self *ListES) ScrollAmount(amount int)
- func (self *ListES) ScrollBottom()
- func (self *ListES) ScrollDown()
- func (self *ListES) ScrollHalfPageDown()
- func (self *ListES) ScrollHalfPageUp()
- func (self *ListES) ScrollPageDown()
- func (self *ListES) ScrollPageUp()
- func (self *ListES) ScrollTop()
- func (self *ListES) ScrollUp()
- type LogRecord
- type LogStack
- func (ls *LogStack) AddErrLogRecord(err error)
- func (ls *LogStack) AddInfoLogRecord(message string)
- func (ls *LogStack) AddLogRecordAsIs(lr LogRecord)
- func (ls *LogStack) AddWarnLogRecord(message string)
- func (ls *LogStack) Draw(buf *Buffer)
- func (ls *LogStack) GetId() string
- func (ls *LogStack) SetId(name string)
- type Logo
- type Paragraph
- type PieChart
- type PieChartLabel
- type Plot
- type PlotMarker
- type PlotType
- type Sparkline
- type SparklineGroup
- type StackedBarChart
- type TabPane
- type Table
- type Tree
- func (self *Tree) Collapse()
- func (self *Tree) CollapseAll()
- func (self *Tree) Draw(buf *Buffer)
- func (self *Tree) Expand()
- func (self *Tree) ExpandAll()
- func (self *Tree) ScrollAmount(amount int)
- func (self *Tree) ScrollBottom()
- func (self *Tree) ScrollDown()
- func (self *Tree) ScrollHalfPageDown()
- func (self *Tree) ScrollHalfPageUp()
- func (self *Tree) ScrollPageDown()
- func (self *Tree) ScrollPageUp()
- func (self *Tree) ScrollTop()
- func (self *Tree) ScrollUp()
- func (self *Tree) SelectedNode() *TreeNode
- func (self *Tree) SetNodes(nodes []*TreeNode)
- func (self *Tree) ToggleExpand()
- func (self *Tree) Walk(fn TreeWalkFn)
- type TreeNode
- type TreeWalkFn
- type Widget
Constants ¶
const ( LogRecTypeInfo = "info" LogRecTypeWarn = "warn" LogRecTypeErr = "err" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ATable ¶
type ATable struct { Table WidgetTheme *WidgetTheme ColSeparator bool ColTextAlignment map[int]Alignment // contains filtered or unexported fields }
ATable - таблица с расширенным функционалом форматирования
func MakeDefaultATable ¶
func MakeDefaultHotkeyWindow ¶
MakeDefaultHotkeyWindow - всплывающее окно со справочной информацией @parent - размер приложения на экране @w, @h - размеры в которые должно вписываться это всплывающее окно @rows - содержимое
func (*ATable) AddCellAlignment ¶
func (*ATable) AddColAlignDefTheme ¶
func (at *ATable) AddColAlignDefTheme()
AddColAlignDefTheme - желательно вызвать после того как заполнено свойство Rows подходит для таблицы в две колонки
func (*ATable) AddColAlignment ¶
func (*ATable) GetCellAlignment ¶
func (*ATable) UseCellAlignment ¶
func (at *ATable) UseCellAlignment()
type Banner ¶
type Banner struct { Block // contains filtered or unexported fields }
func (*Banner) UploadWidgetTheme ¶
func (b *Banner) UploadWidgetTheme(wt WidgetTheme)
type BarChart ¶
type BarChart struct { Block BarColors []Color LabelStyles []Style NumStyles []Style // only Fg and Modifier are used NumFormatter func(float64) string Data []float64 Labels []string BarWidth int BarGap int MaxVal float64 }
func NewBarChart ¶
func NewBarChart() *BarChart
type Button ¶
type Button struct { Block // contains filtered or unexported fields }
func (*Button) ChangeLabel ¶
type DialogBox ¶
type DialogBox struct { Block // contains filtered or unexported fields }
func (*DialogBox) SetButtonLabel ¶
type FnHlpRowMarker ¶
type FnKBHandler ¶
type FnKBHandler func(data ...interface{}) uint8
type Frame ¶
type Frame struct { Block // contains filtered or unexported fields }
Frame Окно с возможностью редактирования текста
func (*Frame) CaptureModeOff ¶
func (f *Frame) CaptureModeOff()
func (*Frame) CaptureModeOn ¶
func (f *Frame) CaptureModeOn()
func (*Frame) OnlyNumbers ¶
func (f *Frame) OnlyNumbers()
type Gauge ¶
func MakeDefaultGauge ¶
func MakeDefaultGauge(gts ...GaugeTheme) *Gauge
func (*Gauge) UploadTheme ¶
func (g *Gauge) UploadTheme(gt *GaugeTheme)
func (*Gauge) UploadWidgetTheme ¶
type Image ¶
type List ¶
type List struct { Block Rows []string WrapText bool TextStyle Style SelectedRow int SelectedRowStyle Style // contains filtered or unexported fields }
func (*List) ScrollAmount ¶
ScrollAmount scrolls by amount given. If amount is < 0, then scroll up. There is no need to set self.topRow, as this will be set automatically when drawn, since if the selected item is off screen then the topRow variable will change accordingly.
func (*List) ScrollBottom ¶
func (self *List) ScrollBottom()
func (*List) ScrollDown ¶
func (self *List) ScrollDown()
func (*List) ScrollHalfPageDown ¶
func (self *List) ScrollHalfPageDown()
func (*List) ScrollHalfPageUp ¶
func (self *List) ScrollHalfPageUp()
func (*List) ScrollPageDown ¶
func (self *List) ScrollPageDown()
func (*List) ScrollPageUp ¶
func (self *List) ScrollPageUp()
type ListES ¶
type ListES struct { Block Rows *[]string WrapText bool TextStyle Style SelectedRow int SelectedRowStyle Style // contains filtered or unexported fields }
ListES - список со ссылкой на источник
func MakeDefaultListES ¶
func MakeDefaultListES() *ListES
func (*ListES) ScrollAmount ¶
ScrollAmount scrolls by amount given. If amount is < 0, then scroll up. There is no need to set self.topRow, as this will be set automatically when drawn, since if the selected item is off screen then the topRow variable will change accordingly.
func (*ListES) ScrollBottom ¶
func (self *ListES) ScrollBottom()
func (*ListES) ScrollDown ¶
func (self *ListES) ScrollDown()
func (*ListES) ScrollHalfPageDown ¶
func (self *ListES) ScrollHalfPageDown()
func (*ListES) ScrollHalfPageUp ¶
func (self *ListES) ScrollHalfPageUp()
func (*ListES) ScrollPageDown ¶
func (self *ListES) ScrollPageDown()
func (*ListES) ScrollPageUp ¶
func (self *ListES) ScrollPageUp()
type LogRecord ¶
type LogRecord struct {
// contains filtered or unexported fields
}
func NewLogRecord ¶
func NewLogRecordPtr ¶
func (*LogRecord) GetMomentFormat ¶
func (*LogRecord) GetRecType ¶
type LogStack ¶
type LogStack struct { Block // contains filtered or unexported fields }
func NewLogStack ¶
func (*LogStack) AddErrLogRecord ¶
func (*LogStack) AddInfoLogRecord ¶
func (*LogStack) AddLogRecordAsIs ¶
func (*LogStack) AddWarnLogRecord ¶
type Paragraph ¶
func NewParagraph ¶
func NewParagraph() *Paragraph
type PieChart ¶
type PieChart struct { Block Data []float64 // list of data items Colors []Color // colors to by cycled through LabelFormatter PieChartLabel // callback function for labels AngleOffset float64 // which angle to start drawing at? (see piechartOffsetUp) }
func NewPieChart ¶
func NewPieChart() *PieChart
NewPieChart Creates a new pie chart with reasonable defaults and no labels.
type PieChartLabel ¶
PieChartLabel callback
type Plot ¶
type Plot struct { Block Data [][]float64 DataLabels []string MaxVal float64 LineColors []Color AxesColor Color // TODO ShowAxes bool Marker PlotMarker DotMarkerRune rune PlotType PlotType HorizontalScale int DrawDirection DrawDirection // TODO }
Plot has two modes: line(default) and scatter. Plot also has two marker types: braille(default) and dot. A single braille character is a 2x4 grid of dots, so using braille gives 2x X resolution and 4x Y resolution over dot mode.
type Sparkline ¶
type Sparkline struct { Data []float64 Title string TitleStyle Style LineColor Color MaxVal float64 MaxHeight int // TODO }
Sparkline is like: ▅▆▂▂▅▇▂▂▃▆▆▆▅▃. The data points should be non-negative integers.
func NewSparkline ¶
func NewSparkline() *Sparkline
NewSparkline returns a unrenderable single sparkline that needs to be added to a SparklineGroup
type SparklineGroup ¶
type SparklineGroup struct { Block Sparklines []*Sparkline }
SparklineGroup is a renderable widget which groups together the given sparklines.
func NewSparklineGroup ¶
func NewSparklineGroup(sls ...*Sparkline) *SparklineGroup
func (*SparklineGroup) Draw ¶
func (self *SparklineGroup) Draw(buf *Buffer)
type StackedBarChart ¶
type StackedBarChart struct { Block BarColors []Color LabelStyles []Style NumStyles []Style // only Fg and Modifier are used NumFormatter func(float64) string Data [][]float64 Labels []string BarWidth int BarGap int MaxVal float64 }
func NewStackedBarChart ¶
func NewStackedBarChart() *StackedBarChart
func (*StackedBarChart) Draw ¶
func (self *StackedBarChart) Draw(buf *Buffer)
type TabPane ¶
type TabPane struct { Block TabNames []string ActiveTabIndex int ActiveTabStyle Style InactiveTabStyle Style }
TabPane is a renderable widget which can be used to conditionally render certain tabs/views. TabPane shows a list of Tab names. The currently selected tab can be found through the `ActiveTabIndex` field.
func NewTabPane ¶
func (*TabPane) FocusRight ¶
func (self *TabPane) FocusRight()
type Table ¶
type Table struct { Block Rows [][]string ColumnWidths []int TextStyle Style RowSeparator bool TextAlignment Alignment RowStyles map[int]Style FillRow bool // ColumnResizer is called on each Draw. Can be used for custom column sizing. ColumnResizer func() }
Table is like: ┌ Awesome Table ───────────────────────────────────────────────┐ │ Col0 | Col1 | Col2 | Col3 | Col4 | Col5 | Col6 | │──────────────────────────────────────────────────────────────│ │ Some Item #1 | AAA | 123 | CCCCC | EEEEE | GGGGG | IIIII | │──────────────────────────────────────────────────────────────│ │ Some Item #2 | BBB | 456 | DDDDD | FFFFF | HHHHH | JJJJJ | └──────────────────────────────────────────────────────────────┘
type Tree ¶
type Tree struct { Block TextStyle Style SelectedRowStyle Style WrapText bool SelectedRow int // contains filtered or unexported fields }
Tree is a tree widget.
func (*Tree) CollapseAll ¶
func (self *Tree) CollapseAll()
func (*Tree) ScrollAmount ¶
ScrollAmount scrolls by amount given. If amount is < 0, then scroll up. There is no need to set self.topRow, as this will be set automatically when drawn, since if the selected item is off screen then the topRow variable will change accordingly.
func (*Tree) ScrollBottom ¶
func (self *Tree) ScrollBottom()
func (*Tree) ScrollDown ¶
func (self *Tree) ScrollDown()
func (*Tree) ScrollHalfPageDown ¶
func (self *Tree) ScrollHalfPageDown()
func (*Tree) ScrollHalfPageUp ¶
func (self *Tree) ScrollHalfPageUp()
func (*Tree) ScrollPageDown ¶
func (self *Tree) ScrollPageDown()
func (*Tree) ScrollPageUp ¶
func (self *Tree) ScrollPageUp()
func (*Tree) SelectedNode ¶
func (*Tree) ToggleExpand ¶
func (self *Tree) ToggleExpand()
func (*Tree) Walk ¶
func (self *Tree) Walk(fn TreeWalkFn)
type TreeNode ¶
type TreeNode struct { Value fmt.Stringer Expanded bool Nodes []*TreeNode // contains filtered or unexported fields }
TreeNode is a tree node.
type TreeWalkFn ¶
TreeWalkFn is a function used for walking a Tree. To interrupt the walking process function should return false.