From: Julian Smart Date: Sat, 5 Sep 1998 16:45:26 +0000 (+0000) Subject: Fixed Get...String functions. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/42871d38193dcaa37644ad3be452540c9f545343 Fixed Get...String functions. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/font.cpp b/src/gtk/font.cpp index 47dc19b2e5..2152854752 100644 --- a/src/gtk/font.cpp +++ b/src/gtk/font.cpp @@ -21,10 +21,11 @@ //----------------------------------------------------------------------------- static char *wx_font_family [] = { - "wxDEFAULT", "wxDECORATIVE", "wxMODERN", "wxROMAN", "wxSCRIPT", - "wxSWISS", "wxTELETYPE", + "wxDEFAULT", "wxDECORATIVE", "wxROMAN", "wxSCRIPT", + "wxSWISS", "wxMODERN", "wxTELETYPE", }; +/* static char *wx_font_style [] = { "wxDEFAULT", "wxNORMAL", "wxSLANT", "wxITALIC", }; @@ -32,6 +33,7 @@ static char *wx_font_style [] = { static char *wx_font_weight [] = { "wxDEFAULT", "wxNORMAL", "wxBOLD", "wxLIGHT", }; +*/ extern wxFontNameDirectory *wxTheFontNameDirectory; @@ -216,7 +218,7 @@ int wxFont::GetFamily(void) const wxString wxFont::GetFamilyString(void) const { - wxString s = wx_font_family[M_FONTDATA->m_family]; + wxString s = wx_font_family[M_FONTDATA->m_family - wxDEFAULT]; return s; } @@ -232,8 +234,27 @@ int wxFont::GetStyle(void) const wxString wxFont::GetStyleString(void) const { - wxString s = wx_font_style[M_FONTDATA->m_style]; - return s; + switch (M_FONTDATA->m_style) + { + case wxNORMAL: + { + return wxString("wxNORMAL"); + } + case wxSLANT: + { + return wxString("wxSLANT"); + } + case wxITALIC: + { + return wxString("wxITALIC"); + } + case wxDEFAULT: + default: + { + return wxString("wxDEFAULT"); + } + } + return wxString("wxDEFAULT"); } int wxFont::GetWeight(void) const @@ -243,8 +264,27 @@ int wxFont::GetWeight(void) const wxString wxFont::GetWeightString(void) const { - wxString s = wx_font_weight[M_FONTDATA->m_weight]; - return s; + switch (M_FONTDATA->m_weight) + { + case wxNORMAL: + { + return wxString("wxNORMAL"); + } + case wxBOLD: + { + return wxString("wxBOLD"); + } + case wxLIGHT: + { + return wxString("wxLIGHT"); + } + case wxDEFAULT: + default: + { + return wxString("wxDEFAULT"); + } + } + return wxString("wxDEFAULT"); } bool wxFont::GetUnderlined(void) const diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index 47dc19b2e5..2152854752 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -21,10 +21,11 @@ //----------------------------------------------------------------------------- static char *wx_font_family [] = { - "wxDEFAULT", "wxDECORATIVE", "wxMODERN", "wxROMAN", "wxSCRIPT", - "wxSWISS", "wxTELETYPE", + "wxDEFAULT", "wxDECORATIVE", "wxROMAN", "wxSCRIPT", + "wxSWISS", "wxMODERN", "wxTELETYPE", }; +/* static char *wx_font_style [] = { "wxDEFAULT", "wxNORMAL", "wxSLANT", "wxITALIC", }; @@ -32,6 +33,7 @@ static char *wx_font_style [] = { static char *wx_font_weight [] = { "wxDEFAULT", "wxNORMAL", "wxBOLD", "wxLIGHT", }; +*/ extern wxFontNameDirectory *wxTheFontNameDirectory; @@ -216,7 +218,7 @@ int wxFont::GetFamily(void) const wxString wxFont::GetFamilyString(void) const { - wxString s = wx_font_family[M_FONTDATA->m_family]; + wxString s = wx_font_family[M_FONTDATA->m_family - wxDEFAULT]; return s; } @@ -232,8 +234,27 @@ int wxFont::GetStyle(void) const wxString wxFont::GetStyleString(void) const { - wxString s = wx_font_style[M_FONTDATA->m_style]; - return s; + switch (M_FONTDATA->m_style) + { + case wxNORMAL: + { + return wxString("wxNORMAL"); + } + case wxSLANT: + { + return wxString("wxSLANT"); + } + case wxITALIC: + { + return wxString("wxITALIC"); + } + case wxDEFAULT: + default: + { + return wxString("wxDEFAULT"); + } + } + return wxString("wxDEFAULT"); } int wxFont::GetWeight(void) const @@ -243,8 +264,27 @@ int wxFont::GetWeight(void) const wxString wxFont::GetWeightString(void) const { - wxString s = wx_font_weight[M_FONTDATA->m_weight]; - return s; + switch (M_FONTDATA->m_weight) + { + case wxNORMAL: + { + return wxString("wxNORMAL"); + } + case wxBOLD: + { + return wxString("wxBOLD"); + } + case wxLIGHT: + { + return wxString("wxLIGHT"); + } + case wxDEFAULT: + default: + { + return wxString("wxDEFAULT"); + } + } + return wxString("wxDEFAULT"); } bool wxFont::GetUnderlined(void) const