Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Image in menu and toolbar Collapse All
Subject Author Date
Khoa Nguyen Tan Mar 13, 2004 - 9:16 AM

Hi,

In order for an menu item having an associated image, I usually create a button on a toolbar which has the same ID as the menu item.

Now my program grows big and to me it’s more comfortable for user to complete their task by selecting menu item (because too many toolbar will be some things really annoy :->). I don’t know whether I can assoicate images with menu item without the need of create a toolbar???

Another question about toolbar:
Suppose that my program has 10 toolbars then when the user do a right click on the toolbar area, they will see a popup menu of 10 toolbars. Is there any solution that I can’t hide some of the toolbar???

Thanks. Best regard (sorry for long writing :->)

Technical Support Mar 15, 2004 - 7:38 AM

Dear Khoa,

Of course, you may have menu images without having to create corresponding toolbar window(s). Just create a toolbar resource which will be never used in any toolbar window. Add all the command icons which you want to use for menu items to it. Then upload these icons to the command manager (which is a global object) in your code:

g_CmdManager->UpdateFromToolBar(
    "your profile name",
    IDR_TOOLBAR_RESOURCE_WITH_MENU_ICONS
    );

In fact, the toolbar is not a standard Win32 resource. This is an MFC-related feature of the Visual Studio IDE. The toolbar resource consists of a bitmap resource, a width in pixels of the command image in this bitmap resource, and a list of UINT values which are used as command identifiers for all the command images.

Let’s get to the second question: You can exclude any toolbars or resizable bars from the context menus of any control bars and floating frames. Just set the following property of CExtControlBar to false:
m_wnd_My_Toolbar_Or_ResizableBar.
    m_bAppearInDockSiteControlBarPopupMenu = false;