readme.txt 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. wxRichTextCtrl README
  2. =====================
  3. Welcome to wxRichTextCtrl. It includes the following functionality:
  4. * Text entry, paragraph wrapping
  5. * Scrolling, keyboard navigation
  6. * Application of character styles:
  7. bold, italic, underlined, font face, text colour
  8. * Application of paragraph styles:
  9. left/right indentation, sub-indentation (first-line indent),
  10. paragraph spacing (before and after), line spacing,
  11. left/centre/right alignment, numbered bullets
  12. * Insertion of images
  13. * Copy/paste
  14. * Undo/Redo with optional batching and undo history suppression
  15. * Named paragraph and character styles management and application
  16. * File handlers allow addition of file formats
  17. * Text saving and loading, XML saving and loading, HTML saving (unfinished)
  18. Sorry, this is a Windows-only demo for now but the code should
  19. compile on other platforms.
  20. Design
  21. ======
  22. Data is represented by a hierarchy of objects, all derived from
  23. wxRichTextObject.
  24. The top of the hierarchy is the buffer, a kind of wxRichTextParagraphLayoutBox.
  25. These boxes will allow flexible placement of text boxes on a page, but
  26. for now there will be a single box representing the document,
  27. and this box will a wxRichTextParagraphLayoutBox which contains further
  28. wxRichTextParagraph objects, each of which can include text and images.
  29. Each object maintains a range (start and end position) measured
  30. from the start of the main parent box.
  31. A paragraph object knows its range, and a text fragment knows its range
  32. too. So, a character or image in a page has a position relative to the
  33. start of the document, and a character in an embedded text box has
  34. a position relative to that text box. For now, we will not be dealing with
  35. embedded objects but it's something to bear in mind for later.
  36. Before display, a changed buffer must have Layout() called on it,
  37. to do wrapping, alignment etc. Ranges representing wrapped lines are stored
  38. with each paragraph.
  39. Since wxRichTextBuffer is separate from wxRichTextCtrl, the storage
  40. and rendering facilities can be used by other controls.
  41. API
  42. ===
  43. It's basically the wxTextCtrl with some additions. There is a new
  44. wxTextAttrEx class deriving from wxTextAttr, to accomodate new
  45. style attributes. This could be merged with wxTextAttr. There
  46. is also a wxRichTextAttr which is similar to wxTextAttrEx but
  47. doesn't store the font as a wxFont: this allows much more
  48. efficient operations, especially when querying styles in a
  49. UI update handler. We would not want to create several new wxFonts
  50. when querying for italics, bold, etc. every few milliseconds.
  51. See "Functionality specific to wxRichTextCtrl" section in richtextctrl.h.
  52. One addition is Set/GetBasicStyle, which is needed in addition to
  53. Set/GetDefaultStyle to get the overall style for the buffer
  54. from which content will inherit (after apply the default style).
  55. wxRichTextRange is a new class representing start and end positions.
  56. It's used in the implementation so that pieces of content
  57. know their range, and also in the API in preference to using
  58. two positions.
  59. What next?
  60. ==========
  61. - Decision about where to put it: wxCode, wxWidgets
  62. - Makefiles/bakefiles
  63. - Refining the API
  64. - Documentation
  65. - Bug fixing/improvements
  66. See todo.txt for a list of bugs, improvements and features,
  67. and also TODO throughout the source.
  68. ==
  69. Julian Smart, October 18th 2005