Added URL support to attribute objects and to wxRichTextCtrl,

generating a wxTextUrlEvent as appropriate.
Added outline list support and updated previews.
Added alignment support for bullets.
Added single right parenthesis support.
Added XML stylesheet reading/writing.
Changed SetBulletSymbol to SetBulletText so it can support
bullet text more generally (e.g. for cached outline list numbering)
Added wxRichTextRenderer to isolate e.g. bullet drawing and make
it customisable.
Added event handler support to wxRichTextBuffer.
Updated documentation.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42431 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2006-10-26 06:32:47 +00:00
parent a60a549995
commit d2d0adc776
25 changed files with 2460 additions and 780 deletions

View File

@@ -94,14 +94,14 @@ bool wxRichTextListStyleDefinition::operator ==(const wxRichTextListStyleDefinit
}
/// Sets/gets the attributes for the given level
void wxRichTextListStyleDefinition::SetLevelAttributes(int i, const wxTextAttrEx& attr)
void wxRichTextListStyleDefinition::SetLevelAttributes(int i, const wxRichTextAttr& attr)
{
wxASSERT( (i >= 0 && i < 10) );
if (i >= 0 && i < 10)
m_levelStyles[i] = attr;
}
const wxTextAttrEx* wxRichTextListStyleDefinition::GetLevelAttributes(int i) const
const wxRichTextAttr* wxRichTextListStyleDefinition::GetLevelAttributes(int i) const
{
wxASSERT( (i >= 0 && i < 10) );
if (i >= 0 && i < 10)
@@ -110,7 +110,7 @@ const wxTextAttrEx* wxRichTextListStyleDefinition::GetLevelAttributes(int i) con
return NULL;
}
wxTextAttrEx* wxRichTextListStyleDefinition::GetLevelAttributes(int i)
wxRichTextAttr* wxRichTextListStyleDefinition::GetLevelAttributes(int i)
{
wxASSERT( (i >= 0 && i < 10) );
if (i >= 0 && i < 10)
@@ -125,13 +125,18 @@ void wxRichTextListStyleDefinition::SetAttributes(int i, int leftIndent, int lef
wxASSERT( (i >= 0 && i < 10) );
if (i >= 0 && i < 10)
{
wxTextAttrEx attr;
wxRichTextAttr attr;
attr.SetBulletStyle(bulletStyle);
attr.SetLeftIndent(leftIndent, leftSubIndent);
if (!bulletSymbol.IsEmpty())
attr.SetBulletSymbol(bulletSymbol[0]);
{
if (bulletStyle & wxTEXT_ATTR_BULLET_STYLE_SYMBOL)
attr.SetBulletText(bulletSymbol);
else
attr.SetBulletName(bulletSymbol);
}
m_levelStyles[i] = attr;
}
@@ -156,11 +161,11 @@ int wxRichTextListStyleDefinition::FindLevelForIndent(int indent) const
/// Combine the list style with a paragraph style, using the given indent (from which
/// an appropriate level is found)
wxTextAttrEx wxRichTextListStyleDefinition::CombineWithParagraphStyle(int indent, const wxTextAttrEx& paraStyle)
wxRichTextAttr wxRichTextListStyleDefinition::CombineWithParagraphStyle(int indent, const wxRichTextAttr& paraStyle)
{
int listLevel = FindLevelForIndent(indent);
wxTextAttrEx attr(*GetLevelAttributes(listLevel));
wxRichTextAttr attr(*GetLevelAttributes(listLevel));
int oldLeftIndent = attr.GetLeftIndent();
int oldLeftSubIndent = attr.GetLeftSubIndent();
@@ -178,7 +183,7 @@ wxTextAttrEx wxRichTextListStyleDefinition::CombineWithParagraphStyle(int indent
/// Combine the base and list style, using the given indent (from which
/// an appropriate level is found)
wxTextAttrEx wxRichTextListStyleDefinition::GetCombinedStyle(int indent)
wxRichTextAttr wxRichTextListStyleDefinition::GetCombinedStyle(int indent)
{
int listLevel = FindLevelForIndent(indent);
return GetCombinedStyleForLevel(listLevel);
@@ -186,9 +191,9 @@ wxTextAttrEx wxRichTextListStyleDefinition::GetCombinedStyle(int indent)
/// Combine the base and list style, using the given indent (from which
/// an appropriate level is found)
wxTextAttrEx wxRichTextListStyleDefinition::GetCombinedStyleForLevel(int listLevel)
wxRichTextAttr wxRichTextListStyleDefinition::GetCombinedStyleForLevel(int listLevel)
{
wxTextAttrEx attr(*GetLevelAttributes(listLevel));
wxRichTextAttr attr(*GetLevelAttributes(listLevel));
int oldLeftIndent = attr.GetLeftIndent();
int oldLeftSubIndent = attr.GetLeftSubIndent();