How can I add bitmap to dialog?
Posted: Tue Sep 22, 2020 12:08 pm
I try own message box like wxMessageBox.
How can I add bitmap to dialog?
is posssible add bitmap to button:
I try using panel https://wiki.wxwidgets.org/An_image_panel after correcting "wxImagePanel: public wxPanel" and "wxImagePanel(wxWindow* parent, wxString file, wxBitmapType format)" I don't see image on this panel.
How can I add bitmap to dialog?
is posssible add bitmap to button:
Code: Select all
const wxSize imageSize(32, 32);
wxImageList* m_imageList = new wxImageList();
m_imageList = new wxImageList(imageSize.GetWidth(), imageSize.GetHeight());
m_imageList->
Add(wxArtProvider::GetIcon(wxART_INFORMATION, wxART_OTHER, imageSize));
m_imageList->
Add(wxArtProvider::GetIcon(wxART_QUESTION, wxART_OTHER, imageSize));
m_imageList->
Add(wxArtProvider::GetIcon(wxART_WARNING, wxART_OTHER, imageSize));
m_imageList->
Add(wxArtProvider::GetIcon(wxART_ERROR, wxART_OTHER, imageSize));
wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
wxButton *button = new wxButton(this, 1, "");
button->SetBitmap(m_imageList->GetBitmap(0));
sizer->Add(button);
SetSizer(sizer);