1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richtextstyles.h
3 // Purpose: Style management for wxRichTextCtrl
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_RICHTEXTSTYLES_H_
13 #define _WX_RICHTEXTSTYLES_H_
23 #include "wx/richtext/richtextbuffer.h"
26 #include "wx/htmllbox.h"
33 #include "wx/choice.h"
36 * Forward declarations
39 class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextCtrl
;
40 class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextBuffer
;
43 * wxRichTextStyleDefinition class declaration
44 * A base class for paragraph and character styles.
47 class WXDLLIMPEXP_RICHTEXT wxRichTextStyleDefinition
: public wxObject
49 DECLARE_CLASS(wxRichTextStyleDefinition
)
53 wxRichTextStyleDefinition(const wxRichTextStyleDefinition
& def
)
60 /// Default constructor
61 wxRichTextStyleDefinition(const wxString
& name
= wxEmptyString
) { Init(); m_name
= name
; }
64 virtual ~wxRichTextStyleDefinition() {}
66 /// Initialises members
70 void Copy(const wxRichTextStyleDefinition
& def
);
73 bool Eq(const wxRichTextStyleDefinition
& def
) const;
75 /// Assignment operator
76 void operator =(const wxRichTextStyleDefinition
& def
) { Copy(def
); }
79 bool operator ==(const wxRichTextStyleDefinition
& def
) const { return Eq(def
); }
81 /// Override to clone the object
82 virtual wxRichTextStyleDefinition
* Clone() const = 0;
84 /// Sets and gets the name of the style
85 void SetName(const wxString
& name
) { m_name
= name
; }
86 const wxString
& GetName() const { return m_name
; }
88 /// Sets and gets the style description
89 void SetDescription(const wxString
& descr
) { m_description
= descr
; }
90 const wxString
& GetDescription() const { return m_description
; }
92 /// Sets and gets the name of the style that this style is based on
93 void SetBaseStyle(const wxString
& name
) { m_baseStyle
= name
; }
94 const wxString
& GetBaseStyle() const { return m_baseStyle
; }
96 /// Sets and gets the style
97 void SetStyle(const wxRichTextAttr
& style
) { m_style
= style
; }
98 const wxRichTextAttr
& GetStyle() const { return m_style
; }
99 wxRichTextAttr
& GetStyle() { return m_style
; }
101 /// Gets the style combined with the base style
102 virtual wxRichTextAttr
GetStyleMergedWithBase(const wxRichTextStyleSheet
* sheet
) const;
106 wxString m_baseStyle
;
107 wxString m_description
;
108 wxRichTextAttr m_style
;
112 * wxRichTextCharacterStyleDefinition class declaration
115 class WXDLLIMPEXP_RICHTEXT wxRichTextCharacterStyleDefinition
: public wxRichTextStyleDefinition
117 DECLARE_DYNAMIC_CLASS(wxRichTextCharacterStyleDefinition
)
121 wxRichTextCharacterStyleDefinition(const wxRichTextCharacterStyleDefinition
& def
): wxRichTextStyleDefinition(def
) {}
123 /// Default constructor
124 wxRichTextCharacterStyleDefinition(const wxString
& name
= wxEmptyString
):
125 wxRichTextStyleDefinition(name
) {}
128 virtual ~wxRichTextCharacterStyleDefinition() {}
130 /// Clones the object
131 virtual wxRichTextStyleDefinition
* Clone() const { return new wxRichTextCharacterStyleDefinition(*this); }
137 * wxRichTextParagraphStyleDefinition class declaration
140 class WXDLLIMPEXP_RICHTEXT wxRichTextParagraphStyleDefinition
: public wxRichTextStyleDefinition
142 DECLARE_DYNAMIC_CLASS(wxRichTextParagraphStyleDefinition
)
146 wxRichTextParagraphStyleDefinition(const wxRichTextParagraphStyleDefinition
& def
): wxRichTextStyleDefinition(def
) { m_nextStyle
= def
.m_nextStyle
; }
148 /// Default constructor
149 wxRichTextParagraphStyleDefinition(const wxString
& name
= wxEmptyString
):
150 wxRichTextStyleDefinition(name
) {}
153 virtual ~wxRichTextParagraphStyleDefinition() {}
155 /// Sets and gets the next style
156 void SetNextStyle(const wxString
& name
) { m_nextStyle
= name
; }
157 const wxString
& GetNextStyle() const { return m_nextStyle
; }
160 void Copy(const wxRichTextParagraphStyleDefinition
& def
);
162 /// Assignment operator
163 void operator =(const wxRichTextParagraphStyleDefinition
& def
) { Copy(def
); }
165 /// Equality operator
166 bool operator ==(const wxRichTextParagraphStyleDefinition
& def
) const;
168 /// Clones the object
169 virtual wxRichTextStyleDefinition
* Clone() const { return new wxRichTextParagraphStyleDefinition(*this); }
173 /// The next style to use when adding a paragraph after this style.
174 wxString m_nextStyle
;
178 * wxRichTextListStyleDefinition class declaration
181 class WXDLLIMPEXP_RICHTEXT wxRichTextListStyleDefinition
: public wxRichTextParagraphStyleDefinition
183 DECLARE_DYNAMIC_CLASS(wxRichTextListStyleDefinition
)
187 wxRichTextListStyleDefinition(const wxRichTextListStyleDefinition
& def
): wxRichTextParagraphStyleDefinition(def
) { Init(); Copy(def
); }
189 /// Default constructor
190 wxRichTextListStyleDefinition(const wxString
& name
= wxEmptyString
):
191 wxRichTextParagraphStyleDefinition(name
) { Init(); }
194 virtual ~wxRichTextListStyleDefinition() {}
197 void Copy(const wxRichTextListStyleDefinition
& def
);
199 /// Assignment operator
200 void operator =(const wxRichTextListStyleDefinition
& def
) { Copy(def
); }
202 /// Equality operator
203 bool operator ==(const wxRichTextListStyleDefinition
& def
) const;
205 /// Clones the object
206 virtual wxRichTextStyleDefinition
* Clone() const { return new wxRichTextListStyleDefinition(*this); }
208 /// Sets/gets the attributes for the given level
209 void SetLevelAttributes(int i
, const wxRichTextAttr
& attr
);
210 wxRichTextAttr
* GetLevelAttributes(int i
);
211 const wxRichTextAttr
* GetLevelAttributes(int i
) const;
213 /// Convenience function for setting the major attributes for a list level specification
214 void SetAttributes(int i
, int leftIndent
, int leftSubIndent
, int bulletStyle
, const wxString
& bulletSymbol
= wxEmptyString
);
216 /// Finds the level corresponding to the given indentation
217 int FindLevelForIndent(int indent
) const;
219 /// Combine the base and list style with a paragraph style, using the given indent (from which
220 /// an appropriate level is found)
221 wxRichTextAttr
CombineWithParagraphStyle(int indent
, const wxRichTextAttr
& paraStyle
, wxRichTextStyleSheet
* styleSheet
= NULL
);
223 /// Combine the base and list style, using the given indent (from which
224 /// an appropriate level is found)
225 wxRichTextAttr
GetCombinedStyle(int indent
, wxRichTextStyleSheet
* styleSheet
= NULL
);
227 /// Combine the base and list style, using the given level from which
228 /// an appropriate level is found)
229 wxRichTextAttr
GetCombinedStyleForLevel(int level
, wxRichTextStyleSheet
* styleSheet
= NULL
);
231 /// Gets the number of available levels
232 int GetLevelCount() const { return 10; }
234 /// Is this a numbered list?
235 bool IsNumbered(int i
) const;
239 /// The styles for each level (up to 10)
240 wxRichTextAttr m_levelStyles
[10];
244 * wxRichTextBoxStyleDefinition class declaration, for box attributes in objects such as wxRichTextBox.
247 class WXDLLIMPEXP_RICHTEXT wxRichTextBoxStyleDefinition
: public wxRichTextStyleDefinition
249 DECLARE_DYNAMIC_CLASS(wxRichTextBoxStyleDefinition
)
253 wxRichTextBoxStyleDefinition(const wxRichTextBoxStyleDefinition
& def
): wxRichTextStyleDefinition(def
) { Copy(def
); }
255 /// Default constructor
256 wxRichTextBoxStyleDefinition(const wxString
& name
= wxEmptyString
):
257 wxRichTextStyleDefinition(name
) {}
260 virtual ~wxRichTextBoxStyleDefinition() {}
263 void Copy(const wxRichTextBoxStyleDefinition
& def
);
265 /// Assignment operator
266 void operator =(const wxRichTextBoxStyleDefinition
& def
) { Copy(def
); }
268 /// Equality operator
269 bool operator ==(const wxRichTextBoxStyleDefinition
& def
) const;
271 /// Clones the object
272 virtual wxRichTextStyleDefinition
* Clone() const { return new wxRichTextBoxStyleDefinition(*this); }
281 class WXDLLIMPEXP_RICHTEXT wxRichTextStyleSheet
: public wxObject
283 DECLARE_CLASS( wxRichTextStyleSheet
)
287 wxRichTextStyleSheet(const wxRichTextStyleSheet
& sheet
)
293 wxRichTextStyleSheet() { Init(); }
294 virtual ~wxRichTextStyleSheet();
300 void Copy(const wxRichTextStyleSheet
& sheet
);
303 void operator=(const wxRichTextStyleSheet
& sheet
) { Copy(sheet
); }
306 bool operator==(const wxRichTextStyleSheet
& sheet
) const;
308 /// Add a definition to the character style list
309 bool AddCharacterStyle(wxRichTextCharacterStyleDefinition
* def
);
311 /// Add a definition to the paragraph style list
312 bool AddParagraphStyle(wxRichTextParagraphStyleDefinition
* def
);
314 /// Add a definition to the list style list
315 bool AddListStyle(wxRichTextListStyleDefinition
* def
);
317 /// Add a definition to the box style list
318 bool AddBoxStyle(wxRichTextBoxStyleDefinition
* def
);
320 /// Add a definition to the appropriate style list
321 bool AddStyle(wxRichTextStyleDefinition
* def
);
323 /// Remove a character style
324 bool RemoveCharacterStyle(wxRichTextStyleDefinition
* def
, bool deleteStyle
= false) { return RemoveStyle(m_characterStyleDefinitions
, def
, deleteStyle
); }
326 /// Remove a paragraph style
327 bool RemoveParagraphStyle(wxRichTextStyleDefinition
* def
, bool deleteStyle
= false) { return RemoveStyle(m_paragraphStyleDefinitions
, def
, deleteStyle
); }
329 /// Remove a list style
330 bool RemoveListStyle(wxRichTextStyleDefinition
* def
, bool deleteStyle
= false) { return RemoveStyle(m_listStyleDefinitions
, def
, deleteStyle
); }
332 /// Remove a box style
333 bool RemoveBoxStyle(wxRichTextStyleDefinition
* def
, bool deleteStyle
= false) { return RemoveStyle(m_boxStyleDefinitions
, def
, deleteStyle
); }
336 bool RemoveStyle(wxRichTextStyleDefinition
* def
, bool deleteStyle
= false);
338 /// Find a character definition by name
339 wxRichTextCharacterStyleDefinition
* FindCharacterStyle(const wxString
& name
, bool recurse
= true) const { return (wxRichTextCharacterStyleDefinition
*) FindStyle(m_characterStyleDefinitions
, name
, recurse
); }
341 /// Find a paragraph definition by name
342 wxRichTextParagraphStyleDefinition
* FindParagraphStyle(const wxString
& name
, bool recurse
= true) const { return (wxRichTextParagraphStyleDefinition
*) FindStyle(m_paragraphStyleDefinitions
, name
, recurse
); }
344 /// Find a list definition by name
345 wxRichTextListStyleDefinition
* FindListStyle(const wxString
& name
, bool recurse
= true) const { return (wxRichTextListStyleDefinition
*) FindStyle(m_listStyleDefinitions
, name
, recurse
); }
347 /// Find a box definition by name
348 wxRichTextBoxStyleDefinition
* FindBoxStyle(const wxString
& name
, bool recurse
= true) const { return (wxRichTextBoxStyleDefinition
*) FindStyle(m_boxStyleDefinitions
, name
, recurse
); }
350 /// Find any definition by name
351 wxRichTextStyleDefinition
* FindStyle(const wxString
& name
, bool recurse
= true) const;
353 /// Return the number of character styles
354 size_t GetCharacterStyleCount() const { return m_characterStyleDefinitions
.GetCount(); }
356 /// Return the number of paragraph styles
357 size_t GetParagraphStyleCount() const { return m_paragraphStyleDefinitions
.GetCount(); }
359 /// Return the number of list styles
360 size_t GetListStyleCount() const { return m_listStyleDefinitions
.GetCount(); }
362 /// Return the number of box styles
363 size_t GetBoxStyleCount() const { return m_boxStyleDefinitions
.GetCount(); }
365 /// Return the nth character style
366 wxRichTextCharacterStyleDefinition
* GetCharacterStyle(size_t n
) const { return (wxRichTextCharacterStyleDefinition
*) m_characterStyleDefinitions
.Item(n
)->GetData(); }
368 /// Return the nth paragraph style
369 wxRichTextParagraphStyleDefinition
* GetParagraphStyle(size_t n
) const { return (wxRichTextParagraphStyleDefinition
*) m_paragraphStyleDefinitions
.Item(n
)->GetData(); }
371 /// Return the nth list style
372 wxRichTextListStyleDefinition
* GetListStyle(size_t n
) const { return (wxRichTextListStyleDefinition
*) m_listStyleDefinitions
.Item(n
)->GetData(); }
374 /// Return the nth box style
375 wxRichTextBoxStyleDefinition
* GetBoxStyle(size_t n
) const { return (wxRichTextBoxStyleDefinition
*) m_boxStyleDefinitions
.Item(n
)->GetData(); }
377 /// Delete all styles
380 /// Insert into list of style sheets
381 bool InsertSheet(wxRichTextStyleSheet
* before
);
383 /// Append to list of style sheets
384 bool AppendSheet(wxRichTextStyleSheet
* after
);
386 /// Unlink from the list of style sheets
389 /// Get/set next sheet
390 wxRichTextStyleSheet
* GetNextSheet() const { return m_nextSheet
; }
391 void SetNextSheet(wxRichTextStyleSheet
* sheet
) { m_nextSheet
= sheet
; }
393 /// Get/set previous sheet
394 wxRichTextStyleSheet
* GetPreviousSheet() const { return m_previousSheet
; }
395 void SetPreviousSheet(wxRichTextStyleSheet
* sheet
) { m_previousSheet
= sheet
; }
397 /// Sets and gets the name of the style sheet
398 void SetName(const wxString
& name
) { m_name
= name
; }
399 const wxString
& GetName() const { return m_name
; }
401 /// Sets and gets the style description
402 void SetDescription(const wxString
& descr
) { m_description
= descr
; }
403 const wxString
& GetDescription() const { return m_description
; }
407 /// Add a definition to one of the style lists
408 bool AddStyle(wxList
& list
, wxRichTextStyleDefinition
* def
);
411 bool RemoveStyle(wxList
& list
, wxRichTextStyleDefinition
* def
, bool deleteStyle
);
413 /// Find a definition by name
414 wxRichTextStyleDefinition
* FindStyle(const wxList
& list
, const wxString
& name
, bool recurse
= true) const;
418 wxString m_description
;
421 wxList m_characterStyleDefinitions
;
422 wxList m_paragraphStyleDefinitions
;
423 wxList m_listStyleDefinitions
;
424 wxList m_boxStyleDefinitions
;
426 wxRichTextStyleSheet
* m_previousSheet
;
427 wxRichTextStyleSheet
* m_nextSheet
;
432 * wxRichTextStyleListBox class declaration
433 * A listbox to display styles.
436 class WXDLLIMPEXP_RICHTEXT wxRichTextStyleListBox
: public wxHtmlListBox
438 DECLARE_CLASS(wxRichTextStyleListBox
)
439 DECLARE_EVENT_TABLE()
442 /// Which type of style definition is currently showing?
443 enum wxRichTextStyleType
445 wxRICHTEXT_STYLE_ALL
,
446 wxRICHTEXT_STYLE_PARAGRAPH
,
447 wxRICHTEXT_STYLE_CHARACTER
,
448 wxRICHTEXT_STYLE_LIST
,
452 wxRichTextStyleListBox()
456 wxRichTextStyleListBox(wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= wxDefaultPosition
,
457 const wxSize
& size
= wxDefaultSize
, long style
= 0);
458 virtual ~wxRichTextStyleListBox();
463 m_richTextCtrl
= NULL
;
464 m_applyOnSelection
= false;
465 m_styleType
= wxRICHTEXT_STYLE_PARAGRAPH
;
466 m_autoSetSelection
= true;
469 bool Create(wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= wxDefaultPosition
,
470 const wxSize
& size
= wxDefaultSize
, long style
= 0);
472 /// Creates a suitable HTML fragment for a definition
473 wxString
CreateHTML(wxRichTextStyleDefinition
* def
) const;
475 /// Associates the control with a style sheet
476 void SetStyleSheet(wxRichTextStyleSheet
* styleSheet
) { m_styleSheet
= styleSheet
; }
477 wxRichTextStyleSheet
* GetStyleSheet() const { return m_styleSheet
; }
479 /// Associates the control with a wxRichTextCtrl
480 void SetRichTextCtrl(wxRichTextCtrl
* ctrl
) { m_richTextCtrl
= ctrl
; }
481 wxRichTextCtrl
* GetRichTextCtrl() const { return m_richTextCtrl
; }
483 /// Get style for index
484 wxRichTextStyleDefinition
* GetStyle(size_t i
) const ;
486 /// Get index for style name
487 int GetIndexForStyle(const wxString
& name
) const ;
489 /// Set selection for string, returning the index.
490 int SetStyleSelection(const wxString
& name
);
496 void ApplyStyle(int i
);
499 void OnLeftDown(wxMouseEvent
& event
);
501 /// Left double-click
502 void OnLeftDoubleClick(wxMouseEvent
& event
);
504 /// Auto-select from style under caret in idle time
505 void OnIdle(wxIdleEvent
& event
);
507 /// Convert units in tends of a millimetre to device units
508 int ConvertTenthsMMToPixels(wxDC
& dc
, int units
) const;
510 /// Can we set the selection based on the editor caret position?
511 /// Need to override this if being used in a combobox popup
512 virtual bool CanAutoSetSelection() { return m_autoSetSelection
; }
513 virtual void SetAutoSetSelection(bool autoSet
) { m_autoSetSelection
= autoSet
; }
515 /// Set whether the style should be applied as soon as the item is selected (the default)
516 void SetApplyOnSelection(bool applyOnSel
) { m_applyOnSelection
= applyOnSel
; }
517 bool GetApplyOnSelection() const { return m_applyOnSelection
; }
519 /// Set the style type to display
520 void SetStyleType(wxRichTextStyleType styleType
) { m_styleType
= styleType
; UpdateStyles(); }
521 wxRichTextStyleType
GetStyleType() const { return m_styleType
; }
523 /// Helper for listbox and combo control
524 static wxString
GetStyleToShowInIdleTime(wxRichTextCtrl
* ctrl
, wxRichTextStyleType styleType
);
527 /// Returns the HTML for this item
528 virtual wxString
OnGetItem(size_t n
) const;
532 wxRichTextStyleSheet
* m_styleSheet
;
533 wxRichTextCtrl
* m_richTextCtrl
;
534 bool m_applyOnSelection
; // if true, applies style on selection
535 wxRichTextStyleType m_styleType
; // style type to display
536 bool m_autoSetSelection
;
537 wxArrayString m_styleNames
;
541 * wxRichTextStyleListCtrl class declaration
542 * This is a container for the list control plus a combobox to switch between
546 #define wxRICHTEXTSTYLELIST_HIDE_TYPE_SELECTOR 0x1000
548 class WXDLLIMPEXP_RICHTEXT wxRichTextStyleListCtrl
: public wxControl
550 DECLARE_CLASS(wxRichTextStyleListCtrl
)
551 DECLARE_EVENT_TABLE()
556 wxRichTextStyleListCtrl()
561 wxRichTextStyleListCtrl(wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= wxDefaultPosition
,
562 const wxSize
& size
= wxDefaultSize
, long style
= 0);
565 virtual ~wxRichTextStyleListCtrl();
567 /// Member initialisation
570 m_styleListBox
= NULL
;
571 m_styleChoice
= NULL
;
572 m_dontUpdate
= false;
575 /// Creates the windows
576 bool Create(wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= wxDefaultPosition
,
577 const wxSize
& size
= wxDefaultSize
, long style
= 0);
579 /// Updates the style list box
582 /// Associates the control with a style sheet
583 void SetStyleSheet(wxRichTextStyleSheet
* styleSheet
);
584 wxRichTextStyleSheet
* GetStyleSheet() const;
586 /// Associates the control with a wxRichTextCtrl
587 void SetRichTextCtrl(wxRichTextCtrl
* ctrl
);
588 wxRichTextCtrl
* GetRichTextCtrl() const;
590 /// Set/get the style type to display
591 void SetStyleType(wxRichTextStyleListBox::wxRichTextStyleType styleType
);
592 wxRichTextStyleListBox::wxRichTextStyleType
GetStyleType() const;
594 /// Get the choice index for style type
595 int StyleTypeToIndex(wxRichTextStyleListBox::wxRichTextStyleType styleType
);
597 /// Get the style type for choice index
598 wxRichTextStyleListBox::wxRichTextStyleType
StyleIndexToType(int i
);
601 wxRichTextStyleListBox
* GetStyleListBox() const { return m_styleListBox
; }
604 wxChoice
* GetStyleChoice() const { return m_styleChoice
; }
606 /// React to style type choice
607 void OnChooseType(wxCommandEvent
& event
);
609 /// Lay out the controls
610 void OnSize(wxSizeEvent
& event
);
614 wxRichTextStyleListBox
* m_styleListBox
;
615 wxChoice
* m_styleChoice
;
622 * Style drop-down for a wxComboCtrl
625 class wxRichTextStyleComboPopup
: public wxRichTextStyleListBox
, public wxComboPopup
630 m_itemHere
= -1; // hot item in list
634 virtual bool Create( wxWindow
* parent
);
636 virtual wxWindow
*GetControl() { return this; }
638 virtual void SetStringValue( const wxString
& s
);
640 virtual wxString
GetStringValue() const;
642 /// Can we set the selection based on the editor caret position?
643 // virtual bool CanAutoSetSelection() { return ((m_combo == NULL) || !m_combo->IsPopupShown()); }
644 virtual bool CanAutoSetSelection() { return false; }
647 // Popup event handlers
650 // Mouse hot-tracking
651 void OnMouseMove(wxMouseEvent
& event
);
653 // On mouse left, set the value and close the popup
654 void OnMouseClick(wxMouseEvent
& WXUNUSED(event
));
658 int m_itemHere
; // hot item in popup
662 DECLARE_EVENT_TABLE()
666 * wxRichTextStyleComboCtrl
667 * A combo for applying styles.
670 class WXDLLIMPEXP_RICHTEXT wxRichTextStyleComboCtrl
: public wxComboCtrl
672 DECLARE_CLASS(wxRichTextStyleComboCtrl
)
673 DECLARE_EVENT_TABLE()
676 wxRichTextStyleComboCtrl()
681 wxRichTextStyleComboCtrl(wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= wxDefaultPosition
,
682 const wxSize
& size
= wxDefaultSize
, long style
= wxCB_READONLY
)
685 Create(parent
, id
, pos
, size
, style
);
688 virtual ~wxRichTextStyleComboCtrl() {}
695 bool Create(wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= wxDefaultPosition
,
696 const wxSize
& size
= wxDefaultSize
, long style
= 0);
699 void UpdateStyles() { m_stylePopup
->UpdateStyles(); }
701 /// Associates the control with a style sheet
702 void SetStyleSheet(wxRichTextStyleSheet
* styleSheet
) { m_stylePopup
->SetStyleSheet(styleSheet
); }
703 wxRichTextStyleSheet
* GetStyleSheet() const { return m_stylePopup
->GetStyleSheet(); }
705 /// Associates the control with a wxRichTextCtrl
706 void SetRichTextCtrl(wxRichTextCtrl
* ctrl
) { m_stylePopup
->SetRichTextCtrl(ctrl
); }
707 wxRichTextCtrl
* GetRichTextCtrl() const { return m_stylePopup
->GetRichTextCtrl(); }
709 /// Gets the style popup
710 wxRichTextStyleComboPopup
* GetStylePopup() const { return m_stylePopup
; }
712 /// Auto-select from style under caret in idle time
713 void OnIdle(wxIdleEvent
& event
);
716 wxRichTextStyleComboPopup
* m_stylePopup
;
729 // _WX_RICHTEXTSTYLES_H_