virtual bool GetStyle(long position, wxTextAttrEx& style);
virtual bool GetStyle(long position, wxRichTextAttr& style);
+ // get the common set of styles for the range
+ virtual bool GetStyleForRange(const wxRichTextRange& range, wxRichTextAttr& style);
+ virtual bool GetStyleForRange(const wxRichTextRange& range, wxTextAttrEx& style);
+
// extended style setting operation with flags including:
// wxRICHTEXT_SETSTYLE_WITH_UNDO, wxRICHTEXT_SETSTYLE_OPTIMIZE, wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY, wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY
// see richtextbuffer.h for more details.
/// flags indicating which attributes are of interest.
virtual bool HasCharacterAttributes(const wxRichTextRange& range, const wxTextAttrEx& style) const
{
- return GetBuffer().HasCharacterAttributes(range, style);
+ return GetBuffer().HasCharacterAttributes(range.ToInternal(), style);
}
virtual bool HasCharacterAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const
{
- return GetBuffer().HasCharacterAttributes(range, style);
+ return GetBuffer().HasCharacterAttributes(range.ToInternal(), style);
}
/// Test if this whole range has paragraph attributes of the specified kind. If any
/// flags indicating which attributes are of interest.
virtual bool HasParagraphAttributes(const wxRichTextRange& range, const wxTextAttrEx& style) const
{
- return GetBuffer().HasParagraphAttributes(range, style);
+ return GetBuffer().HasParagraphAttributes(range.ToInternal(), style);
}
virtual bool HasParagraphAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const
{
- return GetBuffer().HasParagraphAttributes(range, style);
+ return GetBuffer().HasParagraphAttributes(range.ToInternal(), style);
}
/// Is all of the selection bold?
return GetBuffer().GetStyle(position, style);
}
+// get the common set of styles for the range
+bool wxRichTextCtrl::GetStyleForRange(const wxRichTextRange& range, wxRichTextAttr& style)
+{
+ wxTextAttrEx styleEx;
+ if (GetBuffer().GetStyleForRange(range.ToInternal(), styleEx))
+ {
+ style = styleEx;
+ return true;
+ }
+ else
+ return false;
+}
+
+bool wxRichTextCtrl::GetStyleForRange(const wxRichTextRange& range, wxTextAttrEx& style)
+{
+ return GetBuffer().GetStyleForRange(range.ToInternal(), style);
+}
+
/// Get the content (uncombined) attributes for this position.
bool wxRichTextCtrl::GetUncombinedStyle(long position, wxTextAttr& style)
if (HasSelection())
{
wxRichTextAttr attr;
- wxRichTextRange range = GetInternalSelectionRange();
+ wxRichTextRange range = GetSelectionRange();
attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
attr.SetFontWeight(wxBOLD);
{
if (HasSelection())
{
- wxRichTextRange range = GetInternalSelectionRange();
+ wxRichTextRange range = GetSelectionRange();
wxRichTextAttr attr;
attr.SetFlags(wxTEXT_ATTR_FONT_ITALIC);
attr.SetFontStyle(wxITALIC);
{
if (HasSelection())
{
- wxRichTextRange range = GetInternalSelectionRange();
+ wxRichTextRange range = GetSelectionRange();
wxRichTextAttr attr;
attr.SetFlags(wxTEXT_ATTR_FONT_UNDERLINE);
attr.SetFontUnderlined(true);
{
wxRichTextRange range;
if (HasSelection())
- range = GetInternalSelectionRange();
+ range = GetSelectionRange();
else
- range = wxRichTextRange(GetCaretPosition()+1, GetCaretPosition()+1);
+ range = wxRichTextRange(GetCaretPosition()+1, GetCaretPosition()+2);
wxRichTextAttr attr;
attr.SetAlignment(alignment);