Kexi/Handbook/Building Simple Databases/Designing Forms/Actions/en: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
Line 4: | Line 4: | ||
An Action is a single activity isolated in the application, available for the user to execute. It can also be executed automatically as a reaction for a given event (e.g. after opening a form). | An Action is a single activity isolated in the application, available for the user to execute. It can also be executed automatically as a reaction for a given event (e.g. after opening a form). | ||
Assigning actions to form buttons | ===== Assigning actions to form buttons ===== | ||
Many actions can be assigned to form button. The assigned action is executed after button is clicked. | Many actions can be assigned to form button. The assigned action is executed after button is clicked. | ||
Line 10: | Line 10: | ||
To assign action: | To assign action: | ||
# Switch to form's | # Switch to form's Design view if you have not done yet. | ||
# Select the existing button widget by clicking on it or put a new button widget onto the form. If you inserted a new button, enter its title and press <keycap>Enter</keycap> key. | # Select the existing button widget by clicking on it or put a new button widget onto the form. If you inserted a new button, enter its title and press <keycap>Enter</keycap> key. | ||
# Click the button widget with the right mouse button to display the context menu. | # Click the button widget with the right mouse button to display the context menu. | ||
# From the context menu select <menuchoice>Assign action...</menuchoice> command. | # From the context menu select <menuchoice>Assign action...</menuchoice> command. | ||
# An '''Assigning Action to Button''' dialog window will appear presenting a list of available actions. One of the actions is selected if the widget already has action assigned. Otherwise the '''Action category''' list has the <menuchoice>No action</menuchoice> item selected. | # An '''Assigning Action to Button''' dialog window will appear presenting a list of available actions. One of the actions is selected if the widget already has action assigned. Otherwise the '''Action category''' list has the <menuchoice>No action</menuchoice> item selected. | ||
# From the '''Action | # From the '''Action category''' list select <menuchoice>Application actions</menuchoice> item. Available application-wide actions will be listed. | ||
# Select one of the actions on the list (e.g. <menuchoice>Delete Selected object</menuchoice>). | # Select one of the actions on the list (e.g. <menuchoice>Delete Selected object</menuchoice>). | ||
<!--dialog closes immediately after clicking an action in the list | <!--dialog closes immediately after clicking an action in the list | ||
Line 25: | Line 25: | ||
* To remove an action assignment, select the <menuchoice>No action</menuchoice> item from the '''Action category''' list of the '''Assigning Action to Button''' dialog window. <!--}}--> | * To remove an action assignment, select the <menuchoice>No action</menuchoice> item from the '''Action category''' list of the '''Assigning Action to Button''' dialog window. <!--}}--> | ||
* Actions only work in the form's data view. Not every action's assignment is reasonable. For example, the <!--FIXME in master/2.4 no Font action available???--><menuchoice>Font...</menuchoice> action is available in data view, but only if you have a widget selected in the | * Actions only work in the form's data view. Not every action's assignment is reasonable. For example, the <!--FIXME in master/2.4 no Font action available???--><menuchoice>Font...</menuchoice> action is available in data view, but only if you have a widget selected in the Design view. If you make changes to the font settings the changes are applied to the text of that selected widget.}} <!--{{--> | ||
{{Prevnext2 | {{Prevnext2 |
Revision as of 11:32, 20 April 2012
Actions
An Action is a single activity isolated in the application, available for the user to execute. It can also be executed automatically as a reaction for a given event (e.g. after opening a form).
Assigning actions to form buttons
Many actions can be assigned to form button. The assigned action is executed after button is clicked.
To assign action:
- Switch to form's Design view if you have not done yet.
- Select the existing button widget by clicking on it or put a new button widget onto the form. If you inserted a new button, enter its title and press Enter key.
- Click the button widget with the right mouse button to display the context menu.
- From the context menu select command.
- An Assigning Action to Button dialog window will appear presenting a list of available actions. One of the actions is selected if the widget already has action assigned. Otherwise the Action category list has the item selected.
- From the Action category list select item. Available application-wide actions will be listed.
- Select one of the actions on the list (e.g. ).
After switching to the form's data view you can try whether the action works.
Note
* To remove an action assignment, select the
item from the Action category list of the Assigning Action to Button dialog window.
- Actions only work in the form's data view. Not every action's assignment is reasonable. For example, the action is available in data view, but only if you have a widget selected in the Design view. If you make changes to the font settings the changes are applied to the text of that selected widget.