Print Page | Close Window

Icons in report control records not displaying

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=13151
Printed Date: 17 November 2024 at 2:58pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Icons in report control records not displaying
Posted By: mark.allender
Subject: Icons in report control records not displaying
Date Posted: 12 January 2009 at 12:53pm
Hello --
 
We have built a report control and would like to attach icons to the items in a particular column.  When we first populate the record, I can get an icon to show up.  I do something like this
 

   item = new CXTPReportRecordItemText(CString(rname.c_str()));
   item->SetIconIndex(IDB_RESOURCE_BROWSER_FILE_PNG_16);
   this->m_report.addItemToRecord(record, column_num, item);
 
This works great, and the icon shows up just fine.  However, we occationally update some of the information in the row and we need to change the icon on the fly.  I have code that does this:
 
    ...
    // code to set icon_index to the proper resource id
    ...
    testRecord->GetItem(0)->SetIconIndex(icon_index);
    ((CXTPReportRecordItemText*)(testRecord->GetItem(0)))->SetValue(CString(rname.c_str()));
 
The icon doesn't show up, and in fact, the original icon that was displayed no longer displays.  The second update is wrapped up between BeginUpdate() and EndUpdate() calls.  I thought about calling Populate(), but that crashed, although I suspect that is because we are calling this second update code through an onSelectionChanged event when the user clicks on a new report row.
 
Are we missing something fundamental about how report control record icons work?  Thanks for any help.
 
   Product: Xtreme ToolkitPro (MFC) version 11.2.0
     Platform: Vista (64bit)
     Language: Visual Studio C++ 2005
 



Replies:
Posted By: znakeeye
Date Posted: 15 January 2009 at 3:06am

Where did you add the icon? The report control has its own image manager, so you have to add your report icons explicitly:

m_wndReport.GetImageManager()->SetIcons(...);
 
Alternatively, you can set the global image manager to be used in the report control (this is my preferred method):
XTPImageManager()->InternalAddRef();
m_wndReport.SetImageManager(XTPImageManager());


-------------
PokerMemento - http://www.pokermemento.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