Always show hint in text entries, even when they have focus.

It was impossible to show the hint for the initially focused child of a dialog
before, as the hint was hidden from the very beginning. By showing it always
we avoid this problem.

We may want to add an option/flag for SetHint() to make this configurable
later if somebody really needs to show hints only for as long as the control
doesn't have focus.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62986 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2009-12-25 11:36:54 +00:00
parent 0aaa6ace7e
commit 7591b0bb53

View File

@ -450,8 +450,12 @@ bool wxTextEntry::SetHint(const wxString& hint)
if ( wxUxThemeEngine::GetIfActive() )
{
// notice that this message always works with Unicode strings
//
// we always use TRUE for wParam to show the hint even when the window
// has focus, otherwise there would be no way to show the hint for the
// initially focused window
if ( ::SendMessage(GetEditHwnd(), EM_SETCUEBANNER,
0, (LPARAM)(const wchar_t *)hint.wc_str()) )
TRUE, (LPARAM)(const wchar_t *)hint.wc_str()) )
return true;
}