Documentation
¶
Index ¶
- Constants
- Variables
- type MultiOptionBox
- func (mob *MultiOptionBox) Display(screen tcell.Screen)
- func (mob *MultiOptionBox) GetContent() string
- func (mob *MultiOptionBox) GetCursorPosition() (int, int)
- func (mob *MultiOptionBox) HandleEventKey(screen tcell.Screen, event *tcell.EventKey)
- func (mob *MultiOptionBox) HandleEventMouse(screen tcell.Screen, event *tcell.EventMouse)
- func (mob *MultiOptionBox) HasFocus() bool
- func (mob *MultiOptionBox) IsColliding(x, y int) bool
- func (mob *MultiOptionBox) SetFocus(value bool)
- type Object
- type Point
- type Rectangle
- type TextBox
- func (tb *TextBox) CheckNextCursorPosition(next_x, next_y int) bool
- func (tb *TextBox) Display(screen tcell.Screen)
- func (tb *TextBox) GetContent() string
- func (tb *TextBox) GetCursorPosition() (int, int)
- func (tb *TextBox) HandleEventKey(screen tcell.Screen, event *tcell.EventKey)
- func (tb *TextBox) HandleEventMouse(screen tcell.Screen, event *tcell.EventMouse)
- func (tb *TextBox) HasFocus() bool
- func (tb *TextBox) IsColliding(x, y int) bool
- func (tb *TextBox) SetCursorPosition(x, y int)
- func (tb *TextBox) SetFocus(value bool)
- func (tb *TextBox) SetNextCursorPosition(x, y int)
Constants ¶
View Source
const TRIANGLE_DOWN string = "🔻"
Variables ¶
View Source
var ARROW_MAPPING map[tcell.Key]Point = map[tcell.Key]Point{
tcell.KeyUp: {0, -1},
tcell.KeyDown: {0, +1},
tcell.KeyLeft: {-1, 0},
tcell.KeyRight: {+1, 0},
}
Mapping event keys arrow to direction (x, y)
View Source
var DIRECTIONS map[tcell.Key]int = map[tcell.Key]int{
tcell.KeyUp: -1,
tcell.KeyDown: 1,
}
Functions ¶
This section is empty.
Types ¶
type MultiOptionBox ¶
type MultiOptionBox struct {
// contains filtered or unexported fields
}
func MultiOptionBox_new ¶
func MultiOptionBox_new(title string, x, y, size_w, size_h int, content map[string]string) *MultiOptionBox
func (*MultiOptionBox) Display ¶
func (mob *MultiOptionBox) Display(screen tcell.Screen)
func (*MultiOptionBox) GetContent ¶
func (mob *MultiOptionBox) GetContent() string
func (*MultiOptionBox) GetCursorPosition ¶
func (mob *MultiOptionBox) GetCursorPosition() (int, int)
Returns the current cursor position relative to the object
func (*MultiOptionBox) HandleEventKey ¶
func (mob *MultiOptionBox) HandleEventKey(screen tcell.Screen, event *tcell.EventKey)
func (*MultiOptionBox) HandleEventMouse ¶
func (mob *MultiOptionBox) HandleEventMouse(screen tcell.Screen, event *tcell.EventMouse)
func (*MultiOptionBox) HasFocus ¶
func (mob *MultiOptionBox) HasFocus() bool
func (*MultiOptionBox) IsColliding ¶
func (mob *MultiOptionBox) IsColliding(x, y int) bool
func (*MultiOptionBox) SetFocus ¶
func (mob *MultiOptionBox) SetFocus(value bool)
type Rectangle ¶
type Rectangle struct { Width int // The width of the rectangle Height int // The height of the rectangle Start_x int // The starting x position Start_y int // The starting y position }
A simple rectangle
func (Rectangle) DrawRectangle ¶
func (rec Rectangle) DrawRectangle(screen tcell.Screen)
Draw a simple rectangle
type TextBox ¶
type TextBox struct {
// contains filtered or unexported fields
}
func TextBox_new ¶
Create a simple text box using a rectangle and leaving one single space for writing text into
func (*TextBox) CheckNextCursorPosition ¶
func (*TextBox) GetContent ¶
func (*TextBox) GetCursorPosition ¶
Returns the current cursor position relative to the object
func (*TextBox) HandleEventKey ¶
func (tb *TextBox) HandleEventKey(screen tcell.Screen, event *tcell.EventKey)
func (*TextBox) HandleEventMouse ¶
func (tb *TextBox) HandleEventMouse(screen tcell.Screen, event *tcell.EventMouse)
func (*TextBox) IsColliding ¶
Check if the textbox collides with input coordinates
func (*TextBox) SetCursorPosition ¶
func (*TextBox) SetNextCursorPosition ¶
Click to show internal directories.
Click to hide internal directories.