Print Page | Close Window

SetIconIndex for CXTPReportRecordItemPreview

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=6689
Printed Date: 26 May 2024 at 3:42am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SetIconIndex for CXTPReportRecordItemPreview
Posted By: FSauer
Subject: SetIconIndex for CXTPReportRecordItemPreview
Date 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



Replies:
Posted By: sserge
Date Posted: 22 March 2007 at 5:43pm
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:

    ((CXTPReportRecordItem*)(wndReport.GetRecords()->GetAt(4)->GetItemPreview()))->SetIconIndex(8);



--
WBR,
Serge


Posted By: FSauer
Date Posted: 27 March 2007 at 5:20am
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 


Posted By: FSauer
Date Posted: 12 April 2007 at 7:45am
?


Posted By: FSauer
Date Posted: 12 April 2007 at 8:28am
Hi.
Ok, i find my problem.
The PreviewHeight was to low.
This was the reason, why the Bitmap didn't show.
 
Regards
FSauer



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