![]() |
|
|
|
#1
|
|||
|
|||
|
Hi all,
I have a question regarding the MDI application created when you choose File-->New-->Project-->MDI Application. what i want to know is, when i run the the apps as is (ie. without adding any code to it), how does each of the ToolButtons know how to enable and disable itself??? I've looked inside the code and found nothing about enabling and disabling those buttons. any idea, please... best regard to you all. Montri |
|
#2
|
|||
|
|||
|
Hi there.
Actually it's because of the TActionList. Those toolbuttons have their action set to one of the standard actions provided, it takes care of which standard actions should be enabled/disabled in certain conditions. It's no use to use the cascade windows button if there are no MDI windows to cascade so that toolbutton is disabled. For another test you can setup a plain form with a TActionlist component, double click the component, then right click and add a standard action TEditCut . Place a TEdit on the form and setup a single toolbutton and also place a button on the form set both of their action properties to the new action you just created. Now run the project. You'l see if no text is selected in the TEdit those buttons will be disabled once text is selected they are enabled. But if you just setup a plain action you must use its OnExecute event if you want controls connected to the action to be enabled. See this article for more info on actions http://www.delphipages.com/news/detaildocs.cfm?ID=16 Hope this answers your question :-) |
![]() |
| Thread Tools | |
| Display Modes | |
|
|