- Added wxAcceleratorEntry::ToRawString() (Armel Asselin).
- Added wxDataViewEvent::SetDragFlags() and GetDropEffect() (Friedrich).
- Added support for fields and virtual attributes to wxRichTextCtrl.
+- Added custom text and dimension scaling to wxRichTextCtrl.
+- Added pixel font size capability to wxTextAttr and wxRichTextCtrl.
GTK:
// A special flag telling the buffer to keep the first paragraph style
// as-is, when deleting a paragraph marker. In future we might pass a
// flag to InsertFragment and DeleteRange to indicate the appropriate mode.
-#define wxTEXT_ATTR_KEEP_FIRST_PARA_STYLE 0x10000000
+#define wxTEXT_ATTR_KEEP_FIRST_PARA_STYLE 0x20000000
/**
Default superscript/subscript font multiplication factor.
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.
*/
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 to 'this', but not if the same as @a compareWith.
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 to this object, but not if the same as @a compareWith.
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.
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.
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
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
*/
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)
};
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); }
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* WXUNUSED(buffer), wxRichTextField* WXUNUSED(obj)) { return false; }
/**
Returns @true if this object is top-level, i.e. contains its own paragraphs, such as a text box.
*/
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
/**
/// Scaling factor in use: needed to calculate correct dimensions when printing
double m_scale;
+
+ /// Font scale for adjusting the text size when editing
+ double m_fontScale;
+
+ /// Dimension scale for reducing redundant whitespace when editing
+ double m_dimensionScale;
};
/**
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);
*/
virtual bool GetVerticalScrollbarEnabled() const { return m_verticalScrollbarEnabled; }
+ /**
+ Sets the scale factor for displaying fonts, for example for more comfortable
+ editing.
+ */
+ void SetFontScale(double fontScale, bool refresh = false);
+
+ /**
+ Returns the scale factor for displaying fonts, for example for more comfortable
+ editing.
+ */
+ double GetFontScale() const { return GetBuffer().GetFontScale(); }
+
+ /**
+ 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, bool refresh = false);
+
+ /**
+ Returns the scale factor for displaying certain dimensions such as indentation
+ and inter-paragraph spacing.
+ */
+ double GetDimensionScale() const { return GetBuffer().GetDimensionScale(); }
+
// Command handlers
/**
#include "wx/richtext/richtextdialogpage.h"
////@begin includes
+#include "wx/spinbutt.h"
////@end includes
/*!
*/
////@begin forward declarations
+class wxSpinButton;
+class wxBoxSizer;
class wxRichTextFontListBox;
class wxRichTextColourSwatchCtrl;
class wxRichTextFontPreviewCtrl;
////@begin wxRichTextFontPage event handler declarations
+ /// wxEVT_IDLE event handler for ID_RICHTEXTFONTPAGE
+ void OnIdle( wxIdleEvent& event );
+
/// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL
void OnFaceTextCtrlUpdated( wxCommandEvent& event );
/// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
void OnSizeTextCtrlUpdated( wxCommandEvent& event );
+ /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS
+ void OnRichtextfontpageSpinbuttonsUp( wxSpinEvent& event );
+
+ /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS
+ void OnRichtextfontpageSpinbuttonsDown( wxSpinEvent& event );
+
+ /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZE_UNITS
+ void OnRichtextfontpageSizeUnitsSelected( wxCommandEvent& event );
+
/// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX
void OnSizeListBoxSelected( wxCommandEvent& event );
////@begin wxRichTextFontPage member variables
wxTextCtrl* m_faceTextCtrl;
- wxRichTextFontListBox* m_faceListBox;
wxTextCtrl* m_sizeTextCtrl;
+ wxSpinButton* m_fontSizeSpinButtons;
+ wxChoice* m_sizeUnitsCtrl;
+ wxBoxSizer* m_fontListBoxParent;
+ wxRichTextFontListBox* m_faceListBox;
wxListBox* m_sizeListBox;
wxComboBox* m_styleCtrl;
wxComboBox* m_weightCtrl;
enum {
ID_RICHTEXTFONTPAGE = 10000,
ID_RICHTEXTFONTPAGE_FACETEXTCTRL = 10001,
- ID_RICHTEXTFONTPAGE_FACELISTBOX = 10002,
ID_RICHTEXTFONTPAGE_SIZETEXTCTRL = 10005,
+ ID_RICHTEXTFONTPAGE_SPINBUTTONS = 10018,
+ ID_RICHTEXTFONTPAGE_SIZE_UNITS = 10017,
+ ID_RICHTEXTFONTPAGE_FACELISTBOX = 10002,
ID_RICHTEXTFONTPAGE_SIZELISTBOX = 10006,
ID_RICHTEXTFONTPAGE_STYLECTRL = 10007,
ID_RICHTEXTFONTPAGE_WEIGHTCTRL = 10004,
DECLARE_HELP_PROVISION()
public:
+ enum { Option_AllowPixelFontSize = 0x0001 };
+
wxRichTextFormattingDialog() { Init(); }
wxRichTextFormattingDialog(long flags, wxWindow* parent, const wxString& title = wxGetTranslation(wxT("Formatting")), wxWindowID id = wxID_ANY,
/// Apply attributes to the given range
virtual bool ApplyStyle(wxRichTextCtrl* ctrl, const wxRichTextRange& range, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE);
-
+
/// Apply attributes to the object being edited, if any
virtual bool ApplyStyle(wxRichTextCtrl* ctrl, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO);
const wxRichTextAttr& GetAttributes() const { return m_attributes; }
wxRichTextAttr& GetAttributes() { return m_attributes; }
void SetAttributes(const wxRichTextAttr& attr) { m_attributes = attr; }
-#if 0
- /// Gets and sets the attributes that the user wants to reset
- const wxRichTextAttr& GetResetAttributes() const { return m_resetAttributes; }
- wxRichTextAttr& GetResetAttributes() { return m_resetAttributes; }
- void SetResetAttributes(const wxRichTextAttr& attr) { m_resetAttributes = attr; }
-#endif
+
+ /// Sets the dialog options, determining what the interface presents to the user.
+ /// Currently the only option is Option_AllowPixelFontSize.
+ void SetOptions(int options) { m_options = options; }
+
+ /// Gets the dialog options, determining what the interface presents to the user.
+ /// Currently the only option is Option_AllowPixelFontSize.
+ int GetOptions() const { return m_options; }
+
+ /// Returns @true if the given option is present.
+ bool HasOption(int option) const { return (m_options & option) != 0; }
+
/// If editing the attributes for a particular object, such as an image,
/// set the object so the code can initialize attributes such as size correctly.
wxRichTextObject* GetObject() const { return m_object; }
/// Get the dimension from the value and units controls
static void GetDimensionValue(wxTextAttrDimension& dim, wxTextCtrl* valueCtrl, wxComboBox* unitsCtrl, wxCheckBox* checkBox);
-
+
/// Convert CM to MM
static bool ConvertFromString(const wxString& string, int& ret, int scale);
/// Map book control page index to our page id
void AddPageId(int id) { m_pageIds.Add(id); }
-
+
/// Find a page by class
wxWindow* FindPage(wxClassInfo* info) const;
protected:
wxRichTextAttr m_attributes;
- //wxRichTextAttr m_resetAttributes;
wxRichTextStyleDefinition* m_styleDefinition;
wxRichTextStyleSheet* m_styleSheet;
wxRichTextObject* m_object;
wxArrayInt m_pageIds; // mapping of book control indexes to page ids
+ int m_options; // UI options
static wxRichTextFormattingDialogFactory* ms_FormattingDialogFactory;
static bool sm_showToolTips;
virtual wxRichTextAttr GetStyleMergedWithBase(const wxRichTextStyleSheet* sheet) const;
/**
- Sets the definition's properties.
+ Returns the definition's properties.
*/
wxRichTextProperties& GetProperties() { return m_properties; }
const wxRichTextProperties& GetProperties() const { return m_properties; }
/**
- Returns the definition's properties.
+ Sets the definition's properties.
*/
void SetProperties(const wxRichTextProperties& props) { m_properties = props; }
const wxString& GetDescription() const { return m_description; }
/**
- Sets the definition's properties.
+ Returns the sheet's properties.
*/
wxRichTextProperties& GetProperties() { return m_properties; }
/**
- Returns the definition's properties.
+ Returns the sheet's properties.
*/
const wxRichTextProperties& GetProperties() const { return m_properties; }
/**
- Returns the definition's properties.
+ Sets the sheet's properties.
*/
void SetProperties(const wxRichTextProperties& props) { m_properties = props; }
wxTEXT_ATTR_BACKGROUND_COLOUR = 0x00000002,
wxTEXT_ATTR_FONT_FACE = 0x00000004,
- wxTEXT_ATTR_FONT_SIZE = 0x00000008,
+ wxTEXT_ATTR_FONT_POINT_SIZE = 0x00000008,
+ wxTEXT_ATTR_FONT_PIXEL_SIZE = 0x10000000,
wxTEXT_ATTR_FONT_WEIGHT = 0x00000010,
wxTEXT_ATTR_FONT_ITALIC = 0x00000020,
wxTEXT_ATTR_FONT_UNDERLINE = 0x00000040,
wxTEXT_ATTR_FONT_STRIKETHROUGH = 0x08000000,
wxTEXT_ATTR_FONT_ENCODING = 0x02000000,
wxTEXT_ATTR_FONT_FAMILY = 0x04000000,
+ wxTEXT_ATTR_FONT_SIZE = \
+ ( wxTEXT_ATTR_FONT_POINT_SIZE | wxTEXT_ATTR_FONT_PIXEL_SIZE ),
wxTEXT_ATTR_FONT = \
( wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT | \
wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE | wxTEXT_ATTR_FONT_STRIKETHROUGH | wxTEXT_ATTR_FONT_ENCODING | wxTEXT_ATTR_FONT_FAMILY ),
// Equality test
bool operator== (const wxTextAttr& attr) const;
- // Partial equality test
- bool EqPartial(const wxTextAttr& attr) const;
+ // 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 wxTextAttr& attr, bool weakTest = true) const;
// Get attributes from font.
bool GetFontAttributes(const wxFont& font, int flags = wxTEXT_ATTR_FONT);
void SetLeftIndent(int indent, int subIndent = 0) { m_leftIndent = indent; m_leftSubIndent = subIndent; m_flags |= wxTEXT_ATTR_LEFT_INDENT; }
void SetRightIndent(int indent) { m_rightIndent = indent; m_flags |= wxTEXT_ATTR_RIGHT_INDENT; }
- void SetFontSize(int pointSize) { m_fontSize = pointSize; m_flags |= wxTEXT_ATTR_FONT_SIZE; }
+ void SetFontSize(int pointSize) { m_fontSize = pointSize; m_flags &= ~wxTEXT_ATTR_FONT_SIZE; m_flags |= wxTEXT_ATTR_FONT_POINT_SIZE; }
+ void SetFontPointSize(int pointSize) { m_fontSize = pointSize; m_flags &= ~wxTEXT_ATTR_FONT_SIZE; m_flags |= wxTEXT_ATTR_FONT_POINT_SIZE; }
+ void SetFontPixelSize(int pixelSize) { m_fontSize = pixelSize; m_flags &= ~wxTEXT_ATTR_FONT_SIZE; m_flags |= wxTEXT_ATTR_FONT_PIXEL_SIZE; }
void SetFontStyle(wxFontStyle fontStyle) { m_fontStyle = fontStyle; m_flags |= wxTEXT_ATTR_FONT_ITALIC; }
void SetFontWeight(wxFontWeight fontWeight) { m_fontWeight = fontWeight; m_flags |= wxTEXT_ATTR_FONT_WEIGHT; }
void SetFontFaceName(const wxString& faceName) { m_fontFaceName = faceName; m_flags |= wxTEXT_ATTR_FONT_FACE; }
void SetFontFamily(wxFontFamily family) { m_fontFamily = family; m_flags |= wxTEXT_ATTR_FONT_FAMILY; }
// Set font
- void SetFont(const wxFont& font, int flags = wxTEXT_ATTR_FONT) { GetFontAttributes(font, flags); }
+ void SetFont(const wxFont& font, int flags = (wxTEXT_ATTR_FONT & ~wxTEXT_ATTR_FONT_PIXEL_SIZE)) { GetFontAttributes(font, flags); }
void SetFlags(long flags) { m_flags = flags; }
bool HasRightIndent() const { return HasFlag(wxTEXT_ATTR_RIGHT_INDENT); }
bool HasFontWeight() const { return HasFlag(wxTEXT_ATTR_FONT_WEIGHT); }
bool HasFontSize() const { return HasFlag(wxTEXT_ATTR_FONT_SIZE); }
+ bool HasFontPointSize() const { return HasFlag(wxTEXT_ATTR_FONT_POINT_SIZE); }
+ bool HasFontPixelSize() const { return HasFlag(wxTEXT_ATTR_FONT_PIXEL_SIZE); }
bool HasFontItalic() const { return HasFlag(wxTEXT_ATTR_FONT_ITALIC); }
bool HasFontUnderlined() const { return HasFlag(wxTEXT_ATTR_FONT_UNDERLINE); }
bool HasFontStrikethrough() const { return HasFlag(wxTEXT_ATTR_FONT_STRIKETHROUGH); }
// 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 wxTextAttr& style, const wxTextAttr* compareWith = NULL);
-
+
// merges the attributes of the base and the overlay objects and returns
// the result; the parameter attributes take precedence
//
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.
*/
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 to 'this', but not if the same as @a compareWith.
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 to this object, but not if the same as @a compareWith.
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.
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.
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
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
*/
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)
};
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); }
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.
*/
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
/**
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);
*/
virtual bool GetVerticalScrollbarEnabled() const;
+ /**
+ Sets the scale factor for displaying fonts, for example for more comfortable
+ editing.
+ */
+ void SetFontScale(double fontScale, bool refresh = false);
+
+ /**
+ Returns the scale factor for displaying fonts, for example for more comfortable
+ editing.
+ */
+ double GetFontScale() const { return GetBuffer().GetFontScale(); }
+
+ /**
+ 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, bool refresh = false);
+
+ /**
+ Returns the scale factor for displaying certain dimensions such as indentation
+ and inter-paragraph spacing.
+ */
+ double GetDimensionScale() const { return GetBuffer().GetDimensionScale(); }
+
// Command handlers
/**
class wxRichTextFormattingDialog : public wxPropertySheetDialog
{
public:
+ enum { Option_AllowPixelFontSize = 0x0001 };
+
/**
Default ctor.
*/
*/
void SetAttributes(const wxTextAttr& attr);
+ /**
+ Sets the dialog options, determining what the interface presents to the user.
+ Currently the only option is Option_AllowPixelFontSize.
+ */
+ void SetOptions(int options) { m_options = options; }
+
+ /**
+ Gets the dialog options, determining what the interface presents to the user.
+ Currently the only option is Option_AllowPixelFontSize.
+ */
+ int GetOptions() const { return m_options; }
+
+ /**
+ Returns @true if the given option is present.
+ */
+ bool HasOption(int option) const { return (m_options & option) != 0; }
+
/**
Sets the formatting factory object to be used for customization and page
creation.
wxTEXT_ATTR_BACKGROUND_COLOUR = 0x00000002,
wxTEXT_ATTR_FONT_FACE = 0x00000004,
- wxTEXT_ATTR_FONT_SIZE = 0x00000008,
+ wxTEXT_ATTR_FONT_POINT_SIZE = 0x00000008,
+ wxTEXT_ATTR_FONT_PIXEL_SIZE = 0x10000000,
wxTEXT_ATTR_FONT_WEIGHT = 0x00000010,
wxTEXT_ATTR_FONT_ITALIC = 0x00000020,
wxTEXT_ATTR_FONT_UNDERLINE = 0x00000040,
+ wxTEXT_ATTR_FONT_STRIKETHROUGH = 0x08000000,
wxTEXT_ATTR_FONT_ENCODING = 0x02000000,
wxTEXT_ATTR_FONT_FAMILY = 0x04000000,
+ wxTEXT_ATTR_FONT_SIZE = \
+ ( wxTEXT_ATTR_FONT_POINT_SIZE | wxTEXT_ATTR_FONT_PIXEL_SIZE ),
/**
Defined as the combination of all @c wxTEXT_ATTR_FONT_* values above.
*/
wxTEXT_ATTR_FONT = \
( wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT | \
- wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE | wxTEXT_ATTR_FONT_ENCODING | wxTEXT_ATTR_FONT_FAMILY ),
+ wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE | wxTEXT_ATTR_FONT_STRIKETHROUGH | wxTEXT_ATTR_FONT_ENCODING | wxTEXT_ATTR_FONT_FAMILY ),
wxTEXT_ATTR_ALIGNMENT = 0x00000080,
wxTEXT_ATTR_LEFT_INDENT = 0x00000100,
const wxTextAttr& overlay);
+ /**
+ 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 wxTextAttrEx& attr, bool weakTest = true) const;
+
/**
@name GetXXX functions
*/
bool HasFontItalic() const;
/**
- Returns @true if the attribute object specifies a font point size.
+ Returns @true if the attribute object specifies a font point or pixel size.
*/
bool HasFontSize() const;
+ /**
+ Returns @true if the attribute object specifies a font point size.
+ */
+ bool HasFontPointSize() const;
+
+ /**
+ Returns @true if the attribute object specifies a font pixel size.
+ */
+ bool HasFontPixelSize() const;
+
/**
Returns @true if the attribute object specifies either underlining or no
underlining.
Sets the attributes for the given font.
Note that wxTextAttr does not store an actual wxFont object.
*/
- void SetFont(const wxFont& font, int flags = wxTEXT_ATTR_FONT);
+ void SetFont(const wxFont& font, int flags = (wxTEXT_ATTR_FONT & ~wxTEXT_ATTR_FONT_PIXEL_SIZE));
/**
Sets the font encoding.
*/
void SetFontSize(int pointSize);
+ /**
+ Sets the font size in points.
+ */
+ void SetFontPointSize(int pointSize);
+
+ /**
+ Sets the font size in pixels.
+ */
+ void SetFontPixelSize(int pixelSize);
+
/**
Sets the font style (normal, italic or slanted).
*/
#include "wx/richtext/richtextprint.h"
#include "wx/richtext/richtextimagedlg.h"
+// A custom field type
+class wxRichTextFieldTypePropertiesTest: public wxRichTextFieldTypeStandard
+{
+public:
+ wxRichTextFieldTypePropertiesTest(const wxString& name, const wxString& label, int displayStyle = wxRICHTEXT_FIELD_STYLE_RECTANGLE):
+ wxRichTextFieldTypeStandard(name, label, displayStyle)
+ {
+ }
+ wxRichTextFieldTypePropertiesTest(const wxString& name, const wxBitmap& bitmap, int displayStyle = wxRICHTEXT_FIELD_STYLE_RECTANGLE):
+ wxRichTextFieldTypeStandard(name, bitmap, displayStyle)
+ {
+ }
+
+ virtual bool CanEditProperties(wxRichTextField* WXUNUSED(obj)) const { return true; }
+ virtual bool EditProperties(wxRichTextField* WXUNUSED(obj), wxWindow* WXUNUSED(parent), wxRichTextBuffer* WXUNUSED(buffer))
+ {
+ wxString label = GetLabel();
+ wxMessageBox(wxString::Format(wxT("Editing %s"), label.c_str()));
+ return true;
+ }
+
+ virtual wxString GetPropertiesMenuLabel(wxRichTextField* WXUNUSED(obj)) const
+ {
+ return GetLabel();
+ }
+};
+
+// A custom composite field type
+class wxRichTextFieldTypeCompositeTest: public wxRichTextFieldTypePropertiesTest
+{
+public:
+ wxRichTextFieldTypeCompositeTest(const wxString& name, const wxString& label):
+ wxRichTextFieldTypePropertiesTest(name, label, wxRICHTEXT_FIELD_STYLE_COMPOSITE)
+ {
+ }
+
+ virtual bool UpdateField(wxRichTextBuffer* buffer, wxRichTextField* obj)
+ {
+ if (buffer)
+ {
+ wxRichTextAttr attr(buffer->GetAttributes());
+ attr.GetTextBoxAttr().Reset();
+ attr.SetParagraphSpacingAfter(0);
+ attr.SetLineSpacing(10);
+ obj->SetAttributes(attr);
+ }
+ obj->GetChildren().Clear();
+ wxRichTextParagraph* para = new wxRichTextParagraph;
+ wxRichTextPlainText* text = new wxRichTextPlainText(GetLabel());
+ para->AppendChild(text);
+ obj->AppendChild(para);
+ return true;
+ }
+};
+
// ----------------------------------------------------------------------------
// resources
// ----------------------------------------------------------------------------
void OnPageSetup(wxCommandEvent& event);
void OnInsertImage(wxCommandEvent& event);
+
+ void OnSetFontScale(wxCommandEvent& event);
+ void OnSetDimensionScale(wxCommandEvent& event);
protected:
// Forward command events to the current rich text control, if any
ID_FORMAT_DEMOTE_LIST,
ID_FORMAT_CLEAR_LIST,
+ ID_SET_FONT_SCALE,
+ ID_SET_DIMENSION_SCALE,
+
ID_VIEW_HTML,
ID_SWITCH_STYLE_SHEETS,
ID_MANAGE_STYLES,
EVT_TEXT_URL(wxID_ANY, MyFrame::OnURL)
EVT_RICHTEXT_STYLESHEET_REPLACING(wxID_ANY, MyFrame::OnStyleSheetReplacing)
+
+ EVT_MENU(ID_SET_FONT_SCALE, MyFrame::OnSetFontScale)
+ EVT_MENU(ID_SET_DIMENSION_SCALE, MyFrame::OnSetDimensionScale)
END_EVENT_TABLE()
// Create a new application object: this macro will allow wxWidgets to create
wxRichTextBuffer::AddHandler(new wxRichTextXMLHandler);
wxRichTextBuffer::AddHandler(new wxRichTextHTMLHandler);
+ // Add field types
+
+ wxRichTextBuffer::AddFieldType(new wxRichTextFieldTypePropertiesTest(wxT("rectangle"), wxT("RECTANGLE"), wxRichTextFieldTypeStandard::wxRICHTEXT_FIELD_STYLE_RECTANGLE));
+
+ wxRichTextFieldTypeStandard* s1 = new wxRichTextFieldTypeStandard(wxT("begin-section"), wxT("SECTION"), wxRichTextFieldTypeStandard::wxRICHTEXT_FIELD_STYLE_START_TAG);
+ s1->SetBackgroundColour(*wxBLUE);
+
+ wxRichTextFieldTypeStandard* s2 = new wxRichTextFieldTypeStandard(wxT("end-section"), wxT("SECTION"), wxRichTextFieldTypeStandard::wxRICHTEXT_FIELD_STYLE_END_TAG);
+ s2->SetBackgroundColour(*wxBLUE);
+
+ wxRichTextFieldTypeStandard* s3 = new wxRichTextFieldTypeStandard(wxT("bitmap"), wxBitmap(paste_xpm), wxRichTextFieldTypeStandard::wxRICHTEXT_FIELD_STYLE_NO_BORDER);
+
+ wxRichTextBuffer::AddFieldType(s1);
+ wxRichTextBuffer::AddFieldType(s2);
+ wxRichTextBuffer::AddFieldType(s3);
+
+ wxRichTextFieldTypeCompositeTest* s4 = new wxRichTextFieldTypeCompositeTest(wxT("composite"), wxT("This is a field value"));
+ wxRichTextBuffer::AddFieldType(s4);
+
// Add image handlers
#if wxUSE_LIBPNG
wxImage::AddHandler( new wxPNGHandler );
editMenu->AppendSeparator();
editMenu->Append(wxID_SELECTALL, _("Select A&ll\tCtrl+A"));
-#if 0
editMenu->AppendSeparator();
- editMenu->Append(wxID_FIND, _("&Find...\tCtrl+F"));
- editMenu->Append(stID_FIND_REPLACE, _("&Replace...\tCtrl+R"));
-#endif
+ editMenu->Append(ID_SET_FONT_SCALE, _("Set &Text Scale..."));
+ editMenu->Append(ID_SET_DIMENSION_SCALE, _("Set &Dimension Scale..."));
wxMenu* formatMenu = new wxMenu;
formatMenu->AppendCheckItem(ID_FORMAT_BOLD, _("&Bold\tCtrl+B"));
wxFont italicFont = wxFont(12, wxROMAN, wxITALIC, wxNORMAL);
m_richTextCtrl = new MyRichTextCtrl(splitter, ID_RICHTEXT_CTRL, wxEmptyString, wxDefaultPosition, wxSize(200, 200), wxVSCROLL|wxHSCROLL|wxWANTS_CHARS);
+ wxASSERT(!m_richTextCtrl->GetBuffer().GetAttributes().HasFontPixelSize());
+
wxFont font(12, wxROMAN, wxNORMAL, wxNORMAL);
m_richTextCtrl->SetFont(font);
+ wxASSERT(!m_richTextCtrl->GetBuffer().GetAttributes().HasFontPixelSize());
+
m_richTextCtrl->SetMargins(10, 10);
m_richTextCtrl->SetStyleSheet(wxGetApp().GetStyleSheet());
r.EndAlignment();
+#if 0
+ r.BeginAlignment(wxTEXT_ALIGNMENT_CENTRE);
+ r.WriteText(wxString(wxT("This is a simple test for a floating left image test. The zebra image should be placed at the left side of the current buffer and all the text should flow around it at the right side. This is a simple test for a floating left image test. The zebra image should be placed at the left side of the current buffer and all the text should flow around it at the right side. This is a simple test for a floating left image test. The zebra image should be placed at the left side of the current buffer and all the text should flow around it at the right side.")));
+ r.Newline();
+ r.EndAlignment();
+#endif
+
r.BeginAlignment(wxTEXT_ALIGNMENT_LEFT);
wxRichTextAttr imageAttr;
imageAttr.GetTextBoxAttr().SetFloatMode(wxTEXT_BOX_ATTR_FLOAT_LEFT);
r.WriteText(wxT("Note: this sample content was generated programmatically from within the MyFrame constructor in the demo. The images were loaded from inline XPMs. Enjoy wxRichTextCtrl!\n"));
r.EndParagraphSpacing();
-#if 1
+#if 1
{
// Add a text box
}
#endif
+ r.Newline();
+
+ wxRichTextProperties properties;
+ r.WriteText(wxT("This is a rectangle field: "));
+ r.WriteField(wxT("rectangle"), properties);
+ r.WriteText(wxT(" and a begin section field: "));
+ r.WriteField(wxT("begin-section"), properties);
+ r.WriteText(wxT("This is text between the two tags."));
+ r.WriteField(wxT("end-section"), properties);
+ r.WriteText(wxT(" Now a bitmap. "));
+ r.WriteField(wxT("bitmap"), properties);
+ r.WriteText(wxT(" Before we go, here's a composite field: ***"));
+ wxRichTextField* field = r.WriteField(wxT("composite"), properties);
+ field->UpdateField(& r.GetBuffer()); // Creates the composite value (sort of a text box)
+ r.WriteText(wxT("*** End of composite field."));
+
+ r.Newline();
r.EndSuppressUndo();
// Add some locked content first - needs Undo to be enabled
int pages = wxRICHTEXT_FORMAT_FONT;
wxRichTextFormattingDialog formatDlg(pages, this);
+ formatDlg.SetOptions(wxRichTextFormattingDialog::Option_AllowPixelFontSize);
formatDlg.GetStyle(m_richTextCtrl, range);
if (formatDlg.ShowModal() == wxID_OK)
{
formatDlg.ApplyStyle(m_richTextCtrl, range, wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE|wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY);
}
-
- // Old method using wxFontDialog
-#if 0
- if (!m_richTextCtrl->HasSelection())
- return;
-
- wxRichTextRange range = m_richTextCtrl->GetSelectionRange();
- wxFontData fontData;
-
- wxRichTextAttr attr;
- attr.SetFlags(wxTEXT_ATTR_FONT);
-
- if (m_richTextCtrl->GetStyle(m_richTextCtrl->GetInsertionPoint(), attr))
- fontData.SetInitialFont(attr.GetFont());
-
- wxFontDialog dialog(this, fontData);
- if (dialog.ShowModal() == wxID_OK)
- {
- fontData = dialog.GetFontData();
- attr.SetFlags(wxTEXT_ATTR_FONT);
- attr.SetFont(fontData.GetChosenFont());
- if (attr.GetFont().IsOk())
- {
- m_richTextCtrl->SetStyle(range, attr);
- }
- }
-#endif
}
void MyFrame::OnImage(wxCommandEvent& WXUNUSED(event))
// wxGetApp().GetPrinting()->PageSetup();
}
+void MyFrame::OnSetFontScale(wxCommandEvent& WXUNUSED(event))
+{
+ wxString value = wxString::Format(wxT("%g"), m_richTextCtrl->GetFontScale());
+ wxString text = wxGetTextFromUser(wxT("Enter a text scale factor:"), wxT("Text Scale Factor"), value, wxGetTopLevelParent(this));
+ if (!text.IsEmpty() && value != text)
+ {
+ double scale = 1.0;
+ wxSscanf(text, wxT("%lf"), & scale);
+ m_richTextCtrl->SetFontScale(scale, true);
+ }
+}
+
+void MyFrame::OnSetDimensionScale(wxCommandEvent& WXUNUSED(event))
+{
+ wxString value = wxString::Format(wxT("%g"), m_richTextCtrl->GetDimensionScale());
+ wxString text = wxGetTextFromUser(wxT("Enter a dimension scale factor:"), wxT("Dimension Scale Factor"), value, wxGetTopLevelParent(this));
+ if (!text.IsEmpty() && value != text)
+ {
+ double scale = 1.0;
+ wxSscanf(text, wxT("%lf"), & scale);
+ m_richTextCtrl->SetDimensionScale(scale, true);
+ }
+}
+
void MyRichTextCtrl::PrepareContent(wxRichTextParagraphLayoutBox& container)
{
if (IsLocked())
}
// Partial equality test. Only returns false if an attribute doesn't match.
-bool wxTextAttr::EqPartial(const wxTextAttr& attr) const
+bool wxTextAttr::EqPartial(const wxTextAttr& attr, bool weakTest) const
{
int flags = attr.GetFlags();
-
- if ((flags & wxTEXT_ATTR_TEXT_COLOUR) && GetTextColour() != attr.GetTextColour())
+
+ if (!weakTest &&
+ ((!HasTextColour() && attr.HasTextColour()) ||
+ (!HasBackgroundColour() && attr.HasBackgroundColour()) ||
+ (!HasFontFaceName() && attr.HasFontFaceName()) ||
+ (!HasFontSize() && attr.HasFontSize()) ||
+ (!HasFontWeight() && attr.HasFontWeight()) ||
+ (!HasFontItalic() && attr.HasFontItalic()) ||
+ (!HasFontUnderlined() && attr.HasFontUnderlined()) ||
+ (!HasFontStrikethrough() && attr.HasFontStrikethrough()) ||
+ (!HasFontEncoding() && attr.HasFontEncoding()) ||
+ (!HasFontFamily() && attr.HasFontFamily()) ||
+ (!HasURL() && attr.HasURL()) ||
+ (!HasAlignment() && attr.HasAlignment()) ||
+ (!HasLeftIndent() && attr.HasLeftIndent()) ||
+ (!HasParagraphSpacingAfter() && attr.HasParagraphSpacingAfter()) ||
+ (!HasParagraphSpacingBefore() && attr.HasParagraphSpacingBefore()) ||
+ (!HasLineSpacing() && attr.HasLineSpacing()) ||
+ (!HasCharacterStyleName() && attr.HasCharacterStyleName()) ||
+ (!HasParagraphStyleName() && attr.HasParagraphStyleName()) ||
+ (!HasListStyleName() && attr.HasListStyleName()) ||
+ (!HasBulletStyle() && attr.HasBulletStyle()) ||
+ (!HasBulletNumber() && attr.HasBulletNumber()) ||
+ (!HasBulletText() && attr.HasBulletText()) ||
+ (!HasBulletName() && attr.HasBulletName()) ||
+ (!HasTabs() && attr.HasTabs()) ||
+ (!HasTextEffects() && attr.HasTextEffects()) ||
+ (!HasOutlineLevel() && attr.HasOutlineLevel())))
+ {
+ return false;
+ }
+
+ if (HasTextColour() && attr.HasTextColour() && GetTextColour() != attr.GetTextColour())
+ return false;
+
+ if (HasBackgroundColour() && attr.HasBackgroundColour() && GetBackgroundColour() != attr.GetBackgroundColour())
+ return false;
+
+ if (HasFontFaceName() && attr.HasFontFaceName() && GetFontFaceName() != attr.GetFontFaceName())
return false;
- if ((flags & wxTEXT_ATTR_BACKGROUND_COLOUR) && GetBackgroundColour() != attr.GetBackgroundColour())
+ // This checks whether the two objects have the same font size dimension (px versus pt)
+ if (HasFontSize() && attr.HasFontSize() && (flags & wxTEXT_ATTR_FONT) != (GetFlags() & wxTEXT_ATTR_FONT))
return false;
- if ((flags & wxTEXT_ATTR_FONT_FACE) &&
- GetFontFaceName() != attr.GetFontFaceName())
+ if (HasFontPointSize() && attr.HasFontPointSize() && GetFontSize() != attr.GetFontSize())
return false;
- if ((flags & wxTEXT_ATTR_FONT_SIZE) &&
- GetFontSize() != attr.GetFontSize())
+ if (HasFontPixelSize() && attr.HasFontPixelSize() && GetFontSize() != attr.GetFontSize())
return false;
- if ((flags & wxTEXT_ATTR_FONT_WEIGHT) &&
- GetFontWeight() != attr.GetFontWeight())
+ if (HasFontWeight() && attr.HasFontWeight() && GetFontWeight() != attr.GetFontWeight())
return false;
- if ((flags & wxTEXT_ATTR_FONT_ITALIC) &&
- GetFontStyle() != attr.GetFontStyle())
+ if (HasFontItalic() && attr.HasFontItalic() && GetFontStyle() != attr.GetFontStyle())
return false;
- if ((flags & wxTEXT_ATTR_FONT_UNDERLINE) &&
- GetFontUnderlined() != attr.GetFontUnderlined())
+ if (HasFontUnderlined() && attr.HasFontUnderlined() && GetFontUnderlined() != attr.GetFontUnderlined())
return false;
- if ((flags & wxTEXT_ATTR_FONT_ENCODING) &&
- GetFontEncoding() != attr.GetFontEncoding())
+ if (HasFontStrikethrough() && attr.HasFontStrikethrough() && GetFontStrikethrough() != attr.GetFontStrikethrough())
return false;
- if ((flags & wxTEXT_ATTR_FONT_FAMILY) &&
- GetFontFamily() != attr.GetFontFamily())
+ if (HasFontEncoding() && attr.HasFontEncoding() && GetFontEncoding() != attr.GetFontEncoding())
return false;
- if ((flags & wxTEXT_ATTR_URL) && GetURL() != attr.GetURL())
+ if (HasFontFamily() && attr.HasFontFamily() && GetFontFamily() != attr.GetFontFamily())
return false;
- if ((flags & wxTEXT_ATTR_ALIGNMENT) && GetAlignment() != attr.GetAlignment())
+ if (HasURL() && attr.HasURL() && GetURL() != attr.GetURL())
return false;
- if ((flags & wxTEXT_ATTR_LEFT_INDENT) &&
+ if (HasAlignment() && attr.HasAlignment() && GetAlignment() != attr.GetAlignment())
+ return false;
+
+ if (HasLeftIndent() && attr.HasLeftIndent() &&
((GetLeftIndent() != attr.GetLeftIndent()) || (GetLeftSubIndent() != attr.GetLeftSubIndent())))
return false;
- if ((flags & wxTEXT_ATTR_RIGHT_INDENT) &&
- (GetRightIndent() != attr.GetRightIndent()))
+ if (HasRightIndent() && attr.HasRightIndent() && (GetRightIndent() != attr.GetRightIndent()))
return false;
- if ((flags & wxTEXT_ATTR_PARA_SPACING_AFTER) &&
+ if (HasParagraphSpacingAfter() && attr.HasParagraphSpacingAfter() &&
(GetParagraphSpacingAfter() != attr.GetParagraphSpacingAfter()))
return false;
- if ((flags & wxTEXT_ATTR_PARA_SPACING_BEFORE) &&
+ if (HasParagraphSpacingBefore() && attr.HasParagraphSpacingBefore() &&
(GetParagraphSpacingBefore() != attr.GetParagraphSpacingBefore()))
return false;
- if ((flags & wxTEXT_ATTR_LINE_SPACING) &&
- (GetLineSpacing() != attr.GetLineSpacing()))
+ if (HasLineSpacing() && attr.HasLineSpacing() && (GetLineSpacing() != attr.GetLineSpacing()))
return false;
- if ((flags & wxTEXT_ATTR_CHARACTER_STYLE_NAME) &&
- (GetCharacterStyleName() != attr.GetCharacterStyleName()))
+ if (HasCharacterStyleName() && attr.HasCharacterStyleName() && (GetCharacterStyleName() != attr.GetCharacterStyleName()))
return false;
- if ((flags & wxTEXT_ATTR_PARAGRAPH_STYLE_NAME) &&
- (GetParagraphStyleName() != attr.GetParagraphStyleName()))
+ if (HasParagraphStyleName() && attr.HasParagraphStyleName() && (GetParagraphStyleName() != attr.GetParagraphStyleName()))
return false;
- if ((flags & wxTEXT_ATTR_LIST_STYLE_NAME) &&
- (GetListStyleName() != attr.GetListStyleName()))
+ if (HasListStyleName() && attr.HasListStyleName() && (GetListStyleName() != attr.GetListStyleName()))
return false;
- if ((flags & wxTEXT_ATTR_BULLET_STYLE) &&
- (GetBulletStyle() != attr.GetBulletStyle()))
+ if (HasBulletStyle() && attr.HasBulletStyle() && (GetBulletStyle() != attr.GetBulletStyle()))
return false;
- if ((flags & wxTEXT_ATTR_BULLET_NUMBER) &&
- (GetBulletNumber() != attr.GetBulletNumber()))
+ if (HasBulletNumber() && attr.HasBulletNumber() && (GetBulletNumber() != attr.GetBulletNumber()))
return false;
- if ((flags & wxTEXT_ATTR_BULLET_TEXT) &&
+ if (HasBulletText() && attr.HasBulletText() &&
(GetBulletText() != attr.GetBulletText()) &&
(GetBulletFont() != attr.GetBulletFont()))
return false;
- if ((flags & wxTEXT_ATTR_BULLET_NAME) &&
- (GetBulletName() != attr.GetBulletName()))
+ if (HasBulletName() && attr.HasBulletName() && (GetBulletName() != attr.GetBulletName()))
return false;
- if ((flags & wxTEXT_ATTR_TABS) &&
- !TabsEq(GetTabs(), attr.GetTabs()))
+ if (HasTabs() && attr.HasTabs() && !TabsEq(GetTabs(), attr.GetTabs()))
return false;
- if ((flags & wxTEXT_ATTR_PAGE_BREAK) &&
- (HasPageBreak() != attr.HasPageBreak()))
+ if ((HasPageBreak() != attr.HasPageBreak()))
return false;
- if (flags & wxTEXT_ATTR_EFFECTS)
+ if (HasTextEffects() && attr.HasTextEffects())
{
- if (HasTextEffects() != attr.HasTextEffects())
- return false;
if (!BitlistsEqPartial(GetTextEffects(), attr.GetTextEffects(), attr.GetTextEffectFlags()))
return false;
}
- if ((flags & wxTEXT_ATTR_OUTLINE_LEVEL) &&
- (GetOutlineLevel() != attr.GetOutlineLevel()))
+ if (HasOutlineLevel() && attr.HasOutlineLevel() && (GetOutlineLevel() != attr.GetOutlineLevel()))
return false;
return true;
if (HasFontSize())
fontSize = GetFontSize();
- int fontStyle = wxNORMAL;
+ wxFontStyle fontStyle = wxFONTSTYLE_NORMAL;
if (HasFontItalic())
fontStyle = GetFontStyle();
- int fontWeight = wxNORMAL;
+ wxFontWeight fontWeight = wxFONTWEIGHT_NORMAL;
if (HasFontWeight())
fontWeight = GetFontWeight();
underlined = GetFontUnderlined();
bool strikethrough = false;
- if ( HasFontStrikethrough() )
+ if (HasFontStrikethrough())
strikethrough = GetFontStrikethrough();
wxString fontFaceName;
if (HasFontFamily())
fontFamily = GetFontFamily();
- wxFont font(fontSize, fontFamily, fontStyle, fontWeight, underlined, fontFaceName, encoding);
- if ( strikethrough )
- font.SetStrikethrough( true );
- return font;
+ if (HasFontPixelSize())
+ {
+ wxFont font(wxSize(0, fontSize), fontFamily, fontStyle, fontWeight, underlined, fontFaceName, encoding);
+ if (strikethrough)
+ font.SetStrikethrough(true);
+ return font;
+ }
+ else
+ {
+ wxFont font(fontSize, fontFamily, fontStyle, fontWeight, underlined, fontFaceName, encoding);
+ if (strikethrough)
+ font.SetStrikethrough(true);
+ return font;
+ }
}
// Get attributes from font.
if (!font.IsOk())
return false;
- if (flags & wxTEXT_ATTR_FONT_SIZE)
+ // If we pass both pixel and point size attributes, this is an indication
+ // to choose the most appropriate units.
+ if ((flags & wxTEXT_ATTR_FONT) == wxTEXT_ATTR_FONT)
+ {
+ if (font.IsUsingSizeInPixels())
+ {
+ m_fontSize = font.GetPixelSize().y;
+ flags &= ~wxTEXT_ATTR_FONT_POINT_SIZE;
+ }
+ else
+ {
+ m_fontSize = font.GetPointSize();
+ flags &= ~wxTEXT_ATTR_FONT_PIXEL_SIZE;
+ }
+ }
+ else if (flags & wxTEXT_ATTR_FONT_POINT_SIZE)
+ {
m_fontSize = font.GetPointSize();
+ flags &= ~wxTEXT_ATTR_FONT_PIXEL_SIZE;
+ }
+ else if (flags & wxTEXT_ATTR_FONT_PIXEL_SIZE)
+ {
+ m_fontSize = font.GetPixelSize().y;
+ }
if (flags & wxTEXT_ATTR_FONT_ITALIC)
m_fontStyle = font.GetStyle();
destStyle.SetFontWeight(style.GetFontWeight());
}
- if (style.HasFontSize())
+ if (style.HasFontPointSize())
+ {
+ if (!(compareWith && compareWith->HasFontPointSize() && compareWith->GetFontSize() == style.GetFontSize()))
+ destStyle.SetFontPointSize(style.GetFontSize());
+ }
+ else if (style.HasFontPixelSize())
{
- if (!(compareWith && compareWith->HasFontSize() && compareWith->GetFontSize() == style.GetFontSize()))
- destStyle.SetFontSize(style.GetFontSize());
+ if (!(compareWith && compareWith->HasFontPixelSize() && compareWith->GetFontSize() == style.GetFontSize()))
+ destStyle.SetFontPixelSize(style.GetFontSize());
}
if (style.HasFontItalic())
#ifndef __WIN32__
wxChar ch = 0;
int keycode = event.GetKeyCode();
-
+
long from, to;
GetSelection(&from,&to);
long insert = GetInsertionPoint();
long last = GetLastPosition();
-
- // catch arrow left and right
-
+
+ // catch arrow left and right
+
switch ( keycode )
{
case WXK_LEFT:
// Helpers for efficiency
inline void wxCheckSetFont(wxDC& dc, const wxFont& font)
{
- // JACS: did I do this some time ago when testing? Should we re-enable it?
-#if 0
- const wxFont& font1 = dc.GetFont();
- if (font1.IsOk() && font.IsOk())
- {
- if (font1.GetPointSize() == font.GetPointSize() &&
- font1.GetFamily() == font.GetFamily() &&
- font1.GetStyle() == font.GetStyle() &&
- font1.GetWeight() == font.GetWeight() &&
- font1.GetUnderlined() == font.GetUnderlined() &&
- font1.GetFamily() == font.GetFamily() &&
- font1.GetFaceName() == font.GetFaceName())
- return;
- }
-#endif
dc.SetFont(font);
}
// Unscale
double scale = 1.0;
if (GetBuffer())
- scale = GetBuffer()->GetScale();
+ scale = GetBuffer()->GetScale() / GetBuffer()->GetDimensionScale();
int p = ConvertTenthsMMToPixels(dc.GetPPI().x, units, scale);
return p;
maxWidth = wxMax(maxWidth, w);
maxMaxWidth = wxMax(maxMaxWidth, w);
}
+ else
+ {
+ // TODO: Make sure the layout box's position reflects
+ // the position of the children, but without
+ // breaking layout of a box within a paragraph.
+ }
// TODO: (also in para layout) should set the
// object's size to an absolute one if specified,
wxRichTextAttr* cStyle = & defaultCharStyle;
wxRichTextParagraph* para = new wxRichTextParagraph(text, this, pStyle, cStyle);
+ para->GetAttributes().GetTextBoxAttr().Reset();
AppendChild(para);
size_t len = text.length();
wxString line;
wxRichTextParagraph* para = new wxRichTextParagraph(wxEmptyString, this, pStyle, cStyle);
+ para->GetAttributes().GetTextBoxAttr().Reset();
AppendChild(para);
plainText->SetText(line);
para = new wxRichTextParagraph(wxEmptyString, this, pStyle, cStyle);
+ para->GetAttributes().GetTextBoxAttr().Reset();
AppendChild(para);
wxRichTextAttr* cStyle = & defaultCharStyle;
wxRichTextParagraph* para = new wxRichTextParagraph(this, pStyle);
+ para->GetAttributes().GetTextBoxAttr().Reset();
AppendChild(para);
para->AppendChild(new wxRichTextImage(image, this, cStyle));
{
// Start with the base style
style = GetAttributes();
+ style.GetTextBoxAttr().Reset();
// Apply the paragraph style
wxRichTextApplyStyle(style, obj->GetAttributes());
foundCount ++;
wxRichTextAttr textAttr = para->GetCombinedAttributes(child->GetAttributes());
- if (wxTextAttrEqPartial(textAttr, style))
+ if (textAttr.EqPartial(style, false /* strong test - attributes must be valid in both objects */))
matchingCount ++;
}
wxRichTextApplyStyle(textAttr, para->GetAttributes());
foundCount ++;
- if (wxTextAttrEqPartial(textAttr, style))
+ if (textAttr.EqPartial(style, false /* strong test */))
matchingCount ++;
}
}
if (child->IsTopLevel())
{
// We can move it to the correct position at this point
- child->Move(GetPosition() + wxPoint(currentWidth, currentPosition.y));
+ // TODO: probably need to add margin
+ child->Move(GetPosition() + wxPoint(currentWidth + (wxMax(leftIndent, leftIndent + leftSubIndent)), currentPosition.y));
}
// Cases:
return;
wxPoint pos = line->GetPosition();
+ wxPoint originalPos = pos;
wxSize size = line->GetSize();
// centering, right-justification
pos.x = pos.x + rect.GetWidth() - size.x - rightIndent;
line->SetPosition(pos);
}
+
+ if (pos != originalPos)
+ {
+ wxPoint inc = pos - originalPos;
+
+ wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst();
+
+ while (node)
+ {
+ wxRichTextObject* child = node->GetData();
+ if (child->IsTopLevel() && !child->GetRange().IsOutside(line->GetAbsoluteRange()))
+ child->Move(child->GetPosition() + inc);
+
+ node = node->GetNext();
+ }
+ }
}
/// Insert text at the given position
{
if ( textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT) )
{
- double size = static_cast<double>(textFont.GetPointSize()) / wxSCRIPT_MUL_FACTOR;
- textFont.SetPointSize( static_cast<int>(size) );
- x = rect.x;
- y = rect.y;
+ if (textFont.IsUsingSizeInPixels())
+ {
+ double size = static_cast<double>(textFont.GetPixelSize().y) / wxSCRIPT_MUL_FACTOR;
+ textFont.SetPixelSize(wxSize(0, static_cast<int>(size)) );
+ x = rect.x;
+ y = rect.y;
+ }
+ else
+ {
+ double size = static_cast<double>(textFont.GetPointSize()) / wxSCRIPT_MUL_FACTOR;
+ textFont.SetPointSize( static_cast<int>(size) );
+ x = rect.x;
+ y = rect.y;
+ }
wxCheckSetFont(dc, textFont);
}
else if ( textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT) )
{
- double size = static_cast<double>(textFont.GetPointSize()) / wxSCRIPT_MUL_FACTOR;
- textFont.SetPointSize( static_cast<int>(size) );
- x = rect.x;
- int sub_height = static_cast<int>( static_cast<double>(charHeight) / wxSCRIPT_MUL_FACTOR);
- y = rect.y + (rect.height - sub_height + (descent - m_descent));
+ if (textFont.IsUsingSizeInPixels())
+ {
+ double size = static_cast<double>(textFont.GetPixelSize().y) / wxSCRIPT_MUL_FACTOR;
+ textFont.SetPixelSize(wxSize(0, static_cast<int>(size)));
+ x = rect.x;
+ int sub_height = static_cast<int>( static_cast<double>(charHeight) / wxSCRIPT_MUL_FACTOR);
+ y = rect.y + (rect.height - sub_height + (descent - m_descent));
+ }
+ else
+ {
+ double size = static_cast<double>(textFont.GetPointSize()) / wxSCRIPT_MUL_FACTOR;
+ textFont.SetPointSize( static_cast<int>(size) );
+ x = rect.x;
+ int sub_height = static_cast<int>( static_cast<double>(charHeight) / wxSCRIPT_MUL_FACTOR);
+ y = rect.y + (rect.height - sub_height + (descent - m_descent));
+ }
wxCheckSetFont(dc, textFont);
}
else
|| (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT) ) )
{
wxFont textFont = font;
- double size = static_cast<double>(textFont.GetPointSize()) / wxSCRIPT_MUL_FACTOR;
- textFont.SetPointSize( static_cast<int>(size) );
+ if (textFont.IsUsingSizeInPixels())
+ {
+ double size = static_cast<double>(textFont.GetPixelSize().y) / wxSCRIPT_MUL_FACTOR;
+ textFont.SetPixelSize(wxSize(0, static_cast<int>(size)));
+ }
+ else
+ {
+ double size = static_cast<double>(textFont.GetPointSize()) / wxSCRIPT_MUL_FACTOR;
+ textFont.SetPointSize(static_cast<int>(size));
+ }
wxCheckSetFont(dc, textFont);
bScript = true;
}
m_suppressUndo = 0;
m_handlerFlags = 0;
m_scale = 1.0;
+ m_dimensionScale = 1.0;
+ m_fontScale = 1.0;
SetMargins(4);
}
m_batchedCommand = NULL;
m_suppressUndo = obj.m_suppressUndo;
m_invalidRange = obj.m_invalidRange;
+ m_dimensionScale = obj.m_dimensionScale;
+ m_fontScale = obj.m_fontScale;
}
/// Push style sheet to top of stack
}
wxRichTextAttr attr(buffer->GetDefaultStyle());
+ // Don't include box attributes such as margins
+ attr.GetTextBoxAttr().Reset();
wxRichTextParagraph* newPara = new wxRichTextParagraph(wxEmptyString, this, & attr);
action->GetNewParagraphs().AppendChild(newPara);
action->SetPosition(pos);
- // Use the default character style
// Use the default character style
if (!buffer->GetDefaultStyle().IsDefault() && newPara->GetChildren().GetFirst())
{
// Check whether the default style merely reflects the paragraph/basic style,
// in which case don't apply it.
wxRichTextAttr defaultStyle(buffer->GetDefaultStyle());
+ defaultStyle.GetTextBoxAttr().Reset();
wxRichTextAttr toApply;
if (para)
{
wxRichTextAttr attr(buffer->GetDefaultStyle());
+ // Don't include box attributes such as margins
+ attr.GetTextBoxAttr().Reset();
+
wxRichTextParagraph* newPara = new wxRichTextParagraph(this, & attr);
if (p)
newPara->SetAttributes(*p);
wxRichTextAttr attr(buffer->GetDefaultStyle());
+ // Don't include box attributes such as margins
+ attr.GetTextBoxAttr().Reset();
+
wxRichTextParagraph* newPara = new wxRichTextParagraph(this, & attr);
if (p)
newPara->SetAttributes(*p);
wxRichTextAttr attr(buffer->GetDefaultStyle());
+ // Don't include box attributes such as margins
+ attr.GetTextBoxAttr().Reset();
+
wxRichTextParagraph* newPara = new wxRichTextParagraph(this, & attr);
if (p)
newPara->SetAttributes(*p);
bool wxRichTextBuffer::BeginStyle(const wxRichTextAttr& style)
{
wxRichTextAttr newStyle(GetDefaultStyle());
+ newStyle.GetTextBoxAttr().Reset();
// Save the old default style
- m_attributeStack.Append((wxObject*) new wxRichTextAttr(GetDefaultStyle()));
+ m_attributeStack.Append((wxObject*) new wxRichTextAttr(newStyle));
wxRichTextApplyStyle(newStyle, style);
newStyle.SetFlags(style.GetFlags()|newStyle.GetFlags());
}
}
+void wxRichTextBuffer::SetFontScale(double fontScale)
+{
+ m_fontScale = fontScale;
+ m_fontTable.SetFontScale(fontScale);
+}
+
+void wxRichTextBuffer::SetDimensionScale(double dimScale)
+{
+ m_dimensionScale = dimScale;
+}
+
bool wxRichTextStdRenderer::DrawStandardBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxRichTextAttr& bulletAttr, const wxRect& rect)
{
if (bulletAttr.GetTextColour().IsOk())
if ((attr.GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_SYMBOL) && !attr.GetBulletFont().IsEmpty() && attr.HasFont())
{
wxRichTextAttr fontAttr;
- fontAttr.SetFontSize(attr.GetFontSize());
+ if (attr.HasFontPixelSize())
+ fontAttr.SetFontPixelSize(attr.GetFontSize());
+ else
+ fontAttr.SetFontPointSize(attr.GetFontSize());
fontAttr.SetFontStyle(attr.GetFontStyle());
fontAttr.SetFontWeight(attr.GetFontWeight());
fontAttr.SetFontUnderlined(attr.GetFontUnderlined());
{
wxRichTextParagraphLayoutBox::Copy(obj);
- UpdateField();
+ UpdateField(GetBuffer());
}
// Edit properties via a GUI
return wxEmptyString;
}
-bool wxRichTextField::UpdateField()
+bool wxRichTextField::UpdateField(wxRichTextBuffer* buffer)
{
wxRichTextFieldType* fieldType = wxRichTextBuffer::FindFieldType(GetFieldType());
if (fieldType)
- return fieldType->UpdateField((wxRichTextField*) this);
+ return fieldType->UpdateField(buffer, (wxRichTextField*) this);
return false;
}
return (attr1 == attr2);
}
-// Partial equality test taking flags into account
-bool wxTextAttrEqPartial(const wxRichTextAttr& attr1, const wxRichTextAttr& attr2)
-{
- return attr1.EqPartial(attr2);
-}
-
/// Compare tabs
bool wxRichTextTabsEq(const wxArrayInt& tabs1, const wxArrayInt& tabs2)
{
public:
wxRichTextFontTableData() {}
- wxFont FindFont(const wxRichTextAttr& fontSpec);
+ wxFont FindFont(const wxRichTextAttr& fontSpec, double fontScale);
wxRichTextFontTableHashMap m_hashMap;
};
-wxFont wxRichTextFontTableData::FindFont(const wxRichTextAttr& fontSpec)
+wxFont wxRichTextFontTableData::FindFont(const wxRichTextAttr& fontSpec, double fontScale)
{
wxString facename(fontSpec.GetFontFaceName());
- wxString spec(wxString::Format(wxT("%d-%d-%d-%d-%s-%d"), fontSpec.GetFontSize(), fontSpec.GetFontStyle(), fontSpec.GetFontWeight(), (int) fontSpec.GetFontUnderlined(), facename.c_str(), (int) fontSpec.GetFontEncoding()));
- wxRichTextFontTableHashMap::iterator entry = m_hashMap.find(spec);
+ int fontSize = fontSpec.GetFontSize();
+ if (fontScale != 1.0)
+ fontSize = (int) ((double(fontSize) * fontScale) + 0.5);
+
+ wxString units;
+ if (fontSpec.HasFontPixelSize() && !fontSpec.HasFontPointSize())
+ units = wxT("px");
+ else
+ units = wxT("pt");
+ wxString spec = wxString::Format(wxT("%d-%s-%d-%d-%d-%d-%s-%d"),
+ fontSize, units.c_str(), fontSpec.GetFontStyle(), fontSpec.GetFontWeight(), (int) fontSpec.GetFontUnderlined(), (int) fontSpec.GetFontStrikethrough(),
+ facename.c_str(), (int) fontSpec.GetFontEncoding());
+
+ wxRichTextFontTableHashMap::iterator entry = m_hashMap.find(spec);
if ( entry == m_hashMap.end() )
{
- wxFont font(fontSpec.GetFontSize(), wxDEFAULT, fontSpec.GetFontStyle(), fontSpec.GetFontWeight(), fontSpec.GetFontUnderlined(), facename.c_str());
- m_hashMap[spec] = font;
- return font;
+ if (fontSpec.HasFontPixelSize() && !fontSpec.HasFontPointSize())
+ {
+ wxFont font(wxSize(0, fontSize), wxDEFAULT, fontSpec.GetFontStyle(), fontSpec.GetFontWeight(), fontSpec.GetFontUnderlined(), facename.c_str());
+ if (fontSpec.HasFontStrikethrough() && fontSpec.GetFontStrikethrough())
+ font.SetStrikethrough(true);
+ m_hashMap[spec] = font;
+ return font;
+ }
+ else
+ {
+ wxFont font(fontSize, wxDEFAULT, fontSpec.GetFontStyle(), fontSpec.GetFontWeight(), fontSpec.GetFontUnderlined(), facename.c_str());
+ if (fontSpec.HasFontStrikethrough() && fontSpec.GetFontStrikethrough())
+ font.SetStrikethrough(true);
+
+ m_hashMap[spec] = font;
+ return font;
+ }
}
else
{
wxRichTextFontTable::wxRichTextFontTable()
{
m_refData = new wxRichTextFontTableData;
+ m_fontScale = 1.0;
}
wxRichTextFontTable::wxRichTextFontTable(const wxRichTextFontTable& table)
void wxRichTextFontTable::operator= (const wxRichTextFontTable& table)
{
Ref(table);
+ m_fontScale = table.m_fontScale;
}
wxFont wxRichTextFontTable::FindFont(const wxRichTextAttr& fontSpec)
{
wxRichTextFontTableData* data = (wxRichTextFontTableData*) m_refData;
if (data)
- return data->FindFont(fontSpec);
+ return data->FindFont(fontSpec, m_fontScale);
else
return wxFont();
}
data->m_hashMap.clear();
}
+void wxRichTextFontTable::SetFontScale(double fontScale)
+{
+ if (fontScale != m_fontScale)
+ Clear();
+ m_fontScale = fontScale;
+}
+
// wxTextBoxAttr
void wxTextBoxAttr::Reset()
}
// Partial equality test
-bool wxTextBoxAttr::EqPartial(const wxTextBoxAttr& attr) const
+bool wxTextBoxAttr::EqPartial(const wxTextBoxAttr& attr, bool weakTest) const
{
+ if (!weakTest &&
+ ((!HasFloatMode() && attr.HasFloatMode()) ||
+ (!HasClearMode() && attr.HasClearMode()) ||
+ (!HasCollapseBorders() && attr.HasCollapseBorders()) ||
+ (!HasVerticalAlignment() && attr.HasVerticalAlignment()) ||
+ (!HasBoxStyleName() && attr.HasBoxStyleName())))
+ {
+ return false;
+ }
if (attr.HasFloatMode() && HasFloatMode() && (GetFloatMode() != attr.GetFloatMode()))
return false;
// Position
- if (!m_position.EqPartial(attr.m_position))
+ if (!m_position.EqPartial(attr.m_position, weakTest))
return false;
// Size
- if (!m_size.EqPartial(attr.m_size))
+ if (!m_size.EqPartial(attr.m_size, weakTest))
return false;
- if (!m_minSize.EqPartial(attr.m_minSize))
+ if (!m_minSize.EqPartial(attr.m_minSize, weakTest))
return false;
- if (!m_maxSize.EqPartial(attr.m_maxSize))
+ if (!m_maxSize.EqPartial(attr.m_maxSize, weakTest))
return false;
// Margins
- if (!m_margins.EqPartial(attr.m_margins))
+ if (!m_margins.EqPartial(attr.m_margins, weakTest))
return false;
// Padding
- if (!m_padding.EqPartial(attr.m_padding))
+ if (!m_padding.EqPartial(attr.m_padding, weakTest))
return false;
// Border
- if (!GetBorder().EqPartial(attr.GetBorder()))
+ if (!GetBorder().EqPartial(attr.GetBorder(), weakTest))
return false;
// Outline
- if (!GetOutline().EqPartial(attr.GetOutline()))
+ if (!GetOutline().EqPartial(attr.GetOutline(), weakTest))
return false;
return true;
return (m_textBoxAttr == attr.m_textBoxAttr);
}
-// Partial equality test taking comparison object into account
-bool wxRichTextAttr::EqPartial(const wxRichTextAttr& attr) const
+// Partial equality test
+bool wxRichTextAttr::EqPartial(const wxRichTextAttr& attr, bool weakTest) const
{
- if (!(wxTextAttr::EqPartial(attr)))
+ if (!(wxTextAttr::EqPartial(attr, weakTest)))
return false;
- return m_textBoxAttr.EqPartial(attr.m_textBoxAttr);
+ return m_textBoxAttr.EqPartial(attr.m_textBoxAttr, weakTest);
}
// Merges the given attributes. If compareWith
}
// Partial equality test
-bool wxTextAttrBorder::EqPartial(const wxTextAttrBorder& border) const
+bool wxTextAttrBorder::EqPartial(const wxTextAttrBorder& border, bool weakTest) const
{
- if (border.HasStyle() && !HasStyle() && (border.GetStyle() != GetStyle()))
+ if (!weakTest &&
+ ((!HasStyle() && border.HasStyle()) ||
+ (!HasColour() && border.HasColour()) ||
+ (!HasWidth() && border.HasWidth())))
+ {
+ return false;
+ }
+
+ if (border.HasStyle() && HasStyle() && (border.GetStyle() != GetStyle()))
return false;
- if (border.HasColour() && !HasColour() && (border.GetColourLong() != GetColourLong()))
+ if (border.HasColour() && HasColour() && (border.GetColourLong() != GetColourLong()))
return false;
- if (border.HasWidth() && !HasWidth() && !(border.GetWidth() == GetWidth()))
+ if (border.HasWidth() && HasWidth() && !(border.GetWidth() == GetWidth()))
return false;
return true;
}
// Partial equality test
-bool wxTextAttrBorders::EqPartial(const wxTextAttrBorders& borders) const
+bool wxTextAttrBorders::EqPartial(const wxTextAttrBorders& borders, bool weakTest) const
{
- return m_left.EqPartial(borders.m_left) && m_right.EqPartial(borders.m_right) &&
- m_top.EqPartial(borders.m_top) && m_bottom.EqPartial(borders.m_bottom);
+ return m_left.EqPartial(borders.m_left, weakTest) && m_right.EqPartial(borders.m_right, weakTest) &&
+ m_top.EqPartial(borders.m_top, weakTest) && m_bottom.EqPartial(borders.m_bottom, weakTest);
}
// Apply border to 'this', but not if the same as compareWith
}
// Partial equality test
-bool wxTextAttrDimension::EqPartial(const wxTextAttrDimension& dim) const
+bool wxTextAttrDimension::EqPartial(const wxTextAttrDimension& dim, bool weakTest) const
{
+ if (!weakTest && !IsValid() && dim.IsValid())
+ return false;
+
if (dim.IsValid() && IsValid() && !((*this) == dim))
return false;
else
}
// Partial equality test
-bool wxTextAttrDimensions::EqPartial(const wxTextAttrDimensions& dims) const
+bool wxTextAttrDimensions::EqPartial(const wxTextAttrDimensions& dims, bool weakTest) const
{
- if (!m_left.EqPartial(dims.m_left))
+ if (!m_left.EqPartial(dims.m_left, weakTest))
return false;
- if (!m_right.EqPartial(dims.m_right))
+ if (!m_right.EqPartial(dims.m_right, weakTest))
return false;
- if (!m_top.EqPartial(dims.m_top))
+ if (!m_top.EqPartial(dims.m_top, weakTest))
return false;
- if (!m_bottom.EqPartial(dims.m_bottom))
+ if (!m_bottom.EqPartial(dims.m_bottom, weakTest))
return false;
return true;
}
// Partial equality test
-bool wxTextAttrSize::EqPartial(const wxTextAttrSize& size) const
+bool wxTextAttrSize::EqPartial(const wxTextAttrSize& size, bool weakTest) const
{
- if (!m_width.EqPartial(size.m_width))
+ if (!m_width.EqPartial(size.m_width, weakTest))
return false;
- if (!m_height.EqPartial(size.m_height))
+ if (!m_height.EqPartial(size.m_height, weakTest))
return false;
return true;
if (attr.HasFont())
{
- if (attr.HasFontSize() && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_FONT_SIZE))
+ if (attr.HasFontPointSize() && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_FONT_POINT_SIZE))
{
- if (currentStyle.HasFontSize())
+ if (currentStyle.HasFontPointSize())
{
if (currentStyle.GetFontSize() != attr.GetFontSize())
{
// Clash of attr - mark as such
- clashingAttr.AddFlag(wxTEXT_ATTR_FONT_SIZE);
- currentStyle.RemoveFlag(wxTEXT_ATTR_FONT_SIZE);
+ clashingAttr.AddFlag(wxTEXT_ATTR_FONT_POINT_SIZE);
+ currentStyle.RemoveFlag(wxTEXT_ATTR_FONT_POINT_SIZE);
}
}
else
currentStyle.SetFontSize(attr.GetFontSize());
}
+ if (attr.HasFontPixelSize() && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_FONT_PIXEL_SIZE))
+ {
+ if (currentStyle.HasFontPixelSize())
+ {
+ if (currentStyle.GetFontSize() != attr.GetFontSize())
+ {
+ // Clash of attr - mark as such
+ clashingAttr.AddFlag(wxTEXT_ATTR_FONT_PIXEL_SIZE);
+ currentStyle.RemoveFlag(wxTEXT_ATTR_FONT_PIXEL_SIZE);
+ }
+ }
+ else
+ currentStyle.SetFontPixelSize(attr.GetFontSize());
+ }
+
if (attr.HasFontItalic() && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_FONT_ITALIC))
{
if (currentStyle.HasFontItalic())
else
currentStyle.SetFontUnderlined(attr.GetFontUnderlined());
}
+
+ if (attr.HasFontStrikethrough() && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_FONT_STRIKETHROUGH))
+ {
+ if (currentStyle.HasFontStrikethrough())
+ {
+ if (currentStyle.GetFontStrikethrough() != attr.GetFontStrikethrough())
+ {
+ // Clash of attr - mark as such
+ clashingAttr.AddFlag(wxTEXT_ATTR_FONT_STRIKETHROUGH);
+ currentStyle.RemoveFlag(wxTEXT_ATTR_FONT_STRIKETHROUGH);
+ }
+ }
+ else
+ currentStyle.SetFontStrikethrough(attr.GetFontStrikethrough());
+ }
}
if (attr.HasTextColour() && !wxHasStyle(forbiddenFlags, wxTEXT_ATTR_TEXT_COLOUR))
attributes.SetLineSpacing(10);
attributes.SetParagraphSpacingAfter(10);
attributes.SetParagraphSpacingBefore(0);
-
SetBasicStyle(attributes);
int margin = 5;
wxString valueUnix = wxTextFile::Translate(value, wxTextFileType_Unix);
GetFocusObject()->InsertTextWithUndo(& GetBuffer(), m_caretPosition+1, valueUnix, this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
+ GetBuffer().Defragment();
if ( flags & SetValue_SendEvent )
wxTextCtrl::SendTextUpdatedEvent(this);
SetupScrollbars();
}
+void wxRichTextCtrl::SetFontScale(double fontScale, bool refresh)
+{
+ GetBuffer().SetFontScale(fontScale);
+ if (refresh)
+ {
+ GetBuffer().Invalidate(wxRICHTEXT_ALL);
+ Refresh();
+ }
+}
+
+void wxRichTextCtrl::SetDimensionScale(double dimScale, bool refresh)
+{
+ GetBuffer().SetDimensionScale(dimScale);
+ if (refresh)
+ {
+ GetBuffer().Invalidate(wxRICHTEXT_ALL);
+ Refresh();
+ }
+}
+
#if wxRICHTEXT_USE_OWN_CARET
// ----------------------------------------------------------------------------
<string name="app-kind">"Standard"</string>
<long name="use-xrc">0</long>
<long name="working-mode">0</long>
+ <string name="event-handler-0">"wxEVT_IDLE|OnIdle|NONE||wxRichTextFontPage"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE"</string>
<long name="proxy-Id value">10000</long>
<string name="proxy-Class">"wxRichTextFontPage"</string>
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
- <string name="proxy-AlignH">"Centre"</string>
- <string name="proxy-AlignV">"Centre"</string>
- <long name="proxy-Stretch factor">0</long>
- <long name="proxy-Border">5</long>
- <bool name="proxy-wxLEFT">1</bool>
- <bool name="proxy-wxRIGHT">1</bool>
- <bool name="proxy-wxTOP">1</bool>
- <bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
+ </document>
+ <document>
+ <string name="title">"wxBoxSizer V"</string>
+ <string name="type">"dialog-control-document"</string>
+ <string name="filename">""</string>
+ <string name="icon-name">"sizer"</string>
+ <long name="is-transient">0</long>
+ <long name="owns-file">1</long>
+ <long name="title-mode">0</long>
+ <long name="locked">0</long>
+ <string name="created">"2/10/2006"</string>
+ <string name="proxy-type">"wbBoxSizerProxy"</string>
+ <string name="proxy-Orientation">"Vertical"</string>
+ <string name="proxy-Member variable name">""</string>
+ <string name="proxy-AlignH">"Centre"</string>
+ <string name="proxy-AlignV">"Expand"</string>
+ <long name="proxy-Stretch factor">0</long>
+ <long name="proxy-Border">5</long>
+ <bool name="proxy-wxLEFT">0</bool>
+ <bool name="proxy-wxRIGHT">0</bool>
+ <bool name="proxy-wxTOP">0</bool>
+ <bool name="proxy-wxBOTTOM">0</bool>
+ <bool name="proxy-wxSHAPED">0</bool>
+ <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+ <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+ <string name="proxy-Platform">"<Any platform>"</string>
<document>
- <string name="title">"wxRichTextFontListBox: ID_RICHTEXTFONTPAGE_FACELISTBOX"</string>
+ <string name="title">"wxStaticText: wxID_STATIC"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
- <string name="icon-name">"foreign"</string>
+ <string name="icon-name">"statictext"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"2/10/2006"</string>
- <string name="proxy-type">"wbForeignCtrlProxy"</string>
- <string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_FACELISTBOX"</string>
- <long name="proxy-Id value">10002</long>
+ <string name="proxy-type">"wbStaticTextProxy"</string>
+ <string name="proxy-Id name">"wxID_STATIC"</string>
+ <long name="proxy-Id value">5105</long>
<string name="proxy-Name">""</string>
- <string name="proxy-Class">"wxRichTextFontListBox"</string>
- <string name="proxy-Base class">"wxWindow"</string>
+ <string name="proxy-Class">"wxStaticText"</string>
+ <string name="proxy-Base class">"wxStaticText"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
- <string name="proxy-Member variable name">"m_faceListBox"</string>
- <bool name="proxy-Create in situ">1</bool>
- <string name="proxy-Help text">"Lists the available fonts."</string>
+ <string name="proxy-Member variable name">""</string>
+ <string name="proxy-Label">"&Size:"</string>
+ <long name="proxy-Wrapping width">-1</long>
+ <string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Data class implementation filename">""</string>
<string name="proxy-Data class header filename">""</string>
<string name="proxy-Data class manager window">""</string>
+ <bool name="proxy-wxALIGN_LEFT">0</bool>
+ <bool name="proxy-wxALIGN_RIGHT">0</bool>
+ <bool name="proxy-wxALIGN_CENTRE">0</bool>
+ <bool name="proxy-wxST_NO_AUTORESIZE">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxSIMPLE_BORDER">0</bool>
<bool name="proxy-wxDOUBLE_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
- <bool name="proxy-wxCLIP_CHILDREN">0</bool>
- <bool name="proxy-wxHSCROLL">0</bool>
- <bool name="proxy-wxVSCROLL">0</bool>
- <bool name="proxy-wxWS_EX_VALIDATE_RECURSIVELY">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
- <long name="proxy-Width">200</long>
- <long name="proxy-Height">100</long>
- <string name="proxy-AlignH">"Expand"</string>
+ <long name="proxy-Width">-1</long>
+ <long name="proxy-Height">-1</long>
+ <string name="proxy-AlignH">"Left"</string>
<string name="proxy-AlignV">"Centre"</string>
- <long name="proxy-Stretch factor">1</long>
+ <long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
- <bool name="proxy-wxBOTTOM">1</bool>
+ <bool name="proxy-wxBOTTOM">0</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
- <bool name="proxy-wxFIXED_MINSIZE">1</bool>
+ <bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
- <string name="proxy-Event sources">""</string>
+ </document>
+ <document>
+ <string name="title">"wxBoxSizer H"</string>
+ <string name="type">"dialog-control-document"</string>
+ <string name="filename">""</string>
+ <string name="icon-name">"sizer"</string>
+ <long name="is-transient">0</long>
+ <long name="owns-file">1</long>
+ <long name="title-mode">0</long>
+ <long name="locked">0</long>
+ <string name="proxy-type">"wbBoxSizerProxy"</string>
+ <string name="proxy-Orientation">"Horizontal"</string>
+ <string name="proxy-Member variable name">""</string>
+ <string name="proxy-AlignH">"Expand"</string>
+ <string name="proxy-AlignV">"Centre"</string>
+ <long name="proxy-Stretch factor">0</long>
+ <long name="proxy-Border">5</long>
+ <bool name="proxy-wxLEFT">0</bool>
+ <bool name="proxy-wxRIGHT">0</bool>
+ <bool name="proxy-wxTOP">0</bool>
+ <bool name="proxy-wxBOTTOM">0</bool>
+ <bool name="proxy-wxSHAPED">0</bool>
+ <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+ <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+ <string name="proxy-Platform">"<Any platform>"</string>
+ <document>
+ <string name="title">"wxTextCtrl: ID_RICHTEXTFONTPAGE_SIZETEXTCTRL"</string>
+ <string name="type">"dialog-control-document"</string>
+ <string name="filename">""</string>
+ <string name="icon-name">"textctrl"</string>
+ <long name="is-transient">0</long>
+ <long name="owns-file">1</long>
+ <long name="title-mode">0</long>
+ <long name="locked">0</long>
+ <string name="proxy-type">"wbTextCtrlProxy"</string>
+ <string name="event-handler-0">"wxEVT_COMMAND_TEXT_UPDATED|OnSizeTextCtrlUpdated"</string>
+ <string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_SIZETEXTCTRL"</string>
+ <long name="proxy-Id value">10005</long>
+ <string name="proxy-Name">""</string>
+ <string name="proxy-Class">"wxTextCtrl"</string>
+ <string name="proxy-Base class">"wxTextCtrl"</string>
+ <bool name="proxy-External implementation">1</bool>
+ <bool name="proxy-Separate files">0</bool>
+ <string name="proxy-Implementation filename">""</string>
+ <string name="proxy-Header filename">""</string>
+ <string name="proxy-Member variable name">"m_sizeTextCtrl"</string>
+ <string name="proxy-Initial value">""</string>
+ <long name="proxy-Max length">0</long>
+ <string name="proxy-Help text">"Type a size in points."</string>
+ <string name="proxy-Tooltip text">""</string>
+ <string name="proxy-Background colour">""</string>
+ <string name="proxy-Foreground colour">""</string>
+ <string name="proxy-Font">""</string>
+ <bool name="proxy-Hidden">0</bool>
+ <bool name="proxy-Enabled">1</bool>
+ <string name="proxy-Platform">"<Any platform>"</string>
+ <string name="proxy-Data variable">""</string>
+ <string name="proxy-Data validator">""</string>
+ <string name="proxy-Data source">""</string>
+ <string name="proxy-Data class name">""</string>
+ <string name="proxy-Data class implementation filename">""</string>
+ <string name="proxy-Data class header filename">""</string>
+ <string name="proxy-Data class manager window">""</string>
+ <bool name="proxy-wxTE_MULTILINE">0</bool>
+ <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
+ <bool name="proxy-wxTE_PROCESS_TAB">0</bool>
+ <bool name="proxy-wxTE_PASSWORD">0</bool>
+ <bool name="proxy-wxTE_READONLY">0</bool>
+ <bool name="proxy-wxTE_RICH">0</bool>
+ <bool name="proxy-wxTE_RICH2">0</bool>
+ <bool name="proxy-wxTE_AUTO_URL">0</bool>
+ <bool name="proxy-wxTE_NOHIDESEL">0</bool>
+ <bool name="proxy-wxTE_LEFT">0</bool>
+ <bool name="proxy-wxTE_CENTRE">0</bool>
+ <bool name="proxy-wxTE_RIGHT">0</bool>
+ <bool name="proxy-wxHSCROLL">0</bool>
+ <bool name="proxy-wxTE_CHARWRAP">0</bool>
+ <bool name="proxy-wxTE_WORDWRAP">0</bool>
+ <bool name="proxy-wxTE_CAPITALIZE">0</bool>
+ <bool name="proxy-wxNO_BORDER">0</bool>
+ <bool name="proxy-wxSIMPLE_BORDER">0</bool>
+ <bool name="proxy-wxDOUBLE_BORDER">0</bool>
+ <bool name="proxy-wxBORDER_THEME">0</bool>
+ <bool name="proxy-wxSUNKEN_BORDER">0</bool>
+ <bool name="proxy-wxRAISED_BORDER">0</bool>
+ <bool name="proxy-wxSTATIC_BORDER">0</bool>
+ <bool name="proxy-wxWANTS_CHARS">0</bool>
+ <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+ <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+ <string name="proxy-Custom styles">""</string>
+ <long name="proxy-X">-1</long>
+ <long name="proxy-Y">-1</long>
+ <long name="proxy-Width">50</long>
+ <long name="proxy-Height">-1</long>
+ <string name="proxy-AlignH">"Expand"</string>
+ <string name="proxy-AlignV">"Centre"</string>
+ <long name="proxy-Stretch factor">0</long>
+ <long name="proxy-Border">5</long>
+ <bool name="proxy-wxLEFT">1</bool>
+ <bool name="proxy-wxRIGHT">0</bool>
+ <bool name="proxy-wxTOP">1</bool>
+ <bool name="proxy-wxBOTTOM">0</bool>
+ <bool name="proxy-wxSHAPED">0</bool>
+ <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+ <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+ <string name="proxy-Custom arguments">""</string>
+ <string name="proxy-Custom ctor arguments">""</string>
+ </document>
+ <document>
+ <string name="title">"wxSpinButton: ID_RICHTEXTFONTPAGE_SPINBUTTONS"</string>
+ <string name="type">"dialog-control-document"</string>
+ <string name="filename">""</string>
+ <string name="icon-name">"spinctrl"</string>
+ <long name="is-transient">0</long>
+ <long name="owns-file">1</long>
+ <long name="title-mode">0</long>
+ <long name="locked">0</long>
+ <string name="proxy-type">"wbSpinButtonProxy"</string>
+ <string name="event-handler-0">"wxEVT_SCROLL_LINEUP|OnRichtextfontpageSpinbuttonsUp|NONE||wxRichTextFontPage"</string>
+ <string name="event-handler-1">"wxEVT_SCROLL_LINEDOWN|OnRichtextfontpageSpinbuttonsDown|NONE||wxRichTextFontPage"</string>
+ <string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_SPINBUTTONS"</string>
+ <long name="proxy-Id value">10018</long>
+ <string name="proxy-Name">""</string>
+ <string name="proxy-Class">"wxSpinButton"</string>
+ <string name="proxy-Base class">"wxSpinButton"</string>
+ <bool name="proxy-External implementation">1</bool>
+ <bool name="proxy-Separate files">0</bool>
+ <string name="proxy-Implementation filename">""</string>
+ <string name="proxy-Header filename">""</string>
+ <string name="proxy-Member variable name">"m_fontSizeSpinButtons"</string>
+ <long name="proxy-Minimum value">0</long>
+ <long name="proxy-Maximum value">100</long>
+ <long name="proxy-Initial value">0</long>
+ <string name="proxy-Help text">""</string>
+ <string name="proxy-Tooltip text">""</string>
+ <string name="proxy-Background colour">""</string>
+ <string name="proxy-Foreground colour">""</string>
+ <string name="proxy-Font">""</string>
+ <bool name="proxy-Hidden">0</bool>
+ <bool name="proxy-Enabled">1</bool>
+ <string name="proxy-Platform">"<Any platform>"</string>
+ <string name="proxy-Data variable">""</string>
+ <string name="proxy-Data validator">""</string>
+ <string name="proxy-Data source">""</string>
+ <string name="proxy-Data class name">""</string>
+ <string name="proxy-Data class implementation filename">""</string>
+ <string name="proxy-Data class header filename">""</string>
+ <string name="proxy-Data class manager window">""</string>
+ <bool name="proxy-wxSP_HORIZONTAL">0</bool>
+ <bool name="proxy-wxSP_VERTICAL">1</bool>
+ <bool name="proxy-wxSP_ARROW_KEYS">0</bool>
+ <bool name="proxy-wxSP_WRAP">0</bool>
+ <bool name="proxy-wxNO_BORDER">0</bool>
+ <bool name="proxy-wxSIMPLE_BORDER">0</bool>
+ <bool name="proxy-wxDOUBLE_BORDER">0</bool>
+ <bool name="proxy-wxBORDER_THEME">0</bool>
+ <bool name="proxy-wxSUNKEN_BORDER">0</bool>
+ <bool name="proxy-wxRAISED_BORDER">0</bool>
+ <bool name="proxy-wxSTATIC_BORDER">0</bool>
+ <bool name="proxy-wxWANTS_CHARS">0</bool>
+ <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+ <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+ <string name="proxy-Custom styles">""</string>
+ <long name="proxy-X">-1</long>
+ <long name="proxy-Y">-1</long>
+ <long name="proxy-Width">-1</long>
+ <long name="proxy-Height">20</long>
+ <string name="proxy-AlignH">"Centre"</string>
+ <string name="proxy-AlignV">"Centre"</string>
+ <long name="proxy-Stretch factor">0</long>
+ <long name="proxy-Border">5</long>
+ <bool name="proxy-wxLEFT">0</bool>
+ <bool name="proxy-wxRIGHT">1</bool>
+ <bool name="proxy-wxTOP">1</bool>
+ <bool name="proxy-wxBOTTOM">0</bool>
+ <bool name="proxy-wxSHAPED">0</bool>
+ <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+ <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+ <string name="proxy-Custom arguments">""</string>
+ <string name="proxy-Custom ctor arguments">""</string>
+ </document>
+ <document>
+ <string name="title">"wxChoice: ID_RICHTEXTFONTPAGE_SIZE_UNITS"</string>
+ <string name="type">"dialog-control-document"</string>
+ <string name="filename">""</string>
+ <string name="icon-name">"choice"</string>
+ <long name="is-transient">0</long>
+ <long name="owns-file">1</long>
+ <long name="title-mode">0</long>
+ <long name="locked">0</long>
+ <string name="proxy-type">"wbChoiceProxy"</string>
+ <string name="event-handler-0">"wxEVT_COMMAND_CHOICE_SELECTED|OnRichtextfontpageSizeUnitsSelected|NONE||wxRichTextFontPage"</string>
+ <string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_SIZE_UNITS"</string>
+ <long name="proxy-Id value">10017</long>
+ <string name="proxy-Name">""</string>
+ <string name="proxy-Class">"wxChoice"</string>
+ <string name="proxy-Base class">"wxChoice"</string>
+ <bool name="proxy-External implementation">1</bool>
+ <bool name="proxy-Separate files">0</bool>
+ <string name="proxy-Implementation filename">""</string>
+ <string name="proxy-Header filename">""</string>
+ <string name="proxy-Member variable name">"m_sizeUnitsCtrl"</string>
+ <string name="proxy-Strings">"pt|px"</string>
+ <string name="proxy-Initial value">"pt"</string>
+ <string name="proxy-Help text">"The font size units, points or pixels."</string>
+ <string name="proxy-Tooltip text">""</string>
+ <string name="proxy-Background colour">""</string>
+ <string name="proxy-Foreground colour">""</string>
+ <string name="proxy-Font">""</string>
+ <bool name="proxy-Hidden">0</bool>
+ <bool name="proxy-Enabled">1</bool>
+ <string name="proxy-Platform">"<Any platform>"</string>
+ <string name="proxy-Data variable">""</string>
+ <string name="proxy-Data validator">""</string>
+ <string name="proxy-Data source">""</string>
+ <string name="proxy-Data class name">""</string>
+ <string name="proxy-Data class implementation filename">""</string>
+ <string name="proxy-Data class header filename">""</string>
+ <string name="proxy-Data class manager window">""</string>
+ <bool name="proxy-wxWANTS_CHARS">0</bool>
+ <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+ <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+ <string name="proxy-Custom styles">""</string>
+ <long name="proxy-X">-1</long>
+ <long name="proxy-Y">-1</long>
+ <long name="proxy-Width">-1</long>
+ <long name="proxy-Height">-1</long>
+ <string name="proxy-AlignH">"Expand"</string>
+ <string name="proxy-AlignV">"Centre"</string>
+ <long name="proxy-Stretch factor">0</long>
+ <long name="proxy-Border">5</long>
+ <bool name="proxy-wxLEFT">0</bool>
+ <bool name="proxy-wxRIGHT">1</bool>
+ <bool name="proxy-wxTOP">1</bool>
+ <bool name="proxy-wxBOTTOM">0</bool>
+ <bool name="proxy-wxSHAPED">0</bool>
+ <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+ <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+ <string name="proxy-Custom arguments">""</string>
+ <string name="proxy-Custom ctor arguments">""</string>
+ </document>
</document>
</document>
+ </document>
+ <document>
+ <string name="title">"wxBoxSizer H"</string>
+ <string name="type">"dialog-control-document"</string>
+ <string name="filename">""</string>
+ <string name="icon-name">"sizer"</string>
+ <long name="is-transient">0</long>
+ <long name="owns-file">1</long>
+ <long name="title-mode">0</long>
+ <long name="locked">0</long>
+ <string name="proxy-type">"wbBoxSizerProxy"</string>
+ <string name="proxy-Orientation">"Horizontal"</string>
+ <string name="proxy-Member variable name">"m_fontListBoxParent"</string>
+ <string name="proxy-AlignH">"Expand"</string>
+ <string name="proxy-AlignV">"Centre"</string>
+ <long name="proxy-Stretch factor">0</long>
+ <long name="proxy-Border">5</long>
+ <bool name="proxy-wxLEFT">0</bool>
+ <bool name="proxy-wxRIGHT">0</bool>
+ <bool name="proxy-wxTOP">0</bool>
+ <bool name="proxy-wxBOTTOM">0</bool>
+ <bool name="proxy-wxSHAPED">0</bool>
+ <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+ <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+ <string name="proxy-Platform">"<Any platform>"</string>
<document>
- <string name="title">"wxBoxSizer V"</string>
+ <string name="title">"wxRichTextFontListBox: ID_RICHTEXTFONTPAGE_FACELISTBOX"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
- <string name="icon-name">"sizer"</string>
+ <string name="icon-name">"foreign"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
- <string name="created">"2/10/2006"</string>
- <string name="proxy-type">"wbBoxSizerProxy"</string>
- <string name="proxy-Orientation">"Vertical"</string>
- <string name="proxy-Member variable name">""</string>
+ <string name="proxy-type">"wbForeignCtrlProxy"</string>
+ <string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_FACELISTBOX"</string>
+ <long name="proxy-Id value">10002</long>
+ <string name="proxy-Name">""</string>
+ <string name="proxy-Class">"wxRichTextFontListBox"</string>
+ <string name="proxy-Base class">"wxWindow"</string>
+ <bool name="proxy-External implementation">1</bool>
+ <bool name="proxy-Separate files">0</bool>
+ <string name="proxy-Implementation filename">""</string>
+ <string name="proxy-Header filename">""</string>
+ <string name="proxy-Member variable name">"m_faceListBox"</string>
+ <bool name="proxy-Create in situ">1</bool>
+ <string name="proxy-Help text">"Lists the available fonts."</string>
+ <string name="proxy-Tooltip text">""</string>
+ <string name="proxy-Background colour">""</string>
+ <string name="proxy-Foreground colour">""</string>
+ <string name="proxy-Font">""</string>
+ <bool name="proxy-Hidden">0</bool>
+ <bool name="proxy-Enabled">1</bool>
+ <string name="proxy-Platform">"<Any platform>"</string>
+ <string name="proxy-Data variable">""</string>
+ <string name="proxy-Data validator">""</string>
+ <string name="proxy-Data source">""</string>
+ <string name="proxy-Data class name">""</string>
+ <string name="proxy-Data class implementation filename">""</string>
+ <string name="proxy-Data class header filename">""</string>
+ <string name="proxy-Data class manager window">""</string>
+ <bool name="proxy-wxNO_BORDER">0</bool>
+ <bool name="proxy-wxSIMPLE_BORDER">0</bool>
+ <bool name="proxy-wxDOUBLE_BORDER">0</bool>
+ <bool name="proxy-wxBORDER_THEME">0</bool>
+ <bool name="proxy-wxSUNKEN_BORDER">0</bool>
+ <bool name="proxy-wxRAISED_BORDER">0</bool>
+ <bool name="proxy-wxSTATIC_BORDER">0</bool>
+ <bool name="proxy-wxWANTS_CHARS">0</bool>
+ <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+ <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+ <bool name="proxy-wxCLIP_CHILDREN">0</bool>
+ <bool name="proxy-wxHSCROLL">0</bool>
+ <bool name="proxy-wxVSCROLL">0</bool>
+ <bool name="proxy-wxWS_EX_VALIDATE_RECURSIVELY">0</bool>
+ <string name="proxy-Custom styles">""</string>
+ <long name="proxy-X">-1</long>
+ <long name="proxy-Y">-1</long>
+ <long name="proxy-Width">200</long>
+ <long name="proxy-Height">100</long>
+ <string name="proxy-AlignH">"Expand"</string>
+ <string name="proxy-AlignV">"Centre"</string>
+ <long name="proxy-Stretch factor">1</long>
+ <long name="proxy-Border">5</long>
+ <bool name="proxy-wxLEFT">1</bool>
+ <bool name="proxy-wxRIGHT">1</bool>
+ <bool name="proxy-wxTOP">1</bool>
+ <bool name="proxy-wxBOTTOM">1</bool>
+ <bool name="proxy-wxSHAPED">0</bool>
+ <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+ <bool name="proxy-wxFIXED_MINSIZE">1</bool>
+ <string name="proxy-Custom arguments">""</string>
+ <string name="proxy-Custom ctor arguments">""</string>
+ <string name="proxy-Event sources">""</string>
+ </document>
+ <document>
+ <string name="title">"wxListBox: ID_RICHTEXTFONTPAGE_SIZELISTBOX"</string>
+ <string name="type">"dialog-control-document"</string>
+ <string name="filename">""</string>
+ <string name="icon-name">"listbox"</string>
+ <long name="is-transient">0</long>
+ <long name="owns-file">1</long>
+ <long name="title-mode">0</long>
+ <long name="locked">0</long>
+ <string name="proxy-type">"wbListBoxProxy"</string>
+ <string name="event-handler-0">"wxEVT_COMMAND_LISTBOX_SELECTED|OnSizeListBoxSelected"</string>
+ <string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_SIZELISTBOX"</string>
+ <long name="proxy-Id value">10006</long>
+ <string name="proxy-Name">""</string>
+ <string name="proxy-Class">"wxListBox"</string>
+ <string name="proxy-Base class">"wxListBox"</string>
+ <bool name="proxy-External implementation">1</bool>
+ <bool name="proxy-Separate files">0</bool>
+ <string name="proxy-Implementation filename">""</string>
+ <string name="proxy-Header filename">""</string>
+ <string name="proxy-Member variable name">"m_sizeListBox"</string>
+ <string name="proxy-Strings">""</string>
+ <string name="proxy-Initial value">""</string>
+ <string name="proxy-Help text">"Lists font sizes in points."</string>
+ <string name="proxy-Tooltip text">""</string>
+ <string name="proxy-Background colour">""</string>
+ <string name="proxy-Foreground colour">""</string>
+ <string name="proxy-Font">""</string>
+ <bool name="proxy-Hidden">0</bool>
+ <bool name="proxy-Enabled">1</bool>
+ <string name="proxy-Platform">"<Any platform>"</string>
+ <string name="proxy-Data variable">""</string>
+ <string name="proxy-Data validator">""</string>
+ <string name="proxy-Data source">""</string>
+ <string name="proxy-Data class name">""</string>
+ <string name="proxy-Data class implementation filename">""</string>
+ <string name="proxy-Data class header filename">""</string>
+ <string name="proxy-Data class manager window">""</string>
+ <bool name="proxy-wxLB_SINGLE">1</bool>
+ <bool name="proxy-wxLB_MULTIPLE">0</bool>
+ <bool name="proxy-wxLB_EXTENDED">0</bool>
+ <bool name="proxy-wxLB_ALWAYS_SB">0</bool>
+ <bool name="proxy-wxLB_NEEDED_SB">0</bool>
+ <bool name="proxy-wxLB_HSCROLL">0</bool>
+ <bool name="proxy-wxLB_SORT">0</bool>
+ <bool name="proxy-wxNO_BORDER">0</bool>
+ <bool name="proxy-wxSIMPLE_BORDER">0</bool>
+ <bool name="proxy-wxDOUBLE_BORDER">0</bool>
+ <bool name="proxy-wxBORDER_THEME">0</bool>
+ <bool name="proxy-wxSUNKEN_BORDER">0</bool>
+ <bool name="proxy-wxRAISED_BORDER">0</bool>
+ <bool name="proxy-wxSTATIC_BORDER">0</bool>
+ <bool name="proxy-wxWANTS_CHARS">0</bool>
+ <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+ <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+ <string name="proxy-Custom styles">""</string>
+ <long name="proxy-X">-1</long>
+ <long name="proxy-Y">-1</long>
+ <long name="proxy-Width">50</long>
+ <long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Expand"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
- <bool name="proxy-wxLEFT">0</bool>
- <bool name="proxy-wxRIGHT">0</bool>
- <bool name="proxy-wxTOP">0</bool>
- <bool name="proxy-wxBOTTOM">0</bool>
+ <bool name="proxy-wxLEFT">1</bool>
+ <bool name="proxy-wxRIGHT">1</bool>
+ <bool name="proxy-wxTOP">1</bool>
+ <bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
- <bool name="proxy-wxFIXED_MINSIZE">0</bool>
- <string name="proxy-Platform">"<Any platform>"</string>
- <document>
- <string name="title">"wxStaticText: wxID_STATIC"</string>
- <string name="type">"dialog-control-document"</string>
- <string name="filename">""</string>
- <string name="icon-name">"statictext"</string>
- <long name="is-transient">0</long>
- <long name="owns-file">1</long>
- <long name="title-mode">0</long>
- <long name="locked">0</long>
- <string name="created">"2/10/2006"</string>
- <string name="proxy-type">"wbStaticTextProxy"</string>
- <string name="proxy-Id name">"wxID_STATIC"</string>
- <long name="proxy-Id value">5105</long>
- <string name="proxy-Name">""</string>
- <string name="proxy-Class">"wxStaticText"</string>
- <string name="proxy-Base class">"wxStaticText"</string>
- <bool name="proxy-External implementation">1</bool>
- <bool name="proxy-Separate files">0</bool>
- <string name="proxy-Implementation filename">""</string>
- <string name="proxy-Header filename">""</string>
- <string name="proxy-Member variable name">""</string>
- <string name="proxy-Label">"&Size:"</string>
- <long name="proxy-Wrapping width">-1</long>
- <string name="proxy-Help text">""</string>
- <string name="proxy-Tooltip text">""</string>
- <string name="proxy-Background colour">""</string>
- <string name="proxy-Foreground colour">""</string>
- <string name="proxy-Font">""</string>
- <bool name="proxy-Hidden">0</bool>
- <bool name="proxy-Enabled">1</bool>
- <string name="proxy-Platform">"<Any platform>"</string>
- <string name="proxy-Data variable">""</string>
- <string name="proxy-Data validator">""</string>
- <string name="proxy-Data source">""</string>
- <string name="proxy-Data class name">""</string>
- <string name="proxy-Data class implementation filename">""</string>
- <string name="proxy-Data class header filename">""</string>
- <string name="proxy-Data class manager window">""</string>
- <bool name="proxy-wxALIGN_LEFT">0</bool>
- <bool name="proxy-wxALIGN_RIGHT">0</bool>
- <bool name="proxy-wxALIGN_CENTRE">0</bool>
- <bool name="proxy-wxST_NO_AUTORESIZE">0</bool>
- <bool name="proxy-wxNO_BORDER">0</bool>
- <bool name="proxy-wxSIMPLE_BORDER">0</bool>
- <bool name="proxy-wxDOUBLE_BORDER">0</bool>
- <bool name="proxy-wxBORDER_THEME">0</bool>
- <bool name="proxy-wxSUNKEN_BORDER">0</bool>
- <bool name="proxy-wxRAISED_BORDER">0</bool>
- <bool name="proxy-wxSTATIC_BORDER">0</bool>
- <bool name="proxy-wxWANTS_CHARS">0</bool>
- <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
- <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
- <string name="proxy-Custom styles">""</string>
- <long name="proxy-X">-1</long>
- <long name="proxy-Y">-1</long>
- <long name="proxy-Width">-1</long>
- <long name="proxy-Height">-1</long>
- <string name="proxy-AlignH">"Left"</string>
- <string name="proxy-AlignV">"Centre"</string>
- <long name="proxy-Stretch factor">0</long>
- <long name="proxy-Border">5</long>
- <bool name="proxy-wxLEFT">1</bool>
- <bool name="proxy-wxRIGHT">1</bool>
- <bool name="proxy-wxTOP">1</bool>
- <bool name="proxy-wxBOTTOM">0</bool>
- <bool name="proxy-wxSHAPED">0</bool>
- <bool name="proxy-wxADJUST_MINSIZE">0</bool>
- <bool name="proxy-wxFIXED_MINSIZE">0</bool>
- <string name="proxy-Custom arguments">""</string>
- <string name="proxy-Custom ctor arguments">""</string>
- </document>
- <document>
- <string name="title">"wxTextCtrl: ID_RICHTEXTFONTPAGE_SIZETEXTCTRL"</string>
- <string name="type">"dialog-control-document"</string>
- <string name="filename">""</string>
- <string name="icon-name">"textctrl"</string>
- <long name="is-transient">0</long>
- <long name="owns-file">1</long>
- <long name="title-mode">0</long>
- <long name="locked">0</long>
- <string name="created">"2/10/2006"</string>
- <string name="proxy-type">"wbTextCtrlProxy"</string>
- <string name="event-handler-0">"wxEVT_COMMAND_TEXT_UPDATED|OnSizeTextCtrlUpdated"</string>
- <string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_SIZETEXTCTRL"</string>
- <long name="proxy-Id value">10005</long>
- <string name="proxy-Name">""</string>
- <string name="proxy-Class">"wxTextCtrl"</string>
- <string name="proxy-Base class">"wxTextCtrl"</string>
- <bool name="proxy-External implementation">1</bool>
- <bool name="proxy-Separate files">0</bool>
- <string name="proxy-Implementation filename">""</string>
- <string name="proxy-Header filename">""</string>
- <string name="proxy-Member variable name">"m_sizeTextCtrl"</string>
- <string name="proxy-Initial value">""</string>
- <long name="proxy-Max length">0</long>
- <string name="proxy-Help text">"Type a size in points."</string>
- <string name="proxy-Tooltip text">""</string>
- <string name="proxy-Background colour">""</string>
- <string name="proxy-Foreground colour">""</string>
- <string name="proxy-Font">""</string>
- <bool name="proxy-Hidden">0</bool>
- <bool name="proxy-Enabled">1</bool>
- <string name="proxy-Platform">"<Any platform>"</string>
- <string name="proxy-Data variable">""</string>
- <string name="proxy-Data validator">""</string>
- <string name="proxy-Data source">""</string>
- <string name="proxy-Data class name">""</string>
- <string name="proxy-Data class implementation filename">""</string>
- <string name="proxy-Data class header filename">""</string>
- <string name="proxy-Data class manager window">""</string>
- <bool name="proxy-wxTE_MULTILINE">0</bool>
- <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
- <bool name="proxy-wxTE_PROCESS_TAB">0</bool>
- <bool name="proxy-wxTE_PASSWORD">0</bool>
- <bool name="proxy-wxTE_READONLY">0</bool>
- <bool name="proxy-wxTE_RICH">0</bool>
- <bool name="proxy-wxTE_RICH2">0</bool>
- <bool name="proxy-wxTE_AUTO_URL">0</bool>
- <bool name="proxy-wxTE_NOHIDESEL">0</bool>
- <bool name="proxy-wxTE_LEFT">0</bool>
- <bool name="proxy-wxTE_CENTRE">0</bool>
- <bool name="proxy-wxTE_RIGHT">0</bool>
- <bool name="proxy-wxHSCROLL">0</bool>
- <bool name="proxy-wxTE_CHARWRAP">0</bool>
- <bool name="proxy-wxTE_WORDWRAP">0</bool>
- <bool name="proxy-wxTE_CAPITALIZE">0</bool>
- <bool name="proxy-wxNO_BORDER">0</bool>
- <bool name="proxy-wxSIMPLE_BORDER">0</bool>
- <bool name="proxy-wxDOUBLE_BORDER">0</bool>
- <bool name="proxy-wxBORDER_THEME">0</bool>
- <bool name="proxy-wxSUNKEN_BORDER">0</bool>
- <bool name="proxy-wxRAISED_BORDER">0</bool>
- <bool name="proxy-wxSTATIC_BORDER">0</bool>
- <bool name="proxy-wxWANTS_CHARS">0</bool>
- <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
- <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
- <string name="proxy-Custom styles">""</string>
- <long name="proxy-X">-1</long>
- <long name="proxy-Y">-1</long>
- <long name="proxy-Width">50</long>
- <long name="proxy-Height">-1</long>
- <string name="proxy-AlignH">"Expand"</string>
- <string name="proxy-AlignV">"Centre"</string>
- <long name="proxy-Stretch factor">0</long>
- <long name="proxy-Border">5</long>
- <bool name="proxy-wxLEFT">1</bool>
- <bool name="proxy-wxRIGHT">1</bool>
- <bool name="proxy-wxTOP">1</bool>
- <bool name="proxy-wxBOTTOM">0</bool>
- <bool name="proxy-wxSHAPED">0</bool>
- <bool name="proxy-wxADJUST_MINSIZE">0</bool>
- <bool name="proxy-wxFIXED_MINSIZE">0</bool>
- <string name="proxy-Custom arguments">""</string>
- <string name="proxy-Custom ctor arguments">""</string>
- </document>
- <document>
- <string name="title">"wxListBox: ID_RICHTEXTFONTPAGE_SIZELISTBOX"</string>
- <string name="type">"dialog-control-document"</string>
- <string name="filename">""</string>
- <string name="icon-name">"listbox"</string>
- <long name="is-transient">0</long>
- <long name="owns-file">1</long>
- <long name="title-mode">0</long>
- <long name="locked">0</long>
- <string name="created">"2/10/2006"</string>
- <string name="proxy-type">"wbListBoxProxy"</string>
- <string name="event-handler-0">"wxEVT_COMMAND_LISTBOX_SELECTED|OnSizeListBoxSelected"</string>
- <string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_SIZELISTBOX"</string>
- <long name="proxy-Id value">10006</long>
- <string name="proxy-Name">""</string>
- <string name="proxy-Class">"wxListBox"</string>
- <string name="proxy-Base class">"wxListBox"</string>
- <bool name="proxy-External implementation">1</bool>
- <bool name="proxy-Separate files">0</bool>
- <string name="proxy-Implementation filename">""</string>
- <string name="proxy-Header filename">""</string>
- <string name="proxy-Member variable name">"m_sizeListBox"</string>
- <string name="proxy-Strings">""</string>
- <string name="proxy-Initial value">""</string>
- <string name="proxy-Help text">"Lists font sizes in points."</string>
- <string name="proxy-Tooltip text">""</string>
- <string name="proxy-Background colour">""</string>
- <string name="proxy-Foreground colour">""</string>
- <string name="proxy-Font">""</string>
- <bool name="proxy-Hidden">0</bool>
- <bool name="proxy-Enabled">1</bool>
- <string name="proxy-Platform">"<Any platform>"</string>
- <string name="proxy-Data variable">""</string>
- <string name="proxy-Data validator">""</string>
- <string name="proxy-Data source">""</string>
- <string name="proxy-Data class name">""</string>
- <string name="proxy-Data class implementation filename">""</string>
- <string name="proxy-Data class header filename">""</string>
- <string name="proxy-Data class manager window">""</string>
- <bool name="proxy-wxLB_SINGLE">1</bool>
- <bool name="proxy-wxLB_MULTIPLE">0</bool>
- <bool name="proxy-wxLB_EXTENDED">0</bool>
- <bool name="proxy-wxLB_ALWAYS_SB">0</bool>
- <bool name="proxy-wxLB_NEEDED_SB">0</bool>
- <bool name="proxy-wxLB_HSCROLL">0</bool>
- <bool name="proxy-wxLB_SORT">0</bool>
- <bool name="proxy-wxNO_BORDER">0</bool>
- <bool name="proxy-wxSIMPLE_BORDER">0</bool>
- <bool name="proxy-wxDOUBLE_BORDER">0</bool>
- <bool name="proxy-wxBORDER_THEME">0</bool>
- <bool name="proxy-wxSUNKEN_BORDER">0</bool>
- <bool name="proxy-wxRAISED_BORDER">0</bool>
- <bool name="proxy-wxSTATIC_BORDER">0</bool>
- <bool name="proxy-wxWANTS_CHARS">0</bool>
- <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
- <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
- <string name="proxy-Custom styles">""</string>
- <long name="proxy-X">-1</long>
- <long name="proxy-Y">-1</long>
- <long name="proxy-Width">50</long>
- <long name="proxy-Height">-1</long>
- <string name="proxy-AlignH">"Centre"</string>
- <string name="proxy-AlignV">"Centre"</string>
- <long name="proxy-Stretch factor">1</long>
- <long name="proxy-Border">5</long>
- <bool name="proxy-wxLEFT">1</bool>
- <bool name="proxy-wxRIGHT">1</bool>
- <bool name="proxy-wxTOP">1</bool>
- <bool name="proxy-wxBOTTOM">1</bool>
- <bool name="proxy-wxSHAPED">0</bool>
- <bool name="proxy-wxADJUST_MINSIZE">0</bool>
- <bool name="proxy-wxFIXED_MINSIZE">1</bool>
- <string name="proxy-Custom arguments">""</string>
- <string name="proxy-Custom ctor arguments">""</string>
- </document>
+ <bool name="proxy-wxFIXED_MINSIZE">1</bool>
+ <string name="proxy-Custom arguments">""</string>
+ <string name="proxy-Custom ctor arguments">""</string>
</document>
</document>
<document>
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
+ <string name="proxy-AlignH">"Centre"</string>
+ <string name="proxy-AlignV">"Centre"</string>
+ <long name="proxy-Stretch factor">0</long>
+ <long name="proxy-Border">5</long>
+ <bool name="proxy-wxLEFT">1</bool>
+ <bool name="proxy-wxRIGHT">1</bool>
+ <bool name="proxy-wxTOP">1</bool>
+ <bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
EVT_BUTTON( ID_RICHTEXTFONTPAGE_BGCOLOURCTRL, wxRichTextFontPage::OnColourClicked )
////@begin wxRichTextFontPage event table entries
+ EVT_IDLE( wxRichTextFontPage::OnIdle )
+
EVT_TEXT( ID_RICHTEXTFONTPAGE_FACETEXTCTRL, wxRichTextFontPage::OnFaceTextCtrlUpdated )
EVT_TEXT( ID_RICHTEXTFONTPAGE_SIZETEXTCTRL, wxRichTextFontPage::OnSizeTextCtrlUpdated )
+ EVT_SPIN_UP( ID_RICHTEXTFONTPAGE_SPINBUTTONS, wxRichTextFontPage::OnRichtextfontpageSpinbuttonsUp )
+ EVT_SPIN_DOWN( ID_RICHTEXTFONTPAGE_SPINBUTTONS, wxRichTextFontPage::OnRichtextfontpageSpinbuttonsDown )
+
+ EVT_CHOICE( ID_RICHTEXTFONTPAGE_SIZE_UNITS, wxRichTextFontPage::OnRichtextfontpageSizeUnitsSelected )
+
EVT_LISTBOX( ID_RICHTEXTFONTPAGE_SIZELISTBOX, wxRichTextFontPage::OnSizeListBoxSelected )
EVT_COMBOBOX( ID_RICHTEXTFONTPAGE_STYLECTRL, wxRichTextFontPage::OnStyleCtrlSelected )
////@begin wxRichTextFontPage member initialisation
m_faceTextCtrl = NULL;
- m_faceListBox = NULL;
m_sizeTextCtrl = NULL;
+ m_fontSizeSpinButtons = NULL;
+ m_sizeUnitsCtrl = NULL;
+ m_fontListBoxParent = NULL;
+ m_faceListBox = NULL;
m_sizeListBox = NULL;
m_styleCtrl = NULL;
m_weightCtrl = NULL;
m_faceTextCtrl->SetToolTip(_("Type a font name."));
itemBoxSizer5->Add(m_faceTextCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
- m_faceListBox = new wxRichTextFontListBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_FACELISTBOX, wxDefaultPosition, wxSize(200, 100), 0 );
- m_faceListBox->SetHelpText(_("Lists the available fonts."));
- if (wxRichTextFontPage::ShowToolTips())
- m_faceListBox->SetToolTip(_("Lists the available fonts."));
- itemBoxSizer5->Add(m_faceListBox, 1, wxGROW|wxALL|wxFIXED_MINSIZE, 5);
+ wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxVERTICAL);
+ itemBoxSizer4->Add(itemBoxSizer8, 0, wxGROW, 5);
- wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL);
- itemBoxSizer4->Add(itemBoxSizer9, 0, wxGROW, 5);
+ wxStaticText* itemStaticText9 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Size:"), wxDefaultPosition, wxDefaultSize, 0 );
+ itemBoxSizer8->Add(itemStaticText9, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
- wxStaticText* itemStaticText10 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Size:"), wxDefaultPosition, wxDefaultSize, 0 );
- itemBoxSizer9->Add(itemStaticText10, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
+ wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxHORIZONTAL);
+ itemBoxSizer8->Add(itemBoxSizer10, 0, wxGROW, 5);
m_sizeTextCtrl = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_SIZETEXTCTRL, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
m_sizeTextCtrl->SetHelpText(_("Type a size in points."));
if (wxRichTextFontPage::ShowToolTips())
m_sizeTextCtrl->SetToolTip(_("Type a size in points."));
- itemBoxSizer9->Add(m_sizeTextCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
+ itemBoxSizer10->Add(m_sizeTextCtrl, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5);
+
+ m_fontSizeSpinButtons = new wxSpinButton( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_SPINBUTTONS, wxDefaultPosition, wxSize(-1, 20), wxSP_VERTICAL );
+ m_fontSizeSpinButtons->SetRange(0, 100);
+ m_fontSizeSpinButtons->SetValue(0);
+ itemBoxSizer10->Add(m_fontSizeSpinButtons, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP, 5);
+
+ wxArrayString m_sizeUnitsCtrlStrings;
+ m_sizeUnitsCtrlStrings.Add(_("pt"));
+ m_sizeUnitsCtrlStrings.Add(_("px"));
+ m_sizeUnitsCtrl = new wxChoice( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_SIZE_UNITS, wxDefaultPosition, wxDefaultSize, m_sizeUnitsCtrlStrings, 0 );
+ m_sizeUnitsCtrl->SetStringSelection(_("pt"));
+ m_sizeUnitsCtrl->SetHelpText(_("The font size units, points or pixels."));
+ if (wxRichTextFontPage::ShowToolTips())
+ m_sizeUnitsCtrl->SetToolTip(_("The font size units, points or pixels."));
+ itemBoxSizer10->Add(m_sizeUnitsCtrl, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP, 5);
+
+ m_fontListBoxParent = new wxBoxSizer(wxHORIZONTAL);
+ itemBoxSizer3->Add(m_fontListBoxParent, 0, wxGROW, 5);
+
+ m_faceListBox = new wxRichTextFontListBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_FACELISTBOX, wxDefaultPosition, wxSize(200, 100), 0 );
+ m_faceListBox->SetHelpText(_("Lists the available fonts."));
+ if (wxRichTextFontPage::ShowToolTips())
+ m_faceListBox->SetToolTip(_("Lists the available fonts."));
+ m_fontListBoxParent->Add(m_faceListBox, 1, wxALIGN_CENTER_VERTICAL|wxALL|wxFIXED_MINSIZE, 5);
wxArrayString m_sizeListBoxStrings;
m_sizeListBox = new wxListBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_SIZELISTBOX, wxDefaultPosition, wxSize(50, -1), m_sizeListBoxStrings, wxLB_SINGLE );
m_sizeListBox->SetHelpText(_("Lists font sizes in points."));
if (wxRichTextFontPage::ShowToolTips())
m_sizeListBox->SetToolTip(_("Lists font sizes in points."));
- itemBoxSizer9->Add(m_sizeListBox, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxFIXED_MINSIZE, 5);
+ m_fontListBoxParent->Add(m_sizeListBox, 0, wxGROW|wxALL|wxFIXED_MINSIZE, 5);
- wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxHORIZONTAL);
- itemBoxSizer3->Add(itemBoxSizer13, 0, wxGROW, 5);
+ wxBoxSizer* itemBoxSizer17 = new wxBoxSizer(wxHORIZONTAL);
+ itemBoxSizer3->Add(itemBoxSizer17, 0, wxGROW, 5);
- wxBoxSizer* itemBoxSizer14 = new wxBoxSizer(wxVERTICAL);
- itemBoxSizer13->Add(itemBoxSizer14, 0, wxGROW, 5);
+ wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxVERTICAL);
+ itemBoxSizer17->Add(itemBoxSizer18, 0, wxGROW, 5);
- wxStaticText* itemStaticText15 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Font st&yle:"), wxDefaultPosition, wxDefaultSize, 0 );
- itemBoxSizer14->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
+ wxStaticText* itemStaticText19 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Font st&yle:"), wxDefaultPosition, wxDefaultSize, 0 );
+ itemBoxSizer18->Add(itemStaticText19, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_styleCtrlStrings;
m_styleCtrl = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_STYLECTRL, wxEmptyString, wxDefaultPosition, wxSize(110, -1), m_styleCtrlStrings, wxCB_READONLY );
m_styleCtrl->SetHelpText(_("Select regular or italic style."));
if (wxRichTextFontPage::ShowToolTips())
m_styleCtrl->SetToolTip(_("Select regular or italic style."));
- itemBoxSizer14->Add(m_styleCtrl, 0, wxGROW|wxALL, 5);
+ itemBoxSizer18->Add(m_styleCtrl, 0, wxGROW|wxALL, 5);
- wxBoxSizer* itemBoxSizer17 = new wxBoxSizer(wxVERTICAL);
- itemBoxSizer13->Add(itemBoxSizer17, 0, wxGROW, 5);
+ wxBoxSizer* itemBoxSizer21 = new wxBoxSizer(wxVERTICAL);
+ itemBoxSizer17->Add(itemBoxSizer21, 0, wxGROW, 5);
- wxStaticText* itemStaticText18 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Font &weight:"), wxDefaultPosition, wxDefaultSize, 0 );
- itemBoxSizer17->Add(itemStaticText18, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
+ wxStaticText* itemStaticText22 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Font &weight:"), wxDefaultPosition, wxDefaultSize, 0 );
+ itemBoxSizer21->Add(itemStaticText22, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_weightCtrlStrings;
m_weightCtrl = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_WEIGHTCTRL, wxEmptyString, wxDefaultPosition, wxSize(110, -1), m_weightCtrlStrings, wxCB_READONLY );
m_weightCtrl->SetHelpText(_("Select regular or bold."));
if (wxRichTextFontPage::ShowToolTips())
m_weightCtrl->SetToolTip(_("Select regular or bold."));
- itemBoxSizer17->Add(m_weightCtrl, 0, wxGROW|wxALL, 5);
+ itemBoxSizer21->Add(m_weightCtrl, 0, wxGROW|wxALL, 5);
- wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxVERTICAL);
- itemBoxSizer13->Add(itemBoxSizer20, 0, wxGROW, 5);
+ wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxVERTICAL);
+ itemBoxSizer17->Add(itemBoxSizer24, 0, wxGROW, 5);
- wxStaticText* itemStaticText21 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Underlining:"), wxDefaultPosition, wxDefaultSize, 0 );
- itemBoxSizer20->Add(itemStaticText21, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
+ wxStaticText* itemStaticText25 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Underlining:"), wxDefaultPosition, wxDefaultSize, 0 );
+ itemBoxSizer24->Add(itemStaticText25, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_underliningCtrlStrings;
m_underliningCtrl = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, wxEmptyString, wxDefaultPosition, wxSize(110, -1), m_underliningCtrlStrings, wxCB_READONLY );
m_underliningCtrl->SetHelpText(_("Select underlining or no underlining."));
if (wxRichTextFontPage::ShowToolTips())
m_underliningCtrl->SetToolTip(_("Select underlining or no underlining."));
- itemBoxSizer20->Add(m_underliningCtrl, 0, wxGROW|wxALL, 5);
+ itemBoxSizer24->Add(m_underliningCtrl, 0, wxGROW|wxALL, 5);
- itemBoxSizer13->Add(0, 0, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5);
+ itemBoxSizer17->Add(0, 0, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5);
- wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxVERTICAL);
- itemBoxSizer13->Add(itemBoxSizer24, 0, wxGROW, 5);
+ wxBoxSizer* itemBoxSizer28 = new wxBoxSizer(wxVERTICAL);
+ itemBoxSizer17->Add(itemBoxSizer28, 0, wxGROW, 5);
m_textColourLabel = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL, _("&Colour:"), wxDefaultPosition, wxDefaultSize, 0 );
m_textColourLabel->SetValue(false);
- itemBoxSizer24->Add(m_textColourLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5);
+ itemBoxSizer28->Add(m_textColourLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5);
m_colourCtrl = new wxRichTextColourSwatchCtrl( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_COLOURCTRL, wxDefaultPosition, wxSize(40, 20), 0 );
m_colourCtrl->SetHelpText(_("Click to change the text colour."));
if (wxRichTextFontPage::ShowToolTips())
m_colourCtrl->SetToolTip(_("Click to change the text colour."));
- itemBoxSizer24->Add(m_colourCtrl, 0, wxGROW|wxALL, 5);
+ itemBoxSizer28->Add(m_colourCtrl, 0, wxGROW|wxALL, 5);
- wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxVERTICAL);
- itemBoxSizer13->Add(itemBoxSizer27, 0, wxGROW, 5);
+ wxBoxSizer* itemBoxSizer31 = new wxBoxSizer(wxVERTICAL);
+ itemBoxSizer17->Add(itemBoxSizer31, 0, wxGROW, 5);
m_bgColourLabel = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL, _("&Bg colour:"), wxDefaultPosition, wxDefaultSize, 0 );
m_bgColourLabel->SetValue(false);
- itemBoxSizer27->Add(m_bgColourLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5);
+ itemBoxSizer31->Add(m_bgColourLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5);
m_bgColourCtrl = new wxRichTextColourSwatchCtrl( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_BGCOLOURCTRL, wxDefaultPosition, wxSize(40, 20), 0 );
m_bgColourCtrl->SetHelpText(_("Click to change the text background colour."));
if (wxRichTextFontPage::ShowToolTips())
m_bgColourCtrl->SetToolTip(_("Click to change the text background colour."));
- itemBoxSizer27->Add(m_bgColourCtrl, 0, wxGROW|wxALL, 5);
+ itemBoxSizer31->Add(m_bgColourCtrl, 0, wxGROW|wxALL, 5);
- wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxHORIZONTAL);
- itemBoxSizer3->Add(itemBoxSizer30, 0, wxGROW, 5);
+ wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxHORIZONTAL);
+ itemBoxSizer3->Add(itemBoxSizer34, 0, wxGROW, 5);
m_strikethroughCtrl = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL, _("&Strikethrough"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER );
m_strikethroughCtrl->SetValue(false);
m_strikethroughCtrl->SetHelpText(_("Check to show a line through the text."));
if (wxRichTextFontPage::ShowToolTips())
m_strikethroughCtrl->SetToolTip(_("Check to show a line through the text."));
- itemBoxSizer30->Add(m_strikethroughCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+ itemBoxSizer34->Add(m_strikethroughCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_capitalsCtrl = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_CAPSCTRL, _("Ca&pitals"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER );
m_capitalsCtrl->SetValue(false);
m_capitalsCtrl->SetHelpText(_("Check to show the text in capitals."));
if (wxRichTextFontPage::ShowToolTips())
m_capitalsCtrl->SetToolTip(_("Check to show the text in capitals."));
- itemBoxSizer30->Add(m_capitalsCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+ itemBoxSizer34->Add(m_capitalsCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_superscriptCtrl = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_SUPERSCRIPT, _("Supe&rscript"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER );
m_superscriptCtrl->SetValue(false);
m_superscriptCtrl->SetHelpText(_("Check to show the text in superscript."));
if (wxRichTextFontPage::ShowToolTips())
m_superscriptCtrl->SetToolTip(_("Check to show the text in superscript."));
- itemBoxSizer30->Add(m_superscriptCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+ itemBoxSizer34->Add(m_superscriptCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_subscriptCtrl = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_SUBSCRIPT, _("Subscrip&t"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER );
m_subscriptCtrl->SetValue(false);
m_subscriptCtrl->SetHelpText(_("Check to show the text in subscript."));
if (wxRichTextFontPage::ShowToolTips())
m_subscriptCtrl->SetToolTip(_("Check to show the text in subscript."));
- itemBoxSizer30->Add(m_subscriptCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
+ itemBoxSizer34->Add(m_subscriptCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5);
int sz = wxAtoi(strSize);
if (sz > 0)
{
- attr->SetFontSize(sz);
+ if (m_sizeUnitsCtrl->GetSelection() == 0)
+ attr->SetFontPointSize(sz);
+ else
+ attr->SetFontPixelSize(sz);
}
}
else
m_faceListBox->SetFaceNameSelection(wxEmptyString);
}
- if (attr->HasFontSize())
+ if (attr->HasFontPointSize())
{
wxString strSize = wxString::Format(wxT("%d"), attr->GetFontSize());
m_sizeTextCtrl->SetValue(strSize);
+ m_sizeUnitsCtrl->SetSelection(0);
if (m_sizeListBox->FindString(strSize) != wxNOT_FOUND)
m_sizeListBox->SetStringSelection(strSize);
}
+ else if (attr->HasFontPixelSize())
+ {
+ wxString strSize = wxString::Format(wxT("%d"), attr->GetFontSize());
+ m_sizeTextCtrl->SetValue(strSize);
+ m_sizeUnitsCtrl->SetSelection(1);
+ m_sizeListBox->SetSelection(wxNOT_FOUND);
+ }
else
{
m_sizeTextCtrl->SetValue(wxEmptyString);
{
int sz = wxAtoi(strSize);
if (sz > 0)
- attr.SetFontSize(sz);
+ {
+ if (m_sizeUnitsCtrl->GetSelection() == 1)
+ attr.SetFontPixelSize(sz);
+ else
+ attr.SetFontPointSize(sz);
+ }
}
if (m_styleCtrl->GetSelection() != wxNOT_FOUND && m_styleCtrl->GetSelection() != 0)
UpdatePreview();
}
+
+/*!
+ * wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZE_UNITS
+ */
+
+void wxRichTextFontPage::OnRichtextfontpageSizeUnitsSelected( wxCommandEvent& WXUNUSED(event) )
+{
+ if (m_dontUpdate)
+ return;
+
+ UpdatePreview();
+}
+
+/*!
+ * wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS
+ */
+
+void wxRichTextFontPage::OnRichtextfontpageSpinbuttonsUp( wxSpinEvent& WXUNUSED(event) )
+{
+ wxString text = m_sizeTextCtrl->GetValue();
+ if (!text.IsEmpty())
+ {
+ int size = wxAtoi(text);
+ if (size > 0)
+ {
+ size ++;
+ m_sizeTextCtrl->SetValue(wxString::Format(wxT("%d"), size));
+ UpdatePreview();
+ }
+ }
+}
+
+/*!
+ * wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS
+ */
+
+void wxRichTextFontPage::OnRichtextfontpageSpinbuttonsDown( wxSpinEvent& WXUNUSED(event) )
+{
+ wxString text = m_sizeTextCtrl->GetValue();
+ if (!text.IsEmpty())
+ {
+ int size = wxAtoi(text);
+ if (size > 0)
+ {
+ size --;
+ m_sizeTextCtrl->SetValue(wxString::Format(wxT("%d"), size));
+ UpdatePreview();
+ }
+ }
+}
+
+/*!
+ * wxEVT_IDLE event handler for ID_RICHTEXTFONTPAGE
+ */
+
+void wxRichTextFontPage::OnIdle( wxIdleEvent& WXUNUSED(event) )
+{
+ if (!m_sizeUnitsCtrl)
+ return;
+
+ if (m_sizeUnitsCtrl->GetSelection() == 1 && m_sizeListBox->IsShown())
+ {
+ m_fontListBoxParent->Show(m_sizeListBox, false);
+ Layout();
+ }
+ else if (m_sizeUnitsCtrl->GetSelection() == 0 && !m_sizeListBox->IsShown())
+ {
+ m_fontListBoxParent->Show(m_sizeListBox, true);
+ Layout();
+ }
+ if (!wxRichTextFormattingDialog::GetDialog(this)->HasOption(wxRichTextFormattingDialog::Option_AllowPixelFontSize) &&
+ m_sizeUnitsCtrl->IsEnabled())
+ {
+ m_sizeUnitsCtrl->Disable();
+ }
+}
m_styleDefinition = NULL;
m_styleSheet = NULL;
m_object = NULL;
+ m_options = 0;
}
wxRichTextFormattingDialog::~wxRichTextFormattingDialog()
name.Find(wxT("default")) != wxNOT_FOUND || name.Find(defaultTranslated) != wxNOT_FOUND)
{
wxRichTextAttr attr2(d->GetStyleMergedWithBase(GetStyleSheet()));
- if (attr2.HasFontSize())
+ if (attr2.HasFontPointSize())
{
stdFontSize = attr2.GetFontSize();
break;
if (d)
{
wxRichTextAttr attr2(d->GetStyleMergedWithBase(GetStyleSheet()));
- if (attr2.HasFontSize())
+ if (attr2.HasFontPointSize())
{
if (attr2.GetFontSize() <= (int) maxSize)
sizes[attr2.GetFontSize()] ++;
if (stdFontSize == 0)
stdFontSize = 12;
- int thisFontSize = ((attr.GetFlags() & wxTEXT_ATTR_FONT_SIZE) != 0) ? attr.GetFontSize() : stdFontSize;
+ int thisFontSize = attr.HasFontPointSize() ? attr.GetFontSize() : stdFontSize;
if (thisFontSize < stdFontSize)
size --;
if (attr.HasBackgroundColour() && attr.GetBackgroundColour().IsOk())
AddAttribute(str, wxT("bgcolor"), attr.GetBackgroundColour());
- if (attr.HasFontSize())
- AddAttribute(str, wxT("fontsize"), attr.GetFontSize());
+ if (attr.HasFontPointSize())
+ AddAttribute(str, wxT("fontpointsize"), attr.GetFontSize());
+ else if (attr.HasFontPixelSize())
+ AddAttribute(str, wxT("fontpixelsize"), attr.GetFontSize());
if (attr.HasFontFamily())
AddAttribute(str, wxT("fontfamily"), attr.GetFontFamily());
if (attr.HasBackgroundColour() && attr.GetBackgroundColour().IsOk())
node->AddAttribute(wxT("bgcolor"), MakeString(attr.GetBackgroundColour()));
- if (attr.HasFontSize())
- node->AddAttribute(wxT("fontsize"), MakeString(attr.GetFontSize()));
+ if (attr.HasFontPointSize())
+ node->AddAttribute(wxT("fontpointsize"), MakeString(attr.GetFontSize()));
+ else if (attr.HasFontPixelSize())
+ node->AddAttribute(wxT("fontpixelsize"), MakeString(attr.GetFontSize()));
if (attr.HasFontFamily())
node->AddAttribute(wxT("fontfamily"), MakeString(attr.GetFontFamily()));
if (attr.HasFontItalic())
if (!value.empty())
attr.SetFontStyle((wxFontStyle)wxAtoi(value));
}
- else if (name == wxT("fontsize"))
+ else if (name == wxT("fontsize") || name == wxT("fontpointsize"))
{
if (!value.empty())
- attr.SetFontSize(wxAtoi(value));
+ attr.SetFontPointSize(wxAtoi(value));
+ }
+ else if (name == wxT("fontpixelsize"))
+ {
+ if (!value.empty())
+ attr.SetFontPixelSize(wxAtoi(value));
}
else if (name == wxT("fontweight"))
{