added wxTextEntry::SetHint() (a.k.a. cue banner or placeholder string)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-03-02 12:25:01 +00:00
parent 231728361c
commit 63f7d5022e
21 changed files with 311 additions and 18 deletions

View File

@@ -42,6 +42,10 @@
#include "wx/wupdlock.h"
#include "wx/msw/private.h"
#if wxUSE_UXTHEME
#include "wx/msw/uxtheme.h"
#endif
#if wxUSE_TOOLTIPS
#include "wx/tooltip.h"
#endif // wxUSE_TOOLTIPS
@@ -445,6 +449,14 @@ WXHWND wxComboBox::GetEditHWND() const
return hWndEdit;
}
wxWindow *wxComboBox::GetEditableWindow()
{
wxASSERT_MSG( !HasFlag(wxCB_READONLY),
_T("read-only combobox doesn't have any edit control") );
return this;
}
// ----------------------------------------------------------------------------
// wxComboBox creation
// ----------------------------------------------------------------------------
@@ -665,4 +677,22 @@ void wxComboBox::DoSetToolTip(wxToolTip *tip)
#endif // wxUSE_TOOLTIPS
#if wxUSE_UXTHEME
bool wxComboBox::SetHint(const wxString& hintOrig)
{
wxString hint(hintOrig);
if ( wxUxThemeEngine::GetIfActive() )
{
// under XP (but not Vista) there is a bug in cue banners
// implementation for combobox edit control: the first character is
// partially chopped off, so prepend a space to make it fully visible
hint.insert(0, " ");
}
return wxTextEntry::SetHint(hint);
}
#endif // wxUSE_UXTHEME
#endif // wxUSE_COMBOBOX