Define context menu actions (verbs) for your components using component editors

Posted on

Context menu with component actions

You can now define a “component editor” class to add commands to the context menu when you right-click the component in CGE editor hierarchy. Detailed instructions and example how to do this are in manual: Add “verbs” to the context menu for given component.

A full working example application is in examples/advanced_editor/custom_component, it defines a verb “Reload URL” over sample TImageGrid defined in that project.

This feature is already used by some built-in components:

  1. “Reset Transformation” is now available for TCastleTransform and all descendants.
  2. “Reload URL” is available for various components that load things from files (TCastleScene, TCastleImageTransform, TCastleImageControl).
  3. “Edit”, “Revert”, “Open” are available for TCastleDesign and TCastleTransformDesign. These new commands will be described in a separate upcoming post — they greatly enhance how you can reuse the designs.

Start the discussion at Castle Game Engine Forum