From 48c8439fdb5bbacf457f3a825bb5a73fe10dd8e7 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 26 Nov 2006 20:41:48 +0000 Subject: [PATCH] Further wxRTC doc updates git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43663 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/richtextctrl.tex | 6 ++ docs/latex/wx/richtextevent.tex | 92 ++++++++++++++++++++++++------ docs/latex/wx/richtextoverview.tex | 51 ++++++++++------- docs/latex/wx/richtextprinting.tex | 12 ++++ 4 files changed, 123 insertions(+), 38 deletions(-) diff --git a/docs/latex/wx/richtextctrl.tex b/docs/latex/wx/richtextctrl.tex index 93d30dc996..deb1f91fba 100644 --- a/docs/latex/wx/richtextctrl.tex +++ b/docs/latex/wx/richtextctrl.tex @@ -3,6 +3,12 @@ wxRichTextCtrl provides a generic, ground-up implementation of a text control capable of showing multiple styles and images. +wxRichTextCtrl sends notification events: see \helpref{wxRichTextEvent}{wxrichtextevent}. +It also sends the standard wxTextCtrl events wxEVT\_COMMAND\_TEXT\_ENTER and wxEVT\_COMMAND\_TEXT\_UPDATED, +and wxTextUrlEvent when URL content is clicked. + +For more information, see the \helpref{wxRichTextCtrl overview}{wxrichtextctrloverview}. + \wxheading{Derived from} wxTextCtrlBase diff --git a/docs/latex/wx/richtextevent.tex b/docs/latex/wx/richtextevent.tex index 49c371709f..7d424054d1 100644 --- a/docs/latex/wx/richtextevent.tex +++ b/docs/latex/wx/richtextevent.tex @@ -1,20 +1,29 @@ \section{\class{wxRichTextEvent}}\label{wxrichtextevent} -This is the event class for wxRichTextCtrl notifications. Note that event generation -is incomplete; events to be implemented include selection of text, deletion, insertion, and so on. +This is the event class for \helpref{wxRichTextCtrl}{wxrichtextctrl} notifications. \wxheading{Event table macros} To process a rich text event, use these event handler macros to direct input to a member function that takes a wxRichTextEvent argument. -\twocolwidtha{7cm} +\twocolwidtha{10cm} \begin{twocollist}\itemsep=0pt -\twocolitem{{\bf EVT\_RICHTEXT\_LEFT\_CLICK(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_LEFT\_CLICK event. Not currently implemented.} -\twocolitem{{\bf EVT\_RICHTEXT\_RIGHT\_CLICK(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_RIGHT\_CLICK event. Not currently implemented.} -\twocolitem{{\bf EVT\_RICHTEXT\_MIDDLE\_CLICK(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_MIDDLE\_CLICK event. Not currently implemented.} -\twocolitem{{\bf EVT\_RICHTEXT\_LEFT\_DCLICK(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_LEFT\_DCLICK event. Not currently implemented.} -\twocolitem{{\bf EVT\_RICHTEXT\_RETURN(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_RETURN event, generated when the user presses the return key.} +%\twocolitem{{\bf EVT\_RICHTEXT\_LEFT\_CLICK(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_LEFT\_CLICK event. Not currently implemented.} +%\twocolitem{{\bf EVT\_RICHTEXT\_RIGHT\_CLICK(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_RIGHT\_CLICK event. Not currently implemented.} +%\twocolitem{{\bf EVT\_RICHTEXT\_MIDDLE\_CLICK(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_MIDDLE\_CLICK event. Not currently implemented.} +%\twocolitem{{\bf EVT\_RICHTEXT\_LEFT\_DCLICK(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_LEFT\_DCLICK event. Not currently implemented.} +\twocolitem{{\bf EVT\_RICHTEXT\_CHARACTER(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_CHARACTER event, generated when the user presses a character key. Valid event functions: GetFlags, GetPosition, GetCharacter.} +\twocolitem{{\bf EVT\_RICHTEXT\_DELETE(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_DELETE event, generated when the user presses the backspace or delete key. Valid event functions: GetFlags, GetPosition.} +\twocolitem{{\bf EVT\_RICHTEXT\_RETURN(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_RETURN event, generated when the user presses the return key. Valid event functions: GetFlags, GetPosition.} +%\twocolitem{{\bf EVT\_RICHTEXT\_SELECTION\_CHANGED(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_SELECTION\_CHANGED event, generated when the selection has been changed. Not currently implemented.} +\twocolitem{{\bf EVT\_RICHTEXT\_STYLE\_CHANGED(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_STYLE\_CHANGED event, generated when styling has been applied to the control. Valid event functions: GetPosition, GetRange.} +%\twocolitem{{\bf EVT\_RICHTEXT\_STYLESHEET\_CHANGING(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_STYLESHEET\_CHANGING event, generated when the control's stylesheet is about to change, for example the user added, edited or deleted a style.} +\twocolitem{{\bf EVT\_RICHTEXT\_STYLESHEET\_CHANGED(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_STYLESHEET\_CHANGING event, generated when the control's stylesheet has changed, for example the user added, edited or deleted a style. Valid event functions: GetRange, GetPosition.} +\twocolitem{{\bf EVT\_RICHTEXT\_STYLESHEET\_REPLACING(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_STYLESHEET\_REPLACING event, generated when the control's stylesheet is about to be replaced, for example when a file is loaded into the control. Valid event functions: Veto, GetOldStyleSheet, GetNewStyleSheet.} +\twocolitem{{\bf EVT\_RICHTEXT\_STYLESHEET\_REPLACED(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_STYLESHEET\_REPLACED event, generated when the control's stylesheet has been replaced, for example when a file is loaded into the control. Valid event functions: GetOldStyleSheet, GetNewStyleSheet.} +\twocolitem{{\bf EVT\_RICHTEXT\_CONTENT\_INSERTED(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_CONTENT\_INSERTED event, generated when content has been inserted into the control. Valid event functions: GetPosition, GetRange.} +\twocolitem{{\bf EVT\_RICHTEXT\_CONTENT\_DELETED(id, func)}}{Process a wxEVT\_COMMAND\_RICHTEXT\_CONTENT\_DELETED event, generated when content has been deleted from the control. Valid event functions: GetPosition, GetRange.} \end{twocollist}% \wxheading{Derived from} @@ -43,28 +52,79 @@ Constructors. Clones the event. +\membersection{wxRichTextEvent::GetCharacter}\label{wxrichtexteventgetcharacter} + +\constfunc{wxChar}{GetCharacter}{\void} + +Returns the character pressed, within a wxEVT\_COMMAND\_RICHTEXT\_CHARACTER event. + \membersection{wxRichTextEvent::GetFlags}\label{wxrichtexteventgetflags} \constfunc{int}{GetFlags}{\void} -Returns flags indicating modifier keys pressed. +Returns flags indicating modifier keys pressed. Possible values are wxRICHTEXT\_CTRL\_DOWN, +wxRICHTEXT\_SHIFT\_DOWN, and wxRICHTEXT\_ALT\_DOWN. + +\membersection{wxRichTextEvent::GetNewStyleSheet}\label{wxrichtexteventgetnewstylesheet} + +\constfunc{wxRichTextStyleSheet*}{GetNewStyleSheet}{\void} + +Returns the new style sheet. Can be used in a wxEVT\_COMMAND\_RICHTEXT\_STYLESHEET\_CHANGING or +wxEVT\_COMMAND\_RICHTEXT\_STYLESHEET\_CHANGED event handler. + +\membersection{wxRichTextEvent::GetOldStyleSheet}\label{wxrichtexteventgetoldstylesheet} + +\constfunc{wxRichTextStyleSheet*}{GetOldStyleSheet}{\void} + +Returns the old style sheet. Can be used in a wxEVT\_COMMAND\_RICHTEXT\_STYLESHEET\_CHANGING or +wxEVT\_COMMAND\_RICHTEXT\_STYLESHEET\_CHANGED event handler. + +\membersection{wxRichTextEvent::GetPosition}\label{wxrichtexteventgetposition} + +\constfunc{long}{GetPosition}{\void} + +Returns the buffer position at which the event occured. -\membersection{wxRichTextEvent::GetIndex}\label{wxrichtexteventgetindex} +\membersection{wxRichTextEvent::GetRange}\label{wxrichtexteventgetrange} -\constfunc{int}{GetIndex}{\void} +\constfunc{wxRichTextRange}{GetRange}{\void} -Not currently used. +Gets the range for the current operation. + +\membersection{wxRichTextEvent::SetCharacter}\label{wxrichtexteventsetcharacter} + +\func{void}{SetCharacter}{\param{wxChar }{ch}} + +Sets the character variable. \membersection{wxRichTextEvent::SetFlags}\label{wxrichtexteventsetflags} \func{void}{SetFlags}{\param{int }{flags}} Sets flags indicating modifier keys pressed. Possible values are wxRICHTEXT\_CTRL\_DOWN, -wxRICHTEXT\_SHIFT\_DOWN, andwxRICHTEXT\_ALT\_DOWN. +wxRICHTEXT\_SHIFT\_DOWN, and wxRICHTEXT\_ALT\_DOWN. + +\membersection{wxRichTextEvent::SetNewStyleSheet}\label{wxrichtexteventsetnewstylesheet} + +\func{void}{SetNewStyleSheet}{\param{wxRichTextStyleSheet*}{ sheet}} + +Sets the new style sheet variable. + +\membersection{wxRichTextEvent::SetOldStyleSheet}\label{wxrichtexteventsetoldstylesheet} + +\func{void}{SetOldStyleSheet}{\param{wxRichTextStyleSheet*}{ sheet}} + +Sets the old style sheet variable. + +\membersection{wxRichTextEvent::SetPosition}\label{wxrichtexteventsetposition} + +\func{void}{SetPosition}{\param{long }{pos}} + +Sets the buffer position variable. -\membersection{wxRichTextEvent::SetIndex}\label{wxrichtexteventsetindex} +\membersection{wxRichTextEvent::SetRange}\label{wxrichtexteventsetrange} -\func{void}{SetIndex}{\param{int }{n}} +\func{void}{SetRange}{\param{const wxRichTextRange\&}{ range}} -Not currently used. +Sets the range variable. diff --git a/docs/latex/wx/richtextoverview.tex b/docs/latex/wx/richtextoverview.tex index ae8f304fde..cb7e946f75 100644 --- a/docs/latex/wx/richtextoverview.tex +++ b/docs/latex/wx/richtextoverview.tex @@ -1,22 +1,28 @@ \section{wxRichTextCtrl overview}\label{wxrichtextctrloverview} -Classes: \helpref{wxRichTextCtrl}{wxrichtextctrl}, \helpref{wxRichTextBuffer}{wxrichtextbuffer}, -\helpref{wxRichTextAttr}{wxrichtextattr}, \helpref{wxTextAttrEx}{wxtextattrex}, -\helpref{wxRichTextCharacterStyleDefinition}{wxrichtextcharacterstyledefinition}, +{\bf Major classes:} \helpref{wxRichTextCtrl}{wxrichtextctrl}, \helpref{wxRichTextBuffer}{wxrichtextbuffer}, \helpref{wxRichTextEvent}{wxrichtextevent} + +{\bf Helper classes:} \helpref{wxRichTextAttr}{wxrichtextattr}, \helpref{wxTextAttrEx}{wxtextattrex}, +\helpref{wxRichTextRange}{wxrichtextrange} + +{\bf File handler classes:} \helpref{wxRichTextFileHandler}{wxrichtextfilehandler}, \helpref{wxRichTextHTMLHandler}{wxrichtexthtmlhandler}, +\helpref{wxRichTextXMLHandler}{wxrichtextxmlhandler} + +{\bf Style classes:} \helpref{wxRichTextCharacterStyleDefinition}{wxrichtextcharacterstyledefinition}, \helpref{wxRichTextParagraphStyleDefinition}{wxrichtextparagraphstyledefinition}, \helpref{wxRichTextListStyleDefinition}{wxrichtextliststyledefinition}, -\helpref{wxRichTextStyleSheet}{wxrichtextstylesheet}, -\helpref{wxRichTextStyleComboCtrl}{wxrichtextstylecomboctrl}, +\helpref{wxRichTextStyleSheet}{wxrichtextstylesheet} + +{\bf Additional controls:} \helpref{wxRichTextStyleComboCtrl}{wxrichtextstylecomboctrl}, \helpref{wxRichTextStyleListBox}{wxrichtextstylelistbox}, -\helpref{wxRichTextStyleListCtrl}{wxrichtextstylelistctrl}, -\helpref{wxRichTextStyleOrganiserDialog}{wxrichtextstyleorganiserdialog}, -\helpref{wxRichTextEvent}{wxrichtextevent}, \helpref{wxRichTextRange}{wxrichtextrange}, -\helpref{wxRichTextFileHandler}{wxrichtextfilehandler}, \helpref{wxRichTextHTMLHandler}{wxrichtexthtmlhandler}, -\helpref{wxRichTextXMLHandler}{wxrichtextxmlhandler}, -\helpref{wxRichTextFormattingDialog}{wxrichtextformattingdialog}, -\helpref{wxRichTextPrinting}{wxrichtextprinting}, +\helpref{wxRichTextStyleListCtrl}{wxrichtextstylelistctrl} + +{\bf Printing classes:} \helpref{wxRichTextPrinting}{wxrichtextprinting}, \helpref{wxRichTextPrintout}{wxrichtextprintout}, -\helpref{wxRichTextHeaderFooterData}{wxrichtextheaderfooterdata}, +\helpref{wxRichTextHeaderFooterData}{wxrichtextheaderfooterdata} + +{\bf Dialog classes:} \helpref{wxRichTextStyleOrganiserDialog}{wxrichtextstyleorganiserdialog}, +\helpref{wxRichTextFormattingDialog}{wxrichtextformattingdialog}, \helpref{wxSymbolPickerDialog}{wxsymbolpickerdialog} wxRichTextCtrl provides a generic implementation of a rich text editor that can handle different character @@ -48,7 +54,7 @@ There are a few disadvantages to using wxRichTextCtrl. It is not native, so does not behave exactly as a native wxTextCtrl, although common editing conventions are followed. Users may miss the built-in spelling correction on Mac OS X, or any special character input that may be provided by the native control. It would also -be a bad choice if intended users rely on screen readers that would be unhappy +be a poor choice if intended users rely on screen readers that would be not work well with non-native text input implementation. You might mitigate this by providing the choice between wxTextCtrl and wxRichTextCtrl, with fewer features in the former case. @@ -214,8 +220,8 @@ be processed by the control rather than being used for navigation between contro \subsubsection{wxRichTextCtrl and styles} -Styling attributes are represented by one of three classes: \helpref{wxTextAttr}{wxtextattr}, \helpref{wxTextAttrEx}{wxtextattrex} and \helpref{wxRichTextAttr}{wxrichtextattr}. -wxTextAttr is shared across all controls that are derived from wxTextCtrl and +Styling attributes are represented by three classes: \helpref{wxTextAttr}{wxtextattr}, \helpref{wxTextAttrEx}{wxtextattrex} and \helpref{wxRichTextAttr}{wxrichtextattr}. +wxTextAttr is shared across all controls that are derived from wxTextCtrlBase and can store basic character and paragraph attributes. wxTextAttrEx derives from wxTextAttr and adds some further attributes that are only supported by wxRichTextCtrl. Finally, wxRichTextAttr is a more efficient version @@ -342,17 +348,18 @@ always has one such buffer. The content is represented by a hierarchy of objects, all derived from wxRichTextObject. An object might be an image, a fragment of text, a paragraph, -or a whole buffer. Objects store a wxRichTextAttr containing style information; -although it contains both paragraph formatting and character style, the -paragraph style information is ignored by children of a paragraph (only -character style is relevant to these objects). +or a whole buffer. Objects store a wxTextAttrEx containing style information; +a paragraph object can contain both paragraph and character information, but +content objects such as text can only store character information. The final +style displayed in the control or in a printout is a combination of base +style, paragraph style and content (character) style. The top of the hierarchy is the buffer, a kind of wxRichTextParagraphLayoutBox. containing further wxRichTextParagraph objects, each of which can include text, images and potentially other types of object. Each object maintains a range (start and end position) measured -from the start of the main parent box. +from the start of the main parent object. When Layout is called on an object, it is given a size which the object must limit itself to, or one or more flexible directions (vertical @@ -368,7 +375,7 @@ A paragraph of pure text with the same style contains just one further object, a wxRichTextPlainText object. When styling is applied to part of this object, the object is decomposed into separate objects, one object for each different character style. So each object within a paragraph always has -just one wxRichTextAttr object to denote its character style. Of course, this can +just one wxTextAttrEx object to denote its character style. Of course, this can lead to fragmentation after a lot of edit operations, potentially leading to several objects with the same style where just one would do. So a Defragment function is called when updating the control's display, to ensure that diff --git a/docs/latex/wx/richtextprinting.tex b/docs/latex/wx/richtextprinting.tex index 53245d1aa1..521549ced7 100644 --- a/docs/latex/wx/richtextprinting.tex +++ b/docs/latex/wx/richtextprinting.tex @@ -132,6 +132,12 @@ Sets the \helpref{wxRichTextHeaderFooterData}{wxrichtextheaderfooterdata} text c A convenience function to set the header text. See \helpref{wxRichTextHeaderFooterData}{wxrichtextheaderfooterdata} for details. +\membersection{wxRichTextPrinting::SetPageSetupData}\label{wxrichtextprintingsetpagesetupdata} + +\func{void}{SetPageSetupData}{\param{const wxPageSetupData\& }{pageSetupData}} + +Sets the page setup data. + \membersection{wxRichTextPrinting::SetParentWindow}\label{wxrichtextprintingsetparentwindow} \func{void}{SetParentWindow}{\param{wxWindow* }{parent}} @@ -144,6 +150,12 @@ Sets the parent window to be used for the preview window and printing wait dialo Sets the dimensions to be used for the preview window. +\membersection{wxRichTextPrinting::SetPrintData}\label{wxrichtextprintingsetprintdata} + +\func{void}{SetPrintData}{\param{const wxPrintData\& }{printData}} + +Sets the print data. + \membersection{wxRichTextPrinting::SetShowOnFirstPage}\label{wxrichtextprintingsetshowonfirstpage} \func{void}{SetShowOnFirstPage}{\param{bool }{show}} -- 2.45.2