]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/stattext.cpp
no_rtti fix was not having correct eval order
[wxWidgets.git] / src / msw / stattext.cpp
index 59725f6c38f04366612d114e57cf4353734b8869..124d9e471d935eddd112a910b0a6849d9f7c6360 100644 (file)
 #if wxUSE_STATTEXT
 
 #ifndef WX_PRECOMP
-#include "wx/event.h"
-#include "wx/app.h"
-#include "wx/brush.h"
+    #include "wx/event.h"
+    #include "wx/app.h"
+    #include "wx/brush.h"
+    #include "wx/dcclient.h"
+    #include "wx/settings.h"
 #endif
 
 #include "wx/stattext.h"
 #include "wx/msw/private.h"
-#include <stdio.h>
 
 #if wxUSE_EXTENDED_RTTI
 WX_DEFINE_FLAGS( wxStaticTextStyle )
@@ -128,7 +129,11 @@ WXDWORD wxStaticText::MSWGetStyle(long style, WXDWORD *exstyle) const
 wxSize wxStaticText::DoGetBestSize() const
 {
     wxClientDC dc(wx_const_cast(wxStaticText *, this));
-    dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
+    wxFont font(GetFont());
+    if (!font.Ok())
+        font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
+    
+    dc.SetFont(font);
 
     wxCoord widthTextMax, heightTextTotal;
     dc.GetMultiLineTextExtent(GetLabel(), &widthTextMax, &heightTextTotal);