From 5dc4c9e92d0343ecf9dbaa92643bddfb793f1bed Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 29 Oct 2002 00:28:33 +0000 Subject: [PATCH] let Ctrl-C work even in a readonly text control git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17649 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/textctrl.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 13b053dc2e..2fccfe9f41 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -1324,11 +1324,13 @@ long wxTextCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) if ( nMsg == WM_GETDLGCODE ) { + // we always want the chars and the arrows: the arrows for navigation + // and the chars because we want Ctrl-C to work even in a read only + // control + long lDlgCode = DLGC_WANTCHARS | DLGC_WANTARROWS; + if ( IsEditable() ) { - // we always want the chars and the arrows - long lDlgCode = DLGC_WANTCHARS | DLGC_WANTARROWS; - // we may have several different cases: // 1. normal case: both TAB and ENTER are used for dlg navigation // 2. ctrl which wants TAB for itself: ENTER is used to pass to the @@ -1349,15 +1351,11 @@ long wxTextCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) } else // !editable { - // when the control can't be edited by user, it doesn't need any - // extra keys changing its contents at all -- but it still needs - // the arrows to allow navigating in it - // // NB: use "=", not "|=" as the base class version returns the // same flags is this state as usual (i.e. including // DLGC_WANTMESSAGE). This is strange (how does it work in the // native Win32 apps?) but for now live with it. - lRc = DLGC_WANTARROWS; + lRc = lDlgCode; } }