fix for handling TAB presses in readonly text controls
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1285,17 +1285,19 @@ long wxTextCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
long lRc = wxTextCtrlBase::MSWWindowProc(nMsg, wParam, lParam);
|
long lRc = wxTextCtrlBase::MSWWindowProc(nMsg, wParam, lParam);
|
||||||
|
|
||||||
if ( nMsg == WM_GETDLGCODE )
|
if ( nMsg == WM_GETDLGCODE )
|
||||||
|
{
|
||||||
|
if ( IsEditable() )
|
||||||
{
|
{
|
||||||
// we always want the chars and the arrows
|
// we always want the chars and the arrows
|
||||||
long lDlgCode = DLGC_WANTCHARS | DLGC_WANTARROWS;
|
long lDlgCode = DLGC_WANTCHARS | DLGC_WANTARROWS;
|
||||||
|
|
||||||
// we may have several different cases:
|
// we may have several different cases:
|
||||||
// 1. normal case: both TAB and ENTER are used for dialog navigation
|
// 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
|
// 2. ctrl which wants TAB for itself: ENTER is used to pass to the
|
||||||
// next control in the dialog
|
// next control in the dialog
|
||||||
// 3. ctrl which wants ENTER for itself: TAB is used for dialog
|
// 3. ctrl which wants ENTER for itself: TAB is used for dialog
|
||||||
// navigation
|
// navigation
|
||||||
// 4. ctrl which wants both TAB and ENTER: Ctrl-ENTER is used to pass
|
// 4. ctrl which wants both TAB and ENTER: Ctrl-ENTER is used to go
|
||||||
// to the next control
|
// to the next control
|
||||||
|
|
||||||
// the multiline edit control should always get <Return> for itself
|
// the multiline edit control should always get <Return> for itself
|
||||||
@@ -1307,6 +1309,13 @@ long wxTextCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
|
|
||||||
lRc |= lDlgCode;
|
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;
|
return lRc;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user