\twocolitem{\windowstyle{wxBU\_TOP}}{Aligns the label to the top of the button. WIN32 only.}
\twocolitem{\windowstyle{wxBU\_RIGHT}}{Right-justifies the bitmap label. WIN32 only.}
\twocolitem{\windowstyle{wxBU\_BOTTOM}}{Aligns the label to the bottom of the button. WIN32 only.}
+\twocolitem{\windowstyle{wxBU\_EXACTFIT}}{Creates the button as small as possible instead of making it of the standard size (which is the default behaviour ).}
\end{twocollist}
See also \helpref{window styles overview}{windowstyles}.
#if wxUSE_BUTTON
+// ----------------------------------------------------------------------------
+// wxButton flags
+// ----------------------------------------------------------------------------
+
+// all these flags are obsolete
+#define wxBU_NOAUTODRAW 0x0000
+#define wxBU_AUTODRAW 0x0004
+#define wxBU_LEFT 0x0040
+#define wxBU_TOP 0x0080
+#define wxBU_RIGHT 0x0100
+#define wxBU_BOTTOM 0x0200
+
+// by default, the buttons will be created with some (system dependent)
+// minimal size to make them look nicer, giving this style will make them as
+// small as possible
+#define wxBU_EXACTFIT 0x0001
+
#include "wx/control.h"
class WXDLLEXPORT wxBitmap;
#define wxSB_HORIZONTAL wxHORIZONTAL
#define wxSB_VERTICAL wxVERTICAL
-/*
- * wxButton flags (Win32 only)
- */
-#define wxBU_AUTODRAW 0x0004
-#define wxBU_NOAUTODRAW 0x0000
-#define wxBU_LEFT 0x0040
-#define wxBU_TOP 0x0080
-#define wxBU_RIGHT 0x0100
-#define wxBU_BOTTOM 0x0200
-
/*
* wxTreeCtrl flags
*/
// for compatibility with other ports, the buttons default size is never
// less than the standard one
- wxSize szDef = GetDefaultSize();
- if ( width < szDef.x )
- width = szDef.x;
+ if ( !(GetWindowStyle() & wxBU_EXACTFIT) )
+ {
+ wxSize szDef = GetDefaultSize();
+ if ( width < szDef.x )
+ width = szDef.x;
+ }
return wxSize(width, height);
}