Gadget class. More...
#include <ilviews/gadgets/text.h>
Public Member Functions | |
IlvText (IlvDisplay *display, const IlvPoint &point, const char *const *labels=0, IlUShort count=0, IlBoolean copy=IlTrue, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Initializes a new IlvText instance with some text lines, at a given location. More... | |
IlvText (IlvDisplay *display, const IlvPoint &point, const char *text, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Initializes a new IlvText instance with some text content, at a given location. More... | |
IlvText (IlvDisplay *display, const IlvRect &rect, const char *const *labels=0, IlUShort count=0, IlBoolean copy=IlTrue, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Initializes a new IlvText instance with some text lines, located in given rectangle. More... | |
IlvText (IlvDisplay *display, const IlvRect &rect, const char *text, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Initializes a new empty IlvText instance, located in given rectangle. More... | |
void | addLine (const char *text, IlShort line=-1) |
Inserts a new text line at the specified location. More... | |
virtual void | addLines (const char *const *labels, IlUShort count, IlShort line=-1, IlBoolean redraw=IlFalse) |
Adds the specified text lines to the text gadget. More... | |
void | addText (const char *text, IlShort line=-1, IlBoolean redraw=IlFalse) |
Adds the specified text to the text gadget. More... | |
virtual void | adjustScrollBars (IlBoolean=IlFalse) |
Recomputes the scroll bars. More... | |
virtual IlBoolean | check (IlUShort character) |
Is called by the interactor for each key down event that corresponds to a regular character. More... | |
virtual void | cursorMoved () |
Is called from the interactor when the cursor is moved. More... | |
void | cutLine (const IlvTextLocation &location) |
Removes the end of the specified line. More... | |
virtual void | drawBackground (IlvPort *, const IlvTransformer *, const IlvRegion *) const |
Draws the gadget background. More... | |
virtual void | drawFrame (IlvPort *, const IlvTransformer *, const IlvRegion *) const |
Draws the gadget frame. More... | |
virtual void | drawGadgetContents (IlvPort *, const IlvTransformer *=0, const IlvRegion *=0) const |
Draws the gadget contents. More... | |
void | ensureVisible (const IlvTextLocation &location, const IlvTransformer *t=0) |
Changes the first line and the offset of the text gadget to ensure that the specified text location is visible. More... | |
IlvTextLocation | getCursorLocation () const |
Returns the current location of the cursor. More... | |
IlvTextLocation | getEndLocation () const |
Returns the last location of the text. More... | |
IlUShort | getFirstLine () const |
Returns the index of the first text line displayed. More... | |
IlUShort | getLastFullVisibleLine (const IlvTransformer *t=0) const |
Returns the index of the last visible line that can be seen without scrolling. More... | |
IlUShort | getLastLine (const IlvTransformer *t=0) const |
Returns the index of the last text line displayed. More... | |
const char * | getLine (IlUShort index) const |
Returns the specified text line. More... | |
IlUShort | getLineLength (IlUShort index) const |
Returns the number of characters in the specified text line. More... | |
const char *const * | getLines (IlUShort &count) const |
Returns an array of strings representing the text stored in the gadget. More... | |
IlvDim | getMaxWidth () const |
Returns the width of the largest visible line. More... | |
IlUShort | getNumberOfLines () const |
Returns the number of text lines stored in the object. More... | |
IlUShort | getNumberOfVisibleLines (const IlvTransformer *t=0) const |
Returns the number of visible text lines. More... | |
IlvDim | getOffset () const |
Returns the text gadget offset. More... | |
const char * | getSelectedText () const |
Returns the selected text. More... | |
void | getSelection (IlvTextLocation &from, IlvTextLocation &to) const |
Returns the location of the current selection. More... | |
const char * | getText () const |
Returns the text stored in the text gadget. More... | |
virtual IlBoolean | handleAltKey (IlUShort character) |
Is called by the interactor to handle keys pressed with the IlvMetaModifier . More... | |
virtual IlBoolean | handleControl (IlUShort character) |
Is called by the interactor to handle the control keys. More... | |
virtual IlBoolean | handleGadgetEvent (IlvEvent &) |
Handles the gadget events. More... | |
void | insertChar (const IlvTextLocation &location, IlUShort character) |
Inserts a character at the specified location. More... | |
void | insertText (const char *text, IlvTextLocation &location, IlBoolean redraw=IlFalse) |
Inserts text into the text gadget at the specified location. More... | |
IlBoolean | isCursorShown () const |
Indicates whether the cursor is visible. More... | |
IlBoolean | isEditable () const |
Indicates whether the text gadget can be edited. More... | |
void | locateWord (const IlvTextLocation &location, IlvTextLocation &start, IlvTextLocation &end) const |
Finds the word at the specified location. More... | |
IlvTextLocation | pointToPosition (const IlvPoint &point, const IlvTransformer *t=0) const |
Returns the location of the specified point in the text. More... | |
IlBoolean | readText (const char *filename=0, const IlvTransformer *t=0) |
Inserts the contents of the specified file into the text gadget. More... | |
void | readText (std::istream &istream, const IlvTransformer *t=0) |
Inserts the contents of the specified stream into the text gadget. More... | |
void | removeChar (const IlvTextLocation &location) |
Removes a character from a specified location. More... | |
void | removeLine (IlUShort line) |
Removes and deletes the specified text line. More... | |
void | removeLines (IlUShort line, IlUShort count) |
Removes and deletes several text lines. More... | |
virtual void | scrollBarVisibilityChanged (IlvDirection) |
Is called when an internal scroll bar is shown or hidden. More... | |
virtual void | selectionChanged () |
Is called from the interactor when the selection is modified. More... | |
void | setCursorLocation (const IlvTextLocation &location) |
Sets the cursor location to a new location. More... | |
void | setEditable (IlBoolean value) |
Specifies whether editing is allowed for the text gadget. More... | |
void | setFirstLine (IlUShort line) |
Sets the first text line to be displayed. More... | |
void | setLine (IlUShort line, const char *text, IlBoolean copy=IlTrue) |
Replaces the text line specified by line with text. More... | |
virtual void | setLines (const char *const *labels, IlUShort count, IlBoolean copy=IlTrue) |
Replaces all the text in the text gadget. More... | |
void | setOffset (IlvDim offset) |
Sets the text gadget offset. More... | |
void | setSelection (const IlvTextLocation &from, const IlvTextLocation &to) |
Sets the location of the current selection. More... | |
virtual void | setText (const char *text) |
Sets the text to be stored in the text gadget. More... | |
void | showCursor (IlBoolean value) |
Specifies whether the cursor should be visible. More... | |
virtual void | valueChanged () |
Is called from the interactor when the value is modified. More... | |
Public Member Functions inherited from IlvScrolledGadget | |
IlvScrolledGadget (IlvDisplay *display, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. More... | |
void | computeBBox (IlvRect &ibox, IlvRect &vbox, IlvRect &vs, IlvRect &hs, const IlvTransformer *t=0) const |
Computes the bounding boxes of the elements that compose the gadget. More... | |
void | computeBBox (IlvRect &ibox, IlvRect &vs, IlvRect &hs, const IlvTransformer *t=0) const |
Computes the bounding boxes of the elements that compose the gadget. More... | |
virtual IlvScrollBar * | createScrollBar (const IlvRect &rect, IlvDirection direction, IlUShort thickness, IlvPalette *palette) |
Returns a new instance of the IlvScrollBar class. More... | |
virtual void | drawScrollBar (IlvPort *dst, IlvDirection direction, const IlvTransformer *t=0, const IlvRegion *clip=0) const |
Draws the specified internal scroll bar. More... | |
void | fitToRect (const IlvRect &rect) |
Resizes the object so that the scrollable area fits the specified rectangle. More... | |
IlUShort | getBottomMargin () const |
Returns the bottom margin. More... | |
IlvScrollBar * | getHorizontalScrollBar () const |
Returns a pointer to the internal horizontal scroll bar. More... | |
IlUShort | getLeftMargin () const |
Returns the left margin. More... | |
IlUShort | getRightMargin () const |
Returns the right margin. More... | |
IlvScrollBar * | getScrollBar (IlvDirection direction) const |
Returns a pointer to the specified internal scroll bar. More... | |
void | getScrollBarShowAsNeeded (IlBoolean &vert, IlBoolean &hor) const |
Returns the scroll bar mode of the internal scroll bars. More... | |
IlUShort | getTopMargin () const |
Returns the top margin. More... | |
IlvScrollBar * | getVerticalScrollBar () const |
Returns a pointer to the internal vertical scroll bar. More... | |
virtual IlBoolean | handleScrollBarsEvent (IlvEvent &event) |
Handles the internal scroll bars event. More... | |
void | hideScrollBar (IlvDirection direction, IlBoolean redraw=IlTrue) |
Hides the specified internal scroll bar. More... | |
virtual void | internalBBox (IlvRect &bbox, const IlvTransformer *t=0) const |
Returns the internal bounding box of the gadget. More... | |
void | moveScrollBar (IlvDirection direction, IlvPosition where, IlBoolean redraw=IlTrue) |
Moves the specified internal scroll bar to a new position. More... | |
virtual void | scrollableSize (IlvDim &width, IlvDim &height) const |
Returns the size of the scrollable area of the gadget. More... | |
virtual void | scrollBarBBox (IlvDirection direction, IlvRect &bbox, const IlvTransformer *t=0) const |
Returns the bounding box of the specified internal scroll bar. More... | |
void | scrollBarShowAsNeeded (IlBoolean vertical, IlBoolean horizontal, IlBoolean redraw=IlTrue) |
Sets the scroll bar mode of the internal scroll bars. More... | |
void | setBottomMargin (IlUShort margin) |
Sets the bottom margin. More... | |
void | setLeftMargin (IlUShort margin) |
Sets the left margin. More... | |
void | setMargin (IlUShort val) |
Sets the left, right, top, and bottom margins. More... | |
void | setRightMargin (IlUShort margin) |
Sets the right margin. More... | |
void | setTopMargin (IlUShort margin) |
Sets the top margin. More... | |
void | showScrollBar (IlvDirection direction, IlBoolean redraw=IlTrue) |
Shows the specified internal scroll bar. More... | |
virtual void | visibleBBox (IlvRect &bbox, const IlvTransformer *t=0) const |
Returns the visible bounding box of the gadget. More... | |
IlvPosition | whereIsScrollBar (IlvDirection direction) const |
Returns the location of the specified internal scroll bar. More... | |
Static Public Member Functions | |
static IlSymbol * | CursorMovedSymbol () |
Returns the callback type of the Cursor Moved callback. More... | |
static IlSymbol * | SelectionChangedSymbol () |
Returns the callback type of the Selection Changed callback. More... | |
static IlSymbol * | ValueChangedSymbol () |
Returns the callback type of the Value Changed callback. More... | |
Static Public Member Functions inherited from IlvScrolledGadget | |
static IlSymbol * | ScrollBarMovedSymbol () |
Returns the callback type for the Scroll Bar Moved callback. More... | |
static IlSymbol * | ScrollBarVisibilitySymbol () |
Returns the callback type for the Scroll Bar Visibility Changed callback. More... | |
Protected Member Functions | |
virtual void | adjustFromScrollBar (const IlvScrollBar *, IlvDirection) |
Is called to adjust the gadget to the scroll bars values. More... | |
void | adjustScrollBarValue (IlvScrollBar *, IlvDirection) |
Is called to adjust the scroll bar values. More... | |
virtual void | scrollBarHasMoved (IlvDirection) |
Is called when an internal scroll bar has moved. More... | |
Protected Member Functions inherited from IlvScrolledGadget | |
IlvDim | getLimitHeightValue () const |
Returns the limit value for the vertical scrolling. More... | |
IlvDim | getLimitWidthValue () const |
Returns the limit value for the horizontal scrolling. More... | |
IlvDim | getScrollableHeight () const |
Returns the height of the scrollable area. More... | |
IlvDim | getScrollableWidth () const |
Returns the width of the scrollable area. More... | |
void | setLimitHeightValue (IlvDim value) |
Sets the limit value for the vertical scrolling. More... | |
void | setLimitWidthValue (IlvDim value) |
Sets the limit value for the horizontal scrolling. More... | |
void | setScrollableHeight (IlvDim height) |
Sets the height of the scrollable area. More... | |
void | setScrollableWidth (IlvDim width) |
Sets the width of the scrollable area. More... | |
Friends | |
class | IlvDefaultTextLFHandler |
Gadget class.
Library: ilvadvgdt
The IlvText
class defines a multiline text editor that can contain up to 65535 lines of text. The contents of a text gadget can be edited.
A Multiline Text Gadget
IlvTextLocation
, IlvTextField
.Name | Type | Equivalent methods |
---|---|---|
lines | UInt | getNumberOfLines() |
text | String | getText() , setText() |
selectedText | String | getSelectedText() |
editable | Boolean | isEditable() , setEditable() |
cursorLocation | UInt | getCursorLocation() , setCursorLocation() |
selectionStart | UInt | getSelection() , setSelection() |
selectionEnd | UInt | getSelection() , setSelection() |
Name | Return type | Equivalent methods |
---|---|---|
getLine(UInt index) | String | getLine(IlUShort index) const |
setLine(UInt index, String str) | Void | setLine(IlUShort index, const char* str, IlBoolean) |
removeLine(UInt index) | Void | removeLine(IlUShort index) |
addLine(String str, UInt index) | Void | addLine(const char* str, IlShort index) |
Graphic property | CSS property | Type |
---|---|---|
Background color | background-color | Color |
Text color | color | Color |
IlvText::IlvText | ( | IlvDisplay * | display, |
const IlvPoint & | point, | ||
const char *const * | labels = 0 , |
||
IlUShort | count = 0 , |
||
IlBoolean | copy = IlTrue , |
||
IlUShort | thickness = IlvDefaultGadgetThickness , |
||
IlvPalette * | palette = 0 |
||
) |
Initializes a new IlvText
instance with some text lines, at a given location.
The size of the object is computed by calling the method IlvGadget::fitToContents()
. If you want to specify its size, use a constructor that takes an IlvRect
reference instead of an IlvPoint
object as parameter.
display | The connection to the display. |
point | The position of the text gadget. |
labels | An array of strings representing the lines of the text gadget. |
count | The number of elements in the labels array. |
copy | If IlTrue , the labels array is copied. Otherwise it is stored as is, and deleted when this IlvText is destroyed. |
thickness | The thickness of the text gadget. |
palette | The palette used by the text gadget. |
IlvText::IlvText | ( | IlvDisplay * | display, |
const IlvRect & | rect, | ||
const char *const * | labels = 0 , |
||
IlUShort | count = 0 , |
||
IlBoolean | copy = IlTrue , |
||
IlUShort | thickness = IlvDefaultGadgetThickness , |
||
IlvPalette * | palette = 0 |
||
) |
Initializes a new IlvText
instance with some text lines, located in given rectangle.
display | The connection to the display. |
rect | The size and position of the text gadget. |
labels | An array of strings representing the lines of the text gadget. |
count | The number of elements in the labels array. |
copy | If IlTrue , the labels array is copied. Otherwise it is stored as is, and deleted when this IlvText is destroyed. |
thickness | The thickness of the text gadget. |
palette | The palette used by the text gadget. |
IlvText::IlvText | ( | IlvDisplay * | display, |
const IlvPoint & | point, | ||
const char * | text, | ||
IlUShort | thickness = IlvDefaultGadgetThickness , |
||
IlvPalette * | palette = 0 |
||
) |
Initializes a new IlvText
instance with some text content, at a given location.
The size of the object is computed by calling the IlvGadget::fitToContents()
method. If you want to specify its size, use a constructor that takes an IlvRect
reference instead of an IlvPoint
object as parameter.
display | The connection to the display. |
point | The position of the text gadget. |
text | The text of the text gadget. The ' ' character identifies a new line. The text is copied. |
thickness | The thickness of the text gadget. |
palette | The palette used by the text gadget. |
IlvText::IlvText | ( | IlvDisplay * | display, |
const IlvRect & | rect, | ||
const char * | text, | ||
IlUShort | thickness = IlvDefaultGadgetThickness , |
||
IlvPalette * | palette = 0 |
||
) |
Initializes a new empty IlvText
instance, located in given rectangle.
display | The connection to the display. |
rect | The size and position of the text gadget. |
text | The text of the text gadget. The ' ' character identifies a new line. The text is copied. |
thickness | The thickness of the text gadget. |
palette | The palette used by the text gadget. |
void IlvText::addLine | ( | const char * | text, |
IlShort | line = -1 |
||
) |
Inserts a new text line at the specified location.
text | The new text line. This string is copied. |
line | The index where text should be inserted. |
setLine()
, removeLine()
, setLines()
.
|
virtual |
Adds the specified text lines to the text gadget.
The labels are copied.
labels | The array of strings to be added. |
count | The number of elements in the labels array. |
line | The index of the line where the labels array will be inserted. |
redraw | Indicates whether the text gadget should be redrawn. |
Adds the specified text to the text gadget.
text | The text to be added. The ' ' character identifies a new line. The text is copied. |
line | The index of the line where the text will be inserted. |
redraw | Specifies whether the text gadget should be redrawn. |
addLines()
, insertText()
.
|
protectedvirtual |
Is called to adjust the gadget to the scroll bars values.
Is called each time the scroll bar scrollbar of direction direction moves. If you want to detect these events, you must redefine this member function in a subclass. The default implementation does nothing.
scrollbar | The scroll bar object. |
direction | The direction of the scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
adjustScrollBarValue()
. Reimplemented from IlvScrolledGadget.
Recomputes the scroll bars.
Sets the right values to the scroll bars.
redraw | A Boolean value specifying whether the gadget should be redrawn. |
Reimplemented from IlvScrolledGadget.
|
protectedvirtual |
Is called to adjust the scroll bar values.
Is called by the member function adjustScrollBars()
to adjust the values of the scroll bar scrollbar of direction direction. This member function must modify the scrollbar values to match the gadget scrolling mode. If you want to detect these events, you must redefine this member function in a subclass. The default implementation does nothing.
scrollbar | The scroll bar object. |
direction | The direction of the scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
adjustFromScrollBar()
. Reimplemented from IlvScrolledGadget.
Is called by the interactor for each key down event that corresponds to a regular character.
Its default implementation inserts the character (erasing the selection if there is one) and updates the display accordingly.
character | The ASCII code of the character. |
|
virtual |
Is called from the interactor when the cursor is moved.
The default implementation calls the Cursor Moved callback.
CursorMovedSymbol()
.
|
static |
Returns the callback type of the Cursor Moved callback.
The Cursor Moved callback is invoked after the cursor of the text gadget is moved through the interactor.
void IlvText::cutLine | ( | const IlvTextLocation & | location | ) |
Removes the end of the specified line.
location | The location from which the line will be removed. |
removeChar()
, removeLine()
.
|
virtual |
Draws the gadget background.
Is called from the draw()
method. This method is not called if the gadget is transparent.
dst | The destination drawing port. |
t | The transformer applied to the gadget. |
clip | The clipping area. |
Reimplemented from IlvScrolledGadget.
|
virtual |
Draws the gadget frame.
Is called from the draw()
method. This method is not called if the method isShowingFrame()
returns IlFalse
.
dst | The destination drawing port. |
t | The transformer applied to the gadget. |
clip | The clipping area. |
drawBackground()
, drawScrollBar()
, drawGadgetContents()
. Reimplemented from IlvScrolledGadget.
|
virtual |
Draws the gadget contents.
Is called from the draw()
method. The default implementation does nothing.
dst | The destination drawing port. |
t | The transformer applied to the gadget. |
clip | The clipping area. |
drawBackground()
, drawScrollBar()
, drawFrame()
. Reimplemented from IlvScrolledGadget.
void IlvText::ensureVisible | ( | const IlvTextLocation & | location, |
const IlvTransformer * | t = 0 |
||
) |
Changes the first line and the offset of the text gadget to ensure that the specified text location is visible.
location | The text location. |
t | The transformer applied to the text gadget. |
setOffset()
, setFirstLine()
. IlvTextLocation IlvText::getCursorLocation | ( | ) | const |
Returns the current location of the cursor.
setCursorLocation()
, getEndLocation()
. IlvTextLocation IlvText::getEndLocation | ( | ) | const |
Returns the last location of the text.
getCursorLocation()
, pointToPosition()
. IlUShort IlvText::getFirstLine | ( | ) | const |
Returns the index of the first text line displayed.
setFirstLine()
, ensureVisible()
. IlUShort IlvText::getLastFullVisibleLine | ( | const IlvTransformer * | t = 0 | ) | const |
Returns the index of the last visible line that can be seen without scrolling.
t | The transformer applied to the text gadget. |
getLastLine()
, getNumberOfVisibleLines()
. IlUShort IlvText::getLastLine | ( | const IlvTransformer * | t = 0 | ) | const |
Returns the index of the last text line displayed.
t | The transformer applied to the text gadget. |
const char* IlvText::getLine | ( | IlUShort | index | ) | const |
Returns the specified text line.
index | The index of the text line. |
getLines()
, setLine()
. Returns the number of characters in the specified text line.
index | The index of the line. |
const char* const* IlvText::getLines | ( | IlUShort & | count | ) | const |
Returns an array of strings representing the text stored in the gadget.
count | The number of elements in the returned array. |
getLine()
, setLines()
. IlvDim IlvText::getMaxWidth | ( | ) | const |
Returns the width of the largest visible line.
IlUShort IlvText::getNumberOfLines | ( | ) | const |
Returns the number of text lines stored in the object.
addLine()
. IlUShort IlvText::getNumberOfVisibleLines | ( | const IlvTransformer * | t = 0 | ) | const |
Returns the number of visible text lines.
The last line is not taken into account if it is not entirely visible.
t | The transformer applied to the text gadget. |
getNumberOfLines()
. IlvDim IlvText::getOffset | ( | ) | const |
Returns the text gadget offset.
This offset value is the distance between the left side of the text gadget bounding box and the starting point of the text.
setOffset()
. const char* IlvText::getSelectedText | ( | ) | const |
Returns the selected text.
getSelection()
, setSelection()
. void IlvText::getSelection | ( | IlvTextLocation & | from, |
IlvTextLocation & | to | ||
) | const |
Returns the location of the current selection.
from | The returned starting location of the current selection. |
to | The returned ending location of the current selection. |
setSelection()
. const char* IlvText::getText | ( | ) | const |
Returns the text stored in the text gadget.
getLines()
. Is called by the interactor to handle keys pressed with the IlvMetaModifier
.
character | The ASCII code of the character. |
handleControl()
. Is called by the interactor to handle the control keys.
Should only handle control characters, that is, characters for which a call to iscntrl()
returns a value different from 0
.
character | The ASCII code of the control character. |
handleAltKey()
. Handles the gadget events.
Is called by handleEvent()
when the member function handleScrollBarsEvent()
returns IlFalse
. Its default implementation does nothing. You can override this member function to implement your own gadget behavior.
event | The event. |
handleScrollBarsEvent()
. Reimplemented from IlvScrolledGadget.
void IlvText::insertChar | ( | const IlvTextLocation & | location, |
IlUShort | character | ||
) |
Inserts a character at the specified location.
location | The location where the character is inserted. |
character | The character to be inserted. |
removeChar()
, pointToPosition()
. void IlvText::insertText | ( | const char * | text, |
IlvTextLocation & | location, | ||
IlBoolean | redraw = IlFalse |
||
) |
Inserts text into the text gadget at the specified location.
text | The text to be inserted. The "\n" character identifies a new line. The text is copied. |
location | The location where text will be inserted. If this location is not valid, the new text is inserted at the end of the existing text. |
redraw | Specifies whether the text gadget should be redrawn. |
insertLabels()
, addText()
. IlBoolean IlvText::isCursorShown | ( | ) | const |
Indicates whether the cursor is visible.
IlTrue
if the cursor is visible. Otherwise, returns IlFalse
. showCursor()
. IlBoolean IlvText::isEditable | ( | ) | const |
Indicates whether the text gadget can be edited.
The user cannot type in a text gadget for which editing is not allowed. However, the text can still be selected and copied.
IlTrue
if the text gadget is editable and IlFalse
if it is not. setEditable()
. void IlvText::locateWord | ( | const IlvTextLocation & | location, |
IlvTextLocation & | start, | ||
IlvTextLocation & | end | ||
) | const |
Finds the word at the specified location.
Uses start and end to return the locators of the word at the specified location. A word is composed of successive characters that are not in the set: ‘_.,;:-=+/()[]{}*&%!|’`
location | The initial location. |
start | The returned starting location of the word found. |
end | The returned ending location of the word found. |
IlvTextLocation IlvText::pointToPosition | ( | const IlvPoint & | point, |
const IlvTransformer * | t = 0 |
||
) | const |
Returns the location of the specified point in the text.
point | The point to be located. |
t | The transformer applied to the text gadget. |
IlBoolean IlvText::readText | ( | const char * | filename = 0 , |
const IlvTransformer * | t = 0 |
||
) |
Inserts the contents of the specified file into the text gadget.
Removes the existing text and inserts the contents of filename.
filename | The name of the file to be inserted. |
t | Not used. |
void IlvText::readText | ( | std::istream & | istream, |
const IlvTransformer * | t = 0 |
||
) |
Inserts the contents of the specified stream into the text gadget.
Removes the existing text and inserts the contents of istream.
istream | The input stream. |
t | Not used. |
void IlvText::removeChar | ( | const IlvTextLocation & | location | ) |
Removes a character from a specified location.
location | The location of the character to be removed. |
insertChar()
, pointToPosition()
. void IlvText::removeLine | ( | IlUShort | line | ) |
Removes and deletes several text lines.
line | The index of the first text line to be removed. |
count | The number of lines to delete. |
addLine()
, setLine()
, getLine()
, removeLine()
.
|
protectedvirtual |
Is called when an internal scroll bar has moved.
Is called by handleEvent()
each time the value of the internal scroll bar specified by direction changes. The default implementation invokes the Scroll Bar Moved callback.
direction | The direction of the internal scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
ScrollBarMovedSymbol()
. Reimplemented from IlvScrolledGadget.
|
virtual |
Is called when an internal scroll bar is shown or hidden.
Is called by handleEvent()
each time the internal scroll bar specified by direction is shown or hidden. The default implementation invokes the Scroll Bar Visibility Changed callback.
direction | The direction of the internal scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
ScrollBarVisibilitySymbol()
. Reimplemented from IlvScrolledGadget.
|
virtual |
Is called from the interactor when the selection is modified.
The default implementation calls the Selection Changed callback.
SelectionChangedSymbol()
.
|
static |
Returns the callback type of the Selection Changed callback.
The Selection Changed callback is invoked after the selection of the text gadget has changed through the interactor.
void IlvText::setCursorLocation | ( | const IlvTextLocation & | location | ) |
Sets the cursor location to a new location.
If location is not a valid value, it is converted to the nearest valid location.
location | The new cursor location. |
getCursorLocation()
. void IlvText::setEditable | ( | IlBoolean | value | ) |
Specifies whether editing is allowed for the text gadget.
The user cannot type in a text gadget for which editing is not allowed. However, the text can still be selected and copied.
value | Specifies whether the text gadget can be edited (IlTrue ) or not (IlFalse ). |
void IlvText::setFirstLine | ( | IlUShort | line | ) |
Sets the first text line to be displayed.
line | The index of the new first line of text. |
getFirstLine()
. Replaces the text line specified by line with text.
line | The index of the text line to be replaced. |
text | The new text line. |
copy | If IlTrue , the text string is copied. Otherwise it is stored as is, and deleted when this IlvText is destroyed. |
addLine()
, removeLine()
, setLines()
.
|
virtual |
Replaces all the text in the text gadget.
Sets the contents of this object to the labels array of count text lines.
labels | The array of new strings. |
count | The number of elements in the labels array. |
copy | If IlTrue , the labels array is copied. Otherwise it is stored as is, and deleted when this IlvText is destroyed. |
void IlvText::setOffset | ( | IlvDim | offset | ) |
Sets the text gadget offset.
offset | The new text gadget offset. |
getOffset()
, ensureVisible()
. void IlvText::setSelection | ( | const IlvTextLocation & | from, |
const IlvTextLocation & | to | ||
) |
Sets the location of the current selection.
from | The location where the new selection starts. |
to | The location where the new selection ends. |
getSelection()
.
|
virtual |
Sets the text to be stored in the text gadget.
text | The text to be stored in the text gadget. The ' ' character identifies a new line. The text is copied. |
getText()
. void IlvText::showCursor | ( | IlBoolean | value | ) |
Specifies whether the cursor should be visible.
value | Specifies whether the cursor should be visible (IlTrue ) or not (IlFalse ). |
isCursorShown()
.
|
virtual |
Is called from the interactor when the value is modified.
The default implementation calls the Value Changed callback.
ValueChangedSymbol()
.
|
static |
Returns the callback type of the Value Changed callback.
The Value Changed callback is invoked after the text gadget has been modified through the interactor.