Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - ImageManager
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ImageManager

 Post Reply Post Reply
Author
Message
Haris View Drop Down
Newbie
Newbie
Avatar

Joined: 20 September 2007
Location: United States
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Haris Quote  Post ReplyReply Direct Link To This Post Topic: ImageManager
    Posted: 20 September 2007 at 7:54pm
Hi, I am working on an issue with icons being replaced by their tooltip text when using Image Manager.
 
My code looks like:
CXTPImageManager* pImageManager;
if (curIcon != NULL)
{
   //pActionControl->SetCustomIcon(curIcon);
   CSize cSize(BUTTONSIZE,BUTTONSIZE);
   pImageManager = GetImageManager();
   BOOL bSuccess = pImageManager->SetIcon(curIcon,  cmdId, cSize);
   DestroyIcon(curIcon);
}
 
-pActionControl is of type CXTPControl*
 
If I open multiple charts and they both use this control then after closing one of the charts, the icons for 2nd chart are replaced by their tooltip text and the icon disappears.
 
After investigating this further, it appears SetIcon only adds the image to the image manager once and when I hit the OnDestroy of my class it is cleaned up. Therefore, the icons disappear from the 2nd chart.
 
I have tried creating a seperate ImageManager object for each class in the constructor that uses GetImageManager but that didn't help:
CXTPImageManager* pImageManager = new CXTPImageManager();
SetImageManager(pImageManager);
 
Please note that this does not happen if I use SetCustomIcon instead of using Image Manager and SetIcon. Also, code above for Image Manager and SetIcon seems to work with CXTPControlButton.
 
Following works fine:
CXTPImageManager* pImageManager;
if (hCurIcon != NULL)
{
    //nextButton->SetCustomIcon(hCurIcon);
    pImageManager = GetImageManager();
    BOOL bSuccess = pImageManager->SetIcon(hCurIcon, IDM_NEXT_PATIENT, cSize);
    DestroyIcon(hCurIcon);
}
 
- nextButton is of type CXTPControlButton
 
Can Image Manager be used with anything other than CXTPControlButton? Am I doing something wrong here?
 
I am new to codejock so any help you can provide will be much appreciated!
 
Thanks,
Haris
 
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 21 September 2007 at 12:42am
Hello,
 
Yes, by default all CommandBars use same ImageManager
you can
1. Create separate ImageManager fro each CommandBars:
 
GetCommandBars()->SetImageManager(new CXTPImageManager()));
 
2. or try not repeat Ids for buttons. Check your resource.h files and manually edit it to remove all dublicate resources.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.051 seconds.