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:
@@ -48,6 +48,11 @@ public:
|
|||||||
|
|
||||||
virtual void SetMaxLength(unsigned long len);
|
virtual void SetMaxLength(unsigned long len);
|
||||||
|
|
||||||
|
#ifdef __WXGTK3__
|
||||||
|
virtual bool SetHint(const wxString& hint);
|
||||||
|
virtual wxString GetHint() const;
|
||||||
|
#endif
|
||||||
|
|
||||||
// implementation only from now on
|
// implementation only from now on
|
||||||
void SendMaxLenEvent();
|
void SendMaxLenEvent();
|
||||||
bool GTKEntryOnInsertText(const char* text);
|
bool GTKEntryOnInsertText(const char* text);
|
||||||
|
@@ -514,4 +514,31 @@ wxPoint wxTextEntry::DoGetMargins() const
|
|||||||
#endif
|
#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
|
#endif // wxUSE_TEXTCTRL || wxUSE_COMBOBOX
|
||||||
|
Reference in New Issue
Block a user