Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Hull and Outfitting

Implied Menu-field Groups

  • Last UpdatedFeb 08, 2023
  • 1 minute read

A separator field and all following fields up to but not including the next separator field implies a menu-field group. You can modify the ACTIVE and VISIBLE properties of all fields in the group, by reference to its separator name.

For example, for the menu:

!menu = !this.newmenu( 'file', 'Main' )

!menu.add( 'MENU', 'Send to', 'SendList', 'SendTo' )

 !menu.add( 'SEPARATOR', 'SaveGroup' )

  !menu.add( 'CALLBACK', 'Save', '!this.SaveFile()', 'Save' )

menu.add( 'FORM', 'Save as...', 'SaveFile', 'SaveAs' )

 !menu.add( 'SEPARATOR', 'explGroup' )

  !menu.add( 'FORM', 'Explorer...', 'ExplFile', 'Expl' )

Executing the method

!menu.SetField( 'saveGroup', 'visible', false )

will make the all the fields invisible for the group currently implied by the separator field ‘SaveGroup’, that means, the fields SaveGroup, Save and SaveAs.

The combination of named SEPARATOR fields, insertion and field group visibility will be useful for managing the sharing of menus between co-operating sub-applications. This facility should be used with great care.

TitleResults for “How to create a CRG?”Also Available in