From 7591b0bb5324c6e996fc81f8458f7674b2f1461e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 25 Dec 2009 11:36:54 +0000 Subject: [PATCH] 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 --- src/msw/textentry.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/msw/textentry.cpp b/src/msw/textentry.cpp index eb53b98d0d..298e07b8eb 100644 --- a/src/msw/textentry.cpp +++ b/src/msw/textentry.cpp @@ -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; } -- 2.45.2