Skip to content

A couple of new features and fixes

Hi,

first of all, sorry for this relatively large PR.

The features and fixes contained in this PR are originally from a fork of tview, which I created a couple of weeks ago. As you may have noticed, the maintainer of tview is not very active (no offense) and only edits issues in large intervals. PRs are also lying around for a long time.

Now I recently stumbled across your fork and thought I'd add my extensions to it.

Besides the other new features and fixes this PR contains two Breaking Changes:

AndreasBieber/cview@1ad2f3a0 (Expose ListItem):
The signature of SetChangedFunc and SetSelectedFunc has changed to pass the newly exposed ListItem instead of its properties

AndreasBieber/cview@844c13a2 (Expose DropDownOption):
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 DropDownOptions. 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 DropDownOptions 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.

Each commit with a breaking change contains a description of what has changed that lead to the breaking change.

I tried to keep each commit as small as possible. And as you will notice I've used symantic commit style. If you don't want this I can adjust it to your current commit style.

I know this is a lot to review, but I think its worth it.

Cheers Andreas

PS: Sorry again 😉

Edited by Andreas Bieber

Merge request reports