Print Page | Close Window

"Bug" in CXTPReportInplaceEdit

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=4705
Printed Date: 23 November 2024 at 5:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: "Bug" in CXTPReportInplaceEdit
Posted By: znakeeye
Subject: "Bug" in CXTPReportInplaceEdit
Date Posted: 02 August 2006 at 9:40pm

If you have enabled multiline support in a report control, you most certainly want the enter key to behave as "insert new line character" instead of cancelling the editing. See code below. Perhaps it would be a good idea to have a SetCancelOnReturn(BOOL bCancel)-method?

void CXTPReportInplaceEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
    if (!pControl)
        return;
    if (nChar == VK_TAB) return;
    // if (nChar == VK_ESCAPE || nChar == VK_RETURN)
    // FIX: Take "want return" style into account
    if (nChar == VK_ESCAPE || (nChar == VK_RETURN && !(GetStyle() & ES_WANTRETURN)))
    {
        pControl->EditItem(NULL);
        return;
    }
    ...
}
If I want this change immediately, do I have to compile the whole source or can I somehow subclass this control? I cannot come up with a nice solution.
 
Thanks!



Replies:
Posted By: sserge
Date Posted: 03 August 2006 at 8:12am
Thanks for a suggestion, easier is to compiler the whole source.

BTW, if you use a solution from a topic: http://forum.codejock.com/forum_posts.asp?TID=4700 - http://forum.codejock.com/forum_posts.asp?TID=4700 , i.e.
pColumn->GetEditOptions()->m_dwEditStyle |= ES_MULTILINE | ES_AUTOVSCROLL; -- you can insert new line char with Ctrl+Enter

--
WBR,
Serge


Posted By: znakeeye
Date Posted: 03 August 2006 at 11:33pm
Actually, it's easier to make a little hack. Here's a solution if anybody else encounters the same problem:
 
BOOL CMyView::PreTranslateMessage(MSG* pMsg)
{
    if (pMsg->message == WM_CHAR && pMsg->wParam == VK_RETURN)
    {
        if (m_myReport.GetInplaceEdit()->IsWindowVisible())
            pMsg->wParam = 0x0A;    // Ctrl+Enter. Voilą!
    }
    return CXTResizeFormView::PreTranslateMessage(pMsg);
}
 


Posted By: Makarand
Date Posted: 12 May 2011 at 8:49am
I am able to set the multiline property by applying
pColumn->GetEditOptions()->m_dwEditStyle |= ES_MULTILINE | ES_AUTOVSCROLL;

but ES_AUTOVSCROLL is not setting. Please see attached screenshot.


any other way to set it?

-Mak



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