X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..81533a3af6ed598c32a35e1c1c2b60f4908f5541:/src/msw/textentry.cpp?ds=sidebyside diff --git a/src/msw/textentry.cpp b/src/msw/textentry.cpp index 672058b8fd..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; } @@ -474,4 +478,44 @@ wxString wxTextEntry::GetHint() const #endif // wxUSE_UXTHEME +// ---------------------------------------------------------------------------- +// margins support +// ---------------------------------------------------------------------------- + +bool wxTextEntry::DoSetMargins(const wxPoint& margins) +{ +#if !defined(__WXWINCE__) + bool res = true; + + if ( margins.x != -1 ) + { + // left margin + ::SendMessage(GetEditHwnd(), EM_SETMARGINS, + EC_LEFTMARGIN, MAKELONG(margins.x, 0)); + } + + if ( margins.y != -1 ) + { + res = false; + } + + return res; +#else + return false; +#endif +} + +wxPoint wxTextEntry::DoGetMargins() const +{ +#if !defined(__WXWINCE__) + LRESULT lResult = ::SendMessage(GetEditHwnd(), EM_GETMARGINS, + 0, 0); + int left = LOWORD(lResult); + int top = -1; + return wxPoint(left, top); +#else + return wxPoint(-1, -1); +#endif +} + #endif // wxUSE_TEXTCTRL || wxUSE_COMBOBOX