I have had numerous requests for an implementation of a multi-line text input control which does not depend on the mWaba toolkit library. I have therefore rewritten and somewhat stripped down the original version of my TextArea to provide a new one which can be used (along with a few support classes) with Waba alone. It is designed for Waba Beta 9 and will probably not work with older versions. It works fine under Java and WinCE but I am unable to test it on a PalmOS device. If someone detects any problems when using it under PalmOS please let me know at: michael_brereton@hotmail.com
I have provided all the source code for the control and its support classes and the JavaDoc generated API. Feel free to use it as you want, commercial or otherwise, just remember to cite myself as the original author in any redistribution of the code.
TextArea allows multi-line text input. It features:
Overall it provides most of the features you would need from such a control. The new-line character ‘\n’, is used to separate lines within the display.
ScrollableTextArea inherits from TextArea and implements the ScrollClient interface which allows it to be placed in a ScrollableContainer. The ScrollableContainer provides horizontal and/or vertical scroll bars to any control which implements the ScrollClient interface. Unlike the ScrollablePanel in the mWaba toolkit, this ScrollableContainer does not support appearing and disappearing scroll bars so the scroll bars will always be visible.
Using the control is fairly simple, even without the API:
And that’s it. There are a few member variables that you can change to alter the behavior of the control. Check the source code or API to see them.
The classes you would need to use the TextArea are: TextArea. AdvControl, Point, DragContext, ImageBuffer, IScroll, and textAreaState.
All together it takes up about 17K. There is an additional class, TextAreaApp.class which is an example Applet showing the TextArea control.
Again this is fairly simple.
The classes you would need to use the ScrollabeTextArea
are all the ones needed by TextArea and the following additional classes:
ScrollableTextArea, ScrollClient, ScrollServer, mScrollEvent, TrackControl,
ScrollTrack, ScrollBar, and ScrollableContainer.
This adds on another 10K. There is an additional class, ScrollabeTextAreaApp.class which is an example Applet showing the ScrollableTextArea control.