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

InplaceEdit

 Post Reply Post Reply
Author
Message
MarkZ View Drop Down
Newbie
Newbie


Joined: 18 June 2015
Location: Manchester
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote MarkZ Quote  Post ReplyReply Direct Link To This Post Topic: InplaceEdit
    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
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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;
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.172 seconds.