X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0c0e063e66f80ce608d8bb9447b33609858ba6be..50d4763f1710f6e45ac6af7112d1ce9effe93bc4:/interface/wx/richtext/richtextctrl.h diff --git a/interface/wx/richtext/richtextctrl.h b/interface/wx/richtext/richtextctrl.h index 831b184965..b341941c60 100644 --- a/interface/wx/richtext/richtextctrl.h +++ b/interface/wx/richtext/richtextctrl.h @@ -111,7 +111,7 @@ public: Adds appropriate menu items for the current container and clicked on object (and container's parent, if appropriate). */ - int AddItems(wxRichTextObject* container, wxRichTextObject* obj); + int AddItems(wxRichTextCtrl* ctrl, wxRichTextObject* container, wxRichTextObject* obj); /** Clears the items. @@ -810,6 +810,28 @@ public: virtual bool PromoteList(int promoteBy, const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel = -1); //@} + /** + Sets the properties for the given range, passing flags to determine how the + attributes are set. You can merge properties or replace them. + + The end point of range is specified as the last character position of the span + of text, plus one. So, for example, to set the properties for a character at + position 5, use the range (5,6). + + @a flags may contain a bit list of the following values: + - wxRICHTEXT_SETSPROPERTIES_NONE: no flag. + - wxRICHTEXT_SETPROPERTIES_WITH_UNDO: specifies that this operation should be + undoable. + - wxRICHTEXT_SETPROPERTIES_PARAGRAPHS_ONLY: specifies that the properties should only be + applied to paragraphs, and not the content. + - wxRICHTEXT_SETPROPERTIES_CHARACTERS_ONLY: specifies that the properties should only be + applied to characters, and not the paragraph. + - wxRICHTEXT_SETPROPERTIES_RESET: resets (clears) the existing properties before applying + the new properties. + - wxRICHTEXT_SETPROPERTIES_REMOVE: removes the specified properties. + */ + virtual bool SetProperties(const wxRichTextRange& range, const wxRichTextProperties& properties, int flags = wxRICHTEXT_SETPROPERTIES_WITH_UNDO); + /** Deletes the content within the given range. */ @@ -1580,6 +1602,49 @@ public: */ virtual int PrepareContextMenu(wxMenu* menu, const wxPoint& pt, bool addPropertyCommands); + /** + Returns @true if we can edit the object's properties via a GUI. + */ + virtual bool CanEditProperties(wxRichTextObject* obj) const; + + /** + Edits the object's properties via a GUI. + */ + virtual bool EditProperties(wxRichTextObject* obj, wxWindow* parent); + + /** + Gets the object's properties menu label. + */ + virtual wxString GetPropertiesMenuLabel(wxRichTextObject* obj); + + /** + Prepares the content just before insertion (or after buffer reset). Called by the same function in wxRichTextBuffer. + Currently is only called if undo mode is on. + */ + virtual void PrepareContent(wxRichTextParagraphLayoutBox& WXUNUSED(container)) {} + + /** + Can we delete this range? + Sends an event to the control. + */ + virtual bool CanDeleteRange(wxRichTextParagraphLayoutBox& container, const wxRichTextRange& range) const; + + /** + Can we insert content at this position? + Sends an event to the control. + */ + virtual bool CanInsertContent(wxRichTextParagraphLayoutBox& container, long pos) const; + + /** + Enable or disable the vertical scrollbar. + */ + virtual void EnableVerticalScrollbar(bool enable); + + /** + Returns @true if the vertical scrollbar is enabled. + */ + virtual bool GetVerticalScrollbarEnabled() const; + // Command handlers /** @@ -1971,6 +2036,11 @@ public: long FindCaretPositionForCharacterPosition(long position, int hitTestFlags, wxRichTextParagraphLayoutBox* container, bool& caretLineStart); + /** + Processes mouse movement in order to change the cursor + */ + virtual bool ProcessMouseMovement(wxRichTextParagraphLayoutBox* container, wxRichTextObject* obj, long position, const wxPoint& pos); + /** Font names take a long time to retrieve, so cache them (on demand). */ @@ -2132,6 +2202,9 @@ protected: when the control's stylesheet has been replaced, for example when a file is loaded into the control. Valid event functions: GetOldStyleSheet, GetNewStyleSheet. + @event{EVT_RICHTEXT_PROPERTIES_CHANGED(id, func)} + Process a @c wxEVT_COMMAND_RICHTEXT_PROPERTIES_CHANGED event, generated when + properties have been applied to the control. Valid event functions: GetPosition, GetRange. @event{EVT_RICHTEXT_CONTENT_INSERTED(id, func)} Process a @c wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED event, generated when content has been inserted into the control. @@ -2184,7 +2257,7 @@ public: { } /** - Returns the buffer position at which the event occured. + Returns the buffer position at which the event occurred. */ long GetPosition() const { return m_position; }