Scrolling Form in ruby ncurses
I’ve just added a Scrolling Form (class
ScrollForm). This allows us to create a form that takes a lot more space than the physical screen. A multi-page data entry screen can be implemented using one ScrollForm. The user can just scroll down or right to get to other fields.
Form with a couple of changes:
* Using a
Pad to write on instead of
focusable() to include
visible?(), so only visible components get focus
* Scroll Keys (M-l, h, n, p) are used to pan the screen vertically or horizontally
This component is in its infancy, need to take care of multi-line components. The demo is am working on is in examples/testscroller.rb
I think this is the last of the new components or widgets I have in mind. Now just to test out and make some more demos. And keep releasing patches or minor optimizations.
The next component will likely be the Tree Component, but that will be in another round of development perhaps 3-4 months down, not earlier.
# Instead of defining a local variable with some initial content (often just an empty hash or array), you can instead define it “on the go” so you can perform operations on it at the same time:
(z ||= ) << 'test'