]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textctrl.cpp
Added make dist for wxX11 to makefile.
[wxWidgets.git] / src / msw / textctrl.cpp
index 882a6f60e9fad54fe7799e3f7a48b7673f302c31..319c02499ff04dd779b01283ef5901a6a59f9371 100644 (file)
@@ -1286,26 +1286,35 @@ long wxTextCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
 
     if ( nMsg == WM_GETDLGCODE )
     {
-        // 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 dialog navigation
-        // 2. ctrl which wants TAB for itself: ENTER is used to pass to the
-        //    next control in the dialog
-        // 3. ctrl which wants ENTER for itself: TAB is used for dialog
-        //    navigation
-        // 4. ctrl which wants both TAB and ENTER: Ctrl-ENTER is used to pass
-        //    to the next control
-
-        // the multiline edit control should always get <Return> for itself
-        if ( HasFlag(wxTE_PROCESS_ENTER) || HasFlag(wxTE_MULTILINE) )
-            lDlgCode |= DLGC_WANTMESSAGE;
-
-        if ( HasFlag(wxTE_PROCESS_TAB) )
-            lDlgCode |= DLGC_WANTTAB;
-
-        lRc |= lDlgCode;
+        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
+            //    next control in the dialog
+            // 3. ctrl which wants ENTER for itself: TAB is used for dialog
+            //    navigation
+            // 4. ctrl which wants both TAB and ENTER: Ctrl-ENTER is used to go
+            //    to the next control
+
+            // the multiline edit control should always get <Return> for itself
+            if ( HasFlag(wxTE_PROCESS_ENTER) || HasFlag(wxTE_MULTILINE) )
+                lDlgCode |= DLGC_WANTMESSAGE;
+
+            if ( HasFlag(wxTE_PROCESS_TAB) )
+                lDlgCode |= DLGC_WANTTAB;
+
+            lRc |= lDlgCode;
+        }
+        else // !editable
+        {
+            // when the control can't be edited by user, it doesn't need any
+            // extra keys at all
+            lRc = 0;
+        }
     }
 
     return lRc;