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
127 wxClientDC dc(
this );
130 int len =
test.length();
135 test.Pad( len,
'9' );
141 wxSize size = dc.GetTextExtent(
test );
154 wxSize clientSize = GetSize();
155 wxPaintDC dc(
this );
160 dc.SetBackground( *wxTRANSPARENT_BRUSH );
169 wxRect rect( wxPoint( 0, 0 ), clientSize - wxSize( 1, 1 ) );
171 brush.SetStyle( wxBRUSHSTYLE_SOLID );
173 dc.SetBrush( brush );
175 dc.DrawRoundedRectangle( rect, rect.height / 2 );
185 dc.DrawLabel(
text, wxRect( wxPoint( 0, 0 ), clientSize ), 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...