X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6f02a879ed7efc5fcf6328ff47a1352ec82812b7..ec1e0c6634b94edaf4138f68bcb0c5d801f952b2:/include/wx/richtext/richtextctrl.h diff --git a/include/wx/richtext/richtextctrl.h b/include/wx/richtext/richtextctrl.h index e9425ea376..5e6f37cb9c 100644 --- a/include/wx/richtext/richtextctrl.h +++ b/include/wx/richtext/richtextctrl.h @@ -84,7 +84,7 @@ * wxRichTextCtrl class declaration */ -class WXDLLIMPEXP_ADV wxRichTextCtrl: +class WXDLLIMPEXP_RICHTEXT wxRichTextCtrl: #if wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE public wxTextCtrlBase, wxScrollHelper #else @@ -98,14 +98,14 @@ public: // Constructors wxRichTextCtrl( ); - wxRichTextCtrl( wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + wxRichTextCtrl( wxWindow* parent, wxWindowID id = -1, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxRE_MULTILINE ); ~wxRichTextCtrl( ); // Operations /// Creation - bool Create( wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + bool Create( wxWindow* parent, wxWindowID id = -1, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxRE_MULTILINE ); /// Member initialisation @@ -175,14 +175,18 @@ public: // text control under some platforms supports the text styles: these // methods allow to apply the given text style to the given selection or to // set/get the style which will be used for all appended text + virtual bool SetStyle(long start, long end, const wxTextAttr& style); virtual bool SetStyle(long start, long end, const wxTextAttrEx& style); virtual bool SetStyle(const wxRichTextRange& range, const wxRichTextAttr& style); + virtual bool GetStyle(long position, wxTextAttr& style) const; virtual bool GetStyle(long position, wxTextAttrEx& style) const; virtual bool GetStyle(long position, wxRichTextAttr& style) const; virtual bool SetDefaultStyle(const wxTextAttrEx& style); + virtual bool SetDefaultStyle(const wxTextAttr& style); // TODO: change to GetDefaultStyle if we merge wxTextAttr and wxTextAttrEx virtual const wxTextAttrEx& GetDefaultStyleEx() const; + virtual const wxTextAttr& GetDefaultStyle() const; // translate between the position (which is just an index in the text ctrl // considering all its contents as a single strings) and (x, y) coordinates @@ -510,7 +514,7 @@ public: // Command handlers - void Command(wxCommandEvent & event); + void Command(wxCommandEvent& event); void OnDropFiles(wxDropFilesEvent& event); void OnCut(wxCommandEvent& event); @@ -575,10 +579,6 @@ public: // Implementation -#if wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE - WX_FORWARD_TO_SCROLL_HELPER() -#endif - /// Set font, and also default attributes virtual bool SetFont(const wxFont& font); @@ -607,7 +607,10 @@ public: void InitCommandEvent(wxCommandEvent& event) const; /// do the window-specific processing after processing the update event + // (duplicated code from wxTextCtrlBase) +#if !wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE virtual void DoUpdateWindowUI(wxUpdateUIEvent& event); +#endif /// Should we inherit colours? virtual bool ShouldInheritColours() const { return false; } @@ -670,6 +673,10 @@ public: /// Returns the first visible position in the current view long GetFirstVisiblePosition() const; +#if wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE + WX_FORWARD_TO_SCROLL_HELPER() +#endif + // Overrides protected: @@ -729,7 +736,7 @@ private: * wxRichTextEvent - the event class for wxRichTextCtrl notifications */ -class WXDLLIMPEXP_ADV wxRichTextEvent : public wxNotifyEvent +class WXDLLIMPEXP_RICHTEXT wxRichTextEvent : public wxNotifyEvent { public: wxRichTextEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) @@ -763,13 +770,13 @@ private: */ BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_RICHTEXT_ITEM_SELECTED, 2600) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_RICHTEXT_ITEM_DESELECTED, 2601) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_RICHTEXT_LEFT_CLICK, 2602) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK, 2603) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK, 2604) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK, 2605) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_RICHTEXT_RETURN, 2606) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_ITEM_SELECTED, 2600) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_ITEM_DESELECTED, 2601) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_LEFT_CLICK, 2602) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK, 2603) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK, 2604) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK, 2605) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_RETURN, 2606) END_DECLARE_EVENT_TYPES() typedef void (wxEvtHandler::*wxRichTextEventFunction)(wxRichTextEvent&);