X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c9fdebe5fd18292fc8d08d5707e8340a0e2ee23..880d76dfb12d4e8466df30d641bb25c6f71bd398:/interface/wx/richtext/richtextbuffer.h?ds=sidebyside diff --git a/interface/wx/richtext/richtextbuffer.h b/interface/wx/richtext/richtextbuffer.h index f5edca39ab..4f821125f8 100644 --- a/interface/wx/richtext/richtextbuffer.h +++ b/interface/wx/richtext/richtextbuffer.h @@ -216,7 +216,8 @@ enum wxTextBoxAttrPosition { wxTEXT_BOX_ATTR_POSITION_STATIC = 0x0000, // Default is static, i.e. as per normal layout wxTEXT_BOX_ATTR_POSITION_RELATIVE = 0x0010, // Relative to the relevant edge - wxTEXT_BOX_ATTR_POSITION_ABSOLUTE = 0x0020, + wxTEXT_BOX_ATTR_POSITION_ABSOLUTE = 0x0020, // Relative to the parent + wxTEXT_BOX_ATTR_POSITION_FIXED = 0x0040, // Relative to the top-level window wxTEXT_BOX_ATTR_POSITION_MASK = 0x00F0 }; @@ -250,9 +251,12 @@ public: void Reset() { m_value = 0; m_flags = 0; } /** - Partial equality test. + Partial equality test. If @a weakTest is @true, attributes of this object do not + have to be present if those attributes of @a dim are present. If @a weakTest is + @false, the function will fail if an attribute is present in @a dim but not + in this object. */ - bool EqPartial(const wxTextAttrDimension& dim) const; + bool EqPartial(const wxTextAttrDimension& dim, bool weakTest = true) const; /** Apply the dimension, but not those identical to @a compareWith if present. */ @@ -377,13 +381,16 @@ public: bool operator==(const wxTextAttrDimensions& dims) const { return m_left == dims.m_left && m_top == dims.m_top && m_right == dims.m_right && m_bottom == dims.m_bottom; } /** - Partial equality test. + Partial equality test. If @a weakTest is @true, attributes of this object do not + have to be present if those attributes of @a dim sare present. If @a weakTest is + @false, the function will fail if an attribute is present in @a dims but not + in this object. */ - bool EqPartial(const wxTextAttrDimensions& dims) const; + bool EqPartial(const wxTextAttrDimensions& dims, bool weakTest = true) const; /** - Apply border to 'this', but not if the same as @a compareWith. + Apply to 'this', but not if the same as @a compareWith. */ bool Apply(const wxTextAttrDimensions& dims, const wxTextAttrDimensions* compareWith = NULL); @@ -468,12 +475,15 @@ public: bool operator==(const wxTextAttrSize& size) const { return m_width == size.m_width && m_height == size.m_height ; } /** - Partial equality test. + Partial equality test. If @a weakTest is @true, attributes of this object do not + have to be present if those attributes of @a size are present. If @a weakTest is + @false, the function will fail if an attribute is present in @a size but not + in this object. */ - bool EqPartial(const wxTextAttrSize& dims) const; + bool EqPartial(const wxTextAttrSize& size, bool weakTest = true) const; /** - Apply border to this object, but not if the same as @a compareWith. + Apply to this object, but not if the same as @a compareWith. */ bool Apply(const wxTextAttrSize& dims, const wxTextAttrSize* compareWith = NULL); @@ -693,9 +703,12 @@ public: void Reset() { m_borderStyle = 0; m_borderColour = 0; m_flags = 0; m_borderWidth.Reset(); } /** - Partial equality test. + Partial equality test. If @a weakTest is @true, attributes of this object do not + have to be present if those attributes of @a border are present. If @a weakTest is + @false, the function will fail if an attribute is present in @a border but not + in this object. */ - bool EqPartial(const wxTextAttrBorder& border) const; + bool EqPartial(const wxTextAttrBorder& border, bool weakTest = true) const; /** Applies the border to this object, but not if the same as @a compareWith. @@ -869,9 +882,12 @@ public: void Reset() { m_left.Reset(); m_right.Reset(); m_top.Reset(); m_bottom.Reset(); } /** - Partial equality test. + Partial equality test. If @a weakTest is @true, attributes of this object do not + have to be present if those attributes of @a borders are present. If @a weakTest is + @false, the function will fail if an attribute is present in @a borders but not + in this object. */ - bool EqPartial(const wxTextAttrBorders& borders) const; + bool EqPartial(const wxTextAttrBorders& borders, bool weakTest = true) const; /** Applies border to this object, but not if the same as @a compareWith. @@ -967,10 +983,13 @@ public: bool operator== (const wxTextBoxAttr& attr) const; /** - Partial equality test, ignoring unset attributes. + Partial equality test, ignoring unset attributes. If @a weakTest is @true, attributes of this object do not + have to be present if those attributes of @a attr are present. If @a weakTest is + @false, the function will fail if an attribute is present in @a attr but not + in this object. */ - bool EqPartial(const wxTextBoxAttr& attr) const; + bool EqPartial(const wxTextBoxAttr& attr, bool weakTest = true) const; /** Merges the given attributes. If @a compareWith is non-NULL, then it will be used @@ -1369,9 +1388,12 @@ public: bool operator==(const wxRichTextAttr& attr) const; /** - Partial equality test taking comparison object into account. + Partial equality test. If @a weakTest is @true, attributes of this object do not + have to be present if those attributes of @a attr are present. If @a weakTest is + @false, the function will fail if an attribute is present in @a attr but not + in this object. */ - bool EqPartial(const wxRichTextAttr& attr) const; + bool EqPartial(const wxRichTextAttr& attr, bool weakTest = true) const; /** Merges the given attributes. If @a compareWith @@ -1632,8 +1654,15 @@ public: */ bool operator != (const wxRichTextFontTable& table) const { return !(*this == table); } + /** + Set the font scale factor. + */ + void SetFontScale(double fontScale); + protected: + double m_fontScale; + DECLARE_DYNAMIC_CLASS(wxRichTextFontTable) }; @@ -3422,7 +3451,7 @@ public: Update the field; delegated to the associated field type. This would typically expand the field to its value, if this is a dynamically changing and/or composite field. */ - virtual bool UpdateField(); + virtual bool UpdateField(wxRichTextBuffer* buffer); virtual wxRichTextObject* Clone() const { return new wxRichTextField(*this); } @@ -3505,7 +3534,7 @@ public: Update the field. This would typically expand the field to its value, if this is a dynamically changing and/or composite field. */ - virtual bool UpdateField(wxRichTextField* WXUNUSED(obj)) { return false; } + virtual bool UpdateField(wxRichTextBuffer* buffer, wxRichTextField* obj) { return false; } /** Returns @true if this object is top-level, i.e. contains its own paragraphs, such as a text box. @@ -4575,6 +4604,31 @@ public: */ void SetFontTable(const wxRichTextFontTable& table) { m_fontTable = table; } + /** + Sets the scale factor for displaying fonts, for example for more comfortable + editing. + */ + void SetFontScale(double fontScale); + + /** + Returns the scale factor for displaying fonts, for example for more comfortable + editing. + */ + double GetFontScale() const { return m_fontScale; } + + /** + Sets the scale factor for displaying certain dimensions such as indentation and + inter-paragraph spacing. This can be useful when editing in a small control + where you still want legible text, but a minimum of wasted white space. + */ + void SetDimensionScale(double dimScale); + + /** + Returns the scale factor for displaying certain dimensions such as indentation + and inter-paragraph spacing. + */ + double GetDimensionScale() const { return m_dimensionScale; } + // Operations /** @@ -6202,10 +6256,6 @@ inline bool wxRichTextHasStyle(int flags, int style) WXDLLIMPEXP_RICHTEXT bool wxTextAttrEq(const wxRichTextAttr& attr1, const wxRichTextAttr& attr2); WXDLLIMPEXP_RICHTEXT bool wxTextAttrEq(const wxRichTextAttr& attr1, const wxRichTextAttr& attr2); -/// Compare two attribute objects, but take into account the flags -/// specifying attributes of interest. -WXDLLIMPEXP_RICHTEXT bool wxTextAttrEqPartial(const wxRichTextAttr& attr1, const wxRichTextAttr& attr2); - /// Apply one style to another WXDLLIMPEXP_RICHTEXT bool wxRichTextApplyStyle(wxRichTextAttr& destStyle, const wxRichTextAttr& style, wxRichTextAttr* compareWith = NULL);