Print Page | Close Window

Buttons in CXTPReportControl - howto?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1923
Printed Date: 13 July 2025 at 1:42pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Buttons in CXTPReportControl - howto?
Posted By: phil
Subject: Buttons in CXTPReportControl - howto?
Date Posted: 07 March 2005 at 4:09am
Hi!

So far I've only found this thread
http://forum.codejock.com/forum_posts.asp?TID=1193&KW=bu tton+report+control
regarding the topic.

Unfortunately none of the provided code examples coming with XT Pro contains any CXTPReportInplaceButton(s), and I can't get it to work.

Here's what I've tried:

===
CRect rcItem(0, 0, 20, 20);
CXTPReportRow *pRow = m_ReportControl.GetRows()->GetAt(1);
XTP_REPORTRECORDITEM_ARGS itemArgs(&m_ReportControl, pRow, pColumn1);
          
CXTPReportInplaceButton Button(1234);
          
Button.Create(&itemArgs, rcItem);

m_ReportControl.RedrawControl();
===

compiles, runs, but there's no button...

here's what I get:



and here's what I'd like to achieve:



or



anyone got an idea how to do that?



Replies:
Posted By: Oleg
Date Posted: 10 March 2005 at 9:54am

CXTPReportColumn* pColumnImportance = m_wndReport.AddColumn(new CXTPReportColumn(COLUMN_IMPORTANCE, _T("Importants"), 18, FALSE, 1));

 pColumnImportance->GetEditOptions()->AddExpandBu tton();

for custom button:

pColumnImportance->GetEditOptions()->arrInplaceButtons .Add(new CSendButton(123));

class CSendButton : public CXTPReportInplaceButton



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: larryp
Date Posted: 12 March 2005 at 2:39pm
Could this be added to the samples for the next release?


Posted By: phil
Date Posted: 14 March 2005 at 3:13am
Originally posted by larryp larryp wrote:

Could this be added to the samples for the next release?


I second that, it would help a lot.


but thx for your reply.

I managed to produce on inplace button now, although I can't get it to stay within its cell boundaries.

I tried getting the caption rectangle by using

CXTPReportRecordItem* pItem = pRecord->AddItem(new CXTPReportRecordItemText(_T("bla")));
pItem->GetCaptionRect(&itemArgs, rcItem);

but that doesn't seem to work :(


Posted By: Oleg
Date Posted: 15 March 2005 at 2:05am
http://forum.codejock.com/uploads/oleg/2005-03-15_020517_rs.zip - 2005-03-15_020517_rs.zip  - sample for you

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: phil
Date Posted: 17 March 2005 at 12:42am
thx for the sample

but how do you get the button to be visible all the time - not just when you click to edit the cell?



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