Liberty BASIC provides different kinds of window types. Controls can be added to these windows as needed (see help section Controls - Menus, Buttons, Etc.). Here are the kinds of windows and the commands associated with them:
The way to specify what kind of window to open is as follows:
open "Window Title" for type as #handle
where type would be one of the descriptors below.
Style suffixes for window types (not all suffixes are supported for each window type):
_fs | window is sized to fill the screen |
_nf | window has no frame and cannot be resized by user |
_nsb | window doesn't contain scroll bars |
_ins | contains inset texteditor |
_popup | window contains no titlebar or sizing frame |
_modal | window must be closed before another window can gain focus |
Liberty BASIC Window Types
There are four types of windows available.These four types include style variations as specified above. The styles of these windows can be changed if the STYLEBITS command is issued before the command to open the window.
Here are the descriptions of the four window types.
Window
Windows of type "window" are the most used and useful windows used by Liberty BASIC programmers. They can contain any of the controls. They can have a sizing frame, or omit it. They can have a titlebar, or they can appear with no titlebar. They can include a menu, but they do not have to have a menu. It is also possible for the user to hit the TAB key to move focus from one control to the next in a window of type "window."
Graphics
Windows of type "graphics" are especially suited to displaying graphics and graphical sprites. They are not intended to contain controls, and some controls do not work properly when placed in a graphics window. A sizing frame and scrollbars are optional in a graphics window.
Dialog
Windows of type "dialog" are similar to windows of type "window" in that they can contain all of the other controls except menus. Menus cannot be placed on a dialog window. Dialog windows allow the user to hit the TAB key to move focus from one control to the next. A dialog can have a default button that is activated when the user hits the ENTER key. For this reason, texteditors do not work well in dialog windows, because hitting ENTER is trapped by the window and the user cannot add a carriage return to text in a texteditor. Dialog windows are best suited for getting information from a user, although it is possible to have applications that are dialog-based. Dialog windows may display as "modal." This means that they receive the input focus for the program until they are closed. Other program windows cannot be accessed by a user while a modal dialog is displayed.
Text
Windows of type "text" are quite limited in their functionality. They are not meant to contain other controls. They are useful for displaying text to a user, or for allowing a user to write and edit text. Text windows always have a menubar that contains a ready-made File Menu and a ready-made Edit Menu.
Window types:
graphics | open a graphics window |
graphics_fs | open a graphics window full screen (size of the screen) |
graphics_nsb | open a graphics window w/no scroll bars |
graphics_fs_nsb | open a graphics window full screen, w/no scroll bars |
graphics_nf_nsb | open a graphics window with no sizing frame or scroll bars |
text | open a text window |
text_fs | open a text window full screen |
text_nsb | open a text window w/no scroll bars |
text_nsb_ins | open a text window w/no scroll bars, with inset editor |
window | open a basic window type |
window_nf | open a basic window type without a sizing frame |
window_popup | open a window without a title bar |
dialog | open a dialog box |
dialog_modal | open a modal dialog box |
dialog_nf | open a dialog box without a frame |
dialog_nf_modal | open a modal dialog box without a frame |
dialog_fs | open a dialog box the size of the screen |
dialog_nf_fs | open a dialog box without a frame the size of the screen |
dialog_popup | open a dialog box without a titlebar |