Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > Apps

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 07-06-2003, 07:37 PM
montri montri is offline
Member
 
Join Date: Nov 2001
Posts: 97
Default Explaination on MDI apps needed...

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
Reply With Quote
  #2  
Old 07-06-2003, 09:50 PM
HTML HTML is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,977
Default RE: Explaination on MDI apps needed...

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 :-)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:26 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.