[Solved] Ctrl- not working in dialog form |
Post Reply |
Author | |
Marco1
Senior Member Joined: 16 January 2004 Location: Germany Status: Offline Points: 251 |
Post Options
Thanks(0)
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... |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
Marco1
Senior Member Joined: 16 January 2004 Location: Germany Status: Offline Points: 251 |
Post Options
Thanks(0)
|
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? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
CXTPEdit is CEdit deriverd class so same DDX_Control/String thigs work for it.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Marco1
Senior Member Joined: 16 January 2004 Location: Germany Status: Offline Points: 251 |
Post Options
Thanks(0)
|
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. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
you can have both DDX_Text and DDX_Control without problem for same Edit
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Marco1
Senior Member Joined: 16 January 2004 Location: Germany Status: Offline Points: 251 |
Post Options
Thanks(0)
|
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. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
Marco1
Senior Member Joined: 16 January 2004 Location: Germany Status: Offline Points: 251 |
Post Options
Thanks(0)
|
Yepp, that's working. Should be added to CXTPEdit.
Thanx! |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |