Documentation ¶
Overview ¶
* Copyright (c) 2022 Andreas Signer <asigner@gmail.com> * * This file is part of termdraw. * * termdraw is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * termdraw is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with termdraw. If not, see <http://www.gnu.org/licenses/>.
* Copyright (c) 2022 Andreas Signer <asigner@gmail.com> * * This file is part of termdraw. * * termdraw is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * termdraw is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with termdraw. If not, see <http://www.gnu.org/licenses/>.
* Copyright (c) 2022 Andreas Signer <asigner@gmail.com> * * This file is part of termdraw. * * termdraw is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * termdraw is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with termdraw. If not, see <http://www.gnu.org/licenses/>.
* Copyright (c) 2022 Andreas Signer <asigner@gmail.com> * * This file is part of termdraw. * * termdraw is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * termdraw is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with termdraw. If not, see <http://www.gnu.org/licenses/>.
* Copyright (c) 2022 Andreas Signer <asigner@gmail.com> * * This file is part of termdraw. * * termdraw is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * termdraw is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with termdraw. If not, see <http://www.gnu.org/licenses/>.
* Copyright (c) 2022 Andreas Signer <asigner@gmail.com> * * This file is part of termdraw. * * termdraw is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * termdraw is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with termdraw. If not, see <http://www.gnu.org/licenses/>.
* Copyright (c) 2022 Andreas Signer <asigner@gmail.com> * * This file is part of termdraw. * * termdraw is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * termdraw is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with termdraw. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Variables
- func DrawBox(x, y, w, h int, fg termbox.Attribute, bg termbox.Attribute, bs BorderStyle)
- func ErrorDialog(message string)
- func FileDialog(title string) (string, bool)
- func FillBox(x, y, w, h int, fg termbox.Attribute, bg termbox.Attribute, bs BorderStyle)
- func Puts(x, y int, s string, fg, bg termbox.Attribute)
- func YesNoCancelDialog(title, message string) (res bool, valid bool)
- type Border
- type BorderStyle
- type Canvas
- func (c *Canvas) AsText() []string
- func (c *Canvas) Clear()
- func (c *Canvas) Delete(p Pos)
- func (c *Canvas) DeleteLine(p Pos)
- func (c *Canvas) Draw()
- func (c *Canvas) IncSize(dw, dh int)
- func (c *Canvas) Insert(p Pos)
- func (c *Canvas) InsertLine(p Pos)
- func (c *Canvas) Move(d Direction) (oldPos, newPos Pos)
- func (c *Canvas) Pos() Pos
- func (c *Canvas) SetPos(p Pos)
- func (c *Canvas) SetRune(p Pos, ch rune)
- func (c *Canvas) SetText(text []string)
- func (c *Canvas) SetTile(p Pos, t Tile)
- func (c *Canvas) Tile(p Pos) Tile
- type Direction
- type EditField
- type Line
- type Pos
- type Segment
- type TextCard
- type Tile
Constants ¶
This section is empty.
Variables ¶
var ( // Color values generated with https://github.com/canidlogic/vgapal ColBlack = termbox.RGBToAttribute(0, 0, 0) ColBlue = termbox.RGBToAttribute(0, 0, 170) ColGreen = termbox.RGBToAttribute(0, 170, 0) ColCyan = termbox.RGBToAttribute(0, 170, 170) ColRed = termbox.RGBToAttribute(170, 0, 0) ColMagenta = termbox.RGBToAttribute(170, 0, 170) ColBrown = termbox.RGBToAttribute(170, 85, 0) ColLightGrey = termbox.RGBToAttribute(170, 170, 170) ColGrey = termbox.RGBToAttribute(85, 85, 85) ColLightBlue = termbox.RGBToAttribute(85, 85, 255) ColLightGreen = termbox.RGBToAttribute(85, 255, 85) ColLightCyan = termbox.RGBToAttribute(85, 255, 255) ColLightRed = termbox.RGBToAttribute(255, 85, 85) ColLightMagenta = termbox.RGBToAttribute(255, 85, 255) ColYellow = termbox.RGBToAttribute(255, 255, 85) ColWhite = termbox.RGBToAttribute(255, 255, 255) )
Functions ¶
func DrawBox ¶
func DrawBox(x, y, w, h int, fg termbox.Attribute, bg termbox.Attribute, bs BorderStyle)
func ErrorDialog ¶
func ErrorDialog(message string)
func FileDialog ¶
func FillBox ¶
func FillBox(x, y, w, h int, fg termbox.Attribute, bg termbox.Attribute, bs BorderStyle)
func YesNoCancelDialog ¶
Types ¶
type BorderStyle ¶
type BorderStyle uint8
const ( BorderStyle_None BorderStyle = iota BorderStyle_Light BorderStyle_Rounded BorderStyle_Heavy BorderStyle_Double BorderStyle_Max = BorderStyle_Double )
func (BorderStyle) Next ¶
func (b BorderStyle) Next() BorderStyle
func (BorderStyle) Prev ¶
func (b BorderStyle) Prev() BorderStyle
func (BorderStyle) Runes ¶
func (b BorderStyle) Runes() Border
func (BorderStyle) String ¶
func (b BorderStyle) String() string
type Canvas ¶
type Canvas struct {
// contains filtered or unexported fields
}
func (*Canvas) DeleteLine ¶
func (*Canvas) InsertLine ¶
type EditField ¶
type EditField struct {
// contains filtered or unexported fields
}
func NewEditField ¶
type TextCard ¶
type TextCard struct {
Fg, Bg termbox.Attribute
Bs BorderStyle
Content []Line
}