title: Dynamic menus/actions in Delphi
body: <p>I have an application with a submenu of places each with unique shortcut. Until now this submenu is static but often there is a need to add a new place to the menu and assign a new shortcut. The application have a unit Clientdata that contains an TActionManager that holds the needed actions for buttons, menus and also the submenu I mentioned.</p>
  
  <p>So I want this submenu to be changable in runtime. All places is persisted in the database. I think the submenu should still have actions in the actionmanager.</p>
  
  <p>Beside that there is a shortcut-editor for all actions, so each user can have its own personal shortcuts. Those shortcuts are saved in a textfile in personal file directory.</p>
  
  <p>There are 3 places that should be changed.</p>
  
  <ul>
  <li>System module. Here I can add, edit and delete places in database that will be in the submenu.</li>
  <li>Actionmanager. It holds all actions for the submenu. It also holds shortcuts and can load/save shortcuts from a textfile.</li>
  <li>Plan module. It uses the submenu for places. It should build the submenu from places in the database and assign the right shortcut to them.</li>
  </ul>
  
  <p>I have started the implementation but I'm not sure if I am on the right track. It is important that the data in ActionManager is in sync when the list of places is edited in the datamodule. I'm not sure how to add, edit delete actions in the ActionManager in runtime. I have only done this in designtime.</p>
  
  <p>Other comments and possible improvements are welcome!</p>
  
  <p>Regards</p>