-
- class TextSizerWrapper : public wxTextWrapper
- {
- public:
- TextSizerWrapper(wxWindow *win)
- {
- m_win = win;
- m_hLine = 0;
- }
-
- wxSizer *CreateSizer(const wxString& text, int widthMax)
- {
- m_sizer = new wxBoxSizer(wxVERTICAL);
- Wrap(m_win, text, widthMax);
- return m_sizer;
- }
-
- protected:
- virtual void OnOutputLine(const wxString& line)
- {
- if ( !line.empty() )
- {
- m_sizer->Add(new wxStaticText(m_win, wxID_ANY, line));
- }
- else // empty line, no need to create a control for it
- {
- if ( !m_hLine )
- m_hLine = m_win->GetCharHeight();
-
- m_sizer->Add(5, m_hLine);
- }
- }
-
- private:
- wxWindow *m_win;
- wxSizer *m_sizer;
- int m_hLine;
- };
-
- TextSizerWrapper wrapper(this);