Add footer text and icon to wxRichMessageDialog
The underlying Windows TaskDialog supports adding an additional footer to the message dialog. This makes the native functionality available and implements it in the generic version. See https://github.com/wxWidgets/wxWidgets/pull/573
This commit is contained in:
@@ -18,12 +18,15 @@
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/checkbox.h"
|
||||
#include "wx/statbmp.h"
|
||||
#include "wx/stattext.h"
|
||||
#include "wx/sizer.h"
|
||||
#endif
|
||||
|
||||
#include "wx/collpane.h"
|
||||
#include "wx/richmsgdlg.h"
|
||||
#include "wx/statline.h"
|
||||
#include "wx/artprov.h"
|
||||
|
||||
wxIMPLEMENT_CLASS(wxRichMessageDialog, wxDialog)
|
||||
|
||||
@@ -77,6 +80,26 @@ void wxGenericRichMessageDialog::AddMessageDialogDetails(wxSizer *sizer)
|
||||
sizerDetails->Add( m_detailsPane, wxSizerFlags().Right().Expand() );
|
||||
sizer->Add( sizerDetails, 0, wxTOP|wxLEFT|wxRIGHT | wxALIGN_LEFT, 10 );
|
||||
}
|
||||
|
||||
if ( !m_footerText.empty() )
|
||||
{
|
||||
// add footer
|
||||
sizer->Add( new wxStaticLine(this), wxSizerFlags().Expand().Border() );
|
||||
wxSizer *footerSizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
if (m_footerIcon)
|
||||
{
|
||||
wxSize iconSize = wxArtProvider::GetNativeSizeHint(wxART_MENU);
|
||||
|
||||
wxStaticBitmap* footerIcon = new wxStaticBitmap(this, wxID_ANY,
|
||||
wxArtProvider::GetIcon(wxArtProvider::GetMessageBoxIconId(m_footerIcon),
|
||||
wxART_MESSAGE_BOX, iconSize));
|
||||
footerSizer->Add( footerIcon,
|
||||
wxSizerFlags().Border(wxLEFT|wxRIGHT).CenterVertical() );
|
||||
}
|
||||
footerSizer->Add( new wxStaticText(this, wxID_ANY, m_footerText),
|
||||
wxSizerFlags().CenterVertical() );
|
||||
sizer->Add( footerSizer, wxSizerFlags().Border().Expand() );
|
||||
}
|
||||
}
|
||||
|
||||
bool wxGenericRichMessageDialog::IsCheckBoxChecked() const
|
||||
|
||||
Reference in New Issue
Block a user