Added custom properties to style definitions and style sheets
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71276 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -101,11 +101,27 @@ public:
|
||||
/// Gets the style combined with the base style
|
||||
virtual wxRichTextAttr GetStyleMergedWithBase(const wxRichTextStyleSheet* sheet) const;
|
||||
|
||||
/**
|
||||
Sets the definition's properties.
|
||||
*/
|
||||
wxRichTextProperties& GetProperties() { return m_properties; }
|
||||
|
||||
/**
|
||||
Returns the definition's properties.
|
||||
*/
|
||||
const wxRichTextProperties& GetProperties() const { return m_properties; }
|
||||
|
||||
/**
|
||||
Returns the definition's properties.
|
||||
*/
|
||||
void SetProperties(const wxRichTextProperties& props) { m_properties = props; }
|
||||
|
||||
protected:
|
||||
wxString m_name;
|
||||
wxString m_baseStyle;
|
||||
wxString m_description;
|
||||
wxRichTextAttr m_style;
|
||||
wxString m_name;
|
||||
wxString m_baseStyle;
|
||||
wxString m_description;
|
||||
wxRichTextAttr m_style;
|
||||
wxRichTextProperties m_properties;
|
||||
};
|
||||
|
||||
/*!
|
||||
@@ -402,6 +418,21 @@ public:
|
||||
void SetDescription(const wxString& descr) { m_description = descr; }
|
||||
const wxString& GetDescription() const { return m_description; }
|
||||
|
||||
/**
|
||||
Sets the definition's properties.
|
||||
*/
|
||||
wxRichTextProperties& GetProperties() { return m_properties; }
|
||||
|
||||
/**
|
||||
Returns the definition's properties.
|
||||
*/
|
||||
const wxRichTextProperties& GetProperties() const { return m_properties; }
|
||||
|
||||
/**
|
||||
Returns the definition's properties.
|
||||
*/
|
||||
void SetProperties(const wxRichTextProperties& props) { m_properties = props; }
|
||||
|
||||
/// Implementation
|
||||
|
||||
/// Add a definition to one of the style lists
|
||||
@@ -425,6 +456,7 @@ protected:
|
||||
|
||||
wxRichTextStyleSheet* m_previousSheet;
|
||||
wxRichTextStyleSheet* m_nextSheet;
|
||||
wxRichTextProperties m_properties;
|
||||
};
|
||||
|
||||
#if wxUSE_HTML
|
||||
|
@@ -35,7 +35,7 @@ public:
|
||||
wxRichTextXMLHandler(const wxString& name = wxT("XML"), const wxString& ext = wxT("xml"), int type = wxRICHTEXT_TYPE_XML)
|
||||
: wxRichTextFileHandler(name, ext, type)
|
||||
{ Init(); }
|
||||
|
||||
|
||||
void Init();
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
@@ -69,6 +69,7 @@ public:
|
||||
bool ImportXML(wxRichTextBuffer* buffer, wxRichTextObject* obj, wxXmlNode* node);
|
||||
bool ImportStyleDefinition(wxRichTextStyleSheet* sheet, wxXmlNode* node);
|
||||
bool ImportProperties(wxRichTextObject* obj, wxXmlNode* node);
|
||||
bool ImportProperties(wxRichTextProperties& properties, wxXmlNode* node);
|
||||
|
||||
/// Import style parameters
|
||||
bool ImportStyle(wxRichTextAttr& attr, wxXmlNode* node, bool isPara = false);
|
||||
@@ -76,7 +77,7 @@ public:
|
||||
|
||||
/// Creates an object given an XML element name
|
||||
virtual wxRichTextObject* CreateObjectForXMLName(wxRichTextObject* parent, const wxString& name) const;
|
||||
|
||||
|
||||
/// Can we save using this handler?
|
||||
virtual bool CanSave() const { return true; }
|
||||
|
||||
|
Reference in New Issue
Block a user