English 中文(简体)
Delphi 2010 Action Manager & Main Menu Bar
原标题:

I m trying to use the Action Manager and Action Main Menu Bar in Delphi 2010 an I have no idea how to make this work. I ve tried looking at the examples that come with Delphi 2010 and I can t seem to figure this out.

I ve tried playing around with the examples. I ve been able to add an image to the Image List component and set that item to the new item index. At design time it displays properly at runtime it reverts back to the original.

I d like to learn how to use the Action Manager and Action Main Menu Bar but I can find any help on these topics. Is there a tutorial on how to use the Action Manager and Action Main Menu Bar?

最佳回答
  1. Drag and drop a ActionManager, a ActionMainMenuBar and a ImageList on your form.
  2. Doubleclick the ImageList, you get the Imagelist Editor. Use the Add-button to add your icons (make sure their sizes are the same as the Height and Width properties that are set in the ImageList-control).
  3. Set the Images-property of the ActionManager to your ImageList and set the ActionManager-property of your ActionMainMenuBar to your ActionManager.
  4. Doubleclick the ActionManager, go to the tab Actions and add new actions by the New -button.
  5. Click each Action in the ActionManager and set each action s properties, at least: ImageIndex (to choose an Icon), Caption and Category. Note: A Category will serve as a main item in the menu (like File, Edit and View) and each Action will serve as menu item (like Save, Save as, Load). So set the Category property of all actions you want to belong to one main menu item to the same name. For instance give the actions Save and Load the category File and give the actions Undo and Redo the category Edit .
  6. Doubleclick each Action in the ActionManager. You ll get the code editor. Type the code you want to perform when the user clicks this menu item. If you don t type any code or comment, the menu item will automatically be disabled when the application is running.
  7. Now drag the categories from the ActionManager to the ActionMainMenuBar.

That s it.

问题回答

I think Actions, Action Lists And Action Managers by Brian Long is a great start to explore the realm of actions.





相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签