* Add wrap_draw implementation for BoxView
This implementation was required because the restriction of fixed &
at least sized BoxView was not fulfilled with the default. The new
implementation takes this into consideration.
Frequent updates to `TextContent` while the screen is being refreshed can
trigger an out-of-bounds access: an update with a smaller string being
performed between calls to `compute_rows()` and `draw()` on TextView will
cause an out-of-bounds access when slicing the string at `Segment::resolve`.
This change fixes the issue by caching the content value when performing
size calculations and using this cached content when drawing the view.
Some additional changes were also made to reuse `TextContent` invalidation
code on `TextView` and wrap content data with `RefCell<Arc<..>>` to enable
sharing the inner string between `content_value` and `content_cache`.
Pancurses returns different key codes for "Enter" in the normal area
('\r'), and the one in the numpad ('\n'). Cursive only interpretes '\n'
as Enter, and leaves '\r' as CtrlChar('m'), which is different than
that with NCurses on Linux, and makes 'Enter' key not trigger a clicked
event on buttons.
* Add a sort method to SelectView, to easily sort all contained items lexicographically by their label.
* Add more sort methods to SelectView, bringing the API up to parity with Vec (except SelectView does not expose _unstable_ sorting).
* Rename SelectView::sort to sort_by_label to make it clear that it does not sort by the ordering of the items.
* The Ord implementation for select_view::Item is not necessary.
* Implement a SelectView::sort method for when the item values are orderable.