X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/38f833b10c071603eb8d7739ab31b1c07c4576f1..391bf008a7c005f7245a6522a67819a94a051011:/include/wx/richtext/richtextstyles.h diff --git a/include/wx/richtext/richtextstyles.h b/include/wx/richtext/richtextstyles.h index f16a3b6cf1..bce0f3399f 100644 --- a/include/wx/richtext/richtextstyles.h +++ b/include/wx/richtext/richtextstyles.h @@ -4,7 +4,7 @@ // Author: Julian Smart // Modified by: // Created: 2005-09-30 -// RCS-ID: +// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -198,9 +198,9 @@ public: virtual wxRichTextStyleDefinition* Clone() const { return new wxRichTextListStyleDefinition(*this); } /// Sets/gets the attributes for the given level - void SetLevelAttributes(int i, const wxTextAttrEx& attr); - wxTextAttrEx* GetLevelAttributes(int i); - const wxTextAttrEx* GetLevelAttributes(int i) const; + void SetLevelAttributes(int i, const wxRichTextAttr& attr); + wxRichTextAttr* GetLevelAttributes(int i); + const wxRichTextAttr* GetLevelAttributes(int i) const; /// Convenience function for setting the major attributes for a list level specification void SetAttributes(int i, int leftIndent, int leftSubIndent, int bulletStyle, const wxString& bulletSymbol = wxEmptyString); @@ -210,15 +210,15 @@ public: /// Combine the base and list style with a paragraph style, using the given indent (from which /// an appropriate level is found) - wxTextAttrEx CombineWithParagraphStyle(int indent, const wxTextAttrEx& paraStyle); + wxRichTextAttr CombineWithParagraphStyle(int indent, const wxRichTextAttr& paraStyle); /// Combine the base and list style, using the given indent (from which /// an appropriate level is found) - wxTextAttrEx GetCombinedStyle(int indent); + wxRichTextAttr GetCombinedStyle(int indent); /// Combine the base and list style, using the given level from which /// an appropriate level is found) - wxTextAttrEx GetCombinedStyleForLevel(int level); + wxRichTextAttr GetCombinedStyleForLevel(int level); /// Gets the number of available levels int GetLevelCount() const { return 10; } @@ -229,7 +229,7 @@ public: protected: /// The styles for each level (up to 10) - wxTextAttrEx m_levelStyles[10]; + wxRichTextAttr m_levelStyles[10]; }; /*! @@ -383,6 +383,7 @@ public: m_richTextCtrl = NULL; m_applyOnSelection = false; m_styleType = wxRICHTEXT_STYLE_PARAGRAPH; + m_autoSetSelection = true; } bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, @@ -414,9 +415,6 @@ public: /// Apply the style void ApplyStyle(int i); - /// React to selection - void OnSelect(wxCommandEvent& event); - /// Left click void OnLeftDown(wxMouseEvent& event); @@ -431,7 +429,8 @@ public: /// Can we set the selection based on the editor caret position? /// Need to override this if being used in a combobox popup - virtual bool CanAutoSetSelection() { return true; } + virtual bool CanAutoSetSelection() { return m_autoSetSelection; } + virtual void SetAutoSetSelection(bool autoSet) { m_autoSetSelection = autoSet; } /// Set whether the style should be applied as soon as the item is selected (the default) void SetApplyOnSelection(bool applyOnSel) { m_applyOnSelection = applyOnSel; } @@ -454,6 +453,7 @@ private: wxRichTextCtrl* m_richTextCtrl; bool m_applyOnSelection; // if true, applies style on selection wxRichTextStyleType m_styleType; // style type to display + bool m_autoSetSelection; }; /*! @@ -462,6 +462,8 @@ private: * style types. */ +#define wxRICHTEXTSTYLELIST_HIDE_TYPE_SELECTOR 0x1000 + class WXDLLIMPEXP_RICHTEXT wxRichTextStyleListCtrl: public wxControl { DECLARE_CLASS(wxRichTextStyleListCtrl) @@ -493,6 +495,9 @@ public: bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); + /// Updates the style list box + void UpdateStyles(); + /// Associates the control with a style manager void SetStyleSheet(wxRichTextStyleSheet* styleSheet); wxRichTextStyleSheet* GetStyleSheet() const; @@ -501,9 +506,6 @@ public: void SetRichTextCtrl(wxRichTextCtrl* ctrl); wxRichTextCtrl* GetRichTextCtrl() const; - /// Updates the style list box - void UpdateStyles(); - /// Set/get the style type to display void SetStyleType(wxRichTextStyleListBox::wxRichTextStyleType styleType); wxRichTextStyleListBox::wxRichTextStyleType GetStyleType() const;