- // 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
- if ( m_windowStyle & wxTE_PROCESS_ENTER )
- lDlgCode |= DLGC_WANTMESSAGE;
- if ( m_windowStyle & wxTE_PROCESS_TAB )
- lDlgCode |= DLGC_WANTTAB;
+ if ( IsEditable() )
+ {
+ // 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
+ {
+ // 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 = lDlgCode;
+ }
+ }
+
+ return lRc;
+}
+
+// ----------------------------------------------------------------------------
+// text control event processing
+// ----------------------------------------------------------------------------
+
+bool wxTextCtrl::SendUpdateEvent()
+{
+ // is event reporting suspended?
+ if ( m_suppressNextUpdate )
+ {
+ // do process the next one
+ m_suppressNextUpdate = FALSE;