Merging Action View Attributes

When any action appears within an application, the automatic merging of its parameters takes place.

 

And the principles of the action attributes precedence described in the previous section are of the highest importance when the runtime system merges the action attributes set on different program levels.  

To illustrate how attribute merging works, let consider the following example of obtaining the finite parameters for the delete action:

 

SystemActionDefaults.fm2 file:

 

<Action Identifier="delete" Text="Delete" Comment="Delete" Order="130000" Validate="no">

      <ActionImage Uri="qx://embedded/delete.png"/>

      <Accelerator1 KeyValue="f2"/>

</Action>

 

UserActionDefaults.fm2 file loaded to an application by means of the LoadActionDefaults() method:

 

<Action Identifier="delete" Text="Delete text" Comment="Delete" Validate="yes">

</Action>

 

XML source, form level:

 

<Action Identifier="delete" Text="MyDelete" Comment="Delete text" Order="3" >

      <ActionImage Uri="qx://newDelete.png"/>

      <Accelerator2 KeyValue="A" ControlModifier="yes" />

      <ShowInContextMenu>Yes</ShowInContextMenu>

</Action>

 

4GL source file, dialog level:

 

fgl_dialog_setactionLabel("Delete", "MyDelete", 1)

 

The table below contains the finite attribute values for the delete action which are obtained in the result of the merging of the parameters set on different program levels (see the extracts given below):

 

Action Attribute

Finite Value

Level (where the value is set)

Identifier

Delete

 

Text

Delete

Dialog Level

Action Image

newDelete.png

Form Level

Comment

Delete text

Form Level

Accelerator1

F2

Cfg file

Accelerator2

CTRL-A

Form Level

Accelerator3

None

None

Accelerator4

None

None

Statical

FALSE

Default value

Validate

Yes

Interface level

ShowInContextMenu

Yes

Form Level

DefaultView

Auto

Default value

Order

1

Dialog Level