BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Menu events

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using
View previous topic :: View next topic  
Author Message
David
Guest





PostPosted: Tue Oct 28, 2003 11:16 am    Post subject: Menu events Reply with quote




I want to enable/disable menu items based on checks of the 'outside world' but cannot see how. There are no Click events associated with the top level menu items (File, Edit, etc.) which is what I used in VB!

Specifically, I want to enable/disable the Paste menu item based on there being Text on the clipboard. The command is simple:
mnuPaste.enabled := Clipboard.HasFormat(CF_TEXT);
but I have nowhere to put it, short of a timer loop - not really good practice!

Anyone know how this should be done?
David.
Back to top
Ignacio Vazquez
Guest





PostPosted: Tue Oct 28, 2003 1:20 pm    Post subject: Re: Menu events Reply with quote



Hello, David!
You wrote on 28 Oct 2003 04:16:49 -0700:
Quote:
Specifically, I want to enable/disable the Paste menu item based on there
being Text on the clipboard. The command is simple: mnuPaste.enabled :=
Clipboard.HasFormat(CF_TEXT); but I have nowhere to put it, short of a
timer loop - not really good practice!

Anyone know how this should be done?

In the OnUpdate event of a TAction.

Cheers,
Ignacio



Back to top
Marc Rohloff
Guest





PostPosted: Tue Oct 28, 2003 5:18 pm    Post subject: Re: Menu events Reply with quote



On 28 Oct 2003 04:16:49 -0700, David<dwilbourn (AT) hotmail (DOT) com> said ...
Quote:

I want to enable/disable menu items based on checks of the 'outside world'
but cannot see how. There are no Click events associated with the top level
menu items (File, Edit, etc.) which is what I used in VB!
There should be.


You probably also want to look at Actions and ActionLists for this which
is a cleaner solution.

Marc

Back to top
Peter Below (TeamB)
Guest





PostPosted: Tue Oct 28, 2003 8:13 pm    Post subject: Re: Menu events Reply with quote

In article <3f9e5e31$1 (AT) newsgroups (DOT) borland.com>, David wrote:
Quote:
I want to enable/disable menu items based on checks of the 'outside world'
but cannot see how. There are no Click events associated with the
top level menu items (File, Edit, etc.) which is what I used in VB!

How so you arrive at this conclusion? All menu items have an OnClick event,
whether top level or not.


--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.