Print Page | Close Window

CCmdUI question

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=7131
Printed Date: 06 October 2024 at 12:16pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CCmdUI question
Posted By: znakeeye
Subject: CCmdUI question
Date Posted: 15 May 2007 at 3:58am
Hi,
 
I have certain menu/toolbar commands that I wish to hide (on both menus and toolbars) when they are disabled. What would be the best method for this?
 
I know I can call SetVisible() explicitly, but it would be much better if this could be handled in the update handlers.
 
Any suggestions? Thanks!



Replies:
Posted By: Oleg
Date Posted: 16 May 2007 at 5:57am
Hi,
Update handler called only for controls - not for toolbars. you can catch idle message and call SetVisible in this handler.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 16 May 2007 at 12:04pm
Good idea. Thanks!


Posted By: brianh
Date Posted: 17 May 2007 at 7:30am
Hi Oleg,
 
I'm not sure I understand you, surely update handlers are called for toolbar buttons?  Or do you mean they aren't called for controls in the toolbar?
 
This fits with a similar problem that I have.  I have a combobox in a toolbar and I want to disable it using an update handler (as I do for the normal buttons on the bar), but it doesn't seem to get called. :(
 
I also have some comboboxes in a drop down menu (from a toolbar button), but the handler IS called for them!  Why the difference, or am I doing something wrong?
 
Thanks.
 


Posted By: Oleg
Date Posted: 17 May 2007 at 8:45am
Hi,
 
Attach your mainfr.cpp.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 17 May 2007 at 8:49am
I believe you have called this somewhere in your code:
pControl->SetFlags(xtpFlagManualUpdate);
 
In that case, uncomment it and it will work as expected.


Posted By: brianh
Date Posted: 17 May 2007 at 9:11am
DOH! 
 
You're quite right, I had set that flag (that's what happens when you copy and paste!) and removing it fixed the problem!
 
Well 'spotted', and thanks!


Posted By: znakeeye
Date Posted: 17 May 2007 at 10:43am

I had the same problem yesterday. Not too hard to pinpoint your problem =)

Glad I could help. Cya around



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net