delphitactionmanager

Number of TActionManager components in a project


I've used TActionLists in D7 for many projects, one for each TForm where it seemed relevant. Now, starting a new project i XE2, the users require a Ribbon, which seems to require a TActionManager.

Reading online and the documentation doesn't give me a clear idea on how to utilize the TActionManager in the way it was developed. My questions are:

Thanks,

/Mikkel


Solution

  • (1) Although conceptually, it is preferable to limit components on forms to visual components and components that are very closely tied to presentation, moving aside all others to data-modules, TActionLists and TActionManagers are the exception to the rule for a practical reason. If you put an actionmanager on a datamodule and have action bars on a form with buttons and menu items linked to contained actions of the actionmanager, the IDE will sometimes destroy all your actionbar hosted controls. To save frustration, put one actionmanager each form.

    (2) Once you start using Actionmanagers, there is no reason to use ActionLists. An actionmanager is like an actionlist on steriods. While you could have a mix, it seems simpler to have just all of one kind in a project. Compare the look and feel of an actionband main menu with an XPStyle style setting, with an old fashioned main menu.

    (3) There is no issue with using actionmanagers in SDI or MDI applications, that I am aware of.

    (4) ActionBands are more than a decade old now. Here are some links authored two great Delphi luminaries...