const wxSize& sizeLabel,
int flags)
{
- // FIXME: this is pure guesswork, need to retrieve the real button margins
wxSize sizeBtn = sizeLabel;
- sizeBtn.x += 3*win->GetCharWidth();
- sizeBtn.y += win->GetCharHeight()/2;
+ // FIXME: The numbers here are pure guesswork, no idea how should the
+ // button margins be really calculated.
+ if ( flags & Size_ExactFit )
+ {
+ // We still need some margin or the text would be overwritten, just
+ // make it as small as possible.
+ sizeBtn.x += (3*win->GetCharWidth())/2;
+ }
+ else
+ {
+ sizeBtn.x += 3*win->GetCharWidth();
+ sizeBtn.y += win->GetCharHeight()/2;
+ }
// account for the shield UAC icon if we have it
if ( flags & Size_AuthNeeded )
if ( ShowsLabel() )
{
int flags = 0;
+ if ( HasFlag(wxBU_EXACTFIT) )
+ flags |= wxMSWButton::Size_ExactFit;
if ( DoGetAuthNeeded() )
flags |= wxMSWButton::Size_AuthNeeded;