Documentation YAML for OpenPetra Forms: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
(New page: * generally the yml files inherit from each other ('''BaseYaml''') ** this allows us to only define the default menu items once, in PetraForm.yaml, and they will be included in all derived...)
 
No edit summary
Line 1: Line 1:
== Inheritance ==
* generally the yml files inherit from each other ('''BaseYaml''')
* generally the yml files inherit from each other ('''BaseYaml''')
** this allows us to only define the default menu items once, in PetraForm.yaml, and they will be included in all derived forms
** this allows us to only define the default menu items once, in PetraForm.yaml, and they will be included in all derived forms
== Attributes of the root node ==
* '''FormType''':  
* '''FormType''':  
** ''abstract'': if this is just used as a base form for other real forms
** ''abstract'': if this is just used as a base form for other real forms
Line 9: Line 11:
* '''MasterTable''': if this is set, you will need to write less DataField attributes for the controls. The name of the controls will be matched to a field in the given table; if such a table field exists, it will be linked to the control.
* '''MasterTable''': if this is set, you will need to write less DataField attributes for the controls. The name of the controls will be matched to a field in the given table; if such a table field exists, it will be linked to the control.
* '''DetailTable''': similar to MasterTable, but this is for the detail table; controls must have the word ''Detail'' after the prefix, eg. txtDetailAmount
* '''DetailTable''': similar to MasterTable, but this is for the detail table; controls must have the word ''Detail'' after the prefix, eg. txtDetailAmount
== Events ==
* '''Events''': here you can link form events to methods in your code
* '''Events''': here you can link form events to methods in your code
** eg. <code>Activated: {class=System.EventHandler,method=FTheObject.TFrmPetra_Activated}</code>
** eg. <code>Activated: {class=System.EventHandler,method=FTheObject.TFrmPetra_Activated}</code>
== Actions ==
* '''Actions''': actions can be used by menuitems, toolbarbuttons, and other controls; this is useful to be able to enable/disable an action on the whole screen, and to only define a certain action once, and refer to it from all controls that trigger the same action
* '''Actions''': actions can be used by menuitems, toolbarbuttons, and other controls; this is useful to be able to enable/disable an action on the whole screen, and to only define a certain action once, and refer to it from all controls that trigger the same action
** eg. <code>actClose: {Label=&Close, ActionId=eClose, Tooltip=Closes this window, Image=Close.ico}</code>
** eg. <code>actClose: {Label=&Close, ActionId=eClose, Tooltip=Closes this window, Image=Close.ico}</code>
** eg. <code>actMainMenu: {Label=Petra &Main Menu, ActionClick=FTheObject.OpenMainScreen}</code>
** eg. <code>actMainMenu: {Label=Petra &Main Menu, ActionClick=FTheObject.OpenMainScreen}</code>
** '''Enabled''': Actions can depend on other actions or conditions; they will be disabled if the condition is false; eg <code>Enabled: cndSelectedSupplier</code>; this can be set in a grid, with '''SelectedRowActivates'''; eg <code>grdSupplierResult: {Dock=Fill, ActionDoubleClick=actSupplierTransactions, SelectedRowActivates=cndSelectedSupplier}</code>
** '''Enabled''': Actions can depend on other actions or conditions; they will be disabled if the condition is false; eg <code>Enabled: cndSelectedSupplier</code>; this can be set in a grid, with '''SelectedRowActivates'''; eg <code>grdSupplierResult: {Dock=Fill, ActionDoubleClick=actSupplierTransactions, SelectedRowActivates=cndSelectedSupplier}</code>
== Controls ==
* '''Controls''': see [[Screen scaffolding: controls]]
* '''Controls''': see [[Screen scaffolding: controls]]
== Menu & Toolbar ==
* '''Menu''': TODO
* '''Menu''': TODO
* '''Toolbar''': TODO
* '''Toolbar''': TODO
* '''Layout''': TODO
== Layout ==
* '''Layout''': TODO (Tabbed pages etc)
 
Another option for layout is the '''Controls''' property that can be used for Panels and GroupBoxes: You can use several rows to arrange the controls and they are aligned in a table layout.

Revision as of 09:10, 17 July 2009

Inheritance

  • generally the yml files inherit from each other (BaseYaml)
    • this allows us to only define the default menu items once, in PetraForm.yaml, and they will be included in all derived forms

Attributes of the root node

  • FormType:
    • abstract: if this is just used as a base form for other real forms
    • navigation: the main window, the module windows
    • edit: edit screens
    • crud: CRUD screens (Create, Read, Update, Delete)
    • find, browse: find screens
  • MasterTable: if this is set, you will need to write less DataField attributes for the controls. The name of the controls will be matched to a field in the given table; if such a table field exists, it will be linked to the control.
  • DetailTable: similar to MasterTable, but this is for the detail table; controls must have the word Detail after the prefix, eg. txtDetailAmount

Events

  • Events: here you can link form events to methods in your code
    • eg. Activated: {class=System.EventHandler,method=FTheObject.TFrmPetra_Activated}

Actions

  • Actions: actions can be used by menuitems, toolbarbuttons, and other controls; this is useful to be able to enable/disable an action on the whole screen, and to only define a certain action once, and refer to it from all controls that trigger the same action
    • eg. actClose: {Label=&Close, ActionId=eClose, Tooltip=Closes this window, Image=Close.ico}
    • eg. actMainMenu: {Label=Petra &Main Menu, ActionClick=FTheObject.OpenMainScreen}
    • Enabled: Actions can depend on other actions or conditions; they will be disabled if the condition is false; eg Enabled: cndSelectedSupplier; this can be set in a grid, with SelectedRowActivates; eg grdSupplierResult: {Dock=Fill, ActionDoubleClick=actSupplierTransactions, SelectedRowActivates=cndSelectedSupplier}

Controls

Menu & Toolbar

  • Menu: TODO
  • Toolbar: TODO

Layout

  • Layout: TODO (Tabbed pages etc)

Another option for layout is the Controls property that can be used for Panels and GroupBoxes: You can use several rows to arrange the controls and they are aligned in a table layout.