+ const int margin = 1; // an extra pixel on either side of the bitmap
+
+ bmpWidth = w + 2*margin;
+ labelWidth += bmpWidth;
+
+ int x = rect.x + margin;
+ const int y = rect.y + wxMax(1, (rect.height - h) / 2);
+
+ const int extraSpace = rect.width - labelWidth;
+ if ( params->m_labelText.empty() && extraSpace > 0 )
+ {
+ // use the alignment flags
+ switch (params->m_labelAlignment)
+ {
+ default:
+ case wxALIGN_LEFT:
+ break;
+
+ case wxALIGN_CENTER:
+ x += extraSpace/2;
+ break;
+
+ case wxALIGN_RIGHT:
+ x += extraSpace;
+ break;
+ }
+ }
+
+ wxDCClipper clip(dc, rect);
+ dc.DrawBitmap(params->m_labelBitmap, x, y, true);
+ }