documentation for wxAppTraits (patch 1518295 from Francesco)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43576 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-07-24 18:20:18 +00:00
parent cb349f69fa
commit 336d8ae9a3
13 changed files with 408 additions and 232 deletions

View File

@@ -391,11 +391,11 @@ public:
int GetTextEffectFlags() const { return m_textEffectFlags; }
int GetOutlineLevel() const { return m_outlineLevel; }
bool HasWeight() const { return (GetFlags() & wxTEXT_ATTR_FONT_WEIGHT) != 0; }
bool HasSize() const { return (GetFlags() & wxTEXT_ATTR_FONT_SIZE) != 0; }
bool HasItalic() const { return (GetFlags() & wxTEXT_ATTR_FONT_ITALIC) != 0; }
bool HasUnderlined() const { return (GetFlags() & wxTEXT_ATTR_FONT_UNDERLINE) != 0; }
bool HasFaceName() const { return (GetFlags() & wxTEXT_ATTR_FONT_FACE) != 0; }
bool HasFontWeight() const { return (GetFlags() & wxTEXT_ATTR_FONT_WEIGHT) != 0; }
bool HasFontSize() const { return (GetFlags() & wxTEXT_ATTR_FONT_SIZE) != 0; }
bool HasFontItalic() const { return (GetFlags() & wxTEXT_ATTR_FONT_ITALIC) != 0; }
bool HasFontUnderlined() const { return (GetFlags() & wxTEXT_ATTR_FONT_UNDERLINE) != 0; }
bool HasFontFaceName() const { return (GetFlags() & wxTEXT_ATTR_FONT_FACE) != 0; }
bool HasParagraphSpacingAfter() const { return HasFlag(wxTEXT_ATTR_PARA_SPACING_AFTER); }
bool HasParagraphSpacingBefore() const { return HasFlag(wxTEXT_ATTR_PARA_SPACING_BEFORE); }
@@ -566,11 +566,11 @@ public:
bool HasTabs() const { return (m_flags & wxTEXT_ATTR_TABS) != 0 ; }
bool HasLeftIndent() const { return (m_flags & wxTEXT_ATTR_LEFT_INDENT) != 0 ; }
bool HasRightIndent() const { return (m_flags & wxTEXT_ATTR_RIGHT_INDENT) != 0 ; }
bool HasWeight() const { return (m_flags & wxTEXT_ATTR_FONT_WEIGHT) != 0; }
bool HasSize() const { return (m_flags & wxTEXT_ATTR_FONT_SIZE) != 0; }
bool HasItalic() const { return (m_flags & wxTEXT_ATTR_FONT_ITALIC) != 0; }
bool HasUnderlined() const { return (m_flags & wxTEXT_ATTR_FONT_UNDERLINE) != 0; }
bool HasFaceName() const { return (m_flags & wxTEXT_ATTR_FONT_FACE) != 0; }
bool HasFontWeight() const { return (m_flags & wxTEXT_ATTR_FONT_WEIGHT) != 0; }
bool HasFontSize() const { return (m_flags & wxTEXT_ATTR_FONT_SIZE) != 0; }
bool HasFontItalic() const { return (m_flags & wxTEXT_ATTR_FONT_ITALIC) != 0; }
bool HasFontUnderlined() const { return (m_flags & wxTEXT_ATTR_FONT_UNDERLINE) != 0; }
bool HasFontFaceName() const { return (m_flags & wxTEXT_ATTR_FONT_FACE) != 0; }
bool HasFont() const { return (m_flags & (wxTEXT_ATTR_FONT)) != 0; }
bool HasParagraphSpacingAfter() const { return (m_flags & wxTEXT_ATTR_PARA_SPACING_AFTER) != 0; }
@@ -601,12 +601,16 @@ public:
return GetFlags() == 0;
}
// return the attribute having the valid font and colours: it uses the
// attributes set in attr and falls back first to attrDefault and then to
// the text control font/colours for those attributes which are not set
static wxRichTextAttr Combine(const wxRichTextAttr& attr,
const wxRichTextAttr& attrDef,
const wxTextCtrlBase *text);
// Merges the given attributes. Does not affect 'this'. If compareWith
// is non-NULL, then it will be used to mask out those attributes that are the same in style
// and compareWith, for situations where we don't want to explicitly set inherited attributes.
bool Apply(const wxRichTextAttr& style, const wxRichTextAttr* compareWith = NULL);
// Merges the given attributes and returns the result. Does not affect 'this'. If compareWith
// is non-NULL, then it will be used to mask out those attributes that are the same in style
// and compareWith, for situations where we don't want to explicitly set inherited attributes.
wxRichTextAttr Combine(const wxRichTextAttr& style, const wxRichTextAttr* compareWith = NULL) const;
private:
long m_flags;

View File

@@ -93,11 +93,14 @@ public:
void SetBaseStyle(const wxString& name) { m_baseStyle = name; }
const wxString& GetBaseStyle() const { return m_baseStyle; }
/// Sets the style
/// Sets and gets the style
void SetStyle(const wxRichTextAttr& style) { m_style = style; }
const wxRichTextAttr& GetStyle() const { return m_style; }
wxRichTextAttr& GetStyle() { return m_style; }
/// Gets the style combined with the base style
virtual wxRichTextAttr GetStyleMergedWithBase(const wxRichTextStyleSheet* sheet) const;
protected:
wxString m_name;
wxString m_baseStyle;
@@ -215,15 +218,15 @@ public:
/// Combine the base and list style with a paragraph style, using the given indent (from which
/// an appropriate level is found)
wxRichTextAttr CombineWithParagraphStyle(int indent, const wxRichTextAttr& paraStyle);
wxRichTextAttr CombineWithParagraphStyle(int indent, const wxRichTextAttr& paraStyle, wxRichTextStyleSheet* styleSheet = NULL);
/// Combine the base and list style, using the given indent (from which
/// an appropriate level is found)
wxRichTextAttr GetCombinedStyle(int indent);
wxRichTextAttr GetCombinedStyle(int indent, wxRichTextStyleSheet* styleSheet = NULL);
/// Combine the base and list style, using the given level from which
/// an appropriate level is found)
wxRichTextAttr GetCombinedStyleForLevel(int level);
wxRichTextAttr GetCombinedStyleForLevel(int level, wxRichTextStyleSheet* styleSheet = NULL);
/// Gets the number of available levels
int GetLevelCount() const { return 10; }
@@ -276,6 +279,9 @@ public:
/// Add a definition to the list style list
bool AddListStyle(wxRichTextListStyleDefinition* def);
/// Add a definition to the appropriate style list
bool AddStyle(wxRichTextStyleDefinition* def);
/// Remove a character style
bool RemoveCharacterStyle(wxRichTextStyleDefinition* def, bool deleteStyle = false) { return RemoveStyle(m_characterStyleDefinitions, def, deleteStyle); }
@@ -285,6 +291,9 @@ public:
/// Remove a list style
bool RemoveListStyle(wxRichTextStyleDefinition* def, bool deleteStyle = false) { return RemoveStyle(m_listStyleDefinitions, def, deleteStyle); }
/// Remove a style
bool RemoveStyle(wxRichTextStyleDefinition* def, bool deleteStyle = false);
/// Find a character definition by name
wxRichTextCharacterStyleDefinition* FindCharacterStyle(const wxString& name, bool recurse = true) const { return (wxRichTextCharacterStyleDefinition*) FindStyle(m_characterStyleDefinitions, name, recurse); }
@@ -294,6 +303,9 @@ public:
/// Find a list definition by name
wxRichTextListStyleDefinition* FindListStyle(const wxString& name, bool recurse = true) const { return (wxRichTextListStyleDefinition*) FindStyle(m_listStyleDefinitions, name, recurse); }
/// Find any definition by name
wxRichTextStyleDefinition* FindStyle(const wxString& name, bool recurse = true) const;
/// Return the number of character styles
size_t GetCharacterStyleCount() const { return m_characterStyleDefinitions.GetCount(); }