]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/button.cpp
only set parent frame ontop when the current frame being destructed is active
[wxWidgets.git] / src / msw / button.cpp
index 492f7d6eed849ad2d10beb6c04ee700a1f948481..620c2a74ab16a3f0409cb38d1b613f18eed54b6a 100644 (file)
@@ -32,6 +32,8 @@
     #include "wx/brush.h"
     #include "wx/panel.h"
     #include "wx/bmpbuttn.h"
+    #include "wx/settings.h"
+    #include "wx/dcscreen.h"
 #endif
 
 #include "wx/msw/private.h"
@@ -68,7 +70,8 @@ bool wxButton::Create(wxWindow *parent,
     if ( !CreateBase(parent, id, pos, size, style, validator, name) )
         return FALSE;
 
-    SetValidator(validator);
+    // Validator was set in CreateBase
+    //SetValidator(validator);
 
     parent->AddChild((wxButton *)this);
 
@@ -81,7 +84,7 @@ bool wxButton::Create(wxWindow *parent,
                       _T("BUTTON"),
                       label,
                       WS_VISIBLE | WS_TABSTOP | WS_CHILD,
-                      0, 0, 0, 0, 
+                      0, 0, 0, 0,
                       GetWinHwnd(parent),
                       (HMENU)m_windowId,
                       wxGetInstance(),
@@ -95,6 +98,17 @@ bool wxButton::Create(wxWindow *parent,
 
     SetSize(pos.x, pos.y, size.x, size.y);
 
+    // bad hack added by Robert to make buttons at least
+    // 80 pixels wide. There are probably better ways...
+    // TODO. FIXME.
+    wxSize nsize( GetSize() );
+    if ((nsize.x < 80) || (nsize.y < 23))
+    {
+        if ((size.x == -1) && (nsize.x < 80)) nsize.x = 80;
+       if ((size.y == -1) && (nsize.y < 23)) nsize.y = 23;
+        SetSize( nsize );
+    }
+
     return TRUE;
 }