#define wxTEXT_ATTR_BULLET_NAME 0x00100000
#define wxTEXT_ATTR_URL 0x00200000
#define wxTEXT_ATTR_PAGE_BREAK 0x00400000
+#define wxTEXT_ATTR_EFFECTS 0x00800000
/*!
* Styles for wxTextAttrEx::SetBulletStyle
#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT 0x00001000
#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE 0x00002000
+/*!
+ * Styles for wxTextAttrEx::SetTextEffects
+ */
+
+#define wxTEXT_ATTR_EFFECT_NONE 0x00000000
+#define wxTEXT_ATTR_EFFECT_CAPITALS 0x00000001
+#define wxTEXT_ATTR_EFFECT_SMALL_CAPITALS 0x00000002
+#define wxTEXT_ATTR_EFFECT_STRIKETHROUGH 0x00000004
+#define wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH 0x00000008
+#define wxTEXT_ATTR_EFFECT_SHADOW 0x00000010
+#define wxTEXT_ATTR_EFFECT_EMBOSS 0x00000020
+#define wxTEXT_ATTR_EFFECT_OUTLINE 0x00000040
+#define wxTEXT_ATTR_EFFECT_ENGRAVE 0x00000080
+#define wxTEXT_ATTR_EFFECT_SUPERSCRIPT 0x00000100
+#define wxTEXT_ATTR_EFFECT_SUBSCRIPT 0x00000200
+
/*!
* Line spacing values
*/
* Character and paragraph combined styles
*/
-#define wxTEXT_ATTR_CHARACTER (wxTEXT_ATTR_FONT | wxTEXT_ATTR_BACKGROUND_COLOUR | wxTEXT_ATTR_TEXT_COLOUR | wxTEXT_ATTR_CHARACTER_STYLE_NAME | wxTEXT_ATTR_URL)
+#define wxTEXT_ATTR_CHARACTER (wxTEXT_ATTR_FONT|wxTEXT_ATTR_EFFECTS|wxTEXT_ATTR_BACKGROUND_COLOUR|wxTEXT_ATTR_TEXT_COLOUR|wxTEXT_ATTR_CHARACTER_STYLE_NAME|wxTEXT_ATTR_URL)
#define wxTEXT_ATTR_PARAGRAPH (wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_TABS|\
wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|wxTEXT_ATTR_LINE_SPACING|\
void SetBulletFont(const wxString& bulletFont) { m_bulletFont = bulletFont; }
void SetURL(const wxString& url) { m_urlTarget = url; SetFlags(GetFlags() | wxTEXT_ATTR_URL); }
void SetPageBreak(bool pageBreak = true) { SetFlags(pageBreak ? (GetFlags() | wxTEXT_ATTR_PAGE_BREAK) : (GetFlags() & ~wxTEXT_ATTR_PAGE_BREAK)); }
+ void SetTextEffects(int effects) { m_textEffects = effects; SetFlags(GetFlags() | wxTEXT_ATTR_EFFECTS); }
+ void SetTextEffectFlags(int effects) { m_textEffectFlags = effects; }
const wxString& GetCharacterStyleName() const { return m_characterStyleName; }
const wxString& GetParagraphStyleName() const { return m_paragraphStyleName; }
const wxString& GetBulletName() const { return m_bulletName; }
const wxString& GetBulletFont() const { return m_bulletFont; }
const wxString& GetURL() const { return m_urlTarget; }
+ int GetTextEffects() const { return m_textEffects; }
+ int GetTextEffectFlags() const { return m_textEffectFlags; }
bool HasWeight() const { return (GetFlags() & wxTEXT_ATTR_FONT_WEIGHT) != 0; }
bool HasSize() const { return (GetFlags() & wxTEXT_ATTR_FONT_SIZE) != 0; }
bool HasBulletName() const { return HasFlag(wxTEXT_ATTR_BULLET_NAME); }
bool HasURL() const { return HasFlag(wxTEXT_ATTR_URL); }
bool HasPageBreak() const { return HasFlag(wxTEXT_ATTR_PAGE_BREAK); }
+ bool HasTextEffects() const { return HasFlag(wxTEXT_ATTR_EFFECTS); }
+ bool HasTextEffect(int effect) const { return HasFlag(wxTEXT_ATTR_EFFECTS) && ((GetTextEffectFlags() & effect) != 0); }
// Is this a character style?
bool IsCharacterStyle() const { return (0 != (GetFlags() & wxTEXT_ATTR_CHARACTER)); }
// returns false if we have any attributes set, true otherwise
bool IsDefault() const
{
- return !HasTextColour() && !HasBackgroundColour() && !HasFont() && !HasAlignment() &&
- !HasTabs() && !HasLeftIndent() && !HasRightIndent() &&
- !HasParagraphSpacingAfter() && !HasParagraphSpacingBefore() && !HasLineSpacing() &&
- !HasCharacterStyleName() && !HasParagraphStyleName() && !HasListStyleName() &&
- !HasBulletNumber() && !HasBulletStyle() && !HasBulletText() && !HasBulletName() && !HasURL();
+ return (GetFlags() == 0);
}
// return the attribute having the valid font and colours: it uses the
int m_lineSpacing;
int m_bulletStyle;
int m_bulletNumber;
+ int m_textEffects;
+ int m_textEffectFlags;
wxString m_bulletText;
wxString m_bulletFont;
wxString m_bulletName;
void SetBulletName(const wxString& name) { m_bulletName = name; m_flags |= wxTEXT_ATTR_BULLET_NAME; }
void SetURL(const wxString& url) { m_urlTarget = url; m_flags |= wxTEXT_ATTR_URL; }
void SetPageBreak(bool pageBreak = true) { SetFlags(pageBreak ? (GetFlags() | wxTEXT_ATTR_PAGE_BREAK) : (GetFlags() & ~wxTEXT_ATTR_PAGE_BREAK)); }
+ void SetTextEffects(int effects) { m_textEffects = effects; SetFlags(GetFlags() | wxTEXT_ATTR_EFFECTS); }
+ void SetTextEffectFlags(int effects) { m_textEffectFlags = effects; }
const wxColour& GetTextColour() const { return m_colText; }
const wxColour& GetBackgroundColour() const { return m_colBack; }
const wxString& GetBulletFont() const { return m_bulletFont; }
const wxString& GetBulletName() const { return m_bulletName; }
const wxString& GetURL() const { return m_urlTarget; }
+ int GetTextEffects() const { return m_textEffects; }
+ int GetTextEffectFlags() const { return m_textEffectFlags; }
// accessors
bool HasTextColour() const { return m_colText.Ok() && HasFlag(wxTEXT_ATTR_TEXT_COLOUR) ; }
bool HasBulletName() const { return (m_flags & wxTEXT_ATTR_BULLET_NAME) != 0; }
bool HasURL() const { return HasFlag(wxTEXT_ATTR_URL); }
bool HasPageBreak() const { return HasFlag(wxTEXT_ATTR_PAGE_BREAK); }
+ bool HasTextEffects() const { return HasFlag(wxTEXT_ATTR_EFFECTS); }
+ bool HasTextEffect(int effect) const { return HasFlag(wxTEXT_ATTR_EFFECTS) && ((GetTextEffectFlags() & effect) != 0); }
bool HasFlag(long flag) const { return (m_flags & flag) != 0; }
// returns false if we have any attributes set, true otherwise
bool IsDefault() const
{
- return !HasTextColour() && !HasBackgroundColour() && !HasFont() && !HasAlignment() &&
- !HasTabs() && !HasLeftIndent() && !HasRightIndent() &&
- !HasParagraphSpacingAfter() && !HasParagraphSpacingBefore() && !HasLineSpacing() &&
- !HasCharacterStyleName() && !HasParagraphStyleName() && !HasListStyleName() &&
- !HasBulletNumber() && !HasBulletStyle() && !HasBulletText() && !HasBulletName() && !HasURL();
+ return GetFlags() == 0;
}
// return the attribute having the valid font and colours: it uses the
int m_lineSpacing;
int m_bulletStyle;
int m_bulletNumber;
+ int m_textEffects;
+ int m_textEffectFlags;
wxString m_bulletText;
wxString m_bulletFont;
wxString m_bulletName;
/// Combines 'style' with 'currentStyle' for the purpose of summarising the attributes of a range of
/// content.
- bool CollectStyle(wxTextAttrEx& currentStyle, const wxTextAttrEx& style, long& multipleStyleAttributes);
+ bool CollectStyle(wxTextAttrEx& currentStyle, const wxTextAttrEx& style, long& multipleStyleAttributes, int& multipleTextEffectAttributes);
/// Set list style
virtual bool SetListStyle(const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1);
WXDLLIMPEXP_RICHTEXT bool wxRichTextApplyStyle(wxTextAttrEx& destStyle, const wxRichTextAttr& style, wxRichTextAttr* compareWith = NULL);
WXDLLIMPEXP_RICHTEXT bool wxRichTextApplyStyle(wxRichTextAttr& destStyle, const wxRichTextAttr& style, wxRichTextAttr* compareWith = NULL);
+/// Combine two bitlists
+WXDLLIMPEXP_RICHTEXT bool wxRichTextCombineBitlists(int& valueA, int valueB, int& flagsA, int flagsB);
+
+/// Compare two bitlists
+WXDLLIMPEXP_RICHTEXT bool wxRichTextBitlistsEqPartial(int valueA, int valueB, int flags);
+
/// Split into paragraph and character styles
WXDLLIMPEXP_RICHTEXT bool wxRichTextSplitParaCharStyles(const wxTextAttrEx& style, wxTextAttrEx& parStyle, wxTextAttrEx& charStyle);
/// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
void OnUnderliningCtrlSelected( wxCommandEvent& event );
+ /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
+ void OnStrikethroughctrlClick( wxCommandEvent& event );
+
+ /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL
+ void OnCapsctrlClick( wxCommandEvent& event );
+
////@end wxRichTextFontPage event handler declarations
////@begin wxRichTextFontPage member function declarations
wxComboBox* m_weightCtrl;
wxComboBox* m_underliningCtrl;
wxRichTextColourSwatchCtrl* m_colourCtrl;
+ wxCheckBox* m_strikethroughCtrl;
+ wxCheckBox* m_capitalsCtrl;
wxRichTextFontPreviewCtrl* m_previewCtrl;
/// Control identifiers
enum {
ID_RICHTEXTFONTPAGE_WEIGHTCTRL = 10004,
ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL = 10008,
ID_RICHTEXTFONTPAGE_COLOURCTRL = 10009,
+ ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL = 10010,
+ ID_RICHTEXTFONTPAGE_CAPSCTRL = 10011,
ID_RICHTEXTFONTPAGE_PREVIEWCTRL = 10003
};
////@end wxRichTextFontPage member variables
wxWindow(parent, id, pos, sz, style)
{
SetBackgroundColour(*wxWHITE);
+ m_textEffects = 0;
}
+ void SetTextEffects(int effects) { m_textEffects = effects; }
+ int GetTextEffects() const { return m_textEffects; }
+
private:
+ int m_textEffects;
+
void OnPaint(wxPaintEvent& event);
DECLARE_EVENT_TABLE()
};
void SetName(const wxString& name) { m_name = name; }
const wxString& GetName() const { return m_name; }
+ /// Sets and gets the style description
+ void SetDescription(const wxString& descr) { m_description = descr; }
+ const wxString& GetDescription() const { return m_description; }
+
/// Sets and gets the name of the style that this style is based on
void SetBaseStyle(const wxString& name) { m_baseStyle = name; }
const wxString& GetBaseStyle() const { return m_baseStyle; }
protected:
wxString m_name;
wxString m_baseStyle;
+ wxString m_description;
wxRichTextAttr m_style;
};
wxRichTextStyleSheet* GetPreviousSheet() const { return m_previousSheet; }
void SetPreviousSheet(wxRichTextStyleSheet* sheet) { m_previousSheet = sheet; }
+ /// Sets and gets the name of the style sheet
+ void SetName(const wxString& name) { m_name = name; }
+ const wxString& GetName() const { return m_name; }
+
+ /// Sets and gets the style description
+ void SetDescription(const wxString& descr) { m_description = descr; }
+ const wxString& GetDescription() const { return m_description; }
+
/// Implementation
/// Add a definition to one of the style lists
protected:
- wxList m_characterStyleDefinitions;
- wxList m_paragraphStyleDefinitions;
- wxList m_listStyleDefinitions;
+ wxString m_description;
+ wxString m_name;
+
+ wxList m_characterStyleDefinitions;
+ wxList m_paragraphStyleDefinitions;
+ wxList m_listStyleDefinitions;
- wxRichTextStyleSheet* m_previousSheet;
- wxRichTextStyleSheet* m_nextSheet;
+ wxRichTextStyleSheet* m_previousSheet;
+ wxRichTextStyleSheet* m_nextSheet;
};
#if wxUSE_HTML
r.EndItalic();
r.EndBold();
-
r.Newline();
+
r.WriteImage(wxBitmap(zebra_xpm));
r.EndAlignment();
r.Newline();
r.WriteText(wxT("What can you do with this thing? "));
+
r.WriteImage(wxBitmap(smiley_xpm));
r.WriteText(wxT(" Well, you can change text "));
if (formatDlg.ShowModal() == wxID_OK)
{
- formatDlg.ApplyStyle(m_richTextCtrl, range);
+ formatDlg.ApplyStyle(m_richTextCtrl, range, wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE|wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY);
}
// Old method using wxFontDialog
/// Combines 'style' with 'currentStyle' for the purpose of summarising the attributes of a range of
/// content.
-bool wxRichTextParagraphLayoutBox::CollectStyle(wxTextAttrEx& currentStyle, const wxTextAttrEx& style, long& multipleStyleAttributes)
+bool wxRichTextParagraphLayoutBox::CollectStyle(wxTextAttrEx& currentStyle, const wxTextAttrEx& style, long& multipleStyleAttributes, int& multipleTextEffectAttributes)
{
if (style.HasFont())
{
{
if (currentStyle.HasParagraphSpacingAfter())
{
- if (currentStyle.HasParagraphSpacingAfter() != style.HasParagraphSpacingAfter())
+ if (currentStyle.GetParagraphSpacingAfter() != style.GetParagraphSpacingAfter())
{
// Clash of style - mark as such
multipleStyleAttributes |= wxTEXT_ATTR_PARA_SPACING_AFTER;
{
if (currentStyle.HasParagraphSpacingBefore())
{
- if (currentStyle.HasParagraphSpacingBefore() != style.HasParagraphSpacingBefore())
+ if (currentStyle.GetParagraphSpacingBefore() != style.GetParagraphSpacingBefore())
{
// Clash of style - mark as such
multipleStyleAttributes |= wxTEXT_ATTR_PARA_SPACING_BEFORE;
{
if (currentStyle.HasLineSpacing())
{
- if (currentStyle.HasLineSpacing() != style.HasLineSpacing())
+ if (currentStyle.GetLineSpacing() != style.GetLineSpacing())
{
// Clash of style - mark as such
multipleStyleAttributes |= wxTEXT_ATTR_LINE_SPACING;
{
if (currentStyle.HasCharacterStyleName())
{
- if (currentStyle.HasCharacterStyleName() != style.HasCharacterStyleName())
+ if (currentStyle.GetCharacterStyleName() != style.GetCharacterStyleName())
{
// Clash of style - mark as such
multipleStyleAttributes |= wxTEXT_ATTR_CHARACTER_STYLE_NAME;
{
if (currentStyle.HasParagraphStyleName())
{
- if (currentStyle.HasParagraphStyleName() != style.HasParagraphStyleName())
+ if (currentStyle.GetParagraphStyleName() != style.GetParagraphStyleName())
{
// Clash of style - mark as such
multipleStyleAttributes |= wxTEXT_ATTR_PARAGRAPH_STYLE_NAME;
{
if (currentStyle.HasListStyleName())
{
- if (currentStyle.HasListStyleName() != style.HasListStyleName())
+ if (currentStyle.GetListStyleName() != style.GetListStyleName())
{
// Clash of style - mark as such
multipleStyleAttributes |= wxTEXT_ATTR_LIST_STYLE_NAME;
{
if (currentStyle.HasBulletStyle())
{
- if (currentStyle.HasBulletStyle() != style.HasBulletStyle())
+ if (currentStyle.GetBulletStyle() != style.GetBulletStyle())
{
// Clash of style - mark as such
multipleStyleAttributes |= wxTEXT_ATTR_BULLET_STYLE;
{
if (currentStyle.HasBulletNumber())
{
- if (currentStyle.HasBulletNumber() != style.HasBulletNumber())
+ if (currentStyle.GetBulletNumber() != style.GetBulletNumber())
{
// Clash of style - mark as such
multipleStyleAttributes |= wxTEXT_ATTR_BULLET_NUMBER;
{
if (currentStyle.HasBulletText())
{
- if (currentStyle.HasBulletText() != style.HasBulletText())
+ if (currentStyle.GetBulletText() != style.GetBulletText())
{
// Clash of style - mark as such
multipleStyleAttributes |= wxTEXT_ATTR_BULLET_TEXT;
{
if (currentStyle.HasBulletName())
{
- if (currentStyle.HasBulletName() != style.HasBulletName())
+ if (currentStyle.GetBulletName() != style.GetBulletName())
{
// Clash of style - mark as such
multipleStyleAttributes |= wxTEXT_ATTR_BULLET_NAME;
{
if (currentStyle.HasURL())
{
- if (currentStyle.HasURL() != style.HasURL())
+ if (currentStyle.GetURL() != style.GetURL())
{
// Clash of style - mark as such
multipleStyleAttributes |= wxTEXT_ATTR_URL;
}
}
+ if (style.HasTextEffects() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_EFFECTS))
+ {
+ if (currentStyle.HasTextEffects())
+ {
+ // We need to find the bits in the new style that are different:
+ // just look at those bits that are specified by the new style.
+
+ int currentRelevantTextEffects = currentStyle.GetTextEffects() & style.GetTextEffectFlags();
+ int newRelevantTextEffects = style.GetTextEffects() & style.GetTextEffectFlags();
+
+ if (currentRelevantTextEffects != newRelevantTextEffects)
+ {
+ // Find the text effects that were different, using XOR
+ int differentEffects = currentRelevantTextEffects ^ newRelevantTextEffects;
+
+ // Clash of style - mark as such
+ multipleTextEffectAttributes |= differentEffects;
+ currentStyle.SetTextEffectFlags(currentStyle.GetTextEffectFlags() & ~differentEffects);
+ }
+ }
+ else
+ {
+ currentStyle.SetTextEffects(style.GetTextEffects());
+ currentStyle.SetTextEffectFlags(style.GetTextEffectFlags());
+ }
+ }
+
return true;
}
// The attributes that aren't valid because of multiple styles within the range
long multipleStyleAttributes = 0;
-
+ int multipleTextEffectAttributes = 0;
+
wxRichTextObjectList::compatibility_iterator node = GetChildren().GetFirst();
while (node)
{
{
wxTextAttrEx paraStyle = para->GetCombinedAttributes();
- CollectStyle(style, paraStyle, multipleStyleAttributes);
+ CollectStyle(style, paraStyle, multipleStyleAttributes, multipleTextEffectAttributes);
}
else
{
// First collect paragraph attributes only
wxTextAttrEx paraStyle = para->GetCombinedAttributes();
paraStyle.SetFlags(paraStyle.GetFlags() & wxTEXT_ATTR_PARAGRAPH);
- CollectStyle(style, paraStyle, multipleStyleAttributes);
+ CollectStyle(style, paraStyle, multipleStyleAttributes, multipleTextEffectAttributes);
wxRichTextObjectList::compatibility_iterator childNode = para->GetChildren().GetFirst();
// Now collect character attributes only
childStyle.SetFlags(childStyle.GetFlags() & wxTEXT_ATTR_CHARACTER);
- CollectStyle(style, childStyle, multipleStyleAttributes);
+ CollectStyle(style, childStyle, multipleStyleAttributes, multipleTextEffectAttributes);
}
childNode = childNode->GetNext();
long len = range.GetLength();
wxString stringChunk = m_text.Mid(range.GetStart() - offset, (size_t) len);
+ if (textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS))
+ stringChunk.MakeUpper();
int charHeight = dc.GetCharHeight();
dc.DrawRectangle(selRect);
}
dc.DrawText(stringChunk, x, y);
+
+ if (attr.HasTextEffects() && (attr.GetTextEffects() & wxTEXT_ATTR_EFFECT_STRIKETHROUGH))
+ {
+ wxPen oldPen = dc.GetPen();
+ dc.SetPen(wxPen(attr.GetTextColour(), 1));
+ dc.DrawLine(x, (int) (y+(h/2)+0.5), x+w, (int) (y+(h/2)+0.5));
+ dc.SetPen(oldPen);
+ }
+
x = nextTabPos;
}
}
dc.DrawRectangle(selRect);
}
dc.DrawText(str, x, y);
+
+ if (attr.HasTextEffects() && (attr.GetTextEffects() & wxTEXT_ATTR_EFFECT_STRIKETHROUGH))
+ {
+ wxPen oldPen = dc.GetPen();
+ dc.SetPen(wxPen(attr.GetTextColour(), 1));
+ dc.DrawLine(x, (int) (y+(h/2)+0.5), x+w, (int) (y+(h/2)+0.5));
+ dc.SetPen(oldPen);
+ }
+
x += w;
}
return true;
if (textAttr.GetFont().Ok())
dc.SetFont(textAttr.GetFont());
+ wxString str = m_text;
+ if (textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS))
+ str.MakeUpper();
+
wxCoord w, h;
- dc.GetTextExtent(m_text, & w, & h, & m_descent);
+ dc.GetTextExtent(str, & w, & h, & m_descent);
m_size = wxSize(w, dc.GetCharHeight());
return true;
int startPos = range.GetStart() - GetRange().GetStart();
long len = range.GetLength();
wxString stringChunk = m_text.Mid(startPos, (size_t) len);
+
+ if (textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS))
+ stringChunk.MakeUpper();
+
wxCoord w, h;
int width = 0;
if (stringChunk.Find(wxT('\t')) != wxNOT_FOUND)
attr1.GetFont().GetWeight() == attr2.GetFontWeight() &&
attr1.GetFont().GetFaceName() == attr2.GetFontFaceName() &&
attr1.GetFont().GetUnderlined() == attr2.GetFontUnderlined() &&
+ attr1.GetTextEffects() == attr2.GetTextEffects() &&
+ attr1.GetTextEffectFlags() == attr2.GetTextEffectFlags() &&
attr1.GetAlignment() == attr2.GetAlignment() &&
attr1.GetLeftIndent() == attr2.GetLeftIndent() &&
attr1.GetRightIndent() == attr2.GetRightIndent() &&
(attr1.HasPageBreak() != attr2.HasPageBreak()))
return false;
+ if (flags & wxTEXT_ATTR_EFFECTS)
+ {
+ if (attr1.HasTextEffects() != attr2.HasTextEffects())
+ return false;
+ if (!wxRichTextBitlistsEqPartial(attr1.GetTextEffects(), attr2.GetTextEffects(), attr2.GetTextEffectFlags()))
+ return false;
+ }
+
return true;
}
(attr1.HasPageBreak() != attr2.HasPageBreak()))
return false;
+ if (flags & wxTEXT_ATTR_EFFECTS)
+ {
+ if (attr1.HasTextEffects() != attr2.HasTextEffects())
+ return false;
+ if (!wxRichTextBitlistsEqPartial(attr1.GetTextEffects(), attr2.GetTextEffects(), attr2.GetTextEffectFlags()))
+ return false;
+ }
+
return true;
}
return true;
}
-
/// Apply one style to another
bool wxRichTextApplyStyle(wxTextAttrEx& destStyle, const wxTextAttrEx& style)
{
if (style.HasPageBreak())
destStyle.SetPageBreak();
+ if (style.HasTextEffects())
+ {
+ int destBits = destStyle.GetTextEffects();
+ int destFlags = destStyle.GetTextEffectFlags();
+
+ int srcBits = style.GetTextEffects();
+ int srcFlags = style.GetTextEffectFlags();
+
+ wxRichTextCombineBitlists(destBits, srcBits, destFlags, srcFlags);
+
+ destStyle.SetTextEffects(destBits);
+ destStyle.SetTextEffectFlags(destFlags);
+ }
+
return true;
}
destStyle.SetPageBreak();
}
+ if (style.HasTextEffects())
+ {
+ if (!(compareWith && compareWith->HasTextEffects() && compareWith->GetTextEffects() == style.GetTextEffects()))
+ {
+ int destBits = destStyle.GetTextEffects();
+ int destFlags = destStyle.GetTextEffectFlags();
+
+ int srcBits = style.GetTextEffects();
+ int srcFlags = style.GetTextEffectFlags();
+
+ wxRichTextCombineBitlists(destBits, srcBits, destFlags, srcFlags);
+
+ destStyle.SetTextEffects(destBits);
+ destStyle.SetTextEffectFlags(destFlags);
+ }
+ }
+
return true;
}
+/// Combine two bitlists, specifying the bits of interest with separate flags.
+bool wxRichTextCombineBitlists(int& valueA, int valueB, int& flagsA, int flagsB)
+{
+ // We want to apply B's bits to A, taking into account each's flags which indicate which bits
+ // are to be taken into account. A zero in B's bits should reset that bit in A but only if B's flags
+ // indicate it.
+
+ // First, reset the 0 bits from B. We make a mask so we're only dealing with B's zero
+ // bits at this point, ignoring any 1 bits in B or 0 bits in B that are not relevant.
+ int valueA2 = ~(~valueB & flagsB) & valueA;
+
+ // Now combine the 1 bits.
+ int valueA3 = (valueB & flagsB) | valueA2;
+
+ valueA = valueA3;
+ flagsA = (flagsA | flagsB);
+
+ return true;
+}
+
+/// Compare two bitlists
+bool wxRichTextBitlistsEqPartial(int valueA, int valueB, int flags)
+{
+ int relevantBitsA = valueA & flags;
+ int relevantBitsB = valueB & flags;
+ return (relevantBitsA != relevantBitsB);
+}
+
/// Split into paragraph and character styles
bool wxRichTextSplitParaCharStyles(const wxTextAttrEx& style, wxTextAttrEx& parStyle, wxTextAttrEx& charStyle)
{
m_paragraphSpacingBefore = 0;
m_lineSpacing = 0;
m_bulletStyle = wxTEXT_ATTR_BULLET_STYLE_NONE;
+ m_textEffects = wxTEXT_ATTR_EFFECT_NONE;
+ m_textEffectFlags = wxTEXT_ATTR_EFFECT_NONE;
m_bulletNumber = 0;
}
m_fontWeight = attr.m_fontWeight;
m_fontUnderlined = attr.m_fontUnderlined;
m_fontFaceName = attr.m_fontFaceName;
+ m_textEffects = attr.m_textEffects;
+ m_textEffectFlags = attr.m_textEffectFlags;
m_paragraphSpacingAfter = attr.m_paragraphSpacingAfter;
m_paragraphSpacingBefore = attr.m_paragraphSpacingBefore;
// operators
void wxRichTextAttr::operator= (const wxTextAttrEx& attr)
{
+ m_flags = attr.GetFlags();
+
m_colText = attr.GetTextColour();
m_colBack = attr.GetBackgroundColour();
m_textAlignment = attr.GetAlignment();
m_leftSubIndent = attr.GetLeftSubIndent();
m_rightIndent = attr.GetRightIndent();
m_tabs = attr.GetTabs();
- m_flags = attr.GetFlags();
+ m_textEffects = attr.GetTextEffects();
+ m_textEffectFlags = attr.GetTextEffectFlags();
m_paragraphSpacingAfter = attr.GetParagraphSpacingAfter();
m_paragraphSpacingBefore = attr.GetParagraphSpacingBefore();
GetBulletFont() == attr.GetBulletFont() &&
GetBulletName() == attr.GetBulletName() &&
+ GetTextEffects() == attr.GetTextEffects() &&
+ GetTextEffectFlags() == attr.GetTextEffectFlags() &&
+
m_fontSize == attr.m_fontSize &&
m_fontStyle == attr.m_fontStyle &&
m_fontWeight == attr.m_fontWeight &&
attr.SetCharacterStyleName(m_characterStyleName);
attr.SetParagraphStyleName(m_paragraphStyleName);
attr.SetListStyleName(m_listStyleName);
+ attr.SetTextEffects(m_textEffects);
+ attr.SetTextEffectFlags(m_textEffectFlags);
attr.SetURL(m_urlTarget);
if (attr.HasPageBreak())
newAttr.SetPageBreak();
+ if (attr.HasTextEffects())
+ {
+ newAttr.SetTextEffects(attr.GetTextEffects());
+ newAttr.SetTextEffectFlags(attr.GetTextEffectFlags());
+ }
+
return newAttr;
}
m_paragraphSpacingBefore = 0;
m_lineSpacing = 0;
m_bulletStyle = wxTEXT_ATTR_BULLET_STYLE_NONE;
+ m_textEffects = wxTEXT_ATTR_EFFECT_NONE;
+ m_textEffectFlags = wxTEXT_ATTR_EFFECT_NONE;
m_bulletNumber = 0;
}
m_bulletFont = attr.m_bulletFont;
m_bulletName = attr.m_bulletName;
m_urlTarget = attr.m_urlTarget;
+ m_textEffects = attr.m_textEffects;
+ m_textEffectFlags = attr.m_textEffectFlags;
}
// Assignment from a wxTextAttrEx object
GetTextColour() == attr.GetTextColour() &&
GetBackgroundColour() == attr.GetBackgroundColour() &&
GetFont() == attr.GetFont() &&
+ GetTextEffects() == attr.GetTextEffects() &&
GetAlignment() == attr.GetAlignment() &&
GetLeftIndent() == attr.GetLeftIndent() &&
GetRightIndent() == attr.GetRightIndent() &&
if (attr.HasURL())
newAttr.SetURL(attr.GetURL());
+ if (attr.HasTextEffects())
+ {
+ newAttr.SetTextEffects(attr.GetTextEffects());
+ newAttr.SetTextEffectFlags(attr.GetTextEffectFlags());
+ }
+
return newAttr;
}
}
}
+ buffer->ResetAndClearCommands();
buffer->Clear();
buffer->AddParagraphs(str);
buffer->UpdateRanges();
return true;
-
}
bool wxRichTextPlainTextHandler::DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream)
if (style & wxTE_READONLY)
SetEditable(false);
+ // The base attributes must all have default values
wxTextAttrEx attributes;
attributes.SetFont(GetFont());
attributes.SetTextColour(*wxBLACK);
attributes.SetLineSpacing(10);
attributes.SetParagraphSpacingAfter(10);
attributes.SetParagraphSpacingBefore(0);
+ attributes.SetTextEffects(0);
+ attributes.SetTextEffectFlags(wxTEXT_ATTR_EFFECT_STRIKETHROUGH|wxTEXT_ATTR_EFFECT_CAPITALS);
SetBasicStyle(attributes);
EVT_COMBOBOX( ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, wxRichTextFontPage::OnUnderliningCtrlSelected )
+ EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL, wxRichTextFontPage::OnStrikethroughctrlClick )
+
+ EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_CAPSCTRL, wxRichTextFontPage::OnCapsctrlClick )
+
////@end wxRichTextFontPage event table entries
END_EVENT_TABLE()
m_weightCtrl = NULL;
m_underliningCtrl = NULL;
m_colourCtrl = NULL;
+ m_strikethroughCtrl = NULL;
+ m_capitalsCtrl = NULL;
m_previewCtrl = NULL;
////@end wxRichTextFontPage member initialisation
}
wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Font:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
- m_faceTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_FACETEXTCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+ m_faceTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_FACETEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
m_faceTextCtrl->SetHelpText(_("Type a font name."));
if (ShowToolTips())
m_faceTextCtrl->SetToolTip(_("Type a font name."));
wxStaticText* itemStaticText10 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Size:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add(itemStaticText10, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
- m_sizeTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_SIZETEXTCTRL, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
+ m_sizeTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_SIZETEXTCTRL, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_sizeTextCtrl->SetHelpText(_("Type a size in points."));
if (ShowToolTips())
m_sizeTextCtrl->SetToolTip(_("Type a size in points."));
itemBoxSizer14->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxString* m_styleCtrlStrings = NULL;
- m_styleCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_STYLECTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, m_styleCtrlStrings, wxCB_READONLY );
+ m_styleCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_STYLECTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_styleCtrlStrings, wxCB_READONLY );
m_styleCtrl->SetHelpText(_("Select regular or italic style."));
if (ShowToolTips())
m_styleCtrl->SetToolTip(_("Select regular or italic style."));
itemBoxSizer17->Add(itemStaticText18, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxString* m_weightCtrlStrings = NULL;
- m_weightCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_WEIGHTCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, m_weightCtrlStrings, wxCB_READONLY );
+ m_weightCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_WEIGHTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_weightCtrlStrings, wxCB_READONLY );
m_weightCtrl->SetHelpText(_("Select regular or bold."));
if (ShowToolTips())
m_weightCtrl->SetToolTip(_("Select regular or bold."));
itemBoxSizer20->Add(itemStaticText21, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxString* m_underliningCtrlStrings = NULL;
- m_underliningCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, m_underliningCtrlStrings, wxCB_READONLY );
+ m_underliningCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_underliningCtrlStrings, wxCB_READONLY );
m_underliningCtrl->SetHelpText(_("Select underlining or no underlining."));
if (ShowToolTips())
m_underliningCtrl->SetToolTip(_("Select underlining or no underlining."));
m_colourCtrl->SetToolTip(_("Click to change the text colour."));
itemBoxSizer23->Add(m_colourCtrl, 0, wxALIGN_LEFT|wxALL, 5);
+ wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxHORIZONTAL);
+ itemBoxSizer3->Add(itemBoxSizer26, 0, wxGROW, 5);
+
+ m_strikethroughCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL, _("&Strikethrough"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
+ m_strikethroughCtrl->SetValue(false);
+ m_strikethroughCtrl->SetHelpText(_("Check to show a line through the text."));
+ if (ShowToolTips())
+ m_strikethroughCtrl->SetToolTip(_("Check to show a line through the text."));
+ itemBoxSizer26->Add(m_strikethroughCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+
+ m_capitalsCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTFONTPAGE_CAPSCTRL, _("Ca&pitals"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
+ m_capitalsCtrl->SetValue(false);
+ m_capitalsCtrl->SetHelpText(_("Check to show the text in capitals."));
+ if (ShowToolTips())
+ m_capitalsCtrl->SetToolTip(_("Check to show the text in capitals."));
+ itemBoxSizer26->Add(m_capitalsCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+
itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_previewCtrl = new wxRichTextFontPreviewCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_PREVIEWCTRL, wxDefaultPosition, wxSize(100, 80), wxSIMPLE_BORDER );
}
else
attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_TEXT_COLOUR));
+
+ if (m_strikethroughCtrl->Get3StateValue() != wxCHK_UNDETERMINED)
+ {
+ attr->SetTextEffectFlags(attr->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_STRIKETHROUGH);
+
+ if (m_strikethroughCtrl->Get3StateValue() == wxCHK_CHECKED)
+ attr->SetTextEffects(attr->GetTextEffects() | wxTEXT_ATTR_EFFECT_STRIKETHROUGH);
+ else
+ attr->SetTextEffects(attr->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_STRIKETHROUGH);
+ }
+
+ if (m_capitalsCtrl->Get3StateValue() != wxCHK_UNDETERMINED)
+ {
+ attr->SetTextEffectFlags(attr->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_CAPITALS);
+
+ if (m_capitalsCtrl->Get3StateValue() == wxCHK_CHECKED)
+ attr->SetTextEffects(attr->GetTextEffects() | wxTEXT_ATTR_EFFECT_CAPITALS);
+ else
+ attr->SetTextEffects(attr->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_CAPITALS);
+ }
return true;
}
m_colourPresent = true;
}
+ if (attr->HasTextEffects())
+ {
+ if (attr->GetTextEffectFlags() & wxTEXT_ATTR_EFFECT_STRIKETHROUGH)
+ {
+ if (attr->GetTextEffects() & wxTEXT_ATTR_EFFECT_STRIKETHROUGH)
+ m_strikethroughCtrl->Set3StateValue(wxCHK_CHECKED);
+ else
+ m_strikethroughCtrl->Set3StateValue(wxCHK_UNCHECKED);
+ }
+ else
+ m_strikethroughCtrl->Set3StateValue(wxCHK_UNDETERMINED);
+
+ if (attr->GetTextEffectFlags() & wxTEXT_ATTR_EFFECT_CAPITALS)
+ {
+ if (attr->GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS)
+ m_capitalsCtrl->Set3StateValue(wxCHK_CHECKED);
+ else
+ m_capitalsCtrl->Set3StateValue(wxCHK_UNCHECKED);
+ }
+ else
+ m_capitalsCtrl->Set3StateValue(wxCHK_UNDETERMINED);
+ }
+ else
+ {
+ m_strikethroughCtrl->Set3StateValue(wxCHK_UNDETERMINED);
+ m_capitalsCtrl->Set3StateValue(wxCHK_UNDETERMINED);
+ }
+
UpdatePreview();
m_dontUpdate = false;
font.SetUnderlined(underlined);
}
+
+ int textEffects = 0;
+
+ if (m_strikethroughCtrl->Get3StateValue() == wxCHK_CHECKED)
+ {
+ textEffects |= wxTEXT_ATTR_EFFECT_STRIKETHROUGH;
+ }
+
+ if (m_capitalsCtrl->Get3StateValue() == wxCHK_CHECKED)
+ {
+ textEffects |= wxTEXT_ATTR_EFFECT_CAPITALS;
+ }
m_previewCtrl->SetFont(font);
+ m_previewCtrl->SetTextEffects(textEffects);
m_previewCtrl->Refresh();
}
UpdatePreview();
}
+/*!
+ * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
+ */
+
+void wxRichTextFontPage::OnStrikethroughctrlClick( wxCommandEvent& WXUNUSED(event) )
+{
+ UpdatePreview();
+}
+
+/*!
+ * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL
+ */
+
+void wxRichTextFontPage::OnCapsctrlClick( wxCommandEvent& WXUNUSED(event) )
+{
+ UpdatePreview();
+}
+
+
long w = 0, h = 0;
wxString text(_("ABCDEFGabcdefg12345"));
+ if (GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS)
+ text.MakeUpper();
dc.GetTextExtent( text, &w, &h);
int cx = wxMax(2, (size.x/2) - (w/2));
dc.SetTextForeground(GetForegroundColour());
dc.SetClippingRegion(2, 2, size.x-4, size.y-4);
dc.DrawText(text, cx, cy);
+
+ if (GetTextEffects() & wxTEXT_ATTR_EFFECT_STRIKETHROUGH)
+ {
+ dc.SetPen(wxPen(GetForegroundColour(), 1));
+ dc.DrawLine(cx, (int) (cy + h/2 + 0.5), cx + w, (int) (cy + h/2 + 0.5));
+ }
+
dc.DestroyClippingRegion();
}
}
{
wxTextAttrEx charStyle(para->GetCombinedAttributes(obj->GetAttributes()));
BeginCharacterFormatting(currentCharStyle, charStyle, paraStyle, stream);
+
+ wxString text = textObj->GetText();
- str << textObj->GetText();
+ if (charStyle.HasTextEffects() && (charStyle.GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS))
+ text.MakeUpper();
+
+ str << text;
EndCharacterFormatting(currentCharStyle, charStyle, paraStyle, stream);
}
wxString align = GetAlignment(thisStyle);
str << wxString::Format(wxT("<p align=\"%s\">"), align.c_str());
}
+
+ if (thisStyle.HasPageBreak())
+ {
+ wxTextOutputStream str(stream);
+ str << wxT("<div style=\"page-break-after:always\"></div>\n");
+ }
}
void wxRichTextHTMLHandler::NavigateToListPosition(const wxTextAttrEx& thisStyle, wxTextOutputStream& str)
m_name = def.m_name;
m_baseStyle = def.m_baseStyle;
m_style = def.m_style;
+ m_description = def.m_description;
}
bool wxRichTextStyleDefinition::Eq(const wxRichTextStyleDefinition& def) const
wxRichTextListStyleDefinition* def = (wxRichTextListStyleDefinition*) node->GetData();
AddListStyle(new wxRichTextListStyleDefinition(*def));
}
+
+ SetName(sheet.GetName());
+ SetDescription(sheet.GetDescription());
}
/// Equality
return false;
buffer->ResetAndClearCommands();
+ buffer->Clear();
wxXmlDocument* xmlDoc = new wxXmlDocument;
bool success = true;
if (!xmlDoc->Load(stream, encoding))
{
+ buffer->ResetAndClearCommands();
success = false;
}
else
if (GetFlags() & wxRICHTEXT_HANDLER_INCLUDE_STYLESHEET)
{
wxRichTextStyleSheet* sheet = new wxRichTextStyleSheet;
+ wxString sheetName = node->GetPropVal(wxT("name"), wxEmptyString);
+ wxString sheetDescription = node->GetPropVal(wxT("description"), wxEmptyString);
+ sheet->SetName(sheetName);
+ sheet->SetDescription(sheetDescription);
wxXmlNode* child = node->GetChildren();
while (child)
if (buffer->GetStyleSheet() && (GetFlags() & wxRICHTEXT_HANDLER_INCLUDE_STYLESHEET))
{
OutputIndentation(stream, level);
- OutputString(stream, wxT("<stylesheet>"), convMem, convFile);
+ wxString nameAndDescr;
+ if (!buffer->GetStyleSheet()->GetName().IsEmpty())
+ nameAndDescr << wxT(" name=\"") << buffer->GetStyleSheet()->GetName() << wxT("\"");
+ if (!buffer->GetStyleSheet()->GetDescription().IsEmpty())
+ nameAndDescr << wxT(" description=\"") << buffer->GetStyleSheet()->GetDescription() << wxT("\"");
+ OutputString(stream, wxString(wxT("<stylesheet")) + nameAndDescr + wxT(">"), convMem, convFile);
int i;
if (!baseStyle.IsEmpty())
baseStyleProp = wxT(" basestyle=\"") + baseStyle + wxT("\"");
+ wxString descr = def->GetDescription();
+ wxString descrProp;
+ if (!descr.IsEmpty())
+ descrProp = wxT(" description=\"") + descr + wxT("\"");
+
if (charDef)
{
OutputIndentation(stream, level);
- OutputString(stream, wxT("<characterstyle") + baseStyleProp + wxT(">"), convMem, convFile);
+ OutputString(stream, wxT("<characterstyle") + baseStyleProp + descrProp + wxT(">"), convMem, convFile);
level ++;
if (!listDef->GetNextStyle().IsEmpty())
baseStyleProp << wxT(" basestyle=\"") << listDef->GetNextStyle() << wxT("\"");
- OutputString(stream, wxT("<liststyle") + baseStyleProp + wxT(">"), convMem, convFile);
+ OutputString(stream, wxT("<liststyle") + baseStyleProp + descrProp + wxT(">"), convMem, convFile);
level ++;
if (!listDef->GetNextStyle().IsEmpty())
baseStyleProp << wxT(" basestyle=\"") << listDef->GetNextStyle() << wxT("\"");
- OutputString(stream, wxT("<paragraphstyle") + baseStyleProp + wxT(">"), convMem, convFile);
+ OutputString(stream, wxT("<paragraphstyle") + baseStyleProp + descrProp + wxT(">"), convMem, convFile);
level ++;
str << wxT(" fontface=\"") << attr.GetFont().GetFaceName() << wxT("\"");
}
+ if (attr.HasTextEffects())
+ {
+ str << wxT(" texteffects=\"");
+ str << attr.GetTextEffects();
+ str << wxT("\"");
+ }
+
if (!attr.GetCharacterStyleName().empty())
str << wxT(" characterstyle=\"") << wxString(attr.GetCharacterStyleName()) << wxT("\"");
}
str << wxT("\"");
}
+
+ if (attr.HasPageBreak())
+ {
+ str << wxT(" pagebreak=\"1\"");
+ }
}
return str;
if (!value.empty())
attr.SetCharacterStyleName(value);
+ value = node->GetPropVal(wxT("texteffects"), wxEmptyString);
+ if (!value.IsEmpty())
+ {
+ attr.SetTextEffects(wxAtoi(value));
+ }
+
// Set paragraph attributes
if (isPara)
{
}
attr.SetTabs(tabs);
}
+
+ value = node->GetPropVal(wxT("pagebreak"), wxEmptyString);
+ if (!value.IsEmpty())
+ {
+ attr.SetPageBreak(wxAtoi(value) != 0);
+ }
}
return true;