+ bool m_applyOnSelection; // if true, applies style on selection
+ wxRichTextStyleType m_styleType; // style type to display
+ bool m_autoSetSelection;
+ wxArrayString m_styleNames;
+};
+
+/*!
+ * wxRichTextStyleListCtrl class declaration
+ * This is a container for the list control plus a combobox to switch between
+ * style types.
+ */
+
+#define wxRICHTEXTSTYLELIST_HIDE_TYPE_SELECTOR 0x1000
+
+class WXDLLIMPEXP_RICHTEXT wxRichTextStyleListCtrl: public wxControl
+{
+ DECLARE_CLASS(wxRichTextStyleListCtrl)
+ DECLARE_EVENT_TABLE()
+
+public:
+
+ /// Constructors
+ wxRichTextStyleListCtrl()
+ {
+ Init();
+ }
+
+ wxRichTextStyleListCtrl(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0);
+
+ /// Constructors
+ virtual ~wxRichTextStyleListCtrl();
+
+ /// Member initialisation
+ void Init()
+ {
+ m_styleListBox = NULL;
+ m_styleChoice = NULL;
+ m_dontUpdate = false;
+ }
+
+ /// Creates the windows
+ 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 sheet
+ void SetStyleSheet(wxRichTextStyleSheet* styleSheet);
+ wxRichTextStyleSheet* GetStyleSheet() const;
+
+ /// Associates the control with a wxRichTextCtrl
+ void SetRichTextCtrl(wxRichTextCtrl* ctrl);
+ wxRichTextCtrl* GetRichTextCtrl() const;
+
+ /// Set/get the style type to display
+ void SetStyleType(wxRichTextStyleListBox::wxRichTextStyleType styleType);
+ wxRichTextStyleListBox::wxRichTextStyleType GetStyleType() const;
+
+ /// Get the choice index for style type
+ int StyleTypeToIndex(wxRichTextStyleListBox::wxRichTextStyleType styleType);
+
+ /// Get the style type for choice index
+ wxRichTextStyleListBox::wxRichTextStyleType StyleIndexToType(int i);
+
+ /// Get the listbox
+ wxRichTextStyleListBox* GetStyleListBox() const { return m_styleListBox; }
+
+ /// Get the choice
+ wxChoice* GetStyleChoice() const { return m_styleChoice; }
+
+ /// React to style type choice
+ void OnChooseType(wxCommandEvent& event);
+
+ /// Lay out the controls
+ void OnSize(wxSizeEvent& event);
+
+private:
+
+ wxRichTextStyleListBox* m_styleListBox;
+ wxChoice* m_styleChoice;
+ bool m_dontUpdate;