ruby TabbedPane new features – unlimited tabs
ruby rbcurse now has a slightly better tabbedpane. Essentially, one can add as many Tabs as one needs.
Traversal will only take focus to visible tab buttons. While on the button form,
M-h will scroll horizontally and being other tabs (buttons) in to view and focus. The test program examples/testtpane.rb can be tried out. While on the button form, press
M-x several times. This is bound to a block that opens a new tab with a text object inside.
(for the moment, just press a left or right key to repaint the form). If you’ve got more buttons that can be displayed test out traversal with the TAB key. Now use
M-l to bring the off-screen buttons into view.
Backtabbing from a form will bring focus onto the last visible button. Similarly, tabbing off the last field of a form will take focus to the first visible button of the button panel.
To make this possible, I’ve extended the old Form class and made a
ScrollForm that contains a
Pad instead of an
Ncurses::Window. This class extends some methods of form to check for whether a field is visible or not. It also resizes the Pad, if a widget is created that falls outside the width or height. This new class has only been tested with the button panel which has a height of 1, and no rows. So it’s not tested with a form that contains many rows! I need to separate it and start testing it in various situations, so we can have multi-page forms in curses using only one form.