X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/955e5433320b462cb99440f100547b6db93f3c15..0ba344c712c77e4a6c7b94263b6f39ab22069039:/src/common/gdicmn.cpp diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index cd7fc0ea37..09222b21d4 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -59,6 +59,10 @@ #include "X11/Xlib.h" #endif +#ifdef __WXMAC__ +#include "wx/mac/private.h" +#include "wx/mac/uma.h" +#endif IMPLEMENT_CLASS(wxColourDatabase, wxList) IMPLEMENT_DYNAMIC_CLASS(wxFontList, wxList) IMPLEMENT_DYNAMIC_CLASS(wxPenList, wxList) @@ -360,7 +364,8 @@ wxColour *wxColourDatabase::FindColour(const wxString& colour) #ifdef __WXGTK__ wxColour *col = new wxColour( colour ); - if (!(col->Ok())) { + if (!(col->Ok())) + { delete col; return (wxColour *) NULL; } @@ -378,7 +383,7 @@ wxColour *wxColourDatabase::FindColour(const wxString& colour) Display* display = (Display*) wxGetDisplay(); #endif /* MATTHEW: [4] Use wxGetMainColormap */ - if (!XParseColor(display, (Colormap) wxTheApp->GetMainColormap((WXDisplay*) display), colour,&xcolour)) + if (!XParseColor(display, (Colormap) wxTheApp->GetMainColormap((WXDisplay*) display), colour.ToAscii() ,&xcolour)) return NULL; #if wxUSE_NANOX @@ -390,7 +395,7 @@ wxColour *wxColourDatabase::FindColour(const wxString& colour) unsigned char g = (unsigned char)(xcolour.green >> 8); unsigned char b = (unsigned char)(xcolour.blue >> 8); #endif - + wxColour *col = new wxColour(r, g, b); Append(colour, col); @@ -450,8 +455,16 @@ void wxInitializeStockObjects () #endif */ #if defined(__WXMAC__) - static const int sizeFont = 12; - wxNORMAL_FONT = new wxFont (sizeFont, wxMODERN, wxNORMAL, wxNORMAL); + int sizeFont = 12; + + Str255 fontName ; + SInt16 fontSize ; + Style fontStyle ; + + GetThemeFont(kThemeSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ; + sizeFont = fontSize ; + p2cstrcpy( (char*) fontName , fontName ) ; + wxSWISS_FONT = new wxFont (fontSize, wxSWISS, wxNORMAL, wxNORMAL , false , fontName ); #elif defined(__WXPM__) static const int sizeFont = 12; #else @@ -464,14 +477,16 @@ void wxInitializeStockObjects () // Basic OS/2 has a fairly limited number of fonts and these are as good // as I can do to get something that looks halfway "wx" normal */ - wxNORMAL_FONT = new wxFont (sizeFont, wxMODERN, wxNORMAL, wxNORMAL); /* System VIO */ - wxSMALL_FONT = new wxFont (sizeFont - 4, wxMODERN, wxNORMAL, wxNORMAL); /* System VIO */ + wxNORMAL_FONT = new wxFont (sizeFont, wxMODERN, wxNORMAL, wxBOLD); + wxSMALL_FONT = new wxFont (sizeFont - 4, wxSWISS, wxNORMAL, wxNORMAL); /* Helv */ wxITALIC_FONT = new wxFont (sizeFont, wxROMAN, wxITALIC, wxNORMAL); wxSWISS_FONT = new wxFont (sizeFont, wxSWISS, wxNORMAL, wxNORMAL); /* Helv */ #elif defined(__WXMAC__) - wxSMALL_FONT = new wxFont (sizeFont - 2, wxSWISS, wxNORMAL, wxNORMAL); - wxITALIC_FONT = new wxFont (sizeFont, wxROMAN, wxITALIC, wxNORMAL); - wxSWISS_FONT = new wxFont (sizeFont - 2, wxSWISS, wxNORMAL, wxNORMAL); + wxNORMAL_FONT = new wxFont (sizeFont, wxMODERN, wxNORMAL, wxNORMAL); + wxITALIC_FONT = new wxFont (sizeFont, wxROMAN, wxITALIC, wxNORMAL); + GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ; + p2cstrcpy( (char*) fontName , fontName ) ; + wxSMALL_FONT = new wxFont (fontSize, wxSWISS, wxNORMAL, wxNORMAL , false , fontName ); #else wxSMALL_FONT = new wxFont (sizeFont - 2, wxSWISS, wxNORMAL, wxNORMAL); wxITALIC_FONT = new wxFont (sizeFont, wxROMAN, wxITALIC, wxNORMAL);