SetIconIndex for CXTPReportRecordItemPreview |
Post Reply |
Author | |
FSauer
Groupie Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
Post Options
Thanks(0)
Posted: 21 March 2007 at 5:12am |
Hi is it possible to set an Icon for a CXTPReportRecordItemPreview with
int CXTPReportRecordItem::SetIconIndex(ImagListIndex);?
Or have i do this in my own Preview-Class?
Regards
FSauer
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Yes, this is possible. Why not, Preview Item is also an item...
For example I've just tested it with the following string added into the initialization if a regular sample:
-- WBR, Serge |
|
FSauer
Groupie Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
Post Options
Thanks(0)
|
Hi Serge.
I test it too. But my result is, that the icon isn't set for my Preview-Item.
Are in the following lines anything wrong, or have i forget anything?
//Add ImageList
if (!m_ilIcons.Create(16,16, ILC_COLOR24|ILC_MASK, 0, 1))
return FALSE; CBitmap bitmap;
VERIFY(bitmap.LoadBitmap(IDB_BITMAP1)); m_ilIcons.Add(&bitmap, RGB(255, 255, 255)); m_wndReportCtrl.SetImageList(&m_ilIcons);
//Add Columns
m_wndReportCtrl.AddColumn(new CXTPReportColumn(COLUMN_IO, _T("First Column"), 18));
m_wndReportCtrl.AddColumn(new CXTPReportColumn(COLUMN_IOE, _T("Second Column"), 18)); //Enable Previewmode
m_wndReportCtrl.EnablePreviewMode(TRUE);
//Add my Records
m_wndReportCtrl.AddRecord( new CMessageRecord("1111111111111","2222222222222","Preview"));
m_wndReportCtrl.AddRecord( new CMessageRecord("1111111111111","2222222222222","Preview")); m_wndReportCtrl.AddRecord( new CMessageRecord("1111111111111","2222222222222","Preview")); //The following Line doesn't work!
((CXTPReportRecordItem*)(m_wndReportCtrl.GetRecords()->GetAt(1)->GetItemPreview()))->SetIconIndex(1); //This following Line work!
((CXTPReportRecordItem*)(m_wndReportCtrl.GetRecords()->GetAt(1)->GetItem(1)))->SetIconIndex(1); //Populate
m_wndReportCtrl.Populate();
//My ReportRecordClass
class CMessageRecord : public CXTPReportRecord
{ public: CMessageRecord( CString Column1, CString Column2, CString Preview) { AddItem(new CXTPReportRecordItemText(Column1)); AddItem(new CXTPReportRecordItemText(Column2)); SetPreviewItem(new CXTPReportRecordItemPreview(Preview)); } }; The result looks like this:
Regards
FSauer
|
|
FSauer
Groupie Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
Post Options
Thanks(0)
|
?
|
|
FSauer
Groupie Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
Post Options
Thanks(0)
|
Hi.
Ok, i find my problem.
The PreviewHeight was to low.
This was the reason, why the Bitmap didn't show.
Regards
FSauer
|
|
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 |