X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/255c07b4df512ff4f844f4d604787b5ea8999530..6cf5edea273b08316390683a17851a2437103da4:/interface/wx/textwrapper.h diff --git a/interface/wx/textwrapper.h b/interface/wx/textwrapper.h index dd830ed3e3..c82b4ff1a2 100644 --- a/interface/wx/textwrapper.h +++ b/interface/wx/textwrapper.h @@ -20,40 +20,41 @@ Here is an example function using this class which inserts hard line breaks into a string of text at the positions where it would be wrapped: + @code -wxString WrapText(wxWindow *win, const wxString& text, int widthMax) -{ - class HardBreakWrapper : public wxTextWrapper + wxString WrapText(wxWindow *win, const wxString& text, int widthMax) { - public: - HardBreakWrapper(wxWindow *win, const wxString& text, int widthMax) - { - Wrap(win, text, widthMax); - } - - wxString const& GetWrapped() const { return m_wrapped; } - - protected: - virtual void OnOutputLine(const wxString& line) + class HardBreakWrapper : public wxTextWrapper { - m_wrapped += line; - } - - virtual void OnNewLine() - { - m_wrapped += '\n'; - } - - private: - wxString m_wrapped; - }; - - HardBreakWrapper wrapper(win, text, widthMax); - return wrapper.GetWrapped(); -} + public: + HardBreakWrapper(wxWindow *win, const wxString& text, int widthMax) + { + Wrap(win, text, widthMax); + } + + wxString const& GetWrapped() const { return m_wrapped; } + + protected: + virtual void OnOutputLine(const wxString& line) + { + m_wrapped += line; + } + + virtual void OnNewLine() + { + m_wrapped += '\n'; + } + + private: + wxString m_wrapped; + }; + + HardBreakWrapper wrapper(win, text, widthMax); + return wrapper.GetWrapped(); + } @endcode - @library{none} + @nolibrary @category{gdi} */ class wxTextWrapper