Commit Graph

477 Commits

Author SHA1 Message Date
Andreas Bieber 9142563f22 feat(inputfield): Add ability to show a note below the inputfield 2020-09-23 20:54:48 +02:00
Andreas Bieber 128c6692d4 fix(form/Draw): Use button colors for focused state 2020-09-23 20:54:48 +02:00
Andreas Bieber 367d377081 fix(form/GetFormItem): Check whether index is out of bounds, if so, return nil 2020-09-23 20:54:48 +02:00
Andreas Bieber 8bd1023ddc feat(dropdown): Add additional field for setting an optional reference (like in TreeView) 2020-09-23 20:54:48 +02:00
Andreas Bieber 6e9f09aec1 feat(dropdown): Draw rune at the end of the field to indicate that this field is a dropdown 2020-09-23 20:54:43 +02:00
Andreas Bieber 6fa4370332 fix(dropdown): Use `getFieldWidth` during draw 2020-09-23 20:51:46 +02:00
Andreas Bieber dedc2da113 feat(dropdown): Abbreviate text of current option when not fitting into field 2020-09-23 20:51:43 +02:00
Andreas Bieber 4ab3586259 feat(dropdown): Introduce `SetChangedFunc` 2020-09-23 20:46:36 +02:00
Andreas Bieber 40efd84aad feat(dropdown): Trigger `selected` when drop down list selection is cancelled 2020-09-23 20:46:36 +02:00
Andreas Bieber e716d0acb9 fix(dropdown): Select previous option in dropdown list when cancelling selection 2020-09-23 20:46:36 +02:00
Andreas Bieber f71273b9c8 feat(dropdown): Expose `DropDownOption`
BREAKING CHANGE:
DropDown:
- The signature of `GetCurrentOption` has been changed to return the index and the newly exposed `DropDownOption`
- `AddOption` has been renamed to `AddOptions` and accepts now multiple `DropDownOption`s. A convenience func called `AddOptionsSimple` has been added to simply add options by only providing its text.
- The signature of `SetOptions` has been changed to accept the global `selected` handler with the newly exposed `DropDownOption` and multiple `DropDownOption`s to set. A convenience func, namely `SetOptionsSimple`, has been added to simply add options by only providing its text.
- The signature of `SetSelectedFunc` has been changed to accept a handler expecting an index and the newly exposed `DropDownOption`

Form:
- The signature of `AddDropDown` has been changed to accept an array of the newly exposed `DropDownOption`. A convenience func, namely `AddDropDownSimple`, has been added to simply add a DropDown by only providing the option's text.
2020-09-23 20:46:36 +02:00
Andreas Bieber 75b6d31409 feat(inputfield/autocompletion): Draw selected autocomplete suggestion in `inputfield` without changing it till confirmed with `ENTER` 2020-09-23 20:46:36 +02:00
Andreas Bieber bace1ac630 feat(List): Add additional field for setting an optional reference (like in TreeView) 2020-09-23 20:46:36 +02:00
Andreas Bieber d315a5c5b3 feat(List): Expose `ListItem`
BREAKING CHANGE:
- The signature of `SetChangedFunc` and `SetSelectedFunc` has changed to pass the newly exposed `ListItem` instead of its properties
- The signature of `AddItem` and `InsertItem` has changed to expect a `ListItem` instead of the properties them self
2020-09-23 20:46:36 +02:00
Andreas Bieber 22895b10bc feat(inputfield): Expose setters for autocomplete list colors 2020-09-23 20:46:36 +02:00
Andreas Bieber 32ed5f11d7 chore(inputfield): Compile regex only once 2020-09-23 20:46:36 +02:00
Andreas Bieber e7aaa8402f fix(inputfield): Use correct regex to detect left or right word/non-word 2020-09-23 20:46:36 +02:00
Andreas Bieber 1b44920167 feat(dropdown): Add setters for dropdown list colors 2020-09-23 20:46:36 +02:00
Andreas Bieber 41a24756f9 feat(FormItems): Allow specifying colors for focused state 2020-09-23 20:46:31 +02:00
Andreas Bieber e6bd3c5db9 feat(checkbox): Increase checkbox width by 2 cols 2020-09-23 20:46:07 +02:00
Andreas Bieber a6bb544c20 feat(checkbox): Add `SetCheckedRune` 2020-09-23 20:45:59 +02:00
Andreas Bieber 7678d84c66 feat(flex): Add `AddItemAtIndex` 2020-09-23 18:25:22 +02:00
Andreas Bieber 49e6b5bfe8 feat(treeview): Add `SetSelectedTextColor` and `SetSelectedBackgroundColor` 2020-09-23 18:25:22 +02:00
Andreas Bieber 60cca5d967 feat(box): Add `SetBorderColorFocused` 2020-09-23 18:25:18 +02:00
Andreas Bieber ecfa14af14 feat(box): Add `GetBackgroundColor` 2020-09-19 11:25:32 +02:00
Andreas Bieber 02c4995bb2 feat(form): Add `IndexOfFormItem` 2020-09-19 11:25:32 +02:00
Andreas Bieber 85bc397af2 feat(flex): Add `GetDirection` 2020-09-19 11:25:32 +02:00
Andreas Bieber 2eac84df0b feat(box): Add `GetBorder` 2020-09-19 11:25:23 +02:00
Andreas Bieber 186ebd7dd6 feat(box): Add `GetBorderPadding` 2020-09-17 20:54:13 +02:00
Trevor Slocum 0974659c81 Release v1.4.9 2020-09-08 14:26:39 -07:00
Trevor Slocum f269c326f6 Base List PageUp and PageDown on the number of items displayed 2020-09-08 14:22:58 -07:00
Trevor Slocum a6a473f866 Add TextView.SetReindexBuffer 2020-09-03 19:23:56 -07:00
Trevor Slocum f35f86924a Add Table.Sort, Table.SetSortFunc and Table.SetSortClicked
Resolves #33.
2020-09-01 15:44:43 -07:00
Trevor Slocum 2ebdbde722 Update strikethrough implementation 2020-09-01 13:48:27 -07:00
Trevor Slocum 624a3fae3c Use updated tcell mouse buttons 2020-08-31 08:44:33 -07:00
Trevor Slocum a6258efb39 Expose strikethrough support
Resolves #17.
2020-08-31 07:50:10 -07:00
Trevor Slocum 8292f9baf2 Upgrade tcell to v2
Resolves #32.
2020-08-30 08:37:17 -07:00
Trevor Slocum d32ac6e3e9 Add InputField.GetCursorPosition and InputField.SetCursorPosition 2020-08-24 19:31:48 -07:00
Trevor Slocum 9ec0a6d3f2 Position ContextMenu on selected item when negative coordinates are provided 2020-08-11 15:31:18 -07:00
Trevor Slocum cdeff20296 Use sync.RWMutex in all widgets
Resolves #30.
2020-08-02 10:06:34 -07:00
Trevor Slocum cc7796c4ca Document TextView.GetText and GetRegionText fix 2020-07-13 14:47:10 -07:00
Oliver 81c828bfe0 TextView.GetText() and .GetRegionText() didn't filter out empty colour tags. Fixes #453 2020-07-13 14:41:29 -07:00
Trevor Slocum bf31b0001a Merge branch 'patch-1' into 'master'
FORK.md - Terminal colors and mouse merged upstream

See merge request tslocum/cview!4
2020-07-13 21:37:53 +00:00
Anatoli Babenia 4868c5bcd7 FORK.md - Terminal colors and mouse merged upstream 2020-07-13 03:56:45 +00:00
Trevor Slocum fb4953b17a Fix Form.Clear deadlock
Resolves #28.
2020-06-29 21:44:21 -07:00
Trevor Slocum 2a76c36094 Clarify how to modify Modal title and appearance
Resolves #24.
2020-06-18 15:17:42 -07:00
Trevor Slocum f477be8ba4 Fill nil Flex space with default background color
Resolves #22.
2020-06-14 14:14:15 -07:00
Trevor Slocum 49536324ce Rename Keys.SelectAlt to Keys.Select2 2020-06-10 09:52:50 -07:00
Trevor Slocum 250da74d1e Clarify usage of Modal.GetForm 2020-06-10 09:43:31 -07:00
Trevor Slocum e0fafcdb01 Add Modal.GetForm and Modal.GetFrame
Resolves #19.
2020-06-09 15:51:28 -07:00