company logo

ActionItem - Action item

Action items associate an action to be executed with an item name. Action items usually are associated with one or more GUI action elements (menu or toolbar item, short cut or button action). One may associate one action item with several GUI action elements. Changing the state of the action item (e.g. label, help text or enable state) will influence all associated GUI action elements.

One might change action item properties during run-time. It is also possible, creating new items in a sub-item list or remove sub-items. In order to make such changes visible, refresh() has to be called with the action item changed or owning the sub-item list.

Creating an action for a control (context) allows reading or updating (e.g. changing action state) by position or name.

  ActionItem      action(this);

  if ( action.count() > 0 ) // returns the number of actions associated with the control/button

    action.get(0);          // get default action, e.g. for a button control

Functions