]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/font.cpp
extending calculation of visible region
[wxWidgets.git] / src / msw / font.cpp
index 45a5473ca99228a1cc59d7abe2d6a49e4c7043e1..ae8752a780e12781b71d8d9ad6e25e1544046be9 100644 (file)
@@ -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"
 
 #if wxUSE_EXTENDED_RTTI
 
 
 #if wxUSE_EXTENDED_RTTI
 
-WX_BEGIN_ENUM( wxFontFamily )
-       WX_ENUM_MEMBER( wxDEFAULT )
-       WX_ENUM_MEMBER( wxDECORATIVE )
-       WX_ENUM_MEMBER( wxROMAN )
-       WX_ENUM_MEMBER( wxSCRIPT )
-       WX_ENUM_MEMBER( wxSWISS )
-       WX_ENUM_MEMBER( wxMODERN )
-       WX_ENUM_MEMBER( wxTELETYPE )
-WX_END_ENUM( wxFontFamily )
-
-WX_BEGIN_ENUM( wxFontStyle )
-       WX_ENUM_MEMBER( wxNORMAL )
-       WX_ENUM_MEMBER( wxITALIC )
-       WX_ENUM_MEMBER( wxSLANT )
-WX_END_ENUM( wxFontStyle )
-
-WX_BEGIN_ENUM( wxFontWeight )
-       WX_ENUM_MEMBER( wxNORMAL )
-       WX_ENUM_MEMBER( wxLIGHT )
-       WX_ENUM_MEMBER( wxBOLD )
-WX_END_ENUM( wxFontWeight )
+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")
 
 
 IMPLEMENT_DYNAMIC_CLASS_WITH_COPY_XTI(wxFont, wxGDIObject,"wx/font.h")
 
-WX_BEGIN_PROPERTIES_TABLE(wxFont)
-       WX_PROPERTY( Size,int, SetPointSize, GetPointSize, 12 )
-       WX_PROPERTY( Family, int  , SetFamily, GetFamily, (int)wxDEFAULT ) // wxFontFamily
-       WX_PROPERTY( Style, int , SetStyle, GetStyle, (int)wxNORMAL ) // wxFontStyle
-       WX_PROPERTY( Weight, int , SetWeight, GetWeight, (int)wxNORMAL ) // wxFontWeight
-       WX_PROPERTY( Underlined, bool , SetUnderlined, GetUnderlined, false )
-       WX_PROPERTY_SET_BY_REF( Face, wxString , SetFaceName, GetFaceName, )
-       WX_PROPERTY( Encoding, wxFontEncoding , SetEncoding, GetEncoding, wxFONTENCODING_DEFAULT )
-WX_END_PROPERTIES_TABLE()
+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()
 
 
-WX_CONSTRUCTOR_6( wxFont , int , Size , int , Family , int , Style , int , Weight , bool , Underlined , wxString , Face )  
+wxCONSTRUCTOR_6( wxFont , int , Size , int , Family , int , Style , int , Weight , bool , Underlined , wxString , Face )  
 
 
-WX_BEGIN_HANDLERS_TABLE(wxFont)
-WX_END_HANDLERS_TABLE()
+wxBEGIN_HANDLERS_TABLE(wxFont)
+wxEND_HANDLERS_TABLE()
 
 #else
        IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
 
 #else
        IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
@@ -947,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