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

"Bug" in CXTPReportInplaceEdit

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: "Bug" in CXTPReportInplaceEdit
    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!
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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, i.e.
pColumn->GetEditOptions()->m_dwEditStyle |= ES_MULTILINE | ES_AUTOVSCROLL; -- you can insert new line char with Ctrl+Enter

--
WBR,
Serge
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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);
}
 
Back to Top
Makarand View Drop Down
Senior Member
Senior Member
Avatar

Joined: 27 February 2007
Location: India
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote Makarand Quote  Post ReplyReply Direct Link To This Post 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
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.