Product Documentation
Virtuoso Studio Design Environment SKILL Reference
Product Version IC23.1, November 2023

Defining a Menu Update Policy

To define a menu update policy in your application, you need to do the following:

  1. Decide what status flags your application needs.
    For example, the Layout editor defines the following flags:
    layoutIsEditable = 2
    layoutIsModified = 4
    shapeIsSelected = 8
    The status flags must be powers of two so that each corresponds to one bit in the status number.
  2. Set the enable predicate on one or more menus items. The enable predicate is a bit mask. The bitmask is formed by combining the status flags using the bitwise OR operator.
    For example, the createShapeMenu and the deselectAllMenu enable predicates are set as follows:
    geSetEnablePredicate(createShapeMenu "LayoutApp" layoutIsEditable)
    geSetEnablePredicate(deselectAllMenu "LayoutApp" shapeIsSelected)
    You must pass the menu object, not the menu’s symbolic name, to geSetEnablePredicate.
  3. Use geSetWindowStatus to set the current status whenever your application’s status changes. The Virtuoso tool enables or disables your menus according to the policy you define.
    currentStatus = geGetWindowStatus(windowId "LayoutApp")
    currentStatus = if(cellview~>modifiedButNotSaved
      then currentStatus | layoutIsModified
      else curre
    ntStatus & ~layoutIsModified
    )
    geSetWindowStatus(windowId "LayoutApp" currentStatus)

Related Topics

geSetEnablePredicate

geSetWindowStatus

geGetWindowStatus

Automatic Menu Enabling Functions


Return to top
 ⠀
X