From d3a3353a8d8ceb29226773cd82d8eaa2972f76f3 Mon Sep 17 00:00:00 2001 From: Jouk Date: Tue, 9 Jul 2019 09:02:14 +0200 Subject: [PATCH] Merge recent stattext chages also into WXgtk1 --- include/wx/gtk1/stattext.h | 2 ++ src/gtk1/stattext.cpp | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/include/wx/gtk1/stattext.h b/include/wx/gtk1/stattext.h index a9b9a221db..cb35e6bfcf 100644 --- a/include/wx/gtk1/stattext.h +++ b/include/wx/gtk1/stattext.h @@ -48,6 +48,8 @@ protected: int sizeFlags = wxSIZE_AUTO); virtual wxSize DoGetBestSize() const; + virtual wxString WXGetVisibleLabel() const wxOVERRIDE; + virtual void WXSetVisibleLabel(const wxString& str) wxOVERRIDE; wxDECLARE_DYNAMIC_CLASS(wxStaticText); }; diff --git a/src/gtk1/stattext.cpp b/src/gtk1/stattext.cpp index a4b6427179..3e0a5fb14d 100644 --- a/src/gtk1/stattext.cpp +++ b/src/gtk1/stattext.cpp @@ -153,6 +153,25 @@ bool wxStaticText::SetForegroundColour(const wxColour& colour) return true; } +// These functions are not used as GTK supports ellipsization natively and we +// never call the base class UpdateText() which uses them. +// +// Note that, unfortunately, we still need to define them because they still +// exist, as pure virtuals, in the base class even in wxGTK to allow +// wxGenericStaticText to override them. + +wxString wxStaticText::WXGetVisibleLabel() const +{ + wxFAIL_MSG(wxS("Unreachable")); + + return wxString(); +} + +void wxStaticText::WXSetVisibleLabel(const wxString& WXUNUSED(str)) +{ + wxFAIL_MSG(wxS("Unreachable")); +} + // static wxVisualAttributes wxStaticText::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))