Kexi/Handbook/Building Simple Databases/Designing Forms/Actions: Difference between revisions

From KDE Wiki Sandbox
(Splitting lists into smaller units)
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 6: Line 6:
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).  


<!--T:3-->
===== Assigning actions to form buttons ===== <!--T:3-->
'''Assigning actions to form buttons'''


<!--T:4-->
<!--T:4-->
Line 16: Line 15:


<!--T:6-->
<!--T:6-->
# Switch to form's '''Design View''' if you have not done yet.</translate>
# Switch to form's Design view if you have not done yet.</translate>
<translate>
<translate>
<!--T:11-->
# 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. </translate>
# 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. </translate>
<translate>
<translate>
<!--T:12-->
# Click the button widget with the right mouse button to display the context menu. </translate>
# Click the button widget with the right mouse button to display the context menu. </translate>
<translate>
<translate>
<!--T:13-->
# From the context menu select <menuchoice>Assign action...</menuchoice> command. </translate>
# From the context menu select <menuchoice>Assign action...</menuchoice> command. </translate>
<translate>
<translate>
# An '''Assigning Action to Command 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 type''' drop down list has the <menuchoice>No</menuchoice> type item selected. </translate>
<!--T:14-->
# 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. </translate>
<translate>
<translate>
# From the '''Action''' type drop down list select <menuchoice>Application</menuchoice> item. Available application-wide actions will be listed. </translate>
<!--T:15-->
# From the '''Action category''' list select <menuchoice>Application actions</menuchoice> item. Available application-wide actions will be listed. </translate>
<translate>
<translate>
# Select one of the actions on the list (e.g. <menuchoice>Delete Row</menuchoice>).</translate>
<!--T:16-->
# Select one of the actions on the list (e.g. <menuchoice>Delete Selected object</menuchoice>).</translate>
<translate>
<translate>
# Click the <menuchoice>OK</menuchoice> button or press the <keycap>Enter</keycap> key to accept your selection.  
<!--T:17-->
<!--dialog closes immediately after clicking an action in the list
# Click the <menuchoice>OK</menuchoice> button or press the <keycap>Enter</keycap> key to accept your selection. -->


<!--T:7-->
<!--T:7-->
After switching to the form's data view you can try whether the action works. For example, if you assigned <menuchoice>Delete Row</menuchoice> action, clicking the button, the current database row will be deleted, similarly to executing <menuchoice>Edit->Delete Row</menuchoice> (<keycap>Ctrl+Delete</keycap>) menu command (depending on your settings you may be asked to confirm the removal).  
After switching to the form's data view you can try whether the action works. <!--FIXME not in master/2.4 For example, if you assigned <menuchoice>Delete Row</menuchoice> action, clicking the button, the current database row will be deleted, similarly to executing <menuchoice>Edit->Delete Row</menuchoice> (<keycap>Ctrl+Delete</keycap>) menu command (depending on your settings you may be asked to confirm the removal). -->


<!--T:8-->
<!--T:8-->
{{Note|
{{Note|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 <menuchoice>No</menuchoice> type item from the '''Action type''' drop down list of the '''Assigning Action to Command Button''' dialog window. <!--}}-->


* Actions only work in the form's data view. Not every action's assignment is reasonable. For example, the <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.}} <!--{{-->
<!--T:18-->
* 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.}} <!--{{-->


<!--T:9-->
<!--T:9-->

Latest revision as of 06:51, 16 May 2014

Other languages:

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:

  1. Switch to form's Design view if you have not done yet.
  2. 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.
  3. Click the button widget with the right mouse button to display the context menu.
  4. From the context menu select Assign action... command.
  5. 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 No action item selected.
  6. From the Action category list select Application actions item. Available application-wide actions will be listed.
  7. Select one of the actions on the list (e.g. Delete Selected object).

After switching to the form's data view you can try whether the action works.

Note
To remove an action assignment, select the No action 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 Font... 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.