 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
David Guest
|
Posted: Tue Oct 28, 2003 11:16 am Post subject: Menu events |
|
|
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
|
Posted: Tue Oct 28, 2003 1:20 pm Post subject: Re: Menu events |
|
|
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
|
Posted: Tue Oct 28, 2003 5:18 pm Post subject: Re: Menu events |
|
|
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
|
Posted: Tue Oct 28, 2003 8:13 pm Post subject: Re: Menu events |
|
|
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 |
|
 |
|
|
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
|
|