Print Page | Close Window

ID_VIEW_TOOLBAR CmdUI

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=9464
Printed Date: 04 July 2025 at 7:04pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ID_VIEW_TOOLBAR CmdUI
Posted By: yossi
Subject: ID_VIEW_TOOLBAR CmdUI
Date Posted: 31 January 2008 at 6:28pm
Hi,
 
I'm sure this is easy. What's the Xtreme way to disable a menu item (which lists all toolbars automatically) when the View -> Toolbars pops up
 
Thanks
 



Replies:
Posted By: Oleg
Date Posted: 01 February 2008 at 1:40am
Hi,
You need disable one of toolbar or whole View->ToolBar popup?


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


Posted By: yossi
Date Posted: 01 February 2008 at 1:58am
Hi Oleg,
 
I only need to disable one of the Toolbars in the popup.
 
Basically one of the Toolbars is only applicable in a particular view. I don't want it to be available to the user in other views.
 
As you imagine, this View -> Toolbars popup was populated automatically (MFCs?); I didn't define any command ids for each of the listed Toolbar in the popup.
 
For example one of Toolbar I wish to disable was created with resource id of IDR_SPECIALBAR.
 
Thanks for your time.


Posted By: Oleg
Date Posted: 01 February 2008 at 3:27pm
Hi,
 
You can call pToolBar->SetContextMenuPresent(FALSE) for this toolbar.


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


Posted By: yossi
Date Posted: 01 February 2008 at 4:13pm
Hi Oleg,
 
How do I obtain this (IDR_SPECIALBAR) pToolbar from pCmdUI in order to disable it using SetContextMenuPresent(FALSE)?
 
Thanks
 
 
 


Posted By: Oleg
Date Posted: 03 February 2008 at 4:00am
You don't need CmdUI - get pointer using GetCommandBars()->GetToolBar(IDR_SPECIALBAR);

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


Posted By: yossi
Date Posted: 04 February 2008 at 4:39pm

Hi Oleg,

Using the SetContextMenuPresent(..) above removes the toolbar from popup alltogether. My intention was to show it as disabled menu item.
 
Thanks
 


Posted By: Oleg
Date Posted: 05 February 2008 at 12:37am
Hi,
 
Its difficult :( See CXTPControlToolbars::CreateToolbarMenu method. you can create class derived from CXTPControlToolbars and use it.


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



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