 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Mike Collins Guest
|
Posted: Sun May 29, 2005 10:38 pm Post subject: Strange Behaviour using TMainMenu and ActionLists |
|
|
Hi all,
just a quick one here, never really come across it before. I actually
discovered it using Toolbar2000 but the same behaviour is shown using the
normal TMainMenu vcl.
Basically, I have an application where I have defined a whole set of
TActions for all the different functionality within my app. I have also
defined a global handeller to deteremine which Action should be enabled /
disabled - which I have done using the TActionList->OnUpdate event, setting
the Handled parameter to true, after I have deteremined the necessary
status. Now before the user have login to my system, I want all the
Actions, bar actLogin & actExit, to be disabled, and to the OnUpdate code
mimics this. The behaviour below is show even when I code individual
OnUpdate event for each Action!
Now within my TMainMenu, I have assigned a corisponding Action to all the
menu items, and so they all appear disabled, based on the above senario, all
except the Sub-menu items. I have one Sub-menu that is call "New" and the
corisponding sub-menu contains a list of new items / actions. Because the
Sub-menu item is not assigned an Action, no update processing is done for
it - which is expected. So now I go about coding a "generic new" Action to
be assigned to this sub-menu and deal with disabling the sub-menu until the
user is logon.
When the app is run, the "New Generic" Action is diabled thus the sub-menu
item is disabled and the corisponding sub-menu is not displayed / popped-up.
User logs on, the sub-menu item is enabled, I move my mouse over the
sub-menu item, the sub-menu pops-up but then the sub-menu item becomes
diabled. The sub-menu is displayed but the sub-menu item is disabled, the
OnUpdate code should force it to be enabled but the OnUpdate event is not
called a second time, the menu simply is diabled. I can't understand this
behaviour - the same thing happends with Toolbar2000. Is there some sore of
default behaviour where by a Sub-menu item can't have an Action assigned to
it. Can a TMenuItem can as both a menu item (i.e. the user can click on it
to envoke some function) and a sub-menu item (i.e. to open a sub menu)
I know this isn't 100% clear - I can post the exe / code if anyone wants to
have a look.
Cheers,
Mike
|
|
| Back to top |
|
 |
Simon D Guest
|
Posted: Tue May 31, 2005 11:43 am Post subject: Re: Strange Behaviour using TMainMenu and ActionLists |
|
|
"Mike Collins" <its (AT) thebottomofthe (DOT) post> wrote in message
I know this isn't 100% clear - I can post the exe / code if anyone wants to
A small sample project may help understand your problem.
Simon.
|
|
| 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
|
|