Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXText Class Reference

#include <FXText.h>

Inheritance diagram for FX::FXText:

FX::FXScrollArea FX::FXComposite FX::FXWindow FX::FXDrawable FX::FXId FX::FXObject List of all members.

Public Types

enum  {
  STYLE_UNDERLINE = 0x0001,
  STYLE_STRIKEOUT = 0x0002
}

Public Methods

 FXText (FXComposite *p, FXObject *tgt=NULL, FXSelector sel=0, FXuint opts=0, FXint x=0, FXint y=0, FXint w=0, FXint h=0)
 Construct multi-line text widget.

virtual void create ()
 Create server-side resources.

virtual void detach ()
 Detach server-side resources.

virtual FXint getDefaultWidth ()
 Return default width.

virtual FXint getDefaultHeight ()
 Return default height.

virtual void enable ()
 Enable the text widget.

virtual void disable ()
 Disable the text widget.

virtual void recalc ()
 Need to recalculate size.

virtual void resize (FXint w, FXint h)
 Resize this window to the specified width and height.

virtual void position (FXint x, FXint y, FXint w, FXint h)
 Move and resize this window in the parent's coordinates.

virtual FXint getContentWidth ()
 Get default width.

virtual FXint getContentHeight ()
 Get default height.

virtual FXbool canFocus () const
 Returns true because a text widget can receive focus.

virtual void setFocus ()
 Move the focus to this window.

virtual void killFocus ()
 Remove the focus from this window.

void moveContents (FXint x, FXint y)
 Scroll the contents.

void setMarginTop (FXint pt)
 Change top margin.

FXint getMarginTop () const
 Return top margin.

void setMarginBottom (FXint pb)
 Change bottom margin.

FXint getMarginBottom () const
 Return bottom margin.

void setMarginLeft (FXint pl)
 Change left margin.

FXint getMarginLeft () const
 Return left margin.

void setMarginRight (FXint pr)
 Change right margin.

FXint getMarginRight () const
 Return right margin.

FXint getWrapColumns () const
 Return wrap columns.

void setWrapColumns (FXint cols)
 Set wrap columns.

FXint getTabColumns () const
 Return tab columns.

void setTabColumns (FXint cols)
 Change tab columns.

FXint getBarColumns () const
 Return number of columns used for line numbers.

void setBarColumns (FXint cols)
 Change number of columns used for line numbers.

FXbool isModified () const
 Return TRUE if text was modified.

void setModified (FXbool mod=TRUE)
 Set modified flag.

FXbool isEditable () const
 Return TRUE if text is editable.

void setEditable (FXbool edit=TRUE)
 Set editable flag.

void setStyled (FXbool styled=TRUE)
 Set styled text mode.

FXbool isStyled () const
 Return TRUE if style buffer.

void setDelimiters (const FXCharset &delims)
 Change delimiters of words.

FXCharset getDelimiters () const
 Return word delimiters.

void setFont (FXFont *fnt)
 Change text font.

FXFontgetFont () const
 Return text font.

void setTextColor (FXColor clr)
 Change text color.

FXColor getTextColor () const
 Return text color.

void setSelBackColor (FXColor clr)
 Change selected background color.

FXColor getSelBackColor () const
 Return selected background color.

void setSelTextColor (FXColor clr)
 Change selected text color.

FXColor getSelTextColor () const
 Return selected text color.

void setHiliteTextColor (FXColor clr)
 Change highlighted text color.

FXColor getHiliteTextColor () const
 Return highlighted text color.

void setHiliteBackColor (FXColor clr)
 Change highlighted background color.

FXColor getHiliteBackColor () const
 Return highlighted background color.

void setActiveBackColor (FXColor clr)
 Change active background color.

FXColor getActiveBackColor () const
 Return active background color.

void setCursorColor (FXColor clr)
 Change cursor color.

FXColor getCursorColor () const
 Return cursor color.

void setNumberColor (FXColor clr)
 Change line number color.

FXColor getNumberColor () const
 Return line number color.

void setBarColor (FXColor clr)
 Change bar color.

FXColor getBarColor () const
 Return bar color.

void setHelpText (const FXString &text)
 Set help text.

const FXStringgetHelpText () const
 Return help text.

void setTipText (const FXString &text)
 Set the tool tip message for this text field.

const FXStringgetTipText () const
 Get the tool tip message for this text field.

FXint getChar (FXint pos) const
 Get character at position in text buffer.

FXint getStyle (FXint pos) const
 Get style at position in style buffer.

void extractText (FXchar *text, FXint pos, FXint n) const
 Extract n characters of text from position pos.

void extractStyle (FXchar *style, FXint pos, FXint n) const
 Extract n characters of style info from position pos.

void replaceText (FXint pos, FXint m, const FXchar *text, FXint n, FXbool notify=FALSE)
 Replace m characters at pos by n characters.

void replaceStyledText (FXint pos, FXint m, const FXchar *text, FXint n, FXint style=0, FXbool notify=FALSE)
 Replace m characters at pos by n characters.

void appendText (const FXchar *text, FXint n, FXbool notify=FALSE)
 Append n characters of text at the end of the buffer.

void appendStyledText (const FXchar *text, FXint n, FXint style=0, FXbool notify=FALSE)
 Append n characters of text at the end of the buffer.

void insertText (FXint pos, const FXchar *text, FXint n, FXbool notify=FALSE)
 Insert n characters of text at position pos into the buffer.

void insertStyledText (FXint pos, const FXchar *text, FXint n, FXint style=0, FXbool notify=FALSE)
 Insert n characters of text at position pos into the buffer.

void removeText (FXint pos, FXint n, FXbool notify=FALSE)
 Remove n characters of text at position pos from the buffer.

void changeStyle (FXint pos, FXint n, FXint style)
 Change style of text range.

void changeStyle (FXint pos, FXint n, const FXchar *style)
 Change style of text range from style-array.

void setText (const FXchar *text, FXint n, FXbool notify=FALSE)
 Change the text in the buffer to new text.

void setStyledText (const FXchar *text, FXint n, FXint style=0, FXbool notify=FALSE)
 Change the text in the buffer to new text.

void getText (FXchar *text, FXint n) const
 Retrieve text into buffer.

void setText (const FXString &text, FXbool notify=FALSE)
 Change the text.

void setStyledText (const FXString &text, FXint style=0, FXbool notify=FALSE)
 Change the text.

FXString getText () const
 Return text in the widget.

FXint getLength () const
 Return length of buffer.

FXint shiftText (FXint start, FXint end, FXint amount, FXbool notify=FALSE)
 Shift block of lines from position start up to end by given amount.

FXbool findText (const FXString &string, FXint *beg=NULL, FXint *end=NULL, FXint start=0, FXuint flags=SEARCH_FORWARD|SEARCH_WRAP|SEARCH_EXACT, FXint npar=1)
FXbool isPosSelected (FXint pos) const
 Return TRUE if position pos is selected.

FXbool isPosVisible (FXint pos) const
 Return TRUE if position is fully visible.

FXint getPosAt (FXint x, FXint y) const
 Return text position at given visible x,y coordinate.

FXint lineStart (FXint pos) const
 Return position of begin of line containing position pos.

FXint lineEnd (FXint pos) const
 Return position of end of line containing position pos.

FXint nextLine (FXint pos, FXint nl=1) const
 Return start of next line.

FXint prevLine (FXint pos, FXint nl=1) const
 Return start of previous line.

FXint rowStart (FXint pos) const
 Return row start.

FXint rowEnd (FXint pos) const
 Return row end.

FXint nextRow (FXint pos, FXint nr=1) const
 Return start of next row.

FXint prevRow (FXint pos, FXint nr=1) const
 Return start of previous row.

FXint leftWord (FXint pos) const
 Return end of previous word.

FXint rightWord (FXint pos) const
 Return begin of next word.

FXint wordStart (FXint pos) const
 Return begin of word.

FXint wordEnd (FXint pos) const
 Return end of word.

FXint validPos (FXint pos) const
 Return validated position.

void setTopLine (FXint pos)
 Make line containing pos the top line.

FXint getTopLine () const
 Return position of top line.

void setBottomLine (FXint pos)
 Make line containing pos the bottom line.

FXint getBottomLine () const
 Return the position of the bottom line.

void setCenterLine (FXint pos)
 Make line containing pos the center line.

void setAnchorPos (FXint pos)
 Set the anchor position.

FXint getAnchorPos () const
 Return the anchor position.

virtual void setCursorPos (FXint pos, FXbool notify=FALSE)
 Set the cursor position.

void setCursorRow (FXint row, FXbool notify=FALSE)
 Set cursor row.

FXint getCursorRow () const
 Return cursor row.

void setCursorColumn (FXint col, FXbool notify=FALSE)
 Set cursor column.

FXint getCursorColumn () const
 Return cursor row, i.e. indent position.

FXint getCursorPos () const
 Return the cursor position.

FXint getSelStartPos () const
 Return selstartpos.

FXint getSelEndPos () const
 Return selendpos.

FXbool selectAll (FXbool notify=FALSE)
 Select all text.

virtual FXbool extendSelection (FXint pos, FXTextSelectionMode select=SELECT_CHARS, FXbool notify=FALSE)
 Extend the selection from the anchor to the given position.

FXbool setSelection (FXint pos, FXint len, FXbool notify=FALSE)
 Select len characters starting at given position pos.

virtual FXbool killSelection (FXbool notify=FALSE)
 Unselect the text.

FXbool setHighlight (FXint start, FXint len)
 Highlight len characters starting at given position pos.

FXbool killHighlight ()
 Unhighlight the text.

void makePositionVisible (FXint pos)
 Scroll text to make the given position visible.

void setTextStyle (FXuint style)
 Change text widget style.

FXuint getTextStyle () const
 Return text widget style.

void setVisibleRows (FXint rows)
 Change number of visible rows.

FXint getVisibleRows () const
 Return number of visible rows.

void setVisibleColumns (FXint cols)
 Change number of visible columns.

FXint getVisibleColumns () const
 Return number of visible columns.

void setHiliteMatchTime (FXuint t)
FXuint getHiliteMatchTime () const
void setHiliteStyles (const FXHiliteStyle *styles)
 Set highlight styles.

const FXHiliteStylegetHiliteStyles () const
 Get highlight styles.

virtual void save (FXStream &store) const
 Save to a stream.

virtual void load (FXStream &store)
 Load from a stream.

virtual ~FXText ()
 Destructor.


Detailed Description

Multiline text widget

See also:


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
STYLE_UNDERLINE  Underline text.
STYLE_STRIKEOUT  Strike out text.


Member Function Documentation

FXbool FX::FXText::findText const FXString   string,
FXint *    beg = NULL,
FXint *    end = NULL,
FXint    start = 0,
FXuint    flags = SEARCH_FORWARD|SEARCH_WRAP|SEARCH_EXACT,
FXint    npar = 1
 

Search for string in text buffer, returning the extent of the string in beg and end. The search starts from the given starting position, scans forward (SEARCH_FORWARD) or backward (SEARCH_BACKWARD), and wraps around if SEARCH_WRAP has been specified. The search type is either a plain search (SEARCH_EXACT), case insensitive search (SEARCH_IGNORECASE), or regular expression search (SEARCH_REGEX). For regular expression searches, capturing parentheses are used if npar is greater than 1; in this case, the number of entries in the beg[], end[] arrays must be npar also. If either beg or end or both are NULL, internal arrays are used. [This API is still subject to change!!]

void FX::FXText::setHiliteMatchTime FXuint    t [inline]
 

Change brace and parenthesis match highlighting time, in ms. A match highlight time of 0 disables brace matching.

FXuint FX::FXText::getHiliteMatchTime   const [inline]
 

Return brace and parenthesis match highlighting time, in ms.