VCF::TextControl Class Reference
The base class for presenting text to the user. More...
#include <vcf/ApplicationKit/TextControl.h>
Inheritance diagram for VCF::TextControl:

Public Member Functions | |
| TextControl (const bool &multiLineControl=false) | |
| virtual | ~TextControl () |
| void | init () |
| virtual void | paint (GraphicsContext *context) |
| Paints the control. | |
| void | setTextModel (TextModel *model) |
| TextModel * | getTextModel () |
| String | getText () |
| void | setText (const String &val) |
| uint32 | getCaretPosition () |
| void | setCaretPosition (const uint32 &caretPos) |
| void | setRightMargin (const double &rightMargin) |
| void | setLeftMargin (const double &leftMargin) |
| uint32 | getLineCount () |
| uint32 | getCurrentLinePosition () |
| double | getLeftMargin () |
| double | getRightMargin () |
| Point * | getPositionFromCharIndex (const uint32 &index) |
| uint32 | getCharIndexFromPosition (Point *point) |
| uint32 | getSelectionStart () |
| returns the zero based index that indicates where the current selection begins. | |
| uint32 | getSelectionCount () |
| gives the number of characters selected. | |
| void | setSelectionMark (const uint32 &start, const uint32 &count) |
| void | selectAll () |
| void | getStyle (unsigned int start, unsigned int length, Dictionary &styles) |
| void | setStyle (unsigned int start, unsigned int length, Dictionary &styles) |
| void | setDefaultStyle (Dictionary &styles) |
| String | getSelectedText () |
| void | replaceSelectedText (const String &text) |
| virtual double | getPreferredHeight () |
| returns the preferred height for this control. | |
| virtual void | handleEvent (Event *event) |
| This gets called by the ControlPeer for any windowing system mouse events, as well as for any windowing system keyboard events and for any windowing system events like size changes, position changes, etc. | |
| bool | getReadOnly () |
| void | setReadOnly (const bool &val) |
| virtual bool | supportsMultiLinedText () |
| void | disableStandardAccelerators () |
| Call this function to disable the standard, built-in, accelerator's that make sure the platforms standard shortcut's for cut, copy, paste, undo, and redo get handled by the underlying platform. | |
| void | enableStandardAccelerators () |
| Call this function to enable the standard, built-in, accelerator's that make sure the platforms standard shortcut's for cut, copy, paste, undo, and redo get handled by the underlying platform. | |
| void | cut () |
| Cuts the selection and places it in the clipboard. | |
| void | copy () |
| Copies the selection and places it in the clipboard. | |
| void | paste () |
| Pastes the contents of the clipboard into the text control. | |
| bool | canUndo () |
| Returns a bool to indicate whether or not an undo operation can be performed. | |
| bool | canRedo () |
| Returns a bool to indicate whether or not a redo operation can be performed. | |
| void | undo () |
| Undoes the last operation. | |
| void | redo () |
| Redoes the last operation. | |
| void | setTextWrapping (const bool &val) |
| This toggles word wrapping. | |
| bool | getTextWrapping () |
| virtual bool | generatePropertyValue (const String &fullPropertyName, Property *property, VariantData *value, String &strValue) |
Public Attributes | |
| VCF::Delegate | TextModelDelegate |
| VCF::Delegate | SelectionChanged |
Protected Member Functions | |
| void | undoAccelerator (Event *e) |
| handlers of some standard accelerator events. | |
| void | redoAccelerator (Event *e) |
| void | cutAccelerator (Event *e) |
| void | copyAccelerator (Event *e) |
| void | pasteAccelerator (Event *e) |
| void | selectAllAccelerator (Event *e) |
| virtual void | gotFocus (FocusEvent *event) |
| handler called when the control is getting the focus. | |
Protected Attributes | |
| TextEditPeer * | textPeer_ |
| bool | readOnly_ |
Detailed Description
The base class for presenting text to the user.The text can be plain text, or styled text, i.e. text with multiple styles.
The TextControl is only for editing or presenting a single line of text. For editing multiple lines of text, please see the MultilineTextControl.
All text controls contain a TextModel, that stores the actual text data.
- See also:
- MultilineTextControl
Constructor & Destructor Documentation
|
|
|
|
|
|
Member Function Documentation
|
|
Returns a bool to indicate whether or not a redo operation can be performed.
|
|
|
Returns a bool to indicate whether or not an undo operation can be performed.
|
|
|
Copies the selection and places it in the clipboard. This uses the standard copy implementation provided by the underlying windowing platform. |
|
|
|
|
|
Cuts the selection and places it in the clipboard. This uses the standard cut implementation provided by the underlying windowing platform. |
|
|
|
|
|
Call this function to disable the standard, built-in, accelerator's that make sure the platforms standard shortcut's for cut, copy, paste, undo, and redo get handled by the underlying platform. You may choose to turn these off if your use of a text control provides more advanced cut/copy/paste/undo/redo support. If you're using the DocView arcichtecture you'll almost certainly want to turn them off. |
|
|
Call this function to enable the standard, built-in, accelerator's that make sure the platforms standard shortcut's for cut, copy, paste, undo, and redo get handled by the underlying platform. By default these are enabled for every text control. |
|
||||||||||||||||||||
|
Reimplemented from VCF::Control. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
returns the preferred height for this control. This is used when determing the height of the control when it is first created. Override it to provide a different value that is more acceptable for your control's initial display size. Reimplemented from VCF::Control. |
|
|
|
|
|
|
|
|
|
|
|
gives the number of characters selected.
|
|
|
returns the zero based index that indicates where the current selection begins. It may be the same index that getCaretPosition() returns |
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
handler called when the control is getting the focus. By default it is added only to a single line control, so we can select all the text whenever we get the focus. Reimplemented from VCF::Control. Reimplemented in VCF::MultilineTextControl. |
|
|
This gets called by the ControlPeer for any windowing system mouse events, as well as for any windowing system keyboard events and for any windowing system events like size changes, position changes, etc. Once inside the event the Control determines the type, and behaves accordingly, as well as notifying any appropriate listeners. Reimplemented from VCF::Control. |
|
|
|
|
|
Paints the control. Called by the underlying windowing system whenever the control needs to be painted. Note that in some cases the GraphicsContext passed in to this method may not be the same pointer as the GraphicsContext that the control holds itself. During the paint() method you should only use the context value for all your drawing and not the one returned in getContext(). The value returned by getContext() should be used for drawing that takes place outside of the paint() method. If the control allows paint notification, then the framework will fire an event to the BeforeControlPainted delegate prior to calling the control's paint() method. After the paint() method has returned, if the control allows paint notification, the framework will fire an event to the AfterControlPainted delegate. This allows outside observers to take part in the paint cycle, but beware that this does come at a bit of a cost, so use this feature sparingly. Note: This should NEVER be called by programmers using the VCF, it will be called for you during the course of your applications native event loop, and is only here for providing custom drawing routines for controls. In other words: you implement it, you never call it yourself.
Implements VCF::Control. |
|
|
Pastes the contents of the clipboard into the text control. This uses the standard paste implementation provided by the underlying windowing platform. |
|
|
|
|
|
Redoes the last operation. This uses the standard redo implementation provided by the underlying windowing platform. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
This toggles word wrapping. If you turn off word wrapping the scroll bars will show up autmatically (if they are needed). If you turn on word wrapping the scroll bars will disapear. |
|
|
Reimplemented in VCF::MultilineTextControl. |
|
|
Undoes the last operation. This uses the standard undo implementation provided by the underlying windowing platform. |
|
|
handlers of some standard accelerator events.
|
Member Data Documentation
|
|
|
|
|
|
|
|
|
|
|
|
The documentation for this class was generated from the following file:
- vcf/ApplicationKit/TextControl.h
