|
GEOS SDK TechDocs
|
|
5.4 Input
|
5.6 Scrolling Views
Among the generic objects of the GEOS UI library is GenInteraction. This object can be used to implement menus, dialog boxes, and error boxes, and it can also be used for grouping and arranging other generic objects (such as triggers, lists, etc.). It provides extreme flexibility and functionality, and experienced programmers can usually get a menu and dialog structure up on the screen quickly just by setting a few attributes.
Remember that because the Interaction is a generic object, the Generic UI and Specific UI libraries will translate it into its proper implementation at run-time. The Interaction serves the primary purpose of grouping objects; the grouping may be implemented in various ways (e.g. a menu or a dialog box) depending on the attributes and hints applied.
The sections below outline some of the practical functionality of these objects; for a full description of what these do and how they can be used, see the Object Reference Book.
Menus
Menus in GEOS are subject to the rules and conventions of the specific UI in use by the user. However, several basic concepts are supported.
-
Standard menus
Some specific UIs have differing menu structures. Therefore, several standard generic menus (e.g. the File menu) can be implemented by giving the menu a standard set of attributes. The UI will automatically build and manage this menu according to the UI specification in use at the time.
-
Cascading or nested menus
Because Interactions may be nested, cascading (or nested) menus are easy to implement. Cascading menus are useful if an application has many menu items that may logically be grouped into different areas of functionality.
-
Keyboard accelerators
Because the UI manages both input and menus, you can easily specify accelerator keystrokes for each menu item. When the user hits the proper keystrokes, the same action is performed as if the user had clicked on the associated menu item. This happens automatically without additional application code.
-
Keyboard menu navigation
Every menu item may have a character that the user may press during keyboard navigation. This is important because it allows users to use your entire application without having a mouse.
-
Lists and checkboxes within menus
Menus may contain not only triggers but also lists of items. Lists are implemented with the GenItemGroup, GenItem, GenBooleanGroup, and GenBoolean generic objects. Lists may be exclusive or not, and each entry may have a checkbox indicating its on/off status. Again, all these functions are determined by the attributes set for the interaction and item objects.
-
Menu items that bring up dialog boxes
By setting certain attributes in an interaction, you can create menu items that automatically bring up dialog boxes. The UI will put a trigger in the menu representing the dialog box, and when the trigger is activated, the UI will put up the box.
-
Pin-up menus
In the OSF/Motif implementation of GEOS, all menus are automatically given the ability to be pinned in place and moved around the screen. Because this is a function of the specific UI, applications are completely unaware of the fact.
Dialog Boxes
Dialog boxes are standard ways of having an application interact with the user. For example, a dialog box may contain a number of controls that determine how the application displays its data.
Dialog boxes, like menus, are implemented through the use of GenInteraction objects. Applications may also call a kernel routine that will put up standard dialogs in certain situations (e.g. errors or warnings).
Several features of dialog boxes are implemented automatically with very little additional code in the application:
-
Automatic geometry management
When a dialog box contains generic objects (e.g. triggers, lists, and text fields), all geometry is handled automatically. By using various hints, you can modify the normal organization, but sizing and placement of the generic objects and the dialog box are entirely automatic.
-
Standard response triggers and reply bars
Just as there are standard menu types, UI specifications often include rules for dialog box response triggers (e.g., the "OK" button on the left and a "Cancel" button on the right). Standard response triggers normally appear in an area of the dialog box known as the "reply bar." You can set up a reply bar with standard attributes that will automatically be implemented properly by the UI. As an alternative, you can even use pre-defined dialog box types that have their own reply bars.
-
Modality
Sometimes, dialog boxes require a user action before the application or system can continue with other tasks. Dialog boxes can have various modality states: system-modal, which does not allow the user to interact with anything but the dialog box; application-modal, which allows the user to switch to other applications but disallows interaction within the dialog's application (except for the dialog box); and non-modal, which allows the user to switch to any other part of the system.
-
Standard dialog types
To increase the amount of standardization across all applications, GEOS includes several standard dialog box types accessible through the use of UI routines. These include errors, warnings, and questions. Also, you can call up custom dialog boxes with special kernel routines.
|
GEOS SDK TechDocs
|
|
5.4 Input
|
5.6 Scrolling Views