select the whole text in the single line text control when its SetFocus() is called (which also happens when the user TABs to it)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1244,6 +1244,24 @@ long wxTextCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||
return wxTextCtrlBase::MSWWindowProc(nMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
void wxTextCtrl::SetFocus()
|
||||
{
|
||||
wxTextCtrlBase::SetFocus();
|
||||
|
||||
// to be consistent with the standard Windows behaviour we select all text
|
||||
// in the single line edit controls when the user TABs to them and also, to
|
||||
// be consistent with this behaviour in turn, do it whenever SetFocus() is
|
||||
// called as well
|
||||
if ( !HasFlag(wxTE_MULTILINE) )
|
||||
{
|
||||
SetSelection(-1, -1);
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// text control event processing
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
|
||||
{
|
||||
switch (param)
|
||||
|
Reference in New Issue
Block a user