Allow using wxBitmapBundle for wxButton bitmaps
Take wxBitmapBundle in wxButton::SetBitmapLabel() and related functions in order to be able to associate several bitmaps to be used in different resolutions with the button, instead of just a single bitmap.
This commit is contained in:
@@ -111,8 +111,8 @@ protected:
|
||||
// (re)create the wxButton
|
||||
void CreateButton();
|
||||
|
||||
// helper function: create a bitmap for wxBitmapButton
|
||||
wxBitmap CreateBitmap(const wxString& label, const wxArtID& type);
|
||||
// helper function: create a bitmap bundle for wxBitmapButton
|
||||
wxBitmapBundle CreateBitmap(const wxString& label, const wxArtID& type);
|
||||
|
||||
|
||||
// the controls
|
||||
@@ -691,7 +691,8 @@ void ButtonWidgetsPage::OnButton(wxCommandEvent& WXUNUSED(event))
|
||||
// bitmap button stuff
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxBitmap ButtonWidgetsPage::CreateBitmap(const wxString& label, const wxArtID& type)
|
||||
wxBitmapBundle
|
||||
ButtonWidgetsPage::CreateBitmap(const wxString& label, const wxArtID& type)
|
||||
{
|
||||
wxBitmap bmp(FromDIP(wxSize(180, 70))); // shouldn't hardcode but it's simpler like this
|
||||
wxMemoryDC dc;
|
||||
@@ -708,4 +709,3 @@ wxBitmap ButtonWidgetsPage::CreateBitmap(const wxString& label, const wxArtID& t
|
||||
|
||||
return bmp;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user