Fix wxGTK build in non-Unicode mode

Use wxGTK_CONV_FONT() and wxGTK_CONV_BACK_FONT() macros instead of implicitly
using "m_font" which doesn't exist in wxTextEntry, which is not a wxWindow.
This commit is contained in:
Vadim Zeitlin
2017-03-15 13:38:37 +01:00
parent 3eda902331
commit 0cc5b6e97e

View File

@@ -574,7 +574,11 @@ bool wxTextEntry::SetHint(const wxString& hint)
GtkEntry *entry = GetEntry(); GtkEntry *entry = GetEntry();
if (entry && gtk_check_version(3,2,0) == NULL) if (entry && gtk_check_version(3,2,0) == NULL)
{ {
gtk_entry_set_placeholder_text(entry, wxGTK_CONV(hint)); gtk_entry_set_placeholder_text
(
entry,
wxGTK_CONV_FONT(hint, GetEditableWindow()->GetFont())
);
return true; return true;
} }
#endif #endif
@@ -586,7 +590,13 @@ wxString wxTextEntry::GetHint() const
#if GTK_CHECK_VERSION(3,2,0) #if GTK_CHECK_VERSION(3,2,0)
GtkEntry *entry = GetEntry(); GtkEntry *entry = GetEntry();
if (entry && gtk_check_version(3,2,0) == NULL) if (entry && gtk_check_version(3,2,0) == NULL)
return wxGTK_CONV_BACK(gtk_entry_get_placeholder_text(entry)); {
return wxGTK_CONV_BACK_FONT
(
gtk_entry_get_placeholder_text(entry),
const_cast<wxTextEntry *>(this)->GetEditableWindow()->GetFont()
);
}
#endif #endif
return wxTextEntryBase::GetHint(); return wxTextEntryBase::GetHint();
} }