Print Page | Close Window

Get a Control Icon

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=1862
Printed Date: 04 July 2024 at 9:49pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Get a Control Icon
Posted By: Marek
Subject: Get a Control Icon
Date Posted: 25 February 2005 at 2:22pm

Hi,

Can anyone suggest a way to get an individual icon from a command bar control? ie Get an icon with a certain ID from the ImageManager??? Seems that you can Count, DrawReverted, Add, Load and RemoveAll but you can't just get one of them.

Or, is there a way to get the collection of icons from the CommandBars and assign that same collection to the Docking Pane Control's Icons property? Seems the Command Bar collection is not compatible with the Docking Pane collection.

Thanks,

-m




Replies:
Posted By: SuperMario
Date Posted: 25 February 2005 at 2:33pm
No, you can't get an individual icon from the ImageManager.  But you can use the icons from the CommandBars in the DockingPanes.

Try:

DockingPaneManager.Icons.AddIcons CommandBars.Icons

Or

DockingPaneManager.Icons = CommandBars.Icons

But the icons will have the same IconId as when they were added to the CommandBars ImagManager so you will have to set the IconId for each Docking Pane to match the IconIds in the ImageManager.


Posted By: JamesH
Date Posted: 25 February 2005 at 2:48pm

I expect it's just my limited knowledge of ATL but how do you copy the command bars icons to the docking panes using ATL?

I've tried:

 m_spDockingPanes->Icons = spCommandBars->Icons;
and

m_spDockingPanes->Icons->AddIcons( spCommandBars->Icons );

But they both give me this error:

error C2664: 'AddIcons' : cannot convert parameter 1 from 'class _com_ptr_t<class _com_IIID<struct XtremeCommandBars::IImageManagerIcons,&struct __s_GUID _GUID_00020400_0000_0000_c000_0000
00000046> >' to 'struct XtremeDockingPane::IImageManagerIcons *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called



Posted By: SuperMario
Date Posted: 25 February 2005 at 3:05pm
I haven't used ATL, but it looks like you need to do some type casting.

For example, this code is from C# copying the icons from a CommandBars ImageManager Control to the Icons collection of the Shortcut bar.  ImageManager is a the Separate ImageManager control in this example.  However you can use the CommandBars.Icons collection as well.
 
wndShortcutBar.Icons = (XtremeSuiteControls.ImageManagerIcons)ImageManager.Icons;


Posted By: maxy
Date Posted: 28 February 2005 at 4:33am

 

mailto:brisbane_chap@yahoo.com - brisbane_chap@yahoo.com

ifound out more about icons

 



Posted By: maxy
Date Posted: 28 February 2005 at 4:35am

Originally posted by SuperMario SuperMario wrote:

No, you can't get an individual icon from the ImageManager.  But you can use the icons from the CommandBars in the DockingPanes.

Try:

DockingPaneManager.Icons.AddIcons CommandBars.Icons

Or

DockingPaneManager.Icons = CommandBars.Icons

But the icons will have the same IconId as when they were added to the CommandBars ImagManager so you will have to set the IconId for each Docking Pane to match the IconIds in the ImageManager.

mailto:brisbane_chap@yahoo.com - brisbane_chap@yahoo.com

 




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