Print Page | Close Window

[Solved] Ctrl- not working in dialog form

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=17594
Printed Date: 27 November 2024 at 12:13am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [Solved] Ctrl- not working in dialog form
Posted By: Marco1
Subject: [Solved] Ctrl- not working in dialog form
Date 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...



-------------
Product: XTP 18.3.0 on VS 2017
Platform: VS 2017 / Windows 10 (64bit)



Replies:
Posted By: Oleg
Date 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


Posted By: Marco1
Date 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?



-------------
Product: XTP 18.3.0 on VS 2017
Platform: VS 2017 / Windows 10 (64bit)


Posted By: Oleg
Date 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


Posted By: Marco1
Date 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.



-------------
Product: XTP 18.3.0 on VS 2017
Platform: VS 2017 / Windows 10 (64bit)


Posted By: Oleg
Date 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


Posted By: Marco1
Date 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.



-------------
Product: XTP 18.3.0 on VS 2017
Platform: VS 2017 / Windows 10 (64bit)


Posted By: Oleg
Date 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


Posted By: Marco1
Date Posted: 14 December 2010 at 6:43am
Yepp, that's working. Should be added to CXTPEdit.
Thanx!



-------------
Product: XTP 18.3.0 on VS 2017
Platform: VS 2017 / Windows 10 (64bit)



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