wxRICHTEXT_FORMATTED,
wxRICHTEXT_UNFORMATTED,
+ wxRICHTEXT_SETSTYLE_NONE,
+ wxRICHTEXT_SETSTYLE_WITH_UNDO,
+ wxRICHTEXT_SETSTYLE_OPTIMIZE,
+ wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY,
+ wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY,
+
+ wxRICHTEXT_INSERT_NONE,
+ wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE,
+
+
// TODO: Rename these to be wxRICHTEXT_* ??
wxTEXT_ATTR_PARAGRAPH_STYLE_NAME,
wxTEXT_ATTR_BULLET_STYLE,
wxTEXT_ATTR_BULLET_NUMBER,
- wxTEXT_ATTR_BULLET_SYMBOL,
wxTEXT_ATTR_BULLET_STYLE_NONE,
wxTEXT_ATTR_BULLET_STYLE_ARABIC,
__safe_for_unpickling__ = True
def __reduce__(self): return (RichTextRange, self.Get())
}
+
+ %property(End, GetEnd, SetEnd, doc="See `GetEnd` and `SetEnd`");
+ %property(Length, GetLength, doc="See `GetLength`");
+ %property(Start, GetStart, SetStart, doc="See `GetStart` and `SetStart`");
};
def SetFont(self, font):
return self.GetFontAttributes(font)
}
-
+
// setters
void SetTextColour(const wxColour& colText);
void SetBackgroundColour(const wxColour& colBack);
void SetLineSpacing(int spacing);
void SetBulletStyle(int style);
void SetBulletNumber(int n);
- void SetBulletSymbol(wxChar symbol);
-
+ void SetBulletText(wxChar symbol);
+ void SetBulletFont(const wxString& bulletFont);
+
const wxColour& GetTextColour() const;
const wxColour& GetBackgroundColour() const;
wxTextAttrAlignment GetAlignment() const;
int GetParagraphSpacingBefore() const;
int GetLineSpacing() const;
int GetBulletStyle() const;
- int GetBulletNumber() const { return m_bulletNumber; }
- wxChar GetBulletSymbol() const;
+ int GetBulletNumber() const;
+ const wxString& GetBulletText() const;
+ const wxString& GetBulletFont() const;
// accessors
bool HasTextColour() const;
bool HasTabs() const;
bool HasLeftIndent() const;
bool HasRightIndent() const;
- bool HasWeight() const;
- bool HasSize() const;
- bool HasItalic() const;
- bool HasUnderlined() const;
- bool HasFaceName() const;
+// bool HasWeight() const;
+// bool HasSize() const;
+// bool HasItalic() const;
+// bool HasUnderlined() const;
+// bool HasFaceName() const;
bool HasFont() const;
bool HasParagraphSpacingAfter() const;
bool HasParagraphStyleName() const;
bool HasBulletStyle() const;
bool HasBulletNumber() const;
- bool HasBulletSymbol() const;
+ bool HasBulletText() const;
bool HasFlag(long flag) const;
// returns false if we have any attributes set, true otherwise
bool IsDefault() const;
-
+
// // return the attribute having the valid font and colours: it uses the
// // attributes set in attr and falls back first to attrDefault and then to
// // the text control font/colours for those attributes which are not set
// static wxRichTextAttr Combine(const wxRichTextAttr& attr,
// const wxRichTextAttr& attrDef,
// const wxTextCtrlBase *text);
+
+
+ %property(Alignment, GetAlignment, SetAlignment, doc="See `GetAlignment` and `SetAlignment`");
+ %property(BackgroundColour, GetBackgroundColour, SetBackgroundColour, doc="See `GetBackgroundColour` and `SetBackgroundColour`");
+ %property(BulletFont, GetBulletFont, SetBulletFont, doc="See `GetBulletFont` and `SetBulletFont`");
+ %property(BulletNumber, GetBulletNumber, SetBulletNumber, doc="See `GetBulletNumber` and `SetBulletNumber`");
+ %property(BulletStyle, GetBulletStyle, SetBulletStyle, doc="See `GetBulletStyle` and `SetBulletStyle`");
+ %property(BulletText, GetBulletText, SetBulletText, doc="See `GetBulletText` and `SetBulletText`");
+ %property(CharacterStyleName, GetCharacterStyleName, SetCharacterStyleName, doc="See `GetCharacterStyleName` and `SetCharacterStyleName`");
+ %property(Flags, GetFlags, SetFlags, doc="See `GetFlags` and `SetFlags`");
+ %property(Font, GetFont, SetFont, doc="See `GetFont` and `SetFont`");
+ %property(FontAttributes, GetFontAttributes, doc="See `GetFontAttributes`");
+ %property(FontFaceName, GetFontFaceName, SetFontFaceName, doc="See `GetFontFaceName` and `SetFontFaceName`");
+ %property(FontSize, GetFontSize, SetFontSize, doc="See `GetFontSize` and `SetFontSize`");
+ %property(FontStyle, GetFontStyle, SetFontStyle, doc="See `GetFontStyle` and `SetFontStyle`");
+ %property(FontUnderlined, GetFontUnderlined, SetFontUnderlined, doc="See `GetFontUnderlined` and `SetFontUnderlined`");
+ %property(FontWeight, GetFontWeight, SetFontWeight, doc="See `GetFontWeight` and `SetFontWeight`");
+ %property(LeftIndent, GetLeftIndent, SetLeftIndent, doc="See `GetLeftIndent` and `SetLeftIndent`");
+ %property(LeftSubIndent, GetLeftSubIndent, doc="See `GetLeftSubIndent`");
+ %property(LineSpacing, GetLineSpacing, SetLineSpacing, doc="See `GetLineSpacing` and `SetLineSpacing`");
+ %property(ParagraphSpacingAfter, GetParagraphSpacingAfter, SetParagraphSpacingAfter, doc="See `GetParagraphSpacingAfter` and `SetParagraphSpacingAfter`");
+ %property(ParagraphSpacingBefore, GetParagraphSpacingBefore, SetParagraphSpacingBefore, doc="See `GetParagraphSpacingBefore` and `SetParagraphSpacingBefore`");
+ %property(ParagraphStyleName, GetParagraphStyleName, SetParagraphStyleName, doc="See `GetParagraphStyleName` and `SetParagraphStyleName`");
+ %property(RightIndent, GetRightIndent, SetRightIndent, doc="See `GetRightIndent` and `SetRightIndent`");
+ %property(Tabs, GetTabs, SetTabs, doc="See `GetTabs` and `SetTabs`");
+ %property(TextColour, GetTextColour, SetTextColour, doc="See `GetTextColour` and `SetTextColour`");
};
wxRichTextCtrl( wxWindow* parent,
wxWindowID id = -1,
+ const wxString& value = wxPyEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxRE_MULTILINE );
bool Create( wxWindow* parent,
wxWindowID id = -1,
+ const wxString& value = wxPyEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxRE_MULTILINE );
virtual bool , SaveFile(const wxString& file = wxPyEmptyString,
int type = wxRICHTEXT_TYPE_ANY),
"Save the contents of the document to the given filename, or if the
-empty string is passed then to the filename set with `SetFileName`.", "");
+empty string is passed then to the filename set with `SetFilename`.", "");
+ DocDeclStr(
+ void , SetHandlerFlags(int flags),
+ "Set the handler flags, controlling loading and saving.", "");
+
+ DocDeclStr(
+ int , GetHandlerFlags() const,
+ "Get the handler flags, controlling loading and saving.", "");
+
// sets/clears the dirty flag
DocDeclStr(
virtual void , MarkDirty(),
"Set the style for the text in ``range`` to ``style``", "");
DocDeclStr(
- virtual bool , GetStyle(long position, wxRichTextAttr& style) const,
+ virtual bool , SetStyleEx(const wxRichTextRange& range, const wxRichTextAttr& style,
+ int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO),
+ "Extended style setting operation with flags including:
+RICHTEXT_SETSTYLE_WITH_UNDO, RICHTEXT_SETSTYLE_OPTIMIZE,
+RICHTEXT_SETSTYLE_PARAGRAPHS_ONLY, RICHTEXT_SETSTYLE_CHARACTERS_ONLY", "");
+
+
+
+ DocDeclStr(
+ virtual bool , GetStyle(long position, wxRichTextAttr& style),
"Retrieve the style used at the given position. Copies the style
-values at ``position`` into the ``style`` parameter returns ``True``
+values at ``position`` into the ``style`` parameter and returns ``True``
if successful. Returns ``False`` otherwise.", "");
+ DocDeclStr(
+ virtual bool , GetUncombinedStyle(long position, wxRichTextAttr& style),
+ "Get the content (uncombined) attributes for this position. Copies the
+style values at ``position`` into the ``style`` parameter and returns
+``True`` if successful. Returns ``False`` otherwise.", "");
+
DocDeclStr(
virtual bool , SetDefaultStyle(const wxRichTextAttr& style),
/// Begin symbol bullet
DocDeclStr(
- bool , BeginSymbolBullet(char symbol,
+ bool , BeginSymbolBullet(const wxString& symbol,
int leftIndent,
int leftSubIndent,
int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL),
"", "");
+ DocDeclStr(
+ bool , BeginListStyle(const wxString& listStyle, int level = 1, int number = 1),
+ "Begin named list style.", "");
+
+ DocDeclStr(
+ bool , EndListStyle(), "End named list style.", "");
+
+ DocDeclStr(
+ bool , BeginURL(const wxString& url, const wxString& characterStyle = wxEmptyString),
+ "Begin URL.", "");
+
+ DocDeclStr(
+ bool , EndURL(), "End URL.", "");
+
/// Sets the default style to the style under the cursor
DocDeclStr(
bool , SetDefaultStyleToCursorStyle(),
virtual void , SelectNone(),
"", "");
+ /// Select the word at the given character position
+ DocDeclStr(
+ virtual bool , SelectWord(long position),
+ "", "");
+
/// Get/set the selection range in character positions. -1, -1 means no selection.
DocDeclStr(
- const wxRichTextRange& , GetSelectionRange() const,
+ wxRichTextRange , GetSelectionRange() const,
"", "");
DocDeclStr(
void , SetSelectionRange(const wxRichTextRange& range),
"", "");
+ /// Get/set the selection range in character positions. -1, -1 means no selection.
+ /// The range is in internal format, i.e. a single character selection is denoted
+ /// by (n, n)
+ DocDeclStr(
+ const wxRichTextRange& , GetInternalSelectionRange() const,
+ "", "");
+
+ DocDeclStr(
+ void , SetInternalSelectionRange(const wxRichTextRange& range),
+ "", "");
+
+
/// Add a new paragraph of text to the end of the buffer
DocDeclStr(
/// Is all of the selection bold?
DocDeclStr(
- virtual bool , IsSelectionBold() const,
+ virtual bool , IsSelectionBold(),
"", "");
/// Is all of the selection italics?
DocDeclStr(
- virtual bool , IsSelectionItalics() const,
+ virtual bool , IsSelectionItalics(),
"", "");
/// Is all of the selection underlined?
DocDeclStr(
- virtual bool , IsSelectionUnderlined() const,
+ virtual bool , IsSelectionUnderlined(),
"", "");
/// Is all of the selection aligned according to the specified flag?
DocDeclStr(
- virtual bool , IsSelectionAligned(wxTextAttrAlignment alignment) const,
+ virtual bool , IsSelectionAligned(wxTextAttrAlignment alignment),
"", "");
wxRichTextStyleSheet* , GetStyleSheet() const,
"", "");
+ /// Apply the style sheet to the buffer, for example if the styles have changed.
+ DocDeclStr(
+ bool , ApplyStyleSheet(wxRichTextStyleSheet* styleSheet = NULL),
+ "", "");
+
+
+ %property(Buffer, GetBuffer, doc="See `GetBuffer`");
+ %property(DefaultStyle, GetDefaultStyle, SetDefaultStyle, doc="See `GetDefaultStyle` and `SetDefaultStyle`");
+ %property(DelayedLayoutThreshold, GetDelayedLayoutThreshold, SetDelayedLayoutThreshold, doc="See `GetDelayedLayoutThreshold` and `SetDelayedLayoutThreshold`");
+ %property(Filename, GetFilename, SetFilename, doc="See `GetFilename` and `SetFilename`");
+ %property(InsertionPoint, GetInsertionPoint, SetInsertionPoint, doc="See `GetInsertionPoint` and `SetInsertionPoint`");
+ %property(InternalSelectionRange, GetInternalSelectionRange, SetInternalSelectionRange, doc="See `GetInternalSelectionRange` and `SetInternalSelectionRange`");
+ %property(LastPosition, GetLastPosition, doc="See `GetLastPosition`");
+ %property(NumberOfLines, GetNumberOfLines, doc="See `GetNumberOfLines`");
+ %property(Selection, GetSelection, SetSelectionRange, doc="See `GetSelection` and `SetSelection`");
+ %property(SelectionRange, GetSelectionRange, SetSelectionRange, doc="See `GetSelectionRange` and `SetSelectionRange`");
+ %property(StringSelection, GetStringSelection, doc="See `GetStringSelection`");
+ %property(StyleSheet, GetStyleSheet, SetStyleSheet, doc="See `GetStyleSheet` and `SetStyleSheet`");
+ %property(Value, GetValue, SetValue, doc="See `GetValue` and `SetValue`");
// Implementation
// TODO: Which of these should be exposed to Python?
//----------------------------------------------------------------------
-%constant wxEventType wxEVT_COMMAND_RICHTEXT_ITEM_SELECTED;
-%constant wxEventType wxEVT_COMMAND_RICHTEXT_ITEM_DESELECTED;
%constant wxEventType wxEVT_COMMAND_RICHTEXT_LEFT_CLICK;
%constant wxEventType wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK;
%constant wxEventType wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK;
%constant wxEventType wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK;
%constant wxEventType wxEVT_COMMAND_RICHTEXT_RETURN;
-
+%constant wxEventType wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING;
+%constant wxEventType wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED;
+%constant wxEventType wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING;
+%constant wxEventType wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED;
+%constant wxEventType wxEVT_COMMAND_RICHTEXT_CHARACTER;
+%constant wxEventType wxEVT_COMMAND_RICHTEXT_DELETE;
%pythoncode {
-EVT_RICHTEXT_ITEM_SELECTED = wx.PyEventBinder(wxEVT_COMMAND_RICHTEXT_ITEM_SELECTED, 1)
-EVT_RICHTEXT_ITEM_DESELECTED = wx.PyEventBinder(wxEVT_COMMAND_RICHTEXT_ITEM_DESELECTED, 1)
EVT_RICHTEXT_LEFT_CLICK = wx.PyEventBinder(wxEVT_COMMAND_RICHTEXT_LEFT_CLICK, 1)
EVT_RICHTEXT_RIGHT_CLICK = wx.PyEventBinder(wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK, 1)
EVT_RICHTEXT_MIDDLE_CLICK = wx.PyEventBinder(wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK, 1)
EVT_RICHTEXT_LEFT_DCLICK = wx.PyEventBinder(wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK, 1)
EVT_RICHTEXT_RETURN = wx.PyEventBinder( wxEVT_COMMAND_RICHTEXT_RETURN, 1)
+EVT_RICHTEXT_STYLESHEET_CHANGING = wx.PyEventBinder( wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING, 1)
+EVT_RICHTEXT_STYLESHEET_CHANGED = wx.PyEventBinder( wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED, 1)
+EVT_RICHTEXT_STYLESHEET_REPLACING = wx.PyEventBinder( wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING, 1)
+EVT_RICHTEXT_STYLESHEET_REPLACED = wx.PyEventBinder( wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED, 1)
+EVT_RICHTEXT_CHARACTER = wx.PyEventBinder( wxEVT_COMMAND_RICHTEXT_CHARACTER, 1)
+EVT_RICHTEXT_DELETE = wx.PyEventBinder( wxEVT_COMMAND_RICHTEXT_DELETE, 1)
}
public:
wxRichTextEvent(wxEventType commandType = wxEVT_NULL, int winid = 0);
- int GetIndex() const;
- void SetIndex(int n);
+ int GetPosition() const;
+ void SetPosition(int n);
int GetFlags() const;
void SetFlags(int flags);
+
+ %property(Flags, GetFlags, SetFlags, doc="See `GetFlags` and `SetFlags`");
+ %property(Index, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`");
};
//----------------------------------------------------------------------
%init %{
+ wxRichTextModuleInit();
%}
//----------------------------------------------------------------------