CXTPControlPopupColor icon not redrawn
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=2792
Printed Date: 15 May 2024 at 8:06am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: CXTPControlPopupColor icon not redrawn
Posted By: craig
Subject: CXTPControlPopupColor icon not redrawn
Date Posted: 25 August 2005 at 7:53pm
I've added a CXTPControlPopupColor control to my application, but the
icon used in the toolbar never gets redrawn. After tracing
through the code, it appears that it is because the image manager
doesn't contain the icon. The icon is in my toolbar resources,
but not in the Xtreme TK image manager.
How do I add my icon?
Thanks,
Craig
|
Replies:
Posted By: Oleg
Date Posted: 25 August 2005 at 11:37pm
Hello,
see
XTPImageManager()->SetIcon(..)
XTPImageManager()->SetIcons(..)
------------- Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS
|
Posted By: craig
Date Posted: 26 August 2005 at 1:58pm
I was looking at those, but after grepping for "SetIcon" in the
Office2003 sample where the XTPControlColorPopup is demonstrated I
couldn't find it being used anywhere.
How is the control working in this example without using SetIcon?
Shoot, after spending 4 days on this, I'd settle for any example where
the XTPControlColorPopup is working with or without SetIcon, SetIcons,
etc.
--Craig
|
Posted By: craig
Date Posted: 26 August 2005 at 4:44pm
I need to get this resolved soon. I'll post here and see if it
gets worked out over the weekend. Otherwise, I'll submit a tech
support incident on Monday.
I tried using SetIcon and SetIcons today. Neither helps because
the GetImageManager() returns a new instance of an image manager every
time it is called. Even if I set the Icon in the image manager it
doesn't matter because the image manager instance isn't saved by the
control. Later when SetColor calls GetImageManager it gets yet
another new instance.
The CXTPControlPopupColor control fails for two reasons:
1. The IconId for the control is not set anywhere. I'm not
sure what this is supposed to be. I thought it would be the ID of
the icon that is to be used on the button. When I look inside of
the SetColor method though, it is looking up an entire set of Icons
using this ID. Anyway, this id is always 0. I can call
SetIconId on the control, but I am still baffled as to why I have to do
this in my code, but it isn't done in the sample application.
- One important note here is that my CXTPToolbar is a member of a
CXTPDialog class, and CXTPControlPopupColor is being added to this
toolbar.
2. Even if I get an IconId set, the call to GetImageManager always returns a new instance. See above.
Even if I can get an ImageManager, I'm not sure what ID I
should be using for the Icon, what Icon I should set the control to
(single Icon or some sort of set of icons)
If you could just provide some documentation or a "simple" example where this control is used it would be very helpful.
|
Posted By: Oleg
Date Posted: 27 August 2005 at 11:28am
See samples:
http://forum.codejock.com/uploads/oleg/2005-08-27_112719_DIalogSample.zip - 2005-08-27_112719_DIalogSample.zip
------------- Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS
|
Posted By: craig
Date Posted: 27 August 2005 at 4:08pm
I have that sample, but it doesn't compile under Visual C++ 7.
1. Can't include CodejockSample.h
FIXED in stdafx.h:
//#include "CodejockSample.h" // Replace it to "XTToolkitPro.h"
#include "XTToolkitPro.h"
2. AboutDlg.h not found.
I commented it out, then several other errors popped up. Perhaps
you have a newer version that has the missing header file?
Also, that looks like it is a DialogView application, I'm trying to add
the control to a CXTPToolbar in a dialog box not a dialog view.
Thanks,
Craig
|
Posted By: Oleg
Date Posted: 28 August 2005 at 11:50pm
At least run it.
I name it like DIalogSample, but it is not samlpe from package.
------------- Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS
|
Posted By: craig
Date Posted: 29 August 2005 at 12:23pm
aw crud... I thought I did try it.
I downloaded it, unzipped it, and then went to another dialog_sample I
had downloaded that had a different date appended to the name.
Now that I'm working off the correct codebase from this thread it does
compile. I'll take a look at the code now. Thanks for the
help, and sorry about the mistake.
Craig
|
Posted By: craig
Date Posted: 29 August 2005 at 1:36pm
Oleg,
Thanks for the help. The example was perfect, and I now have it working in OnCreateControl.
Again, sorry for the mishandling of the sample.
--Craig
|
Posted By: craig
Date Posted: 29 August 2005 at 3:04pm
I've also since realized that a lot of my grief was due to the fact
that I was trying to implement this popupcontrol extension in an MFC
extension DLL. Upon moving everything inside of my application
project several of my troubles just dissapeared.
I'll have to figure out how to modularize later.
--Craig
|
|