Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - SetIconIndex for CXTPReportRecordItemPreview
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SetIconIndex for CXTPReportRecordItemPreview

 Post Reply Post Reply
Author
Message
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post Topic: SetIconIndex for CXTPReportRecordItemPreview
    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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post 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 
Back to Top
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post Posted: 12 April 2007 at 7:45am
?
Back to Top
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post 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
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.154 seconds.