![]() |
ImageManager |
Post Reply
|
| Author | |
Haris
Newbie
Joined: 20 September 2007 Location: United States Status: Offline Points: 1 |
Post Options
Thanks(0)
Quote Reply
Topic: ImageManagerPosted: 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 |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |