]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed Get...String functions.
authorJulian Smart <julian@anthemion.co.uk>
Sat, 5 Sep 1998 16:45:26 +0000 (16:45 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sat, 5 Sep 1998 16:45:26 +0000 (16:45 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/font.cpp
src/gtk1/font.cpp

index 47dc19b2e513304cab257279aa9e74f098cc1524..2152854752a24da066716e1d87d51cafb713cf87 100644 (file)
 //-----------------------------------------------------------------------------
 
 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
index 47dc19b2e513304cab257279aa9e74f098cc1524..2152854752a24da066716e1d87d51cafb713cf87 100644 (file)
 //-----------------------------------------------------------------------------
 
 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