Set Size of a Cell or a row |
Post Reply |
Author | |
fakie
Newbie Joined: 28 April 2006 Location: Germany Status: Offline Points: 3 |
Post Options
Thanks(0)
Posted: 28 April 2006 at 7:37am |
Hello everybody,
I like to change the size of my rows, but i don't know how to set the size of the rows. I created some rows, but they have fixed size and i don't know how change it. I change the size of my font, but the size of my rows didn't change. Can anyone say me how to set the size of my rows or of my cells. Thanks in advance. Here is my code: CXTPReportControl& wndReport = GetReportCtrl(); wndReport.AddColumn(new CXTPReportColumn(0,_T("Column1"),50)); wndReport.AddColumn(new CXTPReportColumn(1,_T("Column2"),50)); wndReport.AddColumn(new CXTPReportColumn(2,_T("Column3"),50)); wndReport.SetVirtualMode(new CVirtualRecord(), 5); CVirtualRecord() { CFont *simpleFont = new CFont; simpleFont->CreatePointFont(220, "Times New Roman"); CXTPReportRecordItem *d=new CXTPReportRecordItem(); d->SetFont(simpleFont); d->SetBackgroundColor(RGB(243,245,253)); AddItem(d); d=new CXTPReportRecordItem(); d->SetFont(simpleFont); d->SetBackgroundColor(RGB(243,245,253)); AddItem(d); d=new CXTPReportRecordItem(); d->SetFont(simpleFont); d->SetBackgroundColor(RGB(243,245,253)); AddItem(d); } cu fakie |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Do you want to change a height or a width of the row?
|
|
fakie
Newbie Joined: 28 April 2006 Location: Germany Status: Offline Points: 3 |
Post Options
Thanks(0)
|
Hello sserge,
I'd like to change the height of the row. I want to set the height by a value. cu fakie |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi,
You'll have to override GetHeight() method for your custom descendant class of CXTPReportRow. Note that you'll have also to override CXTPReportControl::CreateRow() to apply a custom Row class. See also topics: http://forum.codejock.com/forum_posts.asp?TID=2932 http://forum.codejock.com/forum_posts.asp?TID=2984 -- WBR, Serge |
|
fakie
Newbie Joined: 28 April 2006 Location: Germany Status: Offline Points: 3 |
Post Options
Thanks(0)
|
Hello sserge,
Thx for your tipps. I have tried this tutorial: http://forum.codejock.com/forum_posts.asp?TID=2984 and I have added the class VirtualRow to my program and I override the function getheight like this: Class VirtualRow:public CXTPReportRow { ...//some code int VirtualRow::GetHeight(CDC* dc, int nWidth) { dc->SetBkColor(RGB(0,0,0)); m_nPreviewHeight=1000; m_rcRow.SetRect(10,10,10,10); dc->ExcludeClipRect(1,1,100,100); dc->Ellipse(1,1,20,255); return m_nIndex * 20 + 10; } } but I don't know how to change the height of my row. If i call this function( getHeight( getDC(),120) ), it will take no effect. How can I adjust the height with the CDC object? cu fakie |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi,
Here is a working example of how to override GetHeight for a virtual row. You can insert those pieces of code into VirtualListView.cpp and play with it:
-- WBR, Serge |
|
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 |