text controls respect wxTE_PROCESS_ENTER/TAB styles again, WM_GETDLGCODE

handling is generally better


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2827 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-06-19 00:08:58 +00:00
parent d220ae3237
commit 101f488cf5
4 changed files with 41 additions and 29 deletions

View File

@@ -151,6 +151,21 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
if (m_windowStyle & wxTE_PASSWORD) // hidden input
msStyle |= ES_PASSWORD;
// we always want the characters and the arrows
m_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
if ( m_windowStyle & wxTE_PROCESS_ENTER )
m_lDlgCode |= DLGC_WANTMESSAGE;
if ( m_windowStyle & wxTE_PROCESS_TAB )
m_lDlgCode |= DLGC_WANTTAB;
const wxChar *windowClass = _T("EDIT");
#if wxUSE_RICHEDIT
@@ -1123,26 +1138,6 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
event.Skip();
}
long wxTextCtrl::MSWGetDlgCode()
{
// we always want the characters and the arrows
long lRc = 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
if ( m_windowStyle & wxTE_PROCESS_ENTER )
lRc |= DLGC_WANTMESSAGE;
if ( m_windowStyle & wxTE_PROCESS_TAB )
lRc |= DLGC_WANTTAB;
return lRc;
}
bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
{
switch (param)