hacked around wxGTK wxStaticText which doesn't derive from wxStaticTextBase (argh): declare and define Wrap() directly in wxStaticText for this port
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35205 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -25,11 +25,15 @@ class WXDLLEXPORT wxStaticTextBase : public wxControl
|
|||||||
public:
|
public:
|
||||||
wxStaticTextBase() { }
|
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
|
// wrap the text of the control so that no line is longer than the given
|
||||||
// width (if possible: this function won't break words)
|
// width (if possible: this function won't break words)
|
||||||
//
|
//
|
||||||
// NB: implemented in dlgcmn.cpp for now
|
// NB: implemented in dlgcmn.cpp for now
|
||||||
void Wrap(int width);
|
void Wrap(int width);
|
||||||
|
#endif // __WXGTK__
|
||||||
|
|
||||||
// overriden base virtuals
|
// overriden base virtuals
|
||||||
virtual bool AcceptsFocus() const { return false; }
|
virtual bool AcceptsFocus() const { return false; }
|
||||||
|
@@ -238,12 +238,18 @@ wxSizer *wxDialogBase::CreateTextSizer(const wxString& message)
|
|||||||
return wrapper.CreateSizer(text, widthMax);
|
return wrapper.CreateSizer(text, widthMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStaticTextBase::Wrap(int width)
|
void
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
wxStaticText
|
||||||
|
#else
|
||||||
|
wxStaticTextBase
|
||||||
|
#endif
|
||||||
|
::Wrap(int width)
|
||||||
{
|
{
|
||||||
class LabelWrapper : public wxTextWrapper
|
class LabelWrapper : public wxTextWrapper
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void WrapLabel(wxStaticTextBase *text, int widthMax)
|
void WrapLabel(wxWindow *text, int widthMax)
|
||||||
{
|
{
|
||||||
m_text.clear();
|
m_text.clear();
|
||||||
Wrap(text, text->GetLabel(), widthMax);
|
Wrap(text, text->GetLabel(), widthMax);
|
||||||
|
Reference in New Issue
Block a user