31 const wxSize& aSize,
int aStyles ) :
32 wxPanel( aParent, aId, aPos, aSize, aStyles ),
53 else if( aNumber == 0 )
115#if defined( __WXMAC__ )
116#define BADGE_FONTWEIGHT wxFONTWEIGHT_NORMAL
117#define PLATFORM_FUDGE_X 0.92
118#define PLATFORM_FUDGE_Y 1.6
120#define BADGE_FONTWEIGHT wxFONTWEIGHT_BOLD
121#define PLATFORM_FUDGE_X 1.0
122#define PLATFORM_FUDGE_Y 1.0
128 wxClientDC dc(
this );
131 int len =
test.length();
136 test.Pad( len,
'9' );
142 wxSize size = dc.GetTextExtent(
test );
155 wxSize clientSize = GetSize();
156 wxPaintDC dc(
this );
161 dc.SetBackground( *wxTRANSPARENT_BRUSH );
170 wxRect rect( wxPoint( 0, 0 ), clientSize - wxSize( 1, 1 ) );
172 brush.SetStyle( wxBRUSHSTYLE_SOLID );
174 dc.SetBrush( brush );
176 dc.DrawRoundedRectangle( rect, rect.height / 2 );
186 dc.DrawLabel(
text, wxRect( wxPoint( 0, 0 ), clientSize ),
187 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL );
A color representation with 4 components: red, green, blue, alpha.
wxColour ToColour() const
void SetMaximumNumber(int aMax)
Set the maximum number to be shown on the badge.
void UpdateNumber(int aNumber, SEVERITY aSeverity)
Update the number displayed on the badge.
void computeSize()
Helper function to compute the size of the badge.
void SetTextSize(int aSize)
Set the text size to use on the badge.
NUMBER_BADGE(wxWindow *aParent, wxWindowID aId, const wxPoint &aPos, const wxSize &aSize, int aStyles)
Create a number badge with 10pt font and a maximum number of 1000.
void onPaint(wxPaintEvent &aEvt)
Handler that actually paints the badge and the text.
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...