Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Icons in report control records not displaying
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Icons in report control records not displaying

 Post Reply Post Reply
Author
Message
mark.allender View Drop Down
Newbie
Newbie


Joined: 12 January 2009
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote mark.allender Quote  Post ReplyReply Direct Link To This Post Topic: Icons in report control records not displaying
    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
 
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
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.156 seconds.