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

FX::FXText Class Reference

The text widget provides a multi-line text editing control. More...

#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, STYLE_BOLD = 0x0004 }
enum  {
  SelectNone, SelectChars, SelectWords, SelectRows,
  SelectLines
}
 Selection modes. More...
enum  {
  ID_CURSOR_TOP = FXScrollArea::ID_LAST, ID_CURSOR_BOTTOM, ID_CURSOR_HOME, ID_CURSOR_END,
  ID_CURSOR_RIGHT, ID_CURSOR_LEFT, ID_CURSOR_UP, ID_CURSOR_DOWN,
  ID_CURSOR_PAGEUP, ID_CURSOR_PAGEDOWN, ID_CURSOR_WORD_LEFT, ID_CURSOR_WORD_RIGHT,
  ID_CURSOR_SEL_START, ID_CURSOR_SEL_END, ID_CURSOR_SHIFT_TOP, ID_CURSOR_SHIFT_BOTTOM,
  ID_CURSOR_SHIFT_HOME, ID_CURSOR_SHIFT_END, ID_CURSOR_SHIFT_UP, ID_CURSOR_SHIFT_DOWN,
  ID_CURSOR_SHIFT_LEFT, ID_CURSOR_SHIFT_RIGHT, ID_CURSOR_SHIFT_PAGEUP, ID_CURSOR_SHIFT_PAGEDOWN,
  ID_CURSOR_SHIFT_WORD_LEFT, ID_CURSOR_SHIFT_WORD_RIGHT, ID_SCROLL_UP, ID_SCROLL_DOWN,
  ID_SCROLL_TOP, ID_SCROLL_BOTTOM, ID_SCROLL_CENTER, ID_INSERT_STRING,
  ID_INSERT_NEWLINE, IN_INSERT_NEWLINE_ONLY, ID_INSERT_NEWLINE_INDENT, ID_INSERT_TAB,
  ID_INSERT_HARDTAB, ID_INSERT_SOFTTAB, ID_CUT_SEL, ID_COPY_SEL,
  ID_DELETE_SEL, ID_REPLACE_SEL, ID_PASTE_SEL, ID_PASTE_MIDDLE,
  ID_SELECT_CHAR, ID_SELECT_WORD, ID_SELECT_LINE, ID_SELECT_ALL,
  ID_SELECT_MATCHING, ID_SELECT_BRACE, ID_SELECT_BRACK, ID_SELECT_PAREN,
  ID_SELECT_ANG, ID_DESELECT_ALL, ID_BACKSPACE_CHAR, ID_BACKSPACE_WORD,
  ID_BACKSPACE_BOL, ID_DELETE_CHAR, ID_DELETE_WORD, ID_DELETE_EOL,
  ID_DELETE_ALL, ID_DELETE_LINE, ID_TOGGLE_EDITABLE, ID_TOGGLE_OVERSTRIKE,
  ID_CURSOR_ROW, ID_CURSOR_COLUMN, ID_CLEAN_INDENT, ID_SHIFT_LEFT,
  ID_SHIFT_RIGHT, ID_SHIFT_TABLEFT, ID_SHIFT_TABRIGHT, ID_UPPER_CASE,
  ID_LOWER_CASE, ID_GOTO_MATCHING, ID_GOTO_SELECTED, ID_GOTO_LINE,
  ID_SEARCH_FORW_SEL, ID_SEARCH_BACK_SEL, ID_SEARCH_FORW, ID_SEARCH_BACK,
  ID_SEARCH, ID_REPLACE, ID_LEFT_BRACE, ID_LEFT_BRACK,
  ID_LEFT_PAREN, ID_LEFT_ANG, ID_RIGHT_BRACE, ID_RIGHT_BRACK,
  ID_RIGHT_PAREN, ID_RIGHT_ANG, ID_BLINK, ID_FLASH,
  ID_LAST
}

Public Member Functions

long onPaint (FXObject *, FXSelector, void *)
long onBlink (FXObject *, FXSelector, void *)
long onFlash (FXObject *, FXSelector, void *)
long onFocusIn (FXObject *, FXSelector, void *)
long onFocusOut (FXObject *, FXSelector, void *)
long onMotion (FXObject *, FXSelector, void *)
long onAutoScroll (FXObject *, FXSelector, void *)
long onLeftBtnPress (FXObject *, FXSelector, void *)
long onLeftBtnRelease (FXObject *, FXSelector, void *)
long onMiddleBtnPress (FXObject *, FXSelector, void *)
long onMiddleBtnRelease (FXObject *, FXSelector, void *)
long onRightBtnPress (FXObject *, FXSelector, void *)
long onRightBtnRelease (FXObject *, FXSelector, void *)
long onKeyPress (FXObject *, FXSelector, void *)
long onKeyRelease (FXObject *, FXSelector, void *)
long onUngrabbed (FXObject *, FXSelector, void *)
long onBeginDrag (FXObject *, FXSelector, void *)
long onEndDrag (FXObject *, FXSelector, void *)
long onDragged (FXObject *, FXSelector, void *)
long onDNDEnter (FXObject *, FXSelector, void *)
long onDNDLeave (FXObject *, FXSelector, void *)
long onDNDMotion (FXObject *, FXSelector, void *)
long onDNDDrop (FXObject *, FXSelector, void *)
long onDNDRequest (FXObject *, FXSelector, void *)
long onSelectionLost (FXObject *, FXSelector, void *)
long onSelectionGained (FXObject *, FXSelector, void *)
long onSelectionRequest (FXObject *, FXSelector, void *ptr)
long onClipboardLost (FXObject *, FXSelector, void *)
long onClipboardGained (FXObject *, FXSelector, void *)
long onClipboardRequest (FXObject *, FXSelector, void *)
long onCmdSetTip (FXObject *, FXSelector, void *)
long onCmdGetTip (FXObject *, FXSelector, void *)
long onCmdSetHelp (FXObject *, FXSelector, void *)
long onCmdGetHelp (FXObject *, FXSelector, void *)
long onQueryTip (FXObject *, FXSelector, void *)
long onQueryHelp (FXObject *, FXSelector, void *)
long onUpdIsEditable (FXObject *, FXSelector, void *)
long onUpdHaveSelection (FXObject *, FXSelector, void *)
long onUpdHaveEditableSelection (FXObject *, FXSelector, void *)
long onIMEStart (FXObject *, FXSelector, void *)
long onCmdSetStringValue (FXObject *, FXSelector, void *)
long onCmdGetStringValue (FXObject *, FXSelector, void *)
long onCmdCursorTop (FXObject *, FXSelector, void *)
long onCmdCursorBottom (FXObject *, FXSelector, void *)
long onCmdCursorHome (FXObject *, FXSelector, void *)
long onCmdCursorEnd (FXObject *, FXSelector, void *)
long onCmdCursorRight (FXObject *, FXSelector, void *)
long onCmdCursorLeft (FXObject *, FXSelector, void *)
long onCmdCursorUp (FXObject *, FXSelector, void *)
long onCmdCursorDown (FXObject *, FXSelector, void *)
long onCmdCursorPageUp (FXObject *, FXSelector, void *)
long onCmdCursorPageDown (FXObject *, FXSelector, void *)
long onCmdCursorWordLeft (FXObject *, FXSelector, void *)
long onCmdCursorWordRight (FXObject *, FXSelector, void *)
long onCmdCursorSelStart (FXObject *, FXSelector, void *)
long onCmdCursorSelEnd (FXObject *, FXSelector, void *)
long onCmdCursorShiftTop (FXObject *, FXSelector, void *)
long onCmdCursorShiftBottom (FXObject *, FXSelector, void *)
long onCmdCursorShiftHome (FXObject *, FXSelector, void *)
long onCmdCursorShiftEnd (FXObject *, FXSelector, void *)
long onCmdCursorShiftRight (FXObject *, FXSelector, void *)
long onCmdCursorShiftLeft (FXObject *, FXSelector, void *)
long onCmdCursorShiftUp (FXObject *, FXSelector, void *)
long onCmdCursorShiftDown (FXObject *, FXSelector, void *)
long onCmdCursorShiftPageUp (FXObject *, FXSelector, void *)
long onCmdCursorShiftPageDown (FXObject *, FXSelector, void *)
long onCmdCursorShiftWordLeft (FXObject *, FXSelector, void *)
long onCmdCursorShiftWordRight (FXObject *, FXSelector, void *)
long onCmdScrollUp (FXObject *, FXSelector, void *)
long onCmdScrollDown (FXObject *, FXSelector, void *)
long onCmdScrollTop (FXObject *, FXSelector, void *)
long onCmdScrollBottom (FXObject *, FXSelector, void *)
long onCmdScrollCenter (FXObject *, FXSelector, void *)
long onCmdInsertString (FXObject *, FXSelector, void *)
long onCmdInsertNewline (FXObject *, FXSelector, void *)
long onCmdInsertNewlineOnly (FXObject *, FXSelector, void *)
long onCmdInsertNewlineIndent (FXObject *, FXSelector, void *)
long onCmdInsertTab (FXObject *, FXSelector, void *)
long onCmdInsertHardTab (FXObject *, FXSelector, void *)
long onCmdInsertSoftTab (FXObject *, FXSelector, void *)
long onCmdCutSel (FXObject *, FXSelector, void *)
long onCmdCopySel (FXObject *, FXSelector, void *)
long onCmdPasteSel (FXObject *, FXSelector, void *)
long onCmdDeleteSel (FXObject *, FXSelector, void *)
long onCmdReplaceSel (FXObject *, FXSelector, void *)
long onCmdPasteMiddle (FXObject *, FXSelector, void *)
long onCmdSelectChar (FXObject *, FXSelector, void *)
long onCmdSelectWord (FXObject *, FXSelector, void *)
long onCmdSelectLine (FXObject *, FXSelector, void *)
long onCmdSelectMatching (FXObject *, FXSelector, void *)
long onCmdSelectBlock (FXObject *, FXSelector, void *)
long onCmdSelectAll (FXObject *, FXSelector, void *)
long onCmdDeselectAll (FXObject *, FXSelector, void *)
long onCmdBackspaceChar (FXObject *, FXSelector, void *)
long onCmdBackspaceWord (FXObject *, FXSelector, void *)
long onCmdBackspaceBol (FXObject *, FXSelector, void *)
long onCmdDeleteChar (FXObject *, FXSelector, void *)
long onCmdDeleteWord (FXObject *, FXSelector, void *)
long onCmdDeleteEol (FXObject *, FXSelector, void *)
long onCmdDeleteAll (FXObject *, FXSelector, void *)
long onCmdDeleteLine (FXObject *, FXSelector, void *)
long onCmdShiftText (FXObject *, FXSelector, void *)
long onCmdChangeCase (FXObject *, FXSelector, void *)
long onCmdBlockBeg (FXObject *, FXSelector, void *)
long onCmdBlockEnd (FXObject *, FXSelector, void *)
long onCmdGotoMatching (FXObject *, FXSelector, void *)
long onCmdGotoSelected (FXObject *, FXSelector, void *)
long onCmdCursorRow (FXObject *, FXSelector, void *)
long onUpdCursorRow (FXObject *, FXSelector, void *)
long onCmdCursorColumn (FXObject *, FXSelector, void *)
long onUpdCursorColumn (FXObject *, FXSelector, void *)
long onCmdGotoLine (FXObject *, FXSelector, void *)
long onCmdSearch (FXObject *, FXSelector, void *)
long onCmdReplace (FXObject *, FXSelector, void *)
long onCmdSearchNext (FXObject *, FXSelector, void *)
long onCmdSearchSel (FXObject *, FXSelector, void *)
long onCmdToggleEditable (FXObject *, FXSelector, void *)
long onUpdToggleEditable (FXObject *, FXSelector, void *)
long onCmdToggleOverstrike (FXObject *, FXSelector, void *)
long onUpdToggleOverstrike (FXObject *, FXSelector, void *)
 FXText (FXComposite *p, FXObject *tgt=NULL, FXSelector sel=0, FXuint opts=0, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=3, FXint pr=3, FXint pt=2, FXint pb=2)
 Construct multi-line text widget.
virtual void create ()
 Create server-side resources.
virtual void detach ()
 Detach server-side resources.
virtual void layout ()
 Perform layout.
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 FXint getVisibleX () const
 Return visible scroll-area x position.
virtual FXint getVisibleY () const
 Return visible scroll-area y position.
virtual FXint getVisibleWidth () const
 Return visible scroll-area width.
virtual FXint getVisibleHeight () const
 Return visible scroll-area height.
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 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.
void setEditable (FXbool edit=true)
 Set editable mode.
FXbool isEditable () const
 Return true if text is editable.
void setOverstrike (FXbool over=true)
 Set overstrike mode.
FXbool isOverstrike () const
 Return true if overstrike mode in effect.
void setStyled (FXbool styled=true)
 Set styled text mode.
FXbool isStyled () const
 Return true if style buffer.
void setDelimiters (const FXchar *delims=textDelimiters)
 Change delimiters of words.
const FXchar * 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.
FXString getHelpText () const
 Return help text.
void setTipText (const FXString &text)
 Set the tool tip message for this text widget.
FXString getTipText () const
 Get the tool tip message for this text widget.
FXint getByte (FXint pos) const
 Get character at position in text buffer.
FXwchar getChar (FXint pos) const
 Get wide character at position pos.
FXint getCharLen (FXint pos) const
 Get length of wide character at position pos.
FXint getStyle (FXint pos) const
 Get style at position pos.
FXint getLength () const
 Return length of buffer.
FXint getNumRows () const
 Return number of rows in buffer.
FXString getText () const
 Return entire text.
FXString getSelectedText () const
 Get selected text.
void getText (FXchar *text, FXint n) const
 Retrieve text into buffer.
void getText (FXString &text) const
virtual void setText (const FXchar *text, FXint n, FXbool notify=false)
 Change the text in the buffer to new text.
virtual void setText (const FXString &text, FXbool notify=false)
virtual void setStyledText (const FXchar *text, FXint n, FXint style=0, FXbool notify=false)
 Change the text in the buffer to new text.
virtual void setStyledText (const FXString &text, FXint style=0, FXbool notify=false)
virtual void replaceText (FXint pos, FXint m, const FXchar *text, FXint n, FXbool notify=false)
 Replace m bytes at pos by n characters.
virtual void replaceText (FXint pos, FXint m, const FXString &text, FXbool notify=false)
virtual void replaceStyledText (FXint pos, FXint m, const FXchar *text, FXint n, FXint style=0, FXbool notify=false)
 Replace m bytes at pos by n characters.
virtual void replaceStyledText (FXint pos, FXint m, const FXString &text, FXint style=0, FXbool notify=false)
virtual void appendText (const FXchar *text, FXint n, FXbool notify=false)
 Append n bytes of text at the end of the buffer.
virtual void appendText (const FXString &text, FXbool notify=false)
virtual void appendStyledText (const FXchar *text, FXint n, FXint style=0, FXbool notify=false)
 Append n bytes of text at the end of the buffer.
virtual void appendStyledText (const FXString &text, FXint style=0, FXbool notify=false)
virtual void insertText (FXint pos, const FXchar *text, FXint n, FXbool notify=false)
 Insert n bytes of text at position pos into the buffer.
virtual void insertText (FXint pos, const FXString &text, FXbool notify=false)
virtual void insertStyledText (FXint pos, const FXchar *text, FXint n, FXint style=0, FXbool notify=false)
 Insert n bytes of text at position pos into the buffer.
virtual void insertStyledText (FXint pos, const FXString &text, FXint style=0, FXbool notify=false)
virtual void removeText (FXint pos, FXint n, FXbool notify=false)
 Remove n bytes of text at position pos from the buffer.
virtual void changeStyle (FXint pos, FXint n, FXint style)
 Change style of text range.
virtual void changeStyle (FXint pos, const FXchar *style, FXint n)
 Change style of text range from style-array.
virtual void changeStyle (FXint pos, const FXString &style)
void extractText (FXchar *text, FXint pos, FXint n) const
 Extract n bytes of text from position pos.
void extractText (FXString &text, FXint pos, FXint n) const
void extractStyle (FXchar *style, FXint pos, FXint n) const
 Extract n bytes of style info from position pos.
void extractStyle (FXString &text, FXint pos, FXint n) const
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)
 Search for string in text buffer, returning the extent of the string in beg and end.
FXint getPosContaining (FXint x, FXint y) const
 Return text position containing x, y coordinate.
FXint getPosAt (FXint x, FXint y) const
 Return text position at given visible x,y coordinate.
FXint getYOfPos (FXint pos) const
 Return y coordinate of pos.
FXint getXOfPos (FXint pos) const
 Return x coordinate of pos.
FXint countRows (FXint start, FXint end) const
 Count number of rows; start should be on a row start.
FXint countCols (FXint start, FXint end) const
 Count number of columns; start should be on a row start.
FXint countLines (FXint start, FXint end) const
 Count number of newlines.
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 utf8 character start position.
FXint dec (FXint pos) const
 Retreat to the previous valid utf8 character start.
FXint inc (FXint pos) const
 Advance to the next valid utf8 character start.
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.
FXbool selectAll (FXbool notify=false)
 Select all text.
FXbool setSelection (FXint pos, FXint len, FXbool notify=false)
 Select len characters starting at given position pos.
FXbool extendSelection (FXint pos, FXuint select=SelectChars, FXbool notify=false)
 Extend the primary selection from the anchor to the given position.
FXbool copySelection ()
 Copy primary selection to clipboard.
FXbool cutSelection (FXbool notify=false)
 Cut primary selection to clipboard.
FXbool deleteSelection (FXbool notify=false)
 Delete primary selection.
FXbool pasteSelection (FXbool notify=false)
 Paste primary selection.
FXbool pasteClipboard (FXbool notify=false)
 Paste clipboard.
FXbool replaceSelection (const FXchar *text, FXint n, FXbool notify=false)
 Replace primary selection by other text.
FXbool replaceSelection (const FXString &text, FXbool notify=false)
 Replace primary selection by other text.
FXbool killSelection (FXbool notify=false)
 Kill or deselect primary selection.
FXbool isPosSelected (FXint pos) const
 Return true if position pos is selected.
FXbool isPosVisible (FXint pos) const
 Return true if position is fully visible.
void makePositionVisible (FXint pos)
 Scroll text to make the given position visible.
FXbool setHighlight (FXint start, FXint len)
 Highlight len characters starting at given position pos.
FXbool killHighlight ()
 Unhighlight the text.
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.
void setAnchorPos (FXint pos)
 Set the anchor position.
FXint getAnchorPos () const
 Return the anchor position.
FXint getSelStartPos () const
 Return selection start position.
FXint getSelEndPos () const
 Return selection end position.
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 (FXTime t)
 Change brace and parenthesis match highlighting time, in nanoseconds.
FXTime getHiliteMatchTime () const
 Return brace and parenthesis match highlighting time, in nanoseconds.
void setHiliteStyles (FXHiliteStyle *styles)
 Set highlight styles.
FXHiliteStylegetHiliteStyles () const
 Return current value of the style table.
virtual void save (FXStream &store) const
 Save to a stream.
virtual void load (FXStream &store)
 Load from a stream.
virtual ~FXText ()
 Destructor.

Static Public Attributes

static const FXchar textDelimiters []

Protected Types

enum  {
  MOUSE_NONE, MOUSE_CHARS, MOUSE_WORDS, MOUSE_LINES,
  MOUSE_SCROLL, MOUSE_DRAG, MOUSE_TRYDRAG
}
enum  {
  STYLE_MASK = 0x00FF, STYLE_TEXT = 0x0100, STYLE_SELECTED = 0x0200, STYLE_CONTROL = 0x0400,
  STYLE_HILITE = 0x0800, STYLE_ACTIVE = 0x1000
}

Protected Member Functions

void calcVisRows (FXint s, FXint e)
void drawCursor (FXuint state)
virtual void paintCursor (FXDCWindow &dc) const
virtual void eraseCursor (FXDCWindow &dc) const
virtual void eraseCursorOverhang ()
virtual FXuint styleOf (FXint beg, FXint end, FXint row, FXint col, FXint pos) const
virtual void drawBufferText (FXDCWindow &dc, FXint x, FXint y, FXint w, FXint h, FXint pos, FXint n, FXuint style) const
virtual void fillBufferRect (FXDCWindow &dc, FXint x, FXint y, FXint w, FXint h, FXuint style) const
virtual void drawTextRow (FXDCWindow &dc, FXint row) const
virtual void drawContents (FXDCWindow &dc) const
virtual void drawNumbers (FXDCWindow &dc) const
FXint posToLine (FXint pos, FXint ln) const
void updateRange (FXint beg, FXint end) const
void movegap (FXint pos)
void sizegap (FXint sz)
void squeezegap ()
FXint charWidth (FXwchar ch, FXint indent) const
FXint wrap (FXint start) const
FXint measureText (FXint start, FXint end, FXint &wmax, FXint &hmax) const
FXint lineWidth (FXint pos, FXint n) const
FXint changeBeg (FXint pos) const
FXint changeEnd (FXint pos) const
FXint indentFromPos (FXint start, FXint pos) const
FXint posFromIndent (FXint start, FXint indent) const
void mutation (FXint pos, FXint ncins, FXint ncdel, FXint nrins, FXint nrdel)
virtual void replace (FXint pos, FXint m, const FXchar *text, FXint n, FXint style)
void recompute ()
FXint matchForward (FXint pos, FXint end, FXwchar l, FXwchar r, FXint level) const
FXint matchBackward (FXint pos, FXint beg, FXwchar l, FXwchar r, FXint level) const
FXint findMatching (FXint pos, FXint beg, FXint end, FXwchar ch, FXint level) const
void flashMatching ()
void moveContents (FXint x, FXint y)
void moveCursor (FXint pos, FXbool notify=false)
void moveCursorAndSelect (FXint pos, FXuint select, FXbool notify=false)
FXint overstruck (FXint start, FXint end, const FXchar *text, FXint n)
void enterText (const FXchar *text, FXint n, FXbool notify)
void enterText (const FXString &text, FXbool notify)
FXbool deletePendingSelection (FXbool notify)

Protected Attributes

FXchar * buffer
FXchar * sbuffer
FXint * visrows
FXint length
FXint nvisrows
FXint nrows
FXint gapstart
FXint gapend
FXint toppos
FXint keeppos
FXint toprow
FXint selstartpos
FXint selendpos
FXint hilitestartpos
FXint hiliteendpos
FXint anchorpos
FXint cursorpos
FXint cursorstart
FXint cursorend
FXint cursorrow
FXint cursorcol
FXint prefcol
FXint margintop
FXint marginbottom
FXint marginleft
FXint marginright
FXint wrapwidth
FXint wrapcolumns
FXint tabwidth
FXint tabcolumns
FXint barwidth
FXint barcolumns
FXFontfont
FXColor textColor
FXColor selbackColor
FXColor seltextColor
FXColor hilitebackColor
FXColor hilitetextColor
FXColor activebackColor
FXColor numberColor
FXColor cursorColor
FXColor barColor
FXint textWidth
FXint textHeight
FXString searchstring
FXuint searchflags
const FXchar * delimiters
FXString clipped
FXint vrows
FXint vcols
FXString help
FXString tip
FXHiliteStylehilitestyles
FXTime matchtime
FXint grabx
FXint graby
FXuchar mode
FXbool modified

Detailed Description

The text widget provides a multi-line text editing control.

The widget supports both clipboard for cut-and-paste operations, as well as drag and drop of text. Text may be edited interactively by the user, or changed through the programmatic interface.

During interactive editing, the text widget notifies its target of changes to the current cursor location by issueing SEL_CHANGED callbacks. If text is inserted, deleted, or replaced, the widget will send SEL_INSERTED, SEL_DELETED, or SEL_REPLACED messages, and pass along an FXTextChange to indicate what changes were made to the text buffer, in sufficient detail for recording undo and redo info.

When selections are made, SEL_SELECTED or SEL_DESELECTED messages are issued, passing along the range of text affected by the change in selection.

As the cursor is being moved, matching parentheses, brackets, and braces may be highlighted for a short time if the brace-matching feature has been enabled.

An auto-indent feature, enabled by TEXT_AUTOINDENT flag, will automatically enter a number of spaces if a newline is entered, starting new text entry at the same level of indent as the previous line.

When styled mode is turned on, the text widget will maintain a parallel style-buffer along side the text-buffer. This style buffer is used to index into a style table (FXHiliteStyle), which describes what colors and visual attributes are to be used to draw the each character in the text buffer.

When text is added to the widget programmatically, a style index may be passed in to apply to the newly added text. It is also possible to change the style of the text without changing the text itself. This could be used to form the basis of a colorizing text editor, for example.

The first entry in the style table corresponds to a style index of 1. Style index 0 is used for the default text style, the style that would be shown if the styled mode is not in effect.

In a typical scenario, the contents of the style buffer is either directly written when the text is added to the widget, or is continually modified by editing the text via syntax-based highlighting engine which colors the text based on syntactical patterns.

The text widget has several controlling flags which affect its behaviour and display. TEXT_READONLY sets the widget in read-only mode. In this mode, the contents of the widget may only be changed programmatically, although it is possible for the user to select and paste out of the text buffer. The TEXT_WORDWRAP flag turns on line-wrapping. Normally, long lines extend past the right-hand side of the visible buffer. In wrap mode, text is folded at natural break points (breakable spaces, tabs, etc). The default wrap mode is a fluid wrap, that is, the text is reflowed as the widget is resized. The flag TEXT_FIXEDWRAP disables the fluid wrap mode and makes the widget wrap at a fixed column, regardless of the width of the widget. The TEXT_OVERSTRIKE mode causes text entered by the user to overstrike already existing text, instead of inserting new next. This mode can be toggled interactively by hitting the INS key on the keyboard. The flag TEXT_NO_TABS causes a TAB key to be replaced by the appropriate number of spaces when entered interactively; however, the user can still enter a TAB by entering Ctrl+TAB. Finally, the TEXT_SHOWACTIVE mode will cause the line containing the current cursor location to be highlighted. This makes it easier to find the insertion point when scrolling back and forth a large document.


Member Enumeration Documentation

anonymous enum
Enumerator:
STYLE_STRIKEOUT 

Underline text.

STYLE_BOLD 

Strike out text.

anonymous enum

Selection modes.

Enumerator:
SelectChars 

Select nothing.

SelectWords 

Select characters.

SelectRows 

Select words.

SelectLines 

Select rows.

Select lines


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 ( FXTime  t) [inline]

Change brace and parenthesis match highlighting time, in nanoseconds.

A match highlight time of 0 disables brace matching.

void FX::FXText::setHiliteStyles ( FXHiliteStyle styles)

Set highlight styles.

The table of styles is only referenced by the widget; it is not copied. Thus, multiple widgets may share a common style table. Some care must be taken to populate the style-buffer only with numbers inside the style table.

void FX::FXText::setVisibleColumns ( FXint  cols)

Change number of visible columns.

The number of visible columns is used to calculate the default height the text widget reports to its parent layout manager.

void FX::FXText::setVisibleRows ( FXint  rows)

Change number of visible rows.

The number of visible rows is used to calculate the default height the text widget reports to its parent layout manager.


The documentation for this class was generated from the following file:

Copyright © 1997-2011 Jeroen van der Zijp