Dividers in rbcurse 1.2.0
Like a Vim screen, rbcurse has controls that permit creation of multiple panes or windows containing lists, tables, and textareas. These may be resized using keys such as "Ctrl-W + – =" etc. However, there are complex cases where its not possible for the widget to know what all to resize and in what direction. The attached image shows the mbox email client demo with 2 Dividers between the panes of a MasterDetail object. Now these dividers could have been made focusable, but that becomes a pain for the user since they will take focus every time user tabs through.
Pressing F3 (can be configured), makes all such widgets focusable (toggle) such that arrow keys can be used for resizing adjacent widgets. However, pressing arrow keys on these widgets fires an event so the user can do custom resizing. Objects such as VimSplit also fire events for maximizing the current component in one keystroke, which can be bound by the app so custom resizing can be done.
In this version of the demo, i’ve moved to a TabularWidget, and allow the user to press Enter on the header row, so that column sorting can be done. I’ve done some crude sorting, whereas in reality the real data will be sorted from source.
In the image, when focus falls on the Divider (horizontal one on right middle), it becomes yellow, and displays up and down arrow keys. Similarly, when focus falls on the vertical one, it will light up and show left and right arrow keys. Pressing F3 will toggle focusability to make traversal easy.