]> git.saurik.com Git - wxWidgets.git/commitdiff
added wxBU_EXACTFIT style
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 10 Jul 2001 13:44:04 +0000 (13:44 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 10 Jul 2001 13:44:04 +0000 (13:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10942 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/button.tex
include/wx/button.h
include/wx/defs.h
src/univ/button.cpp

index 966fa06461cd912ffd2b3eb2b648ac82fb83b893..043d6d9d5e41d3583914e62f91171c63c0028275 100644 (file)
@@ -24,6 +24,7 @@ almost any other window.
 \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}.
index b9b1f0388b6d7de950342a0c40c32a6b0a1eac70..30183940654fd8d0ec8f77596bb11b85a7a0f673 100644 (file)
 
 #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;
index ccb3af3dbf7d9aec845b2f8ec4c705081e91a704..f0cc3bc94dcab8cec2b0e8cb0e263b1cfa0013dd 100644 (file)
@@ -1195,16 +1195,6 @@ enum wxBorder
 #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
  */
index 95d4ce4aee40b65e7ea17e67e9aa5674a88a686e..a6438e0d51c83d0131dff8925f3483cebf0b01de 100644 (file)
@@ -136,9 +136,12 @@ wxSize wxButton::DoGetBestClientSize() const
 
     // 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);
 }