implement SetFocusFromKbd() to select all text in the controls whose dialog code has DLGC_HASSETSEL
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15224 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -86,6 +86,7 @@ public:
|
|||||||
virtual bool Enable( bool enable = TRUE );
|
virtual bool Enable( bool enable = TRUE );
|
||||||
|
|
||||||
virtual void SetFocus();
|
virtual void SetFocus();
|
||||||
|
virtual void SetFocusFromKbd();
|
||||||
|
|
||||||
virtual bool Reparent(wxWindowBase *newParent);
|
virtual bool Reparent(wxWindowBase *newParent);
|
||||||
|
|
||||||
|
@@ -458,6 +458,20 @@ void wxWindowMSW::SetFocus()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxWindowMSW::SetFocusFromKbd()
|
||||||
|
{
|
||||||
|
wxWindowBase::SetFocusFromKbd();
|
||||||
|
|
||||||
|
// when the focus is given to the control with DLGC_HASSETSEL style from
|
||||||
|
// keyboard its contents should be entirely selected: this is what
|
||||||
|
// ::IsDialogMessage() does and so we should do it as well to provide the
|
||||||
|
// same LNF as the native programs
|
||||||
|
if ( ::SendMessage(GetHwnd(), WM_GETDLGCODE, 0, 0) & DLGC_HASSETSEL )
|
||||||
|
{
|
||||||
|
::SendMessage(GetHwnd(), EM_SETSEL, 0, -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get the window with the focus
|
// Get the window with the focus
|
||||||
wxWindow *wxWindowBase::FindFocus()
|
wxWindow *wxWindowBase::FindFocus()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user