- const int sizeStd = stdSizes[n];
- if ( width > sizeStd || height > sizeStd )
- {
- // it will become -1 if the bitmap is larger than the biggest
- // supported size, this is intentional
- n--;
-
- break;
- }
+ // decide what kind of contents the button will have: we want to use an
+ // icon for buttons with wxBORDER_NONE style as bevel buttons always do
+ // have a border but icons are limited to a few standard sizes only and
+ // are resized by the system with extremely ugly results if they don't
+ // fit (in the past we also tried being smart and pasting a bitmap
+ // instead of a larger square icon to avoid resizing but this resulted
+ // in buttons having different size than specified by wx API and
+ // breaking the layouts and still didn't look good so we don't even try
+ // to do this any more)
+ m_isIcon = (style & wxBORDER_NONE) &&
+ bitmap.IsOk() && IsOfStandardSize(bitmap);