Use wxBitmapBundle in wxWizard.

See #22124.
This commit is contained in:
Vadim Zeitlin
2022-02-13 00:30:26 +01:00
10 changed files with 396 additions and 836 deletions

View File

@@ -29,7 +29,7 @@ public:
wxWizard(wxWindow *parent,
int id = wxID_ANY,
const wxString& title = wxEmptyString,
const wxBitmap& bitmap = wxNullBitmap,
const wxBitmapBundle& bitmap = wxBitmapBundle(),
const wxPoint& pos = wxDefaultPosition,
long style = wxDEFAULT_DIALOG_STYLE)
{
@@ -39,7 +39,7 @@ public:
bool Create(wxWindow *parent,
int id = wxID_ANY,
const wxString& title = wxEmptyString,
const wxBitmap& bitmap = wxNullBitmap,
const wxBitmapBundle& bitmap = wxBitmapBundle(),
const wxPoint& pos = wxDefaultPosition,
long style = wxDEFAULT_DIALOG_STYLE);
void Init();
@@ -55,8 +55,8 @@ public:
virtual void SetBorder(int border) wxOVERRIDE;
/// set/get bitmap
const wxBitmap& GetBitmap() const { return m_bitmap; }
void SetBitmap(const wxBitmap& bitmap);
wxBitmap GetBitmap() const { return m_bitmap.GetBitmapFor(this); }
void SetBitmap(const wxBitmapBundle& bitmap);
// implementation only from now on
// -------------------------------
@@ -116,6 +116,9 @@ protected:
void AddBackNextPair(wxBoxSizer *buttonRow);
void AddButtonRow(wxBoxSizer *mainColumn);
// This function can be used as event handle for wxEVT_DPI_CHANGED event.
void WXHandleDPIChanged(wxDPIChangedEvent& event);
// the page size requested by user
wxSize m_sizePage;
@@ -123,9 +126,9 @@ protected:
wxPoint m_posWizard;
// wizard state
wxWizardPage *m_page; // the current page or NULL
wxWizardPage *m_firstpage; // the page RunWizard started on or NULL
wxBitmap m_bitmap; // the default bitmap to show
wxWizardPage *m_page; // the current page or NULL
wxWizardPage *m_firstpage; // the page RunWizard started on or NULL
wxBitmapBundle m_bitmap; // the default bitmap to show
// wizard controls
wxButton *m_btnPrev, // the "<Back" button

View File

@@ -27,7 +27,7 @@
#include "wx/dialog.h" // the base class
#include "wx/panel.h" // ditto
#include "wx/event.h" // wxEVT_XXX constants
#include "wx/bitmap.h"
#include "wx/bmpbndl.h"
// Extended style to specify a help button
#define wxWIZARD_EX_HELPBUTTON 0x00000010
@@ -62,10 +62,10 @@ public:
// that no other parameters are needed because the wizard will resize and
// reposition the page anyhow
wxWizardPage(wxWizard *parent,
const wxBitmap& bitmap = wxNullBitmap);
const wxBitmapBundle& bitmap = wxBitmapBundle());
bool Create(wxWizard *parent,
const wxBitmap& bitmap = wxNullBitmap);
const wxBitmapBundle& bitmap = wxBitmapBundle());
// these functions are used by the wizard to show another page when the
// user chooses "Back" or "Next" button
@@ -76,7 +76,7 @@ public:
// cases - override this method if you want to create the bitmap to be used
// dynamically or to do something even more fancy. It's ok to return
// wxNullBitmap from here - the default one will be used then.
virtual wxBitmap GetBitmap() const { return m_bitmap; }
virtual wxBitmap GetBitmap() const { return m_bitmap.GetBitmapFor(this); }
#if wxUSE_VALIDATORS
// Override the base functions to allow a validator to be assigned to this page.
@@ -103,7 +103,7 @@ protected:
// common part of ctors:
void Init();
wxBitmap m_bitmap;
wxBitmapBundle m_bitmap;
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxWizardPage);
@@ -127,7 +127,7 @@ public:
wxWizardPageSimple(wxWizard *parent,
wxWizardPage *prev = NULL,
wxWizardPage *next = NULL,
const wxBitmap& bitmap = wxNullBitmap)
const wxBitmapBundle& bitmap = wxBitmapBundle())
{
Create(parent, prev, next, bitmap);
}
@@ -135,7 +135,7 @@ public:
bool Create(wxWizard *parent = NULL, // let it be default ctor too
wxWizardPage *prev = NULL,
wxWizardPage *next = NULL,
const wxBitmap& bitmap = wxNullBitmap)
const wxBitmapBundle& bitmap = wxBitmapBundle())
{
m_prev = prev;
m_next = next;
@@ -197,7 +197,7 @@ public:
wxWizard(wxWindow *parent,
int id = wxID_ANY,
const wxString& title = wxEmptyString,
const wxBitmap& bitmap = wxNullBitmap,
const wxBitmapBundle& bitmap = wxBitmapBundle(),
const wxPoint& pos = wxDefaultPosition,
long style = wxDEFAULT_DIALOG_STYLE);
*/