#if wxUSE_STATTEXT
-class wxTextSizerWrapper : public wxTextWrapper
+wxSizer *wxDialogBase::CreateTextSizer(const wxString& message)
{
-public:
- wxTextSizerWrapper(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);
- }
- }
+ wxTextSizerWrapper wrapper(this);
-private:
- wxWindow *m_win;
- wxSizer *m_sizer;
- int m_hLine;
-};
+ return CreateTextSizer(message, wrapper);
+}
-wxSizer *wxDialogBase::CreateTextSizer(const wxString& message)
+wxSizer *wxDialogBase::CreateTextSizer(const wxString& message,
+ wxTextSizerWrapper& wrapper)
{
// I admit that this is complete bogus, but it makes
// message boxes work for pda screens temporarily..
wxString text(message);
text.Replace(wxT("&"), wxT("&&"));
- wxTextSizerWrapper wrapper(this);
-
return wrapper.CreateSizer(text, widthMax);
}