Make the main message of wxGenericMessageDialog stand out.

Use larger bold font for the main message in wxGenericMessageDialog if the
extended message is also given to make it stand out similarly to how it
happens in the native GTK and MSW dialogs.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65363 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-08-19 15:41:18 +00:00
parent 9a3551d3f4
commit c79510ca12
4 changed files with 121 additions and 44 deletions

View File

@@ -66,5 +66,63 @@ private:
wxDECLARE_NO_COPY_CLASS(wxTextWrapper);
};
#if wxUSE_STATTEXT
#include "wx/sizer.h"
#include "wx/stattext.h"
// A class creating a sizer with one static text per line of text. Creation of
// the controls used for each line can be customized by overriding
// OnCreateLine() function.
//
// This class is currently private to wxWidgets and used only by wxDialog
// itself. We may make it public later if there is sufficient interest.
class wxTextSizerWrapper : public wxTextWrapper
{
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;
}
wxWindow *GetParent() const { return m_win; }
protected:
virtual wxWindow *OnCreateLine(const wxString& line)
{
return new wxStaticText(m_win, wxID_ANY, line);
}
virtual void OnOutputLine(const wxString& line)
{
if ( !line.empty() )
{
m_sizer->Add(OnCreateLine(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;
};
#endif // wxUSE_STATTEXT
#endif // _WX_TEXTWRAPPER_H_