use enumerations instead of integers for wxFont style/weight/family

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58159 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2009-01-16 20:46:20 +00:00
parent 634ad7722b
commit 7d76fbd5a1
7 changed files with 113 additions and 61 deletions

View File

@@ -2997,7 +2997,7 @@ bool wxRichTextCtrl::IsSelectionBold()
wxTextAttr attr;
wxRichTextRange range = GetSelectionRange();
attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
attr.SetFontWeight(wxBOLD);
attr.SetFontWeight(wxFONTWEIGHT_BOLD);
return HasCharacterAttributes(range, attr);
}
@@ -3013,7 +3013,7 @@ bool wxRichTextCtrl::IsSelectionBold()
{
if (IsDefaultStyleShowing())
wxRichTextApplyStyle(attr, GetDefaultStyleEx());
return attr.GetFontWeight() == wxBOLD;
return attr.GetFontWeight() == wxFONTWEIGHT_BOLD;
}
}
return false;
@@ -3027,7 +3027,7 @@ bool wxRichTextCtrl::IsSelectionItalics()
wxRichTextRange range = GetSelectionRange();
wxTextAttr attr;
attr.SetFlags(wxTEXT_ATTR_FONT_ITALIC);
attr.SetFontStyle(wxITALIC);
attr.SetFontStyle(wxFONTSTYLE_ITALIC);
return HasCharacterAttributes(range, attr);
}
@@ -3043,7 +3043,7 @@ bool wxRichTextCtrl::IsSelectionItalics()
{
if (IsDefaultStyleShowing())
wxRichTextApplyStyle(attr, GetDefaultStyleEx());
return attr.GetFontStyle() == wxITALIC;
return attr.GetFontStyle() == wxFONTSTYLE_ITALIC;
}
}
return false;
@@ -3084,7 +3084,7 @@ bool wxRichTextCtrl::ApplyBoldToSelection()
{
wxTextAttr attr;
attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
attr.SetFontWeight(IsSelectionBold() ? wxNORMAL : wxBOLD);
attr.SetFontWeight(IsSelectionBold() ? wxFONTWEIGHT_NORMAL : wxFONTWEIGHT_BOLD);
if (HasSelection())
return SetStyleEx(GetSelectionRange(), attr, wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE|wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY);
@@ -3102,7 +3102,7 @@ bool wxRichTextCtrl::ApplyItalicToSelection()
{
wxTextAttr attr;
attr.SetFlags(wxTEXT_ATTR_FONT_ITALIC);
attr.SetFontStyle(IsSelectionItalics() ? wxNORMAL : wxITALIC);
attr.SetFontStyle(IsSelectionItalics() ? wxFONTSTYLE_NORMAL : wxFONTSTYLE_ITALIC);
if (HasSelection())
return SetStyleEx(GetSelectionRange(), attr, wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE|wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY);