]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/font.cpp
Modified wxGetHomeDir to take environment variable HOME into account.
[wxWidgets.git] / src / msw / font.cpp
index db290f03620eaab8487f1164804832056b84c1fe..ae8752a780e12781b71d8d9ad6e25e1544046be9 100644 (file)
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "font.h"
 #endif
 
     #pragma implementation "font.h"
 #endif
 
@@ -35,6 +35,7 @@
     #include "wx/app.h"
     #include "wx/font.h"
     #include "wx/log.h"
     #include "wx/app.h"
     #include "wx/font.h"
     #include "wx/log.h"
+    #include "wx/encinfo.h"
 #endif // WX_PRECOMP
 
 #include "wx/msw/private.h"
 #endif // WX_PRECOMP
 
 #include "wx/msw/private.h"
 
 #include "wx/tokenzr.h"
 
 
 #include "wx/tokenzr.h"
 
-IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
+#if wxUSE_EXTENDED_RTTI
+
+wxBEGIN_ENUM( wxFontFamily )
+       wxENUM_MEMBER( wxDEFAULT )
+       wxENUM_MEMBER( wxDECORATIVE )
+       wxENUM_MEMBER( wxROMAN )
+       wxENUM_MEMBER( wxSCRIPT )
+       wxENUM_MEMBER( wxSWISS )
+       wxENUM_MEMBER( wxMODERN )
+       wxENUM_MEMBER( wxTELETYPE )
+wxEND_ENUM( wxFontFamily )
+
+wxBEGIN_ENUM( wxFontStyle )
+       wxENUM_MEMBER( wxNORMAL )
+       wxENUM_MEMBER( wxITALIC )
+       wxENUM_MEMBER( wxSLANT )
+wxEND_ENUM( wxFontStyle )
+
+wxBEGIN_ENUM( wxFontWeight )
+       wxENUM_MEMBER( wxNORMAL )
+       wxENUM_MEMBER( wxLIGHT )
+       wxENUM_MEMBER( wxBOLD )
+wxEND_ENUM( wxFontWeight )
+
+IMPLEMENT_DYNAMIC_CLASS_WITH_COPY_XTI(wxFont, wxGDIObject,"wx/font.h")
+
+wxBEGIN_PROPERTIES_TABLE(wxFont)
+       wxPROPERTY( Size,int, SetPointSize, GetPointSize, 12 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+       wxPROPERTY( Family, int  , SetFamily, GetFamily, (int)wxDEFAULT , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // wxFontFamily
+       wxPROPERTY( Style, int , SetStyle, GetStyle, (int)wxNORMAL , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // wxFontStyle
+       wxPROPERTY( Weight, int , SetWeight, GetWeight, (int)wxNORMAL , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // wxFontWeight
+       wxPROPERTY( Underlined, bool , SetUnderlined, GetUnderlined, false , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+       wxPROPERTY( Face, wxString , SetFaceName, GetFaceName, , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+       wxPROPERTY( Encoding, wxFontEncoding , SetEncoding, GetEncoding, wxFONTENCODING_DEFAULT , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+wxEND_PROPERTIES_TABLE()
+
+wxCONSTRUCTOR_6( wxFont , int , Size , int , Family , int , Style , int , Weight , bool , Underlined , wxString , Face )  
+
+wxBEGIN_HANDLERS_TABLE(wxFont)
+wxEND_HANDLERS_TABLE()
+
+#else
+       IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
+#endif
+
 
 // ----------------------------------------------------------------------------
 // constants
 
 // ----------------------------------------------------------------------------
 // constants
@@ -903,12 +948,10 @@ wxFontEncoding wxFont::GetEncoding() const
     return M_FONTDATA->GetEncoding();
 }
 
     return M_FONTDATA->GetEncoding();
 }
 
-wxNativeFontInfo *wxFont::GetNativeFontInfo() const
+const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
 {
 {
-    if ( M_FONTDATA->HasNativeFontInfo() )
-        return new wxNativeFontInfo(M_FONTDATA->GetNativeFontInfo());
-
-    return 0;
+    return M_FONTDATA->HasNativeFontInfo() ? &(M_FONTDATA->GetNativeFontInfo())
+                                           : NULL;
 }
 
 bool wxFont::IsFixedWidth() const
 }
 
 bool wxFont::IsFixedWidth() const