mirror of
https://github.com/gizak/termui.git
synced 2025-04-24 13:48:50 +08:00

- TextBox is a superset of Paragraph, so Paragraph is deprecated - adds support for a cursor, which can be moved - the `Text` field is now private, replaced with `SetText`, `InsertText`, and `ClearText` methods TODO: - adding focusable widgets support to termui might clean up the API since we could potentially move the event handling from client side to library side - add support for scrolling the TextBox view - fix the cursor position on linewrap - fix linewrapping - add line number support
24 lines
317 B
Go
24 lines
317 B
Go
package termui
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
var PRINTABLE_KEYS = append(
|
|
strings.Split(
|
|
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,./<>?;:'\"[]\\{}|`~!@#$%^&*()-_=+",
|
|
"",
|
|
),
|
|
"<Space>",
|
|
"<Tab>",
|
|
"<Enter>",
|
|
)
|
|
|
|
type Alignment uint
|
|
|
|
const (
|
|
AlignLeft Alignment = iota
|
|
AlignCenter
|
|
AlignRight
|
|
)
|