mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
Fix BitmapComboBox for wxWidgets 3.3 (wxBitmap -> wxBitmapBundle)
In wxWidgets 3.3, wxBitmapComboBoxBase::OnAddBitmap changed its parameter from const wxBitmap& to const wxBitmapBundle&, and m_bitmaps was replaced by m_bitmapbundles. Update OnAddBitmap signature and OnDrawItem to use wxBitmapBundle, extracting wxBitmap via GetBitmap(GetDefaultSize()) where needed.
This commit is contained in:
@@ -91,8 +91,9 @@ BitmapComboBox::~BitmapComboBox()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
bool BitmapComboBox::OnAddBitmap(const wxBitmap& bitmap)
|
bool BitmapComboBox::OnAddBitmap(const wxBitmapBundle& bundle)
|
||||||
{
|
{
|
||||||
|
wxBitmap bitmap = bundle.GetBitmap(bundle.GetDefaultSize());
|
||||||
if (bitmap.IsOk())
|
if (bitmap.IsOk())
|
||||||
{
|
{
|
||||||
// we should use scaled! size values of bitmap
|
// we should use scaled! size values of bitmap
|
||||||
@@ -131,7 +132,8 @@ void BitmapComboBox::OnDrawItem(wxDC& dc,
|
|||||||
int item,
|
int item,
|
||||||
int flags) const
|
int flags) const
|
||||||
{
|
{
|
||||||
const wxBitmap& bmp = *(static_cast<wxBitmap*>(m_bitmaps[item]));
|
const wxBitmapBundle& bundle = m_bitmapbundles[item];
|
||||||
|
wxBitmap bmp = bundle.GetBitmap(bundle.GetDefaultSize());
|
||||||
if (bmp.IsOk())
|
if (bmp.IsOk())
|
||||||
{
|
{
|
||||||
// we should use scaled! size values of bitmap
|
// we should use scaled! size values of bitmap
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ protected:
|
|||||||
* For this purpose control drawing methods and
|
* For this purpose control drawing methods and
|
||||||
* control size calculation methods (virtual) are overridden.
|
* control size calculation methods (virtual) are overridden.
|
||||||
**/
|
**/
|
||||||
bool OnAddBitmap(const wxBitmap& bitmap) override;
|
bool OnAddBitmap(const wxBitmapBundle& bitmap) override;
|
||||||
void OnDrawItem(wxDC& dc, const wxRect& rect, int item, int flags) const override;
|
void OnDrawItem(wxDC& dc, const wxRect& rect, int item, int flags) const override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user