X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5276b0a53cef4815230e39b54d2ecda14f72cbd1..ec080ef1873995bcd9b20b0fc1a6d208a78540d3:/src/common/dlgcmn.cpp diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index 1a6b15c16b..8d127fa5e2 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -143,45 +143,15 @@ wxDialogBase::GetParentForModalDialog(wxWindow *parent, long style) const #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.. @@ -198,8 +168,6 @@ wxSizer *wxDialogBase::CreateTextSizer(const wxString& message) wxString text(message); text.Replace(wxT("&"), wxT("&&")); - wxTextSizerWrapper wrapper(this); - return wrapper.CreateSizer(text, widthMax); }