Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Questions about Icons
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Questions about Icons

 Post Reply Post Reply
Author
Message Reverse Sort Order
Number8 View Drop Down
Groupie
Groupie


Joined: 29 July 2008
Location: United States
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote Number8 Quote  Post ReplyReply Direct Link To This Post Topic: Questions about Icons
    Posted: 09 September 2008 at 9:17am
Tech support provided the answer.

Need to pass a SafeArray that can be cast to Variant to LoadBitmap().

     CComSafeArray<int> safeCommands(_countof(cmds));
     for (int i = 0; i < _countof(cmds); ++i) {
          safeCommands.SetAt(i, cmds);
     }

     HRESULT hr = pIcons->LoadBitmap(bstrName, CComVariant((LPSAFEARRAY)safeCommands), xtpImageNormal);

Product: Xtreme SuitePro (ActiveX) version 12.1.0
Platform: Windows XP (32bit) - SP 3
Language: C / C++

Back to Top
Number8 View Drop Down
Groupie
Groupie


Joined: 29 July 2008
Location: United States
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote Number8 Quote  Post ReplyReply Direct Link To This Post Posted: 04 September 2008 at 10:06am
Originally posted by SuperMario SuperMario wrote:

CommandBars.Icons = ImageManager.Icons;

I'm confused: _DCommandBars->GetIcons() returns a pointer to an ImageManagerIcons object. ImageManagerIcons doesn't have an Icons property.

struct __declspec(uuid("1616dc35-b997-432b-ab4f-439341a769e5"))
_DCommandBars : IDispatch
{
    /* snip */    __declspec(property(get=GetIcons,put=PutIcons))
    IImageManagerIconsPtr Icons;
    /* snip */
};
IImageManagerIcons : IDispatch
{
    /* snip */
    HRESULT LoadBitmap (
        _bstr_t Path,
        const _variant_t & Commands,
        enum XTPImageState imageState );
    /* snip */
];

After calling LoadBitmap() on the ImageManagerIcons object, is there another step to adding it back to the CommandBars object?
Thanks for the reply.

Product: Xtreme SuitePro (ActiveX) version 12.1.0
Platform: Windows XP (32bit) - SP 3
Language: C / C++

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 04 September 2008 at 8:25am
CommandBars.Icons = ImageManager.Icons;
Back to Top
Number8 View Drop Down
Groupie
Groupie


Joined: 29 July 2008
Location: United States
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote Number8 Quote  Post ReplyReply Direct Link To This Post Posted: 03 September 2008 at 7:46am
Hello,

Using SuitePro ActiveX 12.0.1.

Could someone point me to the area in the documentation that describes how to get icons to appear on toolbar buttons?

I am trying to load the icons from a bitmap and assign them to toolbar buttons like this:

     _bstr_t bstrName ="C:\\Program Files\\Codejock Software\\ActiveX\\SuitePro ActiveX 12.0.1\\Samples\\CommandBars\\C#.NET\\RibbonSample\\res\\LargeIcons.bmp";

     int cmds[18];

     cmds[0] = M_FILE_NEW;
     cmds[1] = 2;
     /* etc */

     IImageManagerIconsPtr pIcons = pCommandBars->GetIcons();

     pIcons->LoadBitmap(bstrName, cmds, xtpImageNormal);


     ICommandBarActionsPtr pActions = pCommandBars->GetActions();

     pControls = pCommandBar->GetControls();

     pAction = pActions->Add(M_FILE_NEW, _bstr_t("&New"), _bstr_t("Create a new document"), _bstr_t("Create a new document"), _bstr_t("File"));
     pAction->IconId = M_FILE_NEW;
     pControls->Add(xtpControlButton, M_FILE_NEW, "");


However, no icons appear on the toolbars.
What am I doing wrong?

I searched the samples for a use of LoadBitmap() or IconId in a .cpp file, but didn't find any.
I tried to follow the use of LoadBitmap() as used in some .cs files, but those uses of LoadBitmap() are for controls other than a CommandBar.

Thanks for any pointers...

UPDATE:
I tried explicitly setting the style:
     pControl = pControls->Add(xtpControlButton, M_FILE_NEW, "");
     pControl->PutDescriptionText(_bstr_t("Create a new document"));
     pControl->PutStyle(xtpButtonIcon);
Still no icon...
Product: Xtreme SuitePro (ActiveX) version 12.1.0
Platform: Windows XP (32bit) - SP 3
Language: C / C++

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.