Implement wxTextEntry::SetHint() natively for GTK+3.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75335 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2013-12-02 17:46:27 +00:00
parent 59efb1cf1c
commit 065deffd86
2 changed files with 32 additions and 0 deletions

View File

@ -48,6 +48,11 @@ public:
virtual void SetMaxLength(unsigned long len);
#ifdef __WXGTK3__
virtual bool SetHint(const wxString& hint);
virtual wxString GetHint() const;
#endif
// implementation only from now on
void SendMaxLenEvent();
bool GTKEntryOnInsertText(const char* text);

View File

@ -514,4 +514,31 @@ wxPoint wxTextEntry::DoGetMargins() const
#endif
}
#ifdef __WXGTK3__
bool wxTextEntry::SetHint(const wxString& hint)
{
#if GTK_CHECK_VERSION(3,2,0)
GtkEntry *entry = GetEntry();
if ( entry )
{
gtk_entry_set_placeholder_text(entry, wxGTK_CONV(hint));
return true;
}
else
#endif
return wxTextEntryBase::SetHint(hint);
}
wxString wxTextEntry::GetHint() const
{
#if GTK_CHECK_VERSION(3,2,0)
GtkEntry *entry = GetEntry();
if ( entry )
return wxGTK_CONV_BACK(gtk_entry_get_placeholder_text(entry));
else
#endif
return wxTextEntryBase::GetHint();
}
#endif // __WXGTK3__
#endif // wxUSE_TEXTCTRL || wxUSE_COMBOBOX