Creating Customizable Toolbars and Menus

From RAD Studio
Jump to: navigation, search

Go Up to Handling VCL Actions Using an Action Manager

You can use action bands with the Action Manager to create customizable toolbars and menus. At runtime, users of your application can customize the toolbars and menus (action bands) in the application user interface using a customization dialog similar to the Action Manager editor.

To allow the user of your application to customize an action band in your application

  1. Drop an Action Manager component onto a form.
  2. Drop your action band components (Vcl.ActnMenus.TCustomActionMainMenuBar,Vcl.ActnCtrls.TActionToolBar).
  3. Double-click the Action Manager to display the Action Manager editor:
    • Add the actions you want to use in your application. Also add the Customize action, which appears at the bottom of the standard actions list.
    • Drop a TCustomizeDlg component from the Additional tab onto the form, and connect it to the Action Manager using its ActionManager property. You specify a filename for where to stream customizations made by users.
    • Drag and drop the actions onto the action band components. (Make sure you add the Customize action to the toolbar or menu.)
  4. Complete your application.

When you compile and run the application, users can access a Customize command that displays a customization dialog box similar to the Action Manager editor. They can drag and drop menu items and create toolbars using the same actions you supplied in the Action Manager.

See Also