]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/control.cpp
Open files in binary mode to convert DOS to Unix
[wxWidgets.git] / src / msw / control.cpp
index 9b38d3d935dfe6101f4841eba0919cac6ae1579a..20c7dd20fe0e257c6b30ead00819c0b58e5701e2 100644 (file)
@@ -119,7 +119,7 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
     // all controls should have this style
     style |= WS_CHILD;
 
-    // create the control visible if it's currently shown for wxWindows
+    // create the control visible if it's currently shown for wxWidgets
     if ( m_isShown )
     {
         style |= WS_VISIBLE;
@@ -150,7 +150,7 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
     if ( !m_hWnd )
     {
         wxLogDebug(wxT("Failed to create a control of class '%s'"), classname);
-        wxFAIL_MSG(_T("something is very wrong"));
+        wxFAIL_MSG(_T("something is very wrong, CreateWindowEx failed"));
 
         return FALSE;
     }
@@ -163,18 +163,16 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
     }
 #endif // wxUSE_CTL3D
 
-    // install wxWindows window proc for this window
+    // install wxWidgets window proc for this window
     SubclassWin(m_hWnd);
 
     // set up fonts and colours
     InheritAttributes();
-    SetFont(GetDefaultAttributes().font);
+    if (!m_hasFont)
+        SetFont(GetDefaultAttributes().font);
 
     // set the size now if no initial size specified
-    if ( w <= 0 || h <= 0 )
-    {
-        SetBestSize(size);
-    }
+    SetInitialBestSize(size);
 
     return TRUE;
 }
@@ -228,7 +226,7 @@ wxControl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
 
 // another version for the "composite", i.e. non simple controls
 /* static */ wxVisualAttributes
-wxControl::GetCompositeControlsDefaultAttributes(wxWindowVariant variant)
+wxControl::GetCompositeControlsDefaultAttributes(wxWindowVariant WXUNUSED(variant))
 {
     wxVisualAttributes attrs;
     attrs.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);