Hey egsuh,
A
TAction is the perfect way to have code placed in only one place and easily assigned to other components.
Lets say, for example, that you have:
- A menu entry
- A Toolbar Button
- A button
And you want all those 3 to have the same code executed upon being chosen/clicked, but apart from that you want them to have the same Hint, ShortCut, Caption, Image, etc...
Well, the best way to do it is by filling all those properties on the
TAction. Then when you assign a
TAction to your component, all those properties get populated from the
TAction.
Now, this doesn't mean that the components is now locked to the
TAction, it just means that all properties have been copied to it.
If you want to have them be different from the
TAction, just fill them out after you assign the
TAction.
Hope that helps!
Cheers,
Gus