Event action schema
The GUI framework provides different ways of implementing and calling actions. Typically, actions are implemented as functions in a context class assigned to a GUI element. Other actions might be implemented as windows or document (templates) or on any other form.
The event action schema, however, does not focus on implementing actions, but on linking actions with different types of events. The simple case are system defined links between system events and appropriate actions (e.g. action doBeforeClose(), which is linked with the system close event). For these event actions, no specific schema is required.
The situation becomes more complex considering specific actions initiated by user interaction. Usually, users work with pointing devices (e.g. mouse) or keyboard and use visualized actions in form of buttons, tool bars or menu items. Often, several visualizations in an application refer to the same action (e.g. a menu item and a tool bar item). Moreover, invisible event action elements might be defined as short cuts or hidden key combination.
Within the ODABA GUI frame work the concept of event actions has been introduced in order to allow an abstract definition of the link between action and event, which may appear in different forms within a GUI application. Event actions can be accessed in an application program via the odabagui::ActionItem class.
In order to provide an event action schema, the GUI framework supports the definition of event action controls (ADK_EventActionControl). Most GUI elements like buttons, menus or field controls refer to event action controls. Event action controls define a kind of abstract event actions, which may be associated with several GUI elements (menu items, buttons, shortcuts).
The GUI framework provides a standard event action schema, which consists of a number of default event actions (e.g. EditEntry or DeleteEntry) called via shortcuts. GUI elements like field controls are automatically associated with a defined set of default event actions depending on the control style. Default event actions associated with control types are described in chapter Control styles.
Most default actions are associated with an action, a shortcut and a label, but do not contain additional properties as tool tips, icon or usage hints. In order to extend default action definitions, those may be overloaded by means of event action controls (ADK_EventActionControl) in the resource database for an application. Usually, event action controls for default actions are provided when initializing the resource database and may be updated later on (Designer). This also allows updating the initial state for default actions.
There are different places for changing initial settings for default actions. One way to change initial states for actions are GUI framework options. GUI framework options may be set for actions or action items (event action controls):
GUIFramework.Actions.DeleteSet=disable (disable action)
GUIFramework.Actions.DeleteSet.RemoveSet=suppress (suppress action item).
For setting proper options, one may use the options dialog:
The first setting disables all action items referring to action DeleteSet, i.e. action item DeleteSet and RemoveSet. Second setting only disables the action item RemoveSet.
In order to ignore all subsequent action settings, the GUIFramework.Actions option may be set to ignore.
Option settings have got highest priority and will overwrite action (item) states set in the Designer or via application. Supported values for settings are:
suppress - Action (item) is not supported at all, i.e. action is disabled and not visible. Action state cannot be changed from within the application.
disabled - Action (item) is disabled and cannot be executed. In this case, the default action cannot be executed unless it is enabled again from within the application.
hidden - Action (item) is not visible but may be executed (e.g. via shortcut).In this case, the action may be called and executed (e.g. via shortcut or program call) but is not shown in menus and tool bars.
shortcut - When the action (item) is not disabled, hidden or suppressed, the shortcut for the action may be changed by defining an appropriate value (e.g. F1+Ctrl).
When the default action has been defined as event action control within the resource database. Designer also supports changing initial settings for action items. In contrast to options, several settings may be changed for a default action by changing settings for the event action control (ADK_EventActionControl).
Switching Auto-open off, will completely suppress the action item. Setting Disabled option on, will disable the action item and setting Hidden to on will hide the action item. The default shortcut bay be changed by defining appropriate key and meta-key settings.
Disabled and hidden state provide initial settings, which will be updated automatically according to current control state (instance selected, list empty etc.). In order to supress the action completely, auto-open must be switched (Designer) off, or action option has to be set to suppress.
Related topics
- ActionItem - Action item
- Event action control