Print Page | Close Window

InplaceEdit

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=22636
Printed Date: 07 May 2024 at 1:47am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: InplaceEdit
Posted By: MarkZ
Subject: InplaceEdit
Date Posted: 18 June 2015 at 10:37am
Hi Guys
Evaluating Report Control and I'm wondering is there anyway I can have greater control over the Inplace editor. Ideally I would like to restrict the input to numeric only as well as the length. 
I have tried the following with no success

CXTPReportInplaceEdit* b = GetReportCtrl().GetInplaceEdit();
b = GetReportCtrl().GetInplaceEdit();
b->ModifyStyle(0, ES_NUMBER);
b->SetLimitText(2);

is it possible?


-------------
Mark.0161



Replies:
Posted By: olebed
Date Posted: 23 June 2015 at 10:11am
Hello Mark,

Use CXTPReportRecordItemNumber instead CXTPReportInplaceEdit.

For example you can look at
Samples\ReportControl\ReportDialog\MessageRecord.h
Samples\ReportControl\ReportDialog\MessageRecord.cpp

Regards,
 Oleksandr Lebed


Posted By: olebed
Date Posted: 23 June 2015 at 10:38am
CXTPReportInplaceEdit takes ES_ and other style options from editOptions
void CXTPReportInplaceEdit::Create()
{
...
    CXTPReportRecordItemEditOptions* pEditOptions = pItem->GetEditOptions(pColumn);
...
    DWORD dwEditStyle = WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | pEditOptions->m_dwEditStyle;
...
    CEdit::Create(dwEditStyle, rect, pControl, 0); 
....
}

This member Create()  is called on every new using of InplaceEdit.  So you need to change CXTPReportRecordItemEditOptions of RecordItem or ReportColumn which hold this item.

   CXTPReportRecordItemEditOptions *pEditOptions = pColumn->GetEditOptions();
    //or pEditOptions = pItem->GetEditOptions(pColumn);
    pEditOptions->m_dwEditStyle |= ES_NUMBER;



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