1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richtextctrl.h
3 // Purpose: A rich edit control
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_RICHTEXTCTRL_H_
13 #define _WX_RICHTEXTCTRL_H_
15 #include "wx/richtext/richtextbuffer.h"
19 #include "wx/scrolwin.h"
22 #include "wx/textctrl.h"
24 #if !defined(__WXGTK__) && !defined(__WXMAC__)
25 #define wxRICHTEXT_BUFFERED_PAINTING 1
27 #define wxRICHTEXT_BUFFERED_PAINTING 0
30 class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextStyleDefinition
;
39 #define wxRE_READONLY 0x0010
40 #define wxRE_MULTILINE 0x0020
41 #define wxRE_CENTRE_CARET 0x8000
42 #define wxRE_CENTER_CARET wxRE_CENTRE_CARET
47 #define wxRICHTEXT_SHIFT_DOWN 0x01
48 #define wxRICHTEXT_CTRL_DOWN 0x02
49 #define wxRICHTEXT_ALT_DOWN 0x04
54 // Don't draw guide lines around boxes and tables
55 #define wxRICHTEXT_EX_NO_GUIDELINES 0x00000100
61 #define wxRICHTEXT_DEFAULT_OVERALL_SIZE wxSize(-1, -1)
62 #define wxRICHTEXT_DEFAULT_IMAGE_SIZE wxSize(80, 80)
63 #define wxRICHTEXT_DEFAULT_SPACING 3
64 #define wxRICHTEXT_DEFAULT_MARGIN 3
65 #define wxRICHTEXT_DEFAULT_UNFOCUSSED_BACKGROUND wxColour(175, 175, 175)
66 #define wxRICHTEXT_DEFAULT_FOCUSSED_BACKGROUND wxColour(140, 140, 140)
67 #define wxRICHTEXT_DEFAULT_UNSELECTED_BACKGROUND wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)
68 #define wxRICHTEXT_DEFAULT_TYPE_COLOUR wxColour(0, 0, 200)
69 #define wxRICHTEXT_DEFAULT_FOCUS_RECT_COLOUR wxColour(100, 80, 80)
70 #define wxRICHTEXT_DEFAULT_CARET_WIDTH 2
71 // Minimum buffer size before delayed layout kicks in
72 #define wxRICHTEXT_DEFAULT_DELAYED_LAYOUT_THRESHOLD 20000
73 // Milliseconds before layout occurs after resize
74 #define wxRICHTEXT_DEFAULT_LAYOUT_INTERVAL 50
78 #define wxID_RICHTEXT_PROPERTIES1 (wxID_HIGHEST + 1)
79 #define wxID_RICHTEXT_PROPERTIES2 (wxID_HIGHEST + 2)
80 #define wxID_RICHTEXT_PROPERTIES3 (wxID_HIGHEST + 3)
83 * Forward declarations
87 // Drawing styles/states
88 #define wxRICHTEXT_SELECTED 0x01
89 #define wxRICHTEXT_TAGGED 0x02
90 // The control is focussed
91 #define wxRICHTEXT_FOCUSSED 0x04
92 // The item itself has the focus
93 #define wxRICHTEXT_IS_FOCUS 0x08
96 // Normal selection occurs initially and as user drags within one container.
97 // Common ancestor selection occurs when the user starts dragging across containers
98 // that have a common ancestor, for example the cells in a table.
99 enum wxRichTextCtrlSelectionState
101 wxRichTextCtrlSelectionState_Normal
,
102 wxRichTextCtrlSelectionState_CommonAncestor
106 * wxRichTextContextMenuPropertiesInfo keeps track of objects that appear in the context menu,
107 * whose properties are available to be edited.
110 class WXDLLIMPEXP_RICHTEXT wxRichTextContextMenuPropertiesInfo
113 wxRichTextContextMenuPropertiesInfo() { Init(); }
121 bool AddItem(const wxString
& label
, wxRichTextObject
* obj
);
123 /// Returns number of menu items were added.
124 int AddMenuItems(wxMenu
* menu
, int startCmd
= wxID_RICHTEXT_PROPERTIES1
) const;
126 /// Add appropriate menu items for the current container and clicked on object
127 /// (and container's parent, if appropriate).
128 int AddItems(wxRichTextObject
* container
, wxRichTextObject
* obj
);
131 void Clear() { m_objects
.Clear(); m_labels
.Clear(); }
134 /// Gets the nth label
135 wxString
GetLabel(int n
) const { return m_labels
[n
]; }
137 /// Gets the nth object
138 wxRichTextObject
* GetObject(int n
) const { return m_objects
[n
]; }
141 wxRichTextObjectPtrArray
& GetObjects() { return m_objects
; }
142 const wxRichTextObjectPtrArray
& GetObjects() const { return m_objects
; }
145 wxArrayString
& GetLabels() { return m_labels
; }
146 const wxArrayString
& GetLabels() const { return m_labels
; }
148 /// Get number of items
149 int GetCount() const { return m_objects
.GetCount(); }
152 wxRichTextObjectPtrArray m_objects
;
153 wxArrayString m_labels
;
157 * wxRichTextCtrl class declaration
160 class WXDLLIMPEXP_RICHTEXT wxRichTextCtrl
: public wxControl
,
161 public wxTextCtrlIface
,
162 public wxScrollHelper
164 DECLARE_CLASS( wxRichTextCtrl
)
165 DECLARE_EVENT_TABLE()
171 wxRichTextCtrl( wxWindow
* parent
, wxWindowID id
= -1, const wxString
& value
= wxEmptyString
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
172 long style
= wxRE_MULTILINE
, const wxValidator
& validator
= wxDefaultValidator
, const wxString
& name
= wxTextCtrlNameStr
);
174 virtual ~wxRichTextCtrl( );
179 bool Create( wxWindow
* parent
, wxWindowID id
= -1, const wxString
& value
= wxEmptyString
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
180 long style
= wxRE_MULTILINE
, const wxValidator
& validator
= wxDefaultValidator
, const wxString
& name
= wxTextCtrlNameStr
);
182 /// Member initialisation
185 ///// wxTextCtrl compatibility
189 virtual wxString
GetRange(long from
, long to
) const;
191 virtual int GetLineLength(long lineNo
) const ;
192 virtual wxString
GetLineText(long lineNo
) const ;
193 virtual int GetNumberOfLines() const ;
195 virtual bool IsModified() const ;
196 virtual bool IsEditable() const ;
198 // more readable flag testing methods
199 bool IsSingleLine() const { return !HasFlag(wxRE_MULTILINE
); }
200 bool IsMultiLine() const { return !IsSingleLine(); }
202 // If the return values from and to are the same, there is no selection.
203 virtual void GetSelection(long* from
, long* to
) const;
205 virtual wxString
GetStringSelection() const;
207 const wxRichTextSelection
& GetSelection() const { return m_selection
; }
208 wxRichTextSelection
& GetSelection() { return m_selection
; }
209 void SetSelection(const wxRichTextSelection
& sel
) { m_selection
= sel
; }
213 wxString
GetFilename() const { return m_filename
; }
216 void SetFilename(const wxString
& filename
) { m_filename
= filename
; }
218 /// Set the threshold in character positions for doing layout optimization during sizing
219 void SetDelayedLayoutThreshold(long threshold
) { m_delayedLayoutThreshold
= threshold
; }
221 /// Get the threshold in character positions for doing layout optimization during sizing
222 long GetDelayedLayoutThreshold() const { return m_delayedLayoutThreshold
; }
225 void SetTextCursor(const wxCursor
& cursor
) { m_textCursor
= cursor
; }
228 wxCursor
GetTextCursor() const { return m_textCursor
; }
231 void SetURLCursor(const wxCursor
& cursor
) { m_urlCursor
= cursor
; }
234 wxCursor
GetURLCursor() const { return m_urlCursor
; }
236 /// Are we showing the caret position at the start of a line
237 /// instead of at the end of the previous one?
238 bool GetCaretAtLineStart() const { return m_caretAtLineStart
; }
239 void SetCaretAtLineStart(bool atStart
) { m_caretAtLineStart
= atStart
; }
241 /// Are we dragging a selection?
242 bool GetDragging() const { return m_dragging
; }
243 void SetDragging(bool dragging
) { m_dragging
= dragging
; }
245 /// Get/set drag start position
246 const wxPoint
& GetDragStart() const { return m_dragStart
; }
247 void SetDragStart(const wxPoint
& pt
) { m_dragStart
= pt
; }
249 #if wxRICHTEXT_BUFFERED_PAINTING
250 /// Get the buffer bitmap
251 const wxBitmap
& GetBufferBitmap() const { return m_bufferBitmap
; }
252 wxBitmap
& GetBufferBitmap() { return m_bufferBitmap
; }
255 /// Get/set context menu
256 wxMenu
* GetContextMenu() const { return m_contextMenu
; }
257 void SetContextMenu(wxMenu
* menu
);
259 /// Anchor so we know how to extend the selection
260 /// It's a caret position since it's between two characters.
261 long GetSelectionAnchor() const { return m_selectionAnchor
; }
262 void SetSelectionAnchor(long anchor
) { m_selectionAnchor
= anchor
; }
264 /// Anchor object if selecting multiple containers.
265 wxRichTextObject
* GetSelectionAnchorObject() const { return m_selectionAnchorObject
; }
266 void SetSelectionAnchorObject(wxRichTextObject
* anchor
) { m_selectionAnchorObject
= anchor
; }
268 wxRichTextContextMenuPropertiesInfo
& GetContextMenuPropertiesInfo() { return m_contextMenuPropertiesInfo
; }
269 const wxRichTextContextMenuPropertiesInfo
& GetContextMenuPropertiesInfo() const { return m_contextMenuPropertiesInfo
; }
271 /// The wxRichTextObject object that currently has the editing focus
272 wxRichTextParagraphLayoutBox
* GetFocusObject() const { return m_focusObject
; }
273 bool SetFocusObject(wxRichTextParagraphLayoutBox
* obj
, bool setCaretPosition
= true);
277 void Invalidate() { GetBuffer().Invalidate(wxRICHTEXT_ALL
); }
280 virtual void Clear();
281 virtual void Replace(long from
, long to
, const wxString
& value
);
282 virtual void Remove(long from
, long to
);
284 // load/save the controls contents from/to the file
285 virtual bool DoLoadFile(const wxString
& file
, int fileType
);
286 virtual bool DoSaveFile(const wxString
& file
= wxEmptyString
,
287 int fileType
= wxRICHTEXT_TYPE_ANY
);
289 /// Set the handler flags, controlling loading and saving
290 void SetHandlerFlags(int flags
) { GetBuffer().SetHandlerFlags(flags
); }
292 /// Get the handler flags, controlling loading and saving
293 int GetHandlerFlags() const { return GetBuffer().GetHandlerFlags(); }
295 // sets/clears the dirty flag
296 virtual void MarkDirty();
297 virtual void DiscardEdits();
299 // set the max number of characters which may be entered in a single line
301 virtual void SetMaxLength(unsigned long WXUNUSED(len
)) { }
303 // writing text inserts it at the current position, appending always
304 // inserts it at the end
305 virtual void WriteText(const wxString
& text
);
306 virtual void AppendText(const wxString
& text
);
308 // text control under some platforms supports the text styles: these
309 // methods allow to apply the given text style to the given selection or to
310 // set/get the style which will be used for all appended text
311 virtual bool SetStyle(long start
, long end
, const wxTextAttr
& style
);
312 virtual bool SetStyle(long start
, long end
, const wxRichTextAttr
& style
);
313 virtual bool SetStyle(const wxRichTextRange
& range
, const wxTextAttr
& style
);
314 virtual bool SetStyle(const wxRichTextRange
& range
, const wxRichTextAttr
& style
);
315 virtual bool GetStyle(long position
, wxTextAttr
& style
);
316 virtual bool GetStyle(long position
, wxRichTextAttr
& style
);
317 virtual bool GetStyle(long position
, wxRichTextAttr
& style
, wxRichTextParagraphLayoutBox
* container
);
319 // Set the style for a single object
320 virtual void SetStyle(wxRichTextObject
*obj
, const wxRichTextAttr
& textAttr
);
322 // get the common set of styles for the range
323 virtual bool GetStyleForRange(const wxRichTextRange
& range
, wxTextAttr
& style
);
324 virtual bool GetStyleForRange(const wxRichTextRange
& range
, wxRichTextAttr
& style
);
325 virtual bool GetStyleForRange(const wxRichTextRange
& range
, wxRichTextAttr
& style
, wxRichTextParagraphLayoutBox
* container
);
326 // extended style setting operation with flags including:
327 // wxRICHTEXT_SETSTYLE_WITH_UNDO, wxRICHTEXT_SETSTYLE_OPTIMIZE, wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY, wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY
328 // see richtextbuffer.h for more details.
329 virtual bool SetStyleEx(const wxRichTextRange
& range
, const wxRichTextAttr
& style
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
);
331 /// Get the content (uncombined) attributes for this position.
332 virtual bool GetUncombinedStyle(long position
, wxRichTextAttr
& style
);
333 virtual bool GetUncombinedStyle(long position
, wxRichTextAttr
& style
, wxRichTextParagraphLayoutBox
* container
);
335 virtual bool SetDefaultStyle(const wxTextAttr
& style
);
336 virtual bool SetDefaultStyle(const wxRichTextAttr
& style
);
338 virtual const wxRichTextAttr
& GetDefaultStyleEx() const;
340 //virtual const wxTextAttr& GetDefaultStyle() const;
343 virtual bool SetListStyle(const wxRichTextRange
& range
, wxRichTextListStyleDefinition
* def
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
, int startFrom
= 1, int specifiedLevel
= -1);
344 virtual bool SetListStyle(const wxRichTextRange
& range
, const wxString
& defName
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
, int startFrom
= 1, int specifiedLevel
= -1);
346 /// Clear list for given range
347 virtual bool ClearListStyle(const wxRichTextRange
& range
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
);
349 /// Number/renumber any list elements in the given range
350 /// def/defName can be NULL/empty to indicate that the existing list style should be used.
351 virtual bool NumberList(const wxRichTextRange
& range
, wxRichTextListStyleDefinition
* def
= NULL
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
, int startFrom
= 1, int specifiedLevel
= -1);
352 virtual bool NumberList(const wxRichTextRange
& range
, const wxString
& defName
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
, int startFrom
= 1, int specifiedLevel
= -1);
354 /// Promote the list items within the given range. promoteBy can be a positive or negative number, e.g. 1 or -1
355 /// def/defName can be NULL/empty to indicate that the existing list style should be used.
356 virtual bool PromoteList(int promoteBy
, const wxRichTextRange
& range
, wxRichTextListStyleDefinition
* def
= NULL
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
, int specifiedLevel
= -1);
357 virtual bool PromoteList(int promoteBy
, const wxRichTextRange
& range
, const wxString
& defName
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
, int specifiedLevel
= -1);
359 /// Deletes the content in the given range
360 virtual bool Delete(const wxRichTextRange
& range
);
362 // translate between the position (which is just an index in the text ctrl
363 // considering all its contents as a single strings) and (x, y) coordinates
364 // which represent column and line.
365 virtual long XYToPosition(long x
, long y
) const;
366 virtual bool PositionToXY(long pos
, long *x
, long *y
) const;
368 virtual void ShowPosition(long pos
);
370 // find the character at position given in pixels
372 // NB: pt is in device coords (not adjusted for the client area origin nor
374 virtual wxTextCtrlHitTestResult
HitTest(const wxPoint
& pt
, long *pos
) const;
375 virtual wxTextCtrlHitTestResult
HitTest(const wxPoint
& pt
,
377 wxTextCoord
*row
) const;
379 // Clipboard operations
382 virtual void Paste();
383 virtual void DeleteSelection();
385 virtual bool CanCopy() const;
386 virtual bool CanCut() const;
387 virtual bool CanPaste() const;
388 virtual bool CanDeleteSelection() const;
394 virtual bool CanUndo() const;
395 virtual bool CanRedo() const;
398 virtual void SetInsertionPoint(long pos
);
399 virtual void SetInsertionPointEnd();
400 virtual long GetInsertionPoint() const;
401 virtual wxTextPos
GetLastPosition() const;
403 virtual void SetSelection(long from
, long to
);
404 virtual void SelectAll();
405 virtual void SetEditable(bool editable
);
407 /// Returns true if there was a selection and the object containing the selection
408 /// was the same as the current focus object.
409 virtual bool HasSelection() const;
411 /// Returns true if there was a selection, whether or not the current focus object
412 /// is the same as the selection's container object.
413 virtual bool HasUnfocusedSelection() const;
415 ///// Functionality specific to wxRichTextCtrl
417 /// Write an image at the current insertion point. Supply optional type to use
418 /// for internal and file storage of the raw data.
419 virtual bool WriteImage(const wxImage
& image
, wxBitmapType bitmapType
= wxBITMAP_TYPE_PNG
,
420 const wxRichTextAttr
& textAttr
= wxRichTextAttr());
422 /// Write a bitmap at the current insertion point. Supply optional type to use
423 /// for internal and file storage of the raw data.
424 virtual bool WriteImage(const wxBitmap
& bitmap
, wxBitmapType bitmapType
= wxBITMAP_TYPE_PNG
,
425 const wxRichTextAttr
& textAttr
= wxRichTextAttr());
427 /// Load an image from file and write at the current insertion point.
428 virtual bool WriteImage(const wxString
& filename
, wxBitmapType bitmapType
,
429 const wxRichTextAttr
& textAttr
= wxRichTextAttr());
431 /// Write an image block at the current insertion point.
432 virtual bool WriteImage(const wxRichTextImageBlock
& imageBlock
,
433 const wxRichTextAttr
& textAttr
= wxRichTextAttr());
435 /// Write a text box at the current insertion point, returning the text box.
436 /// You can then call SetFocusObject() to set the focus to the new object.
437 virtual wxRichTextBox
* WriteTextBox(const wxRichTextAttr
& textAttr
= wxRichTextAttr());
439 /// Write a table at the current insertion point, returning the table.
440 /// You can then call SetFocusObject() to set the focus to the new object.
441 virtual wxRichTextTable
* WriteTable(int rows
, int cols
, const wxRichTextAttr
& tableAttr
= wxRichTextAttr(), const wxRichTextAttr
& cellAttr
= wxRichTextAttr());
443 /// Insert a newline (actually paragraph) at the current insertion point.
444 virtual bool Newline();
446 /// Insert a line break at the current insertion point.
447 virtual bool LineBreak();
449 /// Set basic (overall) style
450 virtual void SetBasicStyle(const wxRichTextAttr
& style
) { GetBuffer().SetBasicStyle(style
); }
452 /// Get basic (overall) style
453 virtual const wxRichTextAttr
& GetBasicStyle() const { return GetBuffer().GetBasicStyle(); }
455 virtual bool BeginStyle(const wxRichTextAttr
& style
) { return GetBuffer().BeginStyle(style
); }
458 virtual bool EndStyle() { return GetBuffer().EndStyle(); }
461 virtual bool EndAllStyles() { return GetBuffer().EndAllStyles(); }
464 bool BeginBold() { return GetBuffer().BeginBold(); }
467 bool EndBold() { return GetBuffer().EndBold(); }
469 /// Begin using italic
470 bool BeginItalic() { return GetBuffer().BeginItalic(); }
473 bool EndItalic() { return GetBuffer().EndItalic(); }
475 /// Begin using underline
476 bool BeginUnderline() { return GetBuffer().BeginUnderline(); }
478 /// End using underline
479 bool EndUnderline() { return GetBuffer().EndUnderline(); }
481 /// Begin using point size
482 bool BeginFontSize(int pointSize
) { return GetBuffer().BeginFontSize(pointSize
); }
484 /// End using point size
485 bool EndFontSize() { return GetBuffer().EndFontSize(); }
487 /// Begin using this font
488 bool BeginFont(const wxFont
& font
) { return GetBuffer().BeginFont(font
); }
491 bool EndFont() { return GetBuffer().EndFont(); }
493 /// Begin using this colour
494 bool BeginTextColour(const wxColour
& colour
) { return GetBuffer().BeginTextColour(colour
); }
496 /// End using a colour
497 bool EndTextColour() { return GetBuffer().EndTextColour(); }
499 /// Begin using alignment
500 bool BeginAlignment(wxTextAttrAlignment alignment
) { return GetBuffer().BeginAlignment(alignment
); }
503 bool EndAlignment() { return GetBuffer().EndAlignment(); }
505 /// Begin left indent
506 bool BeginLeftIndent(int leftIndent
, int leftSubIndent
= 0) { return GetBuffer().BeginLeftIndent(leftIndent
, leftSubIndent
); }
509 bool EndLeftIndent() { return GetBuffer().EndLeftIndent(); }
511 /// Begin right indent
512 bool BeginRightIndent(int rightIndent
) { return GetBuffer().BeginRightIndent(rightIndent
); }
515 bool EndRightIndent() { return GetBuffer().EndRightIndent(); }
517 /// Begin paragraph spacing
518 bool BeginParagraphSpacing(int before
, int after
) { return GetBuffer().BeginParagraphSpacing(before
, after
); }
520 /// End paragraph spacing
521 bool EndParagraphSpacing() { return GetBuffer().EndParagraphSpacing(); }
523 /// Begin line spacing
524 bool BeginLineSpacing(int lineSpacing
) { return GetBuffer().BeginLineSpacing(lineSpacing
); }
527 bool EndLineSpacing() { return GetBuffer().EndLineSpacing(); }
529 /// Begin numbered bullet
530 bool BeginNumberedBullet(int bulletNumber
, int leftIndent
, int leftSubIndent
, int bulletStyle
= wxTEXT_ATTR_BULLET_STYLE_ARABIC
|wxTEXT_ATTR_BULLET_STYLE_PERIOD
)
531 { return GetBuffer().BeginNumberedBullet(bulletNumber
, leftIndent
, leftSubIndent
, bulletStyle
); }
533 /// End numbered bullet
534 bool EndNumberedBullet() { return GetBuffer().EndNumberedBullet(); }
536 /// Begin symbol bullet
537 bool BeginSymbolBullet(const wxString
& symbol
, int leftIndent
, int leftSubIndent
, int bulletStyle
= wxTEXT_ATTR_BULLET_STYLE_SYMBOL
)
538 { return GetBuffer().BeginSymbolBullet(symbol
, leftIndent
, leftSubIndent
, bulletStyle
); }
540 /// End symbol bullet
541 bool EndSymbolBullet() { return GetBuffer().EndSymbolBullet(); }
543 /// Begin standard bullet
544 bool BeginStandardBullet(const wxString
& bulletName
, int leftIndent
, int leftSubIndent
, int bulletStyle
= wxTEXT_ATTR_BULLET_STYLE_STANDARD
)
545 { return GetBuffer().BeginStandardBullet(bulletName
, leftIndent
, leftSubIndent
, bulletStyle
); }
547 /// End standard bullet
548 bool EndStandardBullet() { return GetBuffer().EndStandardBullet(); }
550 /// Begin named character style
551 bool BeginCharacterStyle(const wxString
& characterStyle
) { return GetBuffer().BeginCharacterStyle(characterStyle
); }
553 /// End named character style
554 bool EndCharacterStyle() { return GetBuffer().EndCharacterStyle(); }
556 /// Begin named paragraph style
557 bool BeginParagraphStyle(const wxString
& paragraphStyle
) { return GetBuffer().BeginParagraphStyle(paragraphStyle
); }
559 /// End named character style
560 bool EndParagraphStyle() { return GetBuffer().EndParagraphStyle(); }
562 /// Begin named list style
563 bool BeginListStyle(const wxString
& listStyle
, int level
= 1, int number
= 1) { return GetBuffer().BeginListStyle(listStyle
, level
, number
); }
565 /// End named character style
566 bool EndListStyle() { return GetBuffer().EndListStyle(); }
569 bool BeginURL(const wxString
& url
, const wxString
& characterStyle
= wxEmptyString
) { return GetBuffer().BeginURL(url
, characterStyle
); }
572 bool EndURL() { return GetBuffer().EndURL(); }
574 /// Sets the default style to the style under the cursor
575 bool SetDefaultStyleToCursorStyle();
577 /// Clear the selection
578 virtual void SelectNone();
580 /// Select the word at the given character position
581 virtual bool SelectWord(long position
);
583 /// Get/set the selection range in character positions. -1, -1 means no selection.
584 /// The range is in API convention, i.e. a single character selection is denoted
586 wxRichTextRange
GetSelectionRange() const;
587 void SetSelectionRange(const wxRichTextRange
& range
);
589 /// Get/set the selection range in character positions. -2, -2 means no selection
590 /// -1, -1 means select everything.
591 /// The range is in internal format, i.e. a single character selection is denoted
593 wxRichTextRange
GetInternalSelectionRange() const { return m_selection
.GetRange(); }
594 void SetInternalSelectionRange(const wxRichTextRange
& range
) { m_selection
.Set(range
, GetFocusObject()); }
596 /// Add a new paragraph of text to the end of the buffer
597 virtual wxRichTextRange
AddParagraph(const wxString
& text
);
600 virtual wxRichTextRange
AddImage(const wxImage
& image
);
602 /// Layout the buffer: which we must do before certain operations, such as
603 /// setting the caret position.
604 virtual bool LayoutContent(bool onlyVisibleRect
= false);
606 /// Move the caret to the given character position
607 virtual bool MoveCaret(long pos
, bool showAtLineStart
= false, wxRichTextParagraphLayoutBox
* container
= NULL
);
610 virtual bool MoveRight(int noPositions
= 1, int flags
= 0);
613 virtual bool MoveLeft(int noPositions
= 1, int flags
= 0);
616 virtual bool MoveUp(int noLines
= 1, int flags
= 0);
619 virtual bool MoveDown(int noLines
= 1, int flags
= 0);
621 /// Move to the end of the line
622 virtual bool MoveToLineEnd(int flags
= 0);
624 /// Move to the start of the line
625 virtual bool MoveToLineStart(int flags
= 0);
627 /// Move to the end of the paragraph
628 virtual bool MoveToParagraphEnd(int flags
= 0);
630 /// Move to the start of the paragraph
631 virtual bool MoveToParagraphStart(int flags
= 0);
633 /// Move to the start of the buffer
634 virtual bool MoveHome(int flags
= 0);
636 /// Move to the end of the buffer
637 virtual bool MoveEnd(int flags
= 0);
640 virtual bool PageUp(int noPages
= 1, int flags
= 0);
642 /// Move n pages down
643 virtual bool PageDown(int noPages
= 1, int flags
= 0);
645 /// Move n words left
646 virtual bool WordLeft(int noPages
= 1, int flags
= 0);
648 /// Move n words right
649 virtual bool WordRight(int noPages
= 1, int flags
= 0);
651 /// Returns the buffer associated with the control.
652 wxRichTextBuffer
& GetBuffer() { return m_buffer
; }
653 const wxRichTextBuffer
& GetBuffer() const { return m_buffer
; }
655 /// Start batching undo history for commands.
656 virtual bool BeginBatchUndo(const wxString
& cmdName
) { return m_buffer
.BeginBatchUndo(cmdName
); }
658 /// End batching undo history for commands.
659 virtual bool EndBatchUndo() { return m_buffer
.EndBatchUndo(); }
661 /// Are we batching undo history for commands?
662 virtual bool BatchingUndo() const { return m_buffer
.BatchingUndo(); }
664 /// Start suppressing undo history for commands.
665 virtual bool BeginSuppressUndo() { return m_buffer
.BeginSuppressUndo(); }
667 /// End suppressing undo history for commands.
668 virtual bool EndSuppressUndo() { return m_buffer
.EndSuppressUndo(); }
670 /// Are we suppressing undo history for commands?
671 virtual bool SuppressingUndo() const { return m_buffer
.SuppressingUndo(); }
673 /// Test if this whole range has character attributes of the specified kind. If any
674 /// of the attributes are different within the range, the test fails. You
675 /// can use this to implement, for example, bold button updating. style must have
676 /// flags indicating which attributes are of interest.
677 virtual bool HasCharacterAttributes(const wxRichTextRange
& range
, const wxRichTextAttr
& style
) const
679 return GetBuffer().HasCharacterAttributes(range
.ToInternal(), style
);
682 /// Test if this whole range has paragraph attributes of the specified kind. If any
683 /// of the attributes are different within the range, the test fails. You
684 /// can use this to implement, for example, centering button updating. style must have
685 /// flags indicating which attributes are of interest.
686 virtual bool HasParagraphAttributes(const wxRichTextRange
& range
, const wxRichTextAttr
& style
) const
688 return GetBuffer().HasParagraphAttributes(range
.ToInternal(), style
);
691 /// Is all of the selection bold?
692 virtual bool IsSelectionBold();
694 /// Is all of the selection italics?
695 virtual bool IsSelectionItalics();
697 /// Is all of the selection underlined?
698 virtual bool IsSelectionUnderlined();
700 /// Is all of the selection aligned according to the specified flag?
701 virtual bool IsSelectionAligned(wxTextAttrAlignment alignment
);
703 /// Apply bold to the selection
704 virtual bool ApplyBoldToSelection();
706 /// Apply italic to the selection
707 virtual bool ApplyItalicToSelection();
709 /// Apply underline to the selection
710 virtual bool ApplyUnderlineToSelection();
712 /// Apply alignment to the selection
713 virtual bool ApplyAlignmentToSelection(wxTextAttrAlignment alignment
);
715 /// Apply a named style to the selection
716 virtual bool ApplyStyle(wxRichTextStyleDefinition
* def
);
718 /// Set style sheet, if any
719 void SetStyleSheet(wxRichTextStyleSheet
* styleSheet
) { GetBuffer().SetStyleSheet(styleSheet
); }
720 wxRichTextStyleSheet
* GetStyleSheet() const { return GetBuffer().GetStyleSheet(); }
722 /// Push style sheet to top of stack
723 bool PushStyleSheet(wxRichTextStyleSheet
* styleSheet
) { return GetBuffer().PushStyleSheet(styleSheet
); }
725 /// Pop style sheet from top of stack
726 wxRichTextStyleSheet
* PopStyleSheet() { return GetBuffer().PopStyleSheet(); }
728 /// Apply the style sheet to the buffer, for example if the styles have changed.
729 bool ApplyStyleSheet(wxRichTextStyleSheet
* styleSheet
= NULL
);
733 void Command(wxCommandEvent
& event
);
734 void OnDropFiles(wxDropFilesEvent
& event
);
735 void OnCaptureLost(wxMouseCaptureLostEvent
& event
);
736 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
738 void OnCut(wxCommandEvent
& event
);
739 void OnCopy(wxCommandEvent
& event
);
740 void OnPaste(wxCommandEvent
& event
);
741 void OnUndo(wxCommandEvent
& event
);
742 void OnRedo(wxCommandEvent
& event
);
743 void OnSelectAll(wxCommandEvent
& event
);
744 void OnProperties(wxCommandEvent
& event
);
745 void OnClear(wxCommandEvent
& event
);
747 void OnUpdateCut(wxUpdateUIEvent
& event
);
748 void OnUpdateCopy(wxUpdateUIEvent
& event
);
749 void OnUpdatePaste(wxUpdateUIEvent
& event
);
750 void OnUpdateUndo(wxUpdateUIEvent
& event
);
751 void OnUpdateRedo(wxUpdateUIEvent
& event
);
752 void OnUpdateSelectAll(wxUpdateUIEvent
& event
);
753 void OnUpdateProperties(wxUpdateUIEvent
& event
);
754 void OnUpdateClear(wxUpdateUIEvent
& event
);
756 // Show a context menu for Rich Edit controls (the standard
757 // EDIT control has one already)
758 void OnContextMenu(wxContextMenuEvent
& event
);
763 void OnPaint(wxPaintEvent
& event
);
764 void OnEraseBackground(wxEraseEvent
& event
);
767 void OnLeftClick(wxMouseEvent
& event
);
770 void OnLeftUp(wxMouseEvent
& event
);
773 void OnMoveMouse(wxMouseEvent
& event
);
775 /// Left-double-click
776 void OnLeftDClick(wxMouseEvent
& event
);
779 void OnMiddleClick(wxMouseEvent
& event
);
782 void OnRightClick(wxMouseEvent
& event
);
785 void OnChar(wxKeyEvent
& event
);
788 void OnSize(wxSizeEvent
& event
);
790 /// Setting/losing focus
791 void OnSetFocus(wxFocusEvent
& event
);
792 void OnKillFocus(wxFocusEvent
& event
);
794 /// Idle-time processing
795 void OnIdle(wxIdleEvent
& event
);
798 void OnScroll(wxScrollWinEvent
& event
);
800 /// Set font, and also default attributes
801 virtual bool SetFont(const wxFont
& font
);
803 /// Set up scrollbars, e.g. after a resize
804 virtual void SetupScrollbars(bool atTop
= false);
806 /// Keyboard navigation
807 virtual bool KeyboardNavigate(int keyCode
, int flags
);
809 /// Paint the background
810 virtual void PaintBackground(wxDC
& dc
);
812 /// Other user defined painting after everything else (i.e. all text) is painted
813 virtual void PaintAboveContent(wxDC
& WXUNUSED(dc
)) {}
815 #if wxRICHTEXT_BUFFERED_PAINTING
816 /// Recreate buffer bitmap if necessary
817 virtual bool RecreateBuffer(const wxSize
& size
= wxDefaultSize
);
821 virtual void DoWriteText(const wxString
& value
, int flags
= 0);
823 /// Should we inherit colours?
824 virtual bool ShouldInheritColours() const { return false; }
826 /// Position the caret
827 virtual void PositionCaret(wxRichTextParagraphLayoutBox
* container
= NULL
);
829 /// Extend the selection, returning true if the selection was
830 /// changed. Selections are in caret positions.
831 virtual bool ExtendSelection(long oldPosition
, long newPosition
, int flags
);
833 /// Scroll into view. This takes a _caret_ position.
834 virtual bool ScrollIntoView(long position
, int keyCode
);
836 /// Refresh the area affected by a selection change
837 bool RefreshForSelectionChange(const wxRichTextSelection
& oldSelection
, const wxRichTextSelection
& newSelection
);
839 /// The caret position is the character position just before the caret.
840 /// A value of -1 means the caret is at the start of the buffer.
841 void SetCaretPosition(long position
, bool showAtLineStart
= false) ;
842 long GetCaretPosition() const { return m_caretPosition
; }
844 /// The adjusted caret position is the character position adjusted to take
845 /// into account whether we're at the start of a paragraph, in which case
846 /// style information should be taken from the next position, not current one.
847 long GetAdjustedCaretPosition(long caretPos
) const;
849 /// Move caret one visual step forward: this may mean setting a flag
850 /// and keeping the same position if we're going from the end of one line
851 /// to the start of the next, which may be the exact same caret position.
852 void MoveCaretForward(long oldPosition
) ;
854 /// Move caret one visual step forward: this may mean setting a flag
855 /// and keeping the same position if we're going from the end of one line
856 /// to the start of the next, which may be the exact same caret position.
857 void MoveCaretBack(long oldPosition
) ;
859 /// Get the caret height and position for the given character position. If container is null,
860 /// the current focus object will be used.
861 bool GetCaretPositionForIndex(long position
, wxRect
& rect
, wxRichTextParagraphLayoutBox
* container
= NULL
);
863 /// Gets the line for the visible caret position. If the caret is
864 /// shown at the very end of the line, it means the next character is actually
865 /// on the following line. So let's get the line we're expecting to find
866 /// if this is the case.
867 wxRichTextLine
* GetVisibleLineForCaretPosition(long caretPosition
) const;
869 /// Gets the command processor
870 wxCommandProcessor
* GetCommandProcessor() const { return GetBuffer().GetCommandProcessor(); }
872 /// Delete content if there is a selection, e.g. when pressing a key.
873 /// Returns the new caret position in newPos, or leaves it if there
875 bool DeleteSelectedContent(long* newPos
= NULL
);
877 /// Transform logical to physical
878 wxPoint
GetPhysicalPoint(const wxPoint
& ptLogical
) const;
880 /// Transform physical to logical
881 wxPoint
GetLogicalPoint(const wxPoint
& ptPhysical
) const;
883 /// Finds the caret position for the next word. Direction
884 /// is 1 (forward) or -1 (backwards).
885 virtual long FindNextWordPosition(int direction
= 1) const;
887 /// Is the given position visible on the screen?
888 bool IsPositionVisible(long pos
) const;
890 /// Returns the first visible position in the current view
891 long GetFirstVisiblePosition() const;
893 /// Returns the caret position since the default formatting was changed. As
894 /// soon as this position changes, we no longer reflect the default style
895 /// in the UI. A value of -2 means that we should only reflect the style of the
896 /// content under the caret.
897 long GetCaretPositionForDefaultStyle() const { return m_caretPositionForDefaultStyle
; }
899 /// Set the caret position for the default style that the user is selecting.
900 void SetCaretPositionForDefaultStyle(long pos
) { m_caretPositionForDefaultStyle
= pos
; }
902 /// Should the UI reflect the default style chosen by the user, rather than the style under
904 bool IsDefaultStyleShowing() const { return m_caretPositionForDefaultStyle
!= -2; }
906 /// Convenience function that tells the control to start reflecting the default
907 /// style, since the user is changing it.
908 void SetAndShowDefaultStyle(const wxRichTextAttr
& attr
)
910 SetDefaultStyle(attr
);
911 SetCaretPositionForDefaultStyle(GetCaretPosition());
914 /// Get the first visible point in the window
915 wxPoint
GetFirstVisiblePoint() const;
919 /// Set up the caret for the given position and container, after a mouse click
920 bool SetCaretPositionAfterClick(wxRichTextParagraphLayoutBox
* container
, long position
, int hitTestFlags
, bool extendSelection
= false);
922 /// Find the caret position for the combination of hit-test flags and character position.
923 /// Returns the caret position and also an indication of where to place the caret (caretLineStart)
924 /// since this is ambiguous (same position used for end of line and start of next).
925 long FindCaretPositionForCharacterPosition(long position
, int hitTestFlags
, wxRichTextParagraphLayoutBox
* container
,
926 bool& caretLineStart
);
928 /// Font names take a long time to retrieve, so cache them (on demand)
929 static const wxArrayString
& GetAvailableFontNames();
930 static void ClearAvailableFontNames();
932 WX_FORWARD_TO_SCROLL_HELPER()
934 // implement wxTextEntry methods
935 virtual wxString
DoGetValue() const;
938 // implement the wxTextEntry pure virtual method
939 virtual wxWindow
*GetEditableWindow() { return this; }
942 virtual bool DoSetMargins(const wxPoint
& pt
);
943 virtual wxPoint
DoGetMargins() const;
945 // FIXME: this does not work, it allows this code to compile but will fail
947 #ifndef __WXUNIVERSAL__
949 virtual WXHWND
GetEditHWND() const { return GetHWND(); }
952 virtual WXWidget
GetTextWidget() const { return NULL
; }
955 virtual GtkEditable
*GetEditable() const { return NULL
; }
956 virtual GtkEntry
*GetEntry() const { return NULL
; }
958 #endif // !__WXUNIVERSAL__
963 virtual wxSize
DoGetBestSize() const ;
965 virtual void DoSetValue(const wxString
& value
, int flags
= 0);
967 virtual void DoThaw();
972 #if wxRICHTEXT_BUFFERED_PAINTING
974 wxBitmap m_bufferBitmap
;
978 wxRichTextBuffer m_buffer
;
980 wxMenu
* m_contextMenu
;
982 /// Caret position (1 less than the character position, so -1 is the
983 /// first caret position).
984 long m_caretPosition
;
986 /// Caret position when the default formatting has been changed. As
987 /// soon as this position changes, we no longer reflect the default style
989 long m_caretPositionForDefaultStyle
;
991 /// Selection range in character positions. -2, -2 means no selection.
992 wxRichTextSelection m_selection
;
994 wxRichTextCtrlSelectionState m_selectionState
;
996 /// Anchor so we know how to extend the selection
997 /// It's a caret position since it's between two characters.
998 long m_selectionAnchor
;
1000 /// Anchor object if selecting multiple container objects, such as grid cells.
1001 wxRichTextObject
* m_selectionAnchorObject
;
1003 /// Are we editable?
1006 /// Are we showing the caret position at the start of a line
1007 /// instead of at the end of the previous one?
1008 bool m_caretAtLineStart
;
1010 /// Are we dragging a selection?
1013 /// Start position for drag
1014 wxPoint m_dragStart
;
1016 /// Do we need full layout in idle?
1017 bool m_fullLayoutRequired
;
1018 wxLongLong m_fullLayoutTime
;
1019 long m_fullLayoutSavedPosition
;
1021 /// Threshold for doing delayed layout
1022 long m_delayedLayoutThreshold
;
1025 wxCursor m_textCursor
;
1026 wxCursor m_urlCursor
;
1028 static wxArrayString sm_availableFontNames
;
1030 wxRichTextContextMenuPropertiesInfo m_contextMenuPropertiesInfo
;
1032 /// The object that currently has the editing focus
1033 wxRichTextParagraphLayoutBox
* m_focusObject
;
1037 * wxRichTextEvent - the event class for wxRichTextCtrl notifications
1040 class WXDLLIMPEXP_RICHTEXT wxRichTextEvent
: public wxNotifyEvent
1043 wxRichTextEvent(wxEventType commandType
= wxEVT_NULL
, int winid
= 0)
1044 : wxNotifyEvent(commandType
, winid
),
1045 m_flags(0), m_position(-1), m_oldStyleSheet(NULL
), m_newStyleSheet(NULL
),
1046 m_char((wxChar
) 0), m_container(NULL
), m_oldContainer(NULL
)
1049 wxRichTextEvent(const wxRichTextEvent
& event
)
1050 : wxNotifyEvent(event
),
1051 m_flags(event
.m_flags
), m_position(-1),
1052 m_oldStyleSheet(event
.m_oldStyleSheet
), m_newStyleSheet(event
.m_newStyleSheet
),
1053 m_char((wxChar
) 0), m_container(event
.m_container
), m_oldContainer(event
.m_oldContainer
)
1056 long GetPosition() const { return m_position
; }
1057 void SetPosition(long pos
) { m_position
= pos
; }
1059 int GetFlags() const { return m_flags
; }
1060 void SetFlags(int flags
) { m_flags
= flags
; }
1062 wxRichTextStyleSheet
* GetOldStyleSheet() const { return m_oldStyleSheet
; }
1063 void SetOldStyleSheet(wxRichTextStyleSheet
* sheet
) { m_oldStyleSheet
= sheet
; }
1065 wxRichTextStyleSheet
* GetNewStyleSheet() const { return m_newStyleSheet
; }
1066 void SetNewStyleSheet(wxRichTextStyleSheet
* sheet
) { m_newStyleSheet
= sheet
; }
1068 const wxRichTextRange
& GetRange() const { return m_range
; }
1069 void SetRange(const wxRichTextRange
& range
) { m_range
= range
; }
1071 wxChar
GetCharacter() const { return m_char
; }
1072 void SetCharacter(wxChar ch
) { m_char
= ch
; }
1074 wxRichTextParagraphLayoutBox
* GetContainer() const { return m_container
; }
1075 void SetContainer(wxRichTextParagraphLayoutBox
* container
) { m_container
= container
; }
1077 wxRichTextParagraphLayoutBox
* GetOldContainer() const { return m_oldContainer
; }
1078 void SetOldContainer(wxRichTextParagraphLayoutBox
* container
) { m_oldContainer
= container
; }
1080 virtual wxEvent
*Clone() const { return new wxRichTextEvent(*this); }
1085 wxRichTextStyleSheet
* m_oldStyleSheet
;
1086 wxRichTextStyleSheet
* m_newStyleSheet
;
1087 wxRichTextRange m_range
;
1089 wxRichTextParagraphLayoutBox
* m_container
;
1090 wxRichTextParagraphLayoutBox
* m_oldContainer
;
1093 DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxRichTextEvent
)
1097 * wxRichTextCtrl events
1099 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_LEFT_CLICK
, wxRichTextEvent
);
1100 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK
, wxRichTextEvent
);
1101 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK
, wxRichTextEvent
);
1102 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK
, wxRichTextEvent
);
1103 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_RETURN
, wxRichTextEvent
);
1104 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_CHARACTER
, wxRichTextEvent
);
1105 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_DELETE
, wxRichTextEvent
);
1107 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING
, wxRichTextEvent
);
1108 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED
, wxRichTextEvent
);
1109 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING
, wxRichTextEvent
);
1110 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED
, wxRichTextEvent
);
1112 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED
, wxRichTextEvent
);
1113 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED
, wxRichTextEvent
);
1114 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED
, wxRichTextEvent
);
1115 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_SELECTION_CHANGED
, wxRichTextEvent
);
1116 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_BUFFER_RESET
, wxRichTextEvent
);
1117 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT
, wxEVT_COMMAND_RICHTEXT_FOCUS_OBJECT_CHANGED
, wxRichTextEvent
);
1119 typedef void (wxEvtHandler::*wxRichTextEventFunction
)(wxRichTextEvent
&);
1121 #define wxRichTextEventHandler(func) \
1122 wxEVENT_HANDLER_CAST(wxRichTextEventFunction, func)
1124 #define EVT_RICHTEXT_LEFT_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_LEFT_CLICK, id, -1, wxRichTextEventHandler( fn ), NULL ),
1125 #define EVT_RICHTEXT_RIGHT_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK, id, -1, wxRichTextEventHandler( fn ), NULL ),
1126 #define EVT_RICHTEXT_MIDDLE_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK, id, -1, wxRichTextEventHandler( fn ), NULL ),
1127 #define EVT_RICHTEXT_LEFT_DCLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK, id, -1, wxRichTextEventHandler( fn ), NULL ),
1128 #define EVT_RICHTEXT_RETURN(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_RETURN, id, -1, wxRichTextEventHandler( fn ), NULL ),
1129 #define EVT_RICHTEXT_CHARACTER(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_CHARACTER, id, -1, wxRichTextEventHandler( fn ), NULL ),
1130 #define EVT_RICHTEXT_DELETE(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_DELETE, id, -1, wxRichTextEventHandler( fn ), NULL ),
1132 #define EVT_RICHTEXT_STYLESHEET_CHANGING(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING, id, -1, wxRichTextEventHandler( fn ), NULL ),
1133 #define EVT_RICHTEXT_STYLESHEET_CHANGED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED, id, -1, wxRichTextEventHandler( fn ), NULL ),
1134 #define EVT_RICHTEXT_STYLESHEET_REPLACING(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING, id, -1, wxRichTextEventHandler( fn ), NULL ),
1135 #define EVT_RICHTEXT_STYLESHEET_REPLACED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED, id, -1, wxRichTextEventHandler( fn ), NULL ),
1137 #define EVT_RICHTEXT_CONTENT_INSERTED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED, id, -1, wxRichTextEventHandler( fn ), NULL ),
1138 #define EVT_RICHTEXT_CONTENT_DELETED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED, id, -1, wxRichTextEventHandler( fn ), NULL ),
1139 #define EVT_RICHTEXT_STYLE_CHANGED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED, id, -1, wxRichTextEventHandler( fn ), NULL ),
1140 #define EVT_RICHTEXT_SELECTION_CHANGED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_SELECTION_CHANGED, id, -1, wxRichTextEventHandler( fn ), NULL ),
1141 #define EVT_RICHTEXT_BUFFER_RESET(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_BUFFER_RESET, id, -1, wxRichTextEventHandler( fn ), NULL ),
1147 // _WX_RICHTEXTCTRL_H_