#include "StaticGroup.hpp" StaticGroup::StaticGroup(wxWindow *parent, wxWindowID id, const wxString &label) : wxStaticBox(parent, id, label) { #ifdef __WXMSW__ Bind(wxEVT_PAINT, &StaticGroup::OnPaint, this); #else #endif } void StaticGroup::ShowBadge(bool show) { if (show) badge = ScalableBitmap(this, "badge", 18); else badge = ScalableBitmap{}; Refresh(); } #ifdef __WXMSW__ void StaticGroup::OnPaint(wxPaintEvent &evt) { wxStaticBox::OnPaint(evt); if (badge.bmp().IsOk()) { auto s = badge.bmp().GetScaledSize(); wxPaintDC dc(this); dc.DrawBitmap(badge.bmp(), GetSize().x - s.x, 8); } } #endif