diff --git a/include/wx/stattext.h b/include/wx/stattext.h index 8b0c667eb1..3774142027 100644 --- a/include/wx/stattext.h +++ b/include/wx/stattext.h @@ -25,11 +25,15 @@ class WXDLLEXPORT wxStaticTextBase : public wxControl public: wxStaticTextBase() { } + // in wxGTK wxStaticText doesn't derive from wxStaticTextBase so we have to + // declare this function directly in gtk header +#ifndef __WXGTK__ // wrap the text of the control so that no line is longer than the given // width (if possible: this function won't break words) // // NB: implemented in dlgcmn.cpp for now void Wrap(int width); +#endif // __WXGTK__ // overriden base virtuals virtual bool AcceptsFocus() const { return false; } diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index d9844ee042..91e11accb1 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -238,12 +238,18 @@ wxSizer *wxDialogBase::CreateTextSizer(const wxString& message) return wrapper.CreateSizer(text, widthMax); } -void wxStaticTextBase::Wrap(int width) +void +#ifdef __WXGTK__ +wxStaticText +#else +wxStaticTextBase +#endif +::Wrap(int width) { class LabelWrapper : public wxTextWrapper { public: - void WrapLabel(wxStaticTextBase *text, int widthMax) + void WrapLabel(wxWindow *text, int widthMax) { m_text.clear(); Wrap(text, text->GetLabel(), widthMax);