Fix combo sample build without wxHAS_SVG

Just don't use bitmaps at all if SVG support is unavailable.

Closes #22161.
This commit is contained in:
Jouk
2022-02-25 08:29:20 +01:00
committed by Vadim Zeitlin
parent 6c9d1291f6
commit e7096e85d2

View File

@@ -538,7 +538,9 @@ public:
style | wxCC_STD_BUTTON, style | wxCC_STD_BUTTON,
validator,name); validator,name);
#ifdef wxHAS_SVG
SetButtonBitmaps(wxBitmapBundle::FromSVGFile("three-dots.svg", wxSize(16, 16)), true); SetButtonBitmaps(wxBitmapBundle::FromSVGFile("three-dots.svg", wxSize(16, 16)), true);
#endif
} }
virtual void OnButtonClick() wxOVERRIDE virtual void OnButtonClick() wxOVERRIDE
@@ -827,6 +829,7 @@ MyFrame::MyFrame(const wxString& title)
); );
// Load images from disk // Load images from disk
#ifdef wxHAS_SVG
wxBitmapBundle bmpNormal = wxBitmapBundle::FromSVGFile("dropbutn.svg", wxSize(16, 16)); wxBitmapBundle bmpNormal = wxBitmapBundle::FromSVGFile("dropbutn.svg", wxSize(16, 16));
wxBitmapBundle bmpPressed = wxBitmapBundle::FromSVGFile("dropbutp.svg", wxSize(16, 16)); wxBitmapBundle bmpPressed = wxBitmapBundle::FromSVGFile("dropbutp.svg", wxSize(16, 16));
wxBitmapBundle bmpHover = wxBitmapBundle::FromSVGFile("dropbuth.svg", wxSize(16, 16)); wxBitmapBundle bmpHover = wxBitmapBundle::FromSVGFile("dropbuth.svg", wxSize(16, 16));
@@ -838,6 +841,7 @@ MyFrame::MyFrame(const wxString& title)
} }
else else
wxLogError("Dropbutton images not found"); wxLogError("Dropbutton images not found");
#endif
//odc2->SetButtonPosition(0, // width adjustment //odc2->SetButtonPosition(0, // width adjustment
// 0, // height adjustment // 0, // height adjustment