X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/255c07b4df512ff4f844f4d604787b5ea8999530..1b7751aaa9a86d76a850b9267bc0c201e3cea30f:/interface/wx/textwrapper.h diff --git a/interface/wx/textwrapper.h b/interface/wx/textwrapper.h index dd830ed3e3..067ff781f9 100644 --- a/interface/wx/textwrapper.h +++ b/interface/wx/textwrapper.h @@ -4,7 +4,7 @@ // Author: Vadim Zeitlin // RCS-ID: $Id$ // Copyright: (c) 2009 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -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