Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - [Solved] Ctrl- not working in dialog form
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[Solved] Ctrl- not working in dialog form

 Post Reply Post Reply
Author
Message
Marco1 View Drop Down
Senior Member
Senior Member


Joined: 16 January 2004
Location: Germany
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote Marco1 Quote  Post ReplyReply Direct Link To This Post Topic: [Solved] Ctrl- not working in dialog form
    Posted: 23 November 2010 at 2:25pm
Any Ctrl- combinations (ctrl-x, ctrl-c) are not working in CEdit fields in any dialog forms when used in a docking bar.
You can easily try with your ActivePaneView example by placing an EditControl in the dialogbox. Ctrl-X is not working inside. Tested with MfC 13.4.2

Seems to be an issue with keyboard hooking...

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 25 November 2010 at 7:45am
Hi,

If you have Ctrl+C n your main Accelerator table it will be converted to ID_EDIT_COPY command.

you can try CXTPEdit class instead - it catch keys before MFC translate them. 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Marco1 View Drop Down
Senior Member
Senior Member


Joined: 16 January 2004
Location: Germany
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote Marco1 Quote  Post ReplyReply Direct Link To This Post Posted: 28 November 2010 at 5:08am
Actually I don't want to use CXTPEdit cause all edit fields in the docking panes dialogs are using DDX_Control and normal CStrings to store/retrieve data.

Any other suggestions how to get copy paste working in there?

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 29 November 2010 at 3:56am
Hi,

CXTPEdit is CEdit deriverd class so same DDX_Control/String thigs work for it.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Marco1 View Drop Down
Senior Member
Senior Member


Joined: 16 January 2004
Location: Germany
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote Marco1 Quote  Post ReplyReply Direct Link To This Post Posted: 29 November 2010 at 5:21am
Yes, I'm aware that CXTPEdit is a CEdit derived class. Acutally I wasn't correct in writing DDX_Control, I meant the DDX mechanism, using DDX_Text in this case to set/retrieve CStrings.

Of course I could add CXTPEdit members for every edit box and use DDX_Control, but then I have to update/set every associated CString manually.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 29 November 2010 at 10:02am
Hi,

you can have both DDX_Text and DDX_Control without problem for same Edit
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Marco1 View Drop Down
Senior Member
Senior Member


Joined: 16 January 2004
Location: Germany
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote Marco1 Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2010 at 6:35pm
Have tried CXTPEdit now. Doesn't seem to work as suggested.
And...

void CAccountingViewTransaction::DoDataExchange(CDataExchange* pDX)
{
  CFormView::DoDataExchange(pDX);
  DDX_Text(pDX, IDC_REFERENCE, m_strReference);
  DDX_Control(pDX, IDC_REFERENCE, m_wndReference);
}

where m_strReference (CString) is used and m_wndReference (CXTPEdit) is a dummy -

... doesn't work, too.

So, still not solved.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 14 December 2010 at 2:12am
Hi,

yes, seems CXTPEdit also doesn't catch these keys automatically.

here simple class for you:

class CMyEdit : public CEdit
{
BOOL PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN && IsDialogMessage(pMsg))
return TRUE;
return CEdit::PreTranslateMessage(pMsg);
}
};


...
CMyEdit m_wndEdit;

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Marco1 View Drop Down
Senior Member
Senior Member


Joined: 16 January 2004
Location: Germany
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote Marco1 Quote  Post ReplyReply Direct Link To This Post Posted: 14 December 2010 at 6:43am
Yepp, that's working. Should be added to CXTPEdit.
Thanx!

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.234 seconds.