don't let the user modify the contents of read-only control (modified patch 1463707)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38657 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -432,8 +432,18 @@ void wxRichTextCtrl::OnChar(wxKeyEvent& event)
|
|||||||
event.GetKeyCode() == WXK_END)
|
event.GetKeyCode() == WXK_END)
|
||||||
{
|
{
|
||||||
KeyboardNavigate(event.GetKeyCode(), flags);
|
KeyboardNavigate(event.GetKeyCode(), flags);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (event.GetKeyCode() == WXK_RETURN)
|
|
||||||
|
// all the other keys modify the controls contents which shouldn't be
|
||||||
|
// possible if we're read-only
|
||||||
|
if ( !IsEditable() )
|
||||||
|
{
|
||||||
|
event.Skip();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.GetKeyCode() == WXK_RETURN)
|
||||||
{
|
{
|
||||||
BeginBatchUndo(_("Insert Text"));
|
BeginBatchUndo(_("Insert Text"));
|
||||||
|
|
||||||
@@ -527,10 +537,6 @@ void wxRichTextCtrl::OnChar(wxKeyEvent& event)
|
|||||||
SetDefaultStyleToCursorStyle();
|
SetDefaultStyleToCursorStyle();
|
||||||
ScrollIntoView(m_caretPosition, WXK_RIGHT);
|
ScrollIntoView(m_caretPosition, WXK_RIGHT);
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
else
|
|
||||||
event.Skip();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delete content if there is a selection, e.g. when pressing a key.
|
/// Delete content if there is a selection, e.g. when pressing a key.
|
||||||
|
Reference in New Issue
Block a user