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

Public Types

enum  {
  STYLE_MASK = 0x00FF, STYLE_TEXT = 0x0100, STYLE_SELECTED = 0x0200, STYLE_CONTROL = 0x0400,
  STYLE_HILITE = 0x0800, STYLE_ACTIVE = 0x1000, STYLE_INSERT = 0x2000
}
 Internal style flags.
 
enum  { STYLE_UNDERLINE = 0x0001, STYLE_STRIKEOUT = 0x0002, STYLE_BOLD = 0x0004 }
 Text highlight style flags.
 
enum  {
  SelectNone, SelectChars, SelectWords, SelectRows,
  SelectLines
}
 Selection modes.
 
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_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_CURSOR_ALT_UP, ID_CURSOR_ALT_DOWN, ID_CURSOR_ALT_LEFT, ID_CURSOR_ALT_RIGHT,
  ID_SCROLL_UP, ID_SCROLL_DOWN, ID_SCROLL_TOP, ID_SCROLL_BOTTOM,
  ID_SCROLL_CENTER, ID_INSERT_STRING, ID_INSERT_NEWLINE, ID_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_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_POS, ID_CURSOR_ROW, ID_CURSOR_COLUMN,
  ID_JOIN_LINES, ID_SHIFT_LEFT, ID_SHIFT_RIGHT, ID_SHIFT_TABLEFT,
  ID_SHIFT_TABRIGHT, ID_CLEAN_INDENT, ID_COPY_LINE, ID_MOVE_LINE_UP,
  ID_MOVE_LINE_DOWN, ID_UPPER_CASE, ID_LOWER_CASE, ID_GOTO_MATCHING,
  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_TEXT_ROWS, ID_TEXT_SIZE,
  ID_LAST
}
 
- Public Types inherited from FX::FXScrollArea
enum  { ID_AUTOSCROLL =FXComposite::ID_LAST, ID_VSCROLLED, ID_HSCROLLED, ID_LAST }
 
- Public Types inherited from FX::FXWindow
enum  WindowClass {
  ClassNormal, ClassGraphic, ClassSpecial, ClassRoot,
  ClassShell, ClassPopup, ClassToolTip, ClassMain,
  ClassDialog, ClassToolBar, ClassSplash, ClassNotify,
  ClassPanel, ClassDesktop
}
 Window classes. More...
 
enum  {
  ID_NONE, ID_HIDE, ID_SHOW, ID_TOGGLESHOWN,
  ID_LOWER, ID_RAISE, ID_DELETE, ID_DISABLE,
  ID_ENABLE, ID_TOGGLEENABLED, ID_UNCHECK, ID_CHECK,
  ID_UNKNOWN, ID_UPDATE, ID_TIPTIMER, ID_SETVALUE,
  ID_SETINTVALUE, ID_SETLONGVALUE, ID_SETREALVALUE, ID_SETSTRINGVALUE,
  ID_SETICONVALUE, ID_SETINTRANGE, ID_SETREALRANGE, ID_GETINTVALUE,
  ID_GETLONGVALUE, ID_GETREALVALUE, ID_GETSTRINGVALUE, ID_GETICONVALUE,
  ID_GETINTRANGE, ID_GETREALRANGE, ID_SETHELPSTRING, ID_GETHELPSTRING,
  ID_SETTIPSTRING, ID_GETTIPSTRING, ID_QUERY_MENU, ID_HOTKEY,
  ID_ACCEL, ID_UNPOST, ID_POST, ID_MDI_TILEHORIZONTAL,
  ID_MDI_TILEVERTICAL, ID_MDI_CASCADE, ID_MDI_MAXIMIZE, ID_MDI_MINIMIZE,
  ID_MDI_RESTORE, ID_MDI_CLOSE, ID_MDI_WINDOW, ID_MDI_MENUWINDOW,
  ID_MDI_MENUMINIMIZE, ID_MDI_MENURESTORE, ID_MDI_MENUCLOSE, ID_MDI_NEXT,
  ID_MDI_PREV, ID_LAST
}
 

Public Member Functions

long onPaint (FXObject *, FXSelector, void *)
 
long onEnter (FXObject *, FXSelector, void *)
 
long onLeave (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 onTipTimer (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 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 onCmdCursorAltUp (FXObject *, FXSelector, void *)
 
long onCmdCursorAltDown (FXObject *, FXSelector, void *)
 
long onCmdCursorAltLeft (FXObject *, FXSelector, void *)
 
long onCmdCursorAltRight (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 onCmdPasteMiddle (FXObject *, FXSelector, void *)
 
long onCmdDeleteSel (FXObject *, FXSelector, void *)
 
long onCmdSelectChar (FXObject *, FXSelector, void *)
 
long onCmdSelectWord (FXObject *, FXSelector, void *)
 
long onCmdSelectLine (FXObject *, FXSelector, void *)
 
long onCmdSelectMatching (FXObject *, FXSelector, void *)
 
long onCmdSelectEnclosing (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 onCmdCopyLine (FXObject *, FXSelector, void *)
 
long onCmdMoveLineUp (FXObject *, FXSelector, void *)
 
long onCmdMoveLineDown (FXObject *, FXSelector, void *)
 
long onCmdJoinLines (FXObject *, FXSelector, void *)
 
long onCmdBlockBeg (FXObject *, FXSelector, void *)
 
long onCmdBlockEnd (FXObject *, FXSelector, void *)
 
long onCmdGotoMatching (FXObject *, FXSelector, void *)
 
long onCmdCursorPos (FXObject *, FXSelector, void *)
 
long onUpdCursorPos (FXObject *, FXSelector, void *)
 
long onCmdCursorRow (FXObject *, FXSelector, void *)
 
long onUpdCursorRow (FXObject *, FXSelector, void *)
 
long onCmdCursorColumn (FXObject *, FXSelector, void *)
 
long onUpdCursorColumn (FXObject *, FXSelector, void *)
 
long onCmdToggleEditable (FXObject *, FXSelector, void *)
 
long onUpdToggleEditable (FXObject *, FXSelector, void *)
 
long onCmdToggleOverstrike (FXObject *, FXSelector, void *)
 
long onUpdToggleOverstrike (FXObject *, FXSelector, void *)
 
long onUpdTextRows (FXObject *, FXSelector, void *)
 
long onUpdTextSize (FXObject *, FXSelector, void *)
 
 FXText (FXComposite *p, FXObject *tgt=nullptr, 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 FXint getContentWidth ()
 Get default width.
 
virtual FXint getContentHeight ()
 Get default height.
 
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 getDefaultWidth ()
 Return default width.
 
virtual FXint getDefaultHeight ()
 Return default height.
 
virtual void layout ()
 Perform layout.
 
virtual void enable ()
 Enable the text widget.
 
virtual void disable ()
 Disable the text widget.
 
virtual void recalc ()
 Need to recalculate size.
 
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 setModified (FXbool mod=true)
 Set modified flag.
 
FXbool isModified () const
 Return true if text was modified.
 
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.
 
FXint getLength () const
 Return length of buffer.
 
FXint getNumRows () const
 Return number of rows in buffer.
 
FXint getByte (FXint pos) const
 Get byte at position in text buffer.
 
FXint getStyle (FXint pos) const
 Get style at position pos.
 
FXint getCharLen (FXint pos) const
 Get length of wide character at position pos.
 
FXwchar getChar (FXint pos) const
 Get wide character at position pos.
 
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.
 
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 countCols (FXint start, FXint end) const
 Count number of columns taken up by some text. More...
 
FXint countRows (FXint start, FXint end) const
 Count number of rows taken up by some text. More...
 
FXint countLines (FXint start, FXint end) const
 Count number of newlines. More...
 
virtual FXint setText (const FXchar *text, FXint num, FXbool notify=false)
 Change the text in the buffer to new text.
 
virtual FXint setText (const FXString &text, FXbool notify=false)
 
virtual FXint setStyledText (const FXchar *text, FXint num, FXint style=0, FXbool notify=false)
 Change the text in the buffer to new text.
 
virtual FXint setStyledText (const FXString &text, FXint style=0, FXbool notify=false)
 
virtual FXint changeStyle (FXint pos, FXint num, FXint style)
 Change style of text range.
 
virtual FXint changeStyle (FXint pos, const FXchar *style, FXint num)
 Change style of text range from style-array.
 
virtual FXint changeStyle (FXint pos, const FXString &style)
 
virtual FXint appendText (const FXchar *text, FXint num, FXbool notify=false)
 Append n bytes of text at the end of the buffer.
 
virtual FXint appendText (const FXString &text, FXbool notify=false)
 
virtual FXint appendStyledText (const FXchar *text, FXint num, FXint style=0, FXbool notify=false)
 Append n bytes of text at the end of the buffer.
 
virtual FXint appendStyledText (const FXString &text, FXint style=0, FXbool notify=false)
 
virtual FXint replaceText (FXint pos, FXint del, const FXchar *text, FXint ins, FXbool notify=false)
 Replace del bytes at pos by ins characters of text.
 
virtual FXint replaceText (FXint pos, FXint del, const FXString &text, FXbool notify=false)
 
virtual FXint replaceStyledText (FXint pos, FXint del, const FXchar *text, FXint ins, FXint style=0, FXbool notify=false)
 Replace del bytes at pos by ins characters of text.
 
virtual FXint replaceStyledText (FXint pos, FXint del, const FXString &text, FXint style=0, FXbool notify=false)
 
virtual FXint replaceTextBlock (FXint startpos, FXint endpos, FXint startcol, FXint endcol, const FXchar *text, FXint num, FXbool notify=false)
 Replace text columns startcol to endcol in lines starting at startpos to endpos by new text.
 
virtual FXint replaceTextBlock (FXint startpos, FXint endpos, FXint startcol, FXint endcol, const FXString &text, FXbool notify=false)
 
virtual FXint replaceStyledTextBlock (FXint startpos, FXint endpos, FXint startcol, FXint endcol, const FXchar *text, FXint num, FXint style=0, FXbool notify=false)
 Replace text columns startcol to endcol in lines starting at startpos to endpos by new text with given style.
 
virtual FXint replaceStyledTextBlock (FXint startpos, FXint endpos, FXint startcol, FXint endcol, const FXString &text, FXint style=0, FXbool notify=false)
 
virtual FXint insertText (FXint pos, const FXchar *text, FXint num, FXbool notify=false)
 Insert n bytes of text at position pos into the buffer.
 
virtual FXint insertText (FXint pos, const FXString &text, FXbool notify=false)
 
virtual FXint insertStyledText (FXint pos, const FXchar *text, FXint num, FXint style=0, FXbool notify=false)
 Insert n bytes of text at position pos into the buffer.
 
virtual FXint insertStyledText (FXint pos, const FXString &text, FXint style=0, FXbool notify=false)
 
virtual FXint insertTextBlock (FXint startpos, FXint endpos, FXint startcol, const FXchar *text, FXint num, FXbool notify=false)
 Insert text columns at startcol in line starting at startpos to endpos.
 
virtual FXint insertTextBlock (FXint startpos, FXint endpos, FXint startcol, const FXString &text, FXbool notify=false)
 
virtual FXint insertStyledTextBlock (FXint startpos, FXint endpos, FXint startcol, const FXchar *text, FXint num, FXint style=0, FXbool notify=false)
 Insert text columns at startcol in line starting at startpos to endpos with given style.
 
virtual FXint insertStyledTextBlock (FXint startpos, FXint endpos, FXint startcol, const FXString &text, FXint style=0, FXbool notify=false)
 
virtual FXint overstrikeTextBlock (FXint startpos, FXint endpos, FXint startcol, const FXchar *text, FXint num, FXbool notify=false)
 Overstrike text block.
 
virtual FXint overstrikeTextBlock (FXint startpos, FXint endpos, FXint startcol, const FXString &text, FXbool notify=false)
 
virtual FXint overstrikeStyledTextBlock (FXint startpos, FXint endpos, FXint startcol, const FXchar *text, FXint num, FXint style=0, FXbool notify=false)
 Overstrike styled text block.
 
virtual FXint overstrikeStyledTextBlock (FXint startpos, FXint endpos, FXint startcol, const FXString &text, FXint style=0, FXbool notify=false)
 
FXString getText () const
 Return entire text as string.
 
void getText (FXchar *text, FXint num) const
 Retrieve text into buffer.
 
void getText (FXString &text) const
 Retrieve text into string.
 
void extractText (FXchar *text, FXint pos, FXint num) const
 Extract n bytes of text from position pos into already allocated buffer.
 
void extractText (FXString &text, FXint pos, FXint num) const
 Extract n bytes of text from position pos into string text.
 
FXString extractText (FXint pos, FXint num) const
 Return n bytes of contents of text buffer from position pos.
 
void extractStyle (FXchar *style, FXint pos, FXint num) const
 Extract n bytes of style info from position pos into already allocated buffer.
 
void extractStyle (FXString &style, FXint pos, FXint num) const
 Extract n bytes of style info from position pos into string text.
 
FXString extractStyle (FXint pos, FXint num) const
 Return n bytes of style info from buffer from position pos.
 
void extractTextBlock (FXString &text, FXint startpos, FXint endpos, FXint startcol, FXint endcol) const
 Extract text columns startcol to endcol from lines starting at startpos to endpos.
 
FXString extractTextBlock (FXint startpos, FXint endpos, FXint startcol, FXint endcol) const
 Return text columns startcol to endcol from lines starting at startpos to endpos.
 
virtual FXint removeText (FXint pos, FXint num, FXbool notify=false)
 Remove n bytes of text at position pos from the buffer.
 
virtual FXint removeTextBlock (FXint startpos, FXint endpos, FXint startcol, FXint endcol, FXbool notify=false)
 Remove columns startcol to endcol from lines starting at startpos to endpos.
 
virtual FXint clearText (FXbool notify=false)
 Remove all text from the buffer.
 
virtual FXbool selectAll (FXbool notify=false)
 Select all text.
 
virtual FXbool setSelection (FXint pos, FXint len, FXbool notify=false)
 Select range of len characters starting at given position pos.
 
virtual FXbool extendSelection (FXint pos, FXuint sel=SelectChars, FXbool notify=false)
 Extend the primary selection from the anchor to the given position.
 
virtual FXbool setBlockSelection (FXint trow, FXint lcol, FXint brow, FXint rcol, FXbool notify=false)
 Select block of characters within given box.
 
virtual FXbool extendBlockSelection (FXint row, FXint col, FXbool notify=false)
 Extend primary selection from anchor to given row, column.
 
virtual FXbool setSelection (FXint spos, FXint epos, FXint scol, FXint ecol, FXbool notify=false)
 Select range or block (scol<=ecol) of text.
 
virtual FXbool killSelection (FXbool notify=false)
 Kill or deselect primary selection.
 
FXbool isPosSelected (FXint pos) const
 Return true if position pos is selected.
 
FXbool isPosSelected (FXint pos, FXint col) const
 Return true if position pos (and column col) is selected.
 
FXint getSelStartPos () const
 Return selection start position.
 
FXint getSelEndPos () const
 Return selection end position.
 
FXint getSelStartColumn () const
 Return selection start column.
 
FXint getSelEndColumn () const
 Return selection end column.
 
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 ("middle-mouse") selection.
 
FXbool pasteClipboard (FXbool notify=false)
 Paste clipboard.
 
FXbool replaceSelection (const FXString &text, FXbool notify=false)
 Replace primary selection by other text.
 
FXString getSelectedText () const
 Get selected text.
 
FXbool setHighlight (FXint start, FXint len)
 Highlight len characters starting at given position pos.
 
FXbool killHighlight ()
 Unhighlight the text.
 
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 isPosVisible (FXint pos) const
 Return true if line containing position is fully visible.
 
void makePositionVisible (FXint pos)
 Scroll text to make the given position visible.
 
FXint getPosAt (FXint x, FXint y) const
 Return text position at given visible x,y coordinate.
 
FXint getPosContaining (FXint x, FXint y) const
 Return text position containing x, y coordinate.
 
FXint getXOfPos (FXint pos) const
 Return screen x-coordinate of pos.
 
FXint getYOfPos (FXint pos) const
 Return screen y-coordinate of pos.
 
FXint getRowColumnAt (FXint x, FXint y, FXint &row, FXint &col) const
 Return closest position and (row,col) of given x,y coordinate. More...
 
FXint getXOfRowColumn (FXint row, FXint col) const
 Return screen x-coordinate of unconstrained (row,col).
 
FXint getYOfRowColumn (FXint row, FXint col) const
 Return screen y-coordinate of unconstrained (row,col).
 
virtual void setCursorPos (FXint pos, FXbool notify=false)
 Set the cursor position.
 
FXint getCursorPos () const
 Return the cursor position.
 
void setCursorRowColumn (FXint row, FXint col, FXbool notify=false)
 Set cursor row, column.
 
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.
 
void setAnchorPos (FXint pos)
 Set the anchor position.
 
FXint getAnchorPos () const
 Return the anchor position.
 
void setAnchorRowColumn (FXint row, FXint col)
 Set anchor row and column.
 
FXint getAnchorRow () const
 Return anchor row.
 
FXint getAnchorColumn () const
 Return anchor row.
 
void moveCursor (FXint pos, FXbool notify=false)
 Move cursor to position, and scroll into view.
 
void moveCursorRowColumn (FXint row, FXint col, FXbool notify=false)
 Move cursor to row and column, and scroll into view.
 
void moveCursorAndSelect (FXint pos, FXuint sel, FXbool notify=false)
 Move cursor to position, and extend the selection to this point.
 
void moveCursorRowColumnAndSelect (FXint row, FXint col, FXbool notify=false)
 Move cursor to row and column, and extend the block selection to this point.
 
FXbool findText (const FXString &string, FXint *beg=nullptr, FXint *end=nullptr, 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. More...
 
void setTextStyle (FXuint style)
 Change text widget style.
 
FXuint getTextStyle () const
 Return text widget style.
 
void setFont (FXFont *fnt)
 Change text font.
 
FXFontgetFont () const
 Return text font.
 
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 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 getBarColumns () const
 Return number of columns used for line numbers.
 
void setBarColumns (FXint cols)
 Change number of columns used for line numbers.
 
void setWrapColumns (FXint cols)
 Set wrap columns.
 
FXint getWrapColumns () const
 Return wrap columns.
 
void setTabColumns (FXint cols)
 Change tab columns.
 
FXint getTabColumns () const
 Return tab columns.
 
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.
 
FXbool setStyled (FXbool styled=true)
 Set styled text mode; return true if success.
 
FXbool isStyled () const
 Return true if style buffer.
 
void setHiliteStyles (FXHiliteStyle *styles)
 Set highlight styles. More...
 
FXHiliteStylegetHiliteStyles () const
 Return current value of the style table.
 
void setHiliteMatchTime (FXTime t)
 Change brace and parenthesis match highlighting time, in nanoseconds. More...
 
FXTime getHiliteMatchTime () const
 Return brace and parenthesis match highlighting time, in nanoseconds.
 
void setDelimiters (const FXchar *delims=textDelimiters)
 Change delimiters of words.
 
const FXchar * getDelimiters () const
 Return word delimiters.
 
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.
 
virtual void save (FXStream &store) const
 Save to a stream.
 
virtual void load (FXStream &store)
 Load from a stream.
 
virtual ~FXText ()
 Destructor.
 
- Public Member Functions inherited from FX::FXScrollArea
long onMouseWheel (FXObject *, FXSelector, void *)
 
long onHScrollerChanged (FXObject *, FXSelector, void *)
 
long onVScrollerChanged (FXObject *, FXSelector, void *)
 
long onHScrollerDragged (FXObject *, FXSelector, void *)
 
long onVScrollerDragged (FXObject *, FXSelector, void *)
 
long onAutoScroll (FXObject *, FXSelector, void *)
 
void setPosition (FXint x, FXint y)
 Set the current position.
 
void getPosition (FXint &x, FXint &y) const
 Get the current position.
 
FXint getContentX () const
 Return content area x position.
 
FXint getContentY () const
 Return content area y position.
 
FXbool isHorizontalScrollable () const
 Return true if horizontally scrollable.
 
FXbool isVerticalScrollable () const
 Return true if vertically scrollable.
 
void setScrollStyle (FXuint style)
 Change scroll style.
 
FXuint getScrollStyle () const
 Return scroll style.
 
FXScrollBarhorizontalScrollBar () const
 Return a pointer to the horizontal scrollbar.
 
FXScrollBarverticalScrollBar () const
 Return a pointer to the vertical scrollbar.
 
virtual ~FXScrollArea ()
 Destructor.
 
- Public Member Functions inherited from FX::FXComposite
long onKeyPress (FXObject *, FXSelector, void *)
 
long onKeyRelease (FXObject *, FXSelector, void *)
 
long onFocusNext (FXObject *, FXSelector, void *)
 
long onFocusPrev (FXObject *, FXSelector, void *)
 
long onCmdUpdate (FXObject *, FXSelector, void *)
 
 FXComposite (FXComposite *p, FXuint opts=0, FXint x=0, FXint y=0, FXint w=0, FXint h=0)
 Constructor.
 
virtual void destroy ()
 Destroy server-side resources.
 
FXint maxChildWidth () const
 Return the width of the widest child window.
 
FXint maxChildHeight () const
 Return the height of the tallest child window.
 
virtual FXbool isComposite () const
 Overrides this virtual function to return true.
 
virtual ~FXComposite ()
 Destructor.
 
- Public Member Functions inherited from FX::FXWindow
long onPaint (FXObject *, FXSelector, void *)
 
long onMap (FXObject *, FXSelector, void *)
 
long onUnmap (FXObject *, FXSelector, void *)
 
long onConfigure (FXObject *, FXSelector, void *)
 
long onUpdate (FXObject *, FXSelector, void *)
 
long onMotion (FXObject *, FXSelector, void *)
 
long onMouseWheel (FXObject *, FXSelector, void *)
 
long onEnter (FXObject *, FXSelector, void *)
 
long onLeave (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 onSpaceBallMotion (FXObject *, FXSelector, void *)
 
long onSpaceBallButtonPress (FXObject *, FXSelector, void *)
 
long onSpaceBallButtonRelease (FXObject *, FXSelector, void *)
 
long onBeginDrag (FXObject *, FXSelector, void *)
 
long onEndDrag (FXObject *, FXSelector, void *)
 
long onDragged (FXObject *, FXSelector, void *)
 
long onKeyPress (FXObject *, FXSelector, void *)
 
long onKeyRelease (FXObject *, FXSelector, void *)
 
long onUngrabbed (FXObject *, FXSelector, void *)
 
long onDestroy (FXObject *, FXSelector, void *)
 
long onFocusSelf (FXObject *, FXSelector, void *)
 
long onFocusIn (FXObject *, FXSelector, void *)
 
long onFocusOut (FXObject *, FXSelector, void *)
 
long onSelectionLost (FXObject *, FXSelector, void *)
 
long onSelectionGained (FXObject *, FXSelector, void *)
 
long onSelectionRequest (FXObject *, FXSelector, void *)
 
long onClipboardLost (FXObject *, FXSelector, void *)
 
long onClipboardGained (FXObject *, FXSelector, void *)
 
long onClipboardRequest (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 onQueryHelp (FXObject *, FXSelector, void *)
 
long onQueryTip (FXObject *, FXSelector, void *)
 
long onCmdShow (FXObject *, FXSelector, void *)
 
long onCmdHide (FXObject *, FXSelector, void *)
 
long onUpdToggleShown (FXObject *, FXSelector, void *)
 
long onCmdToggleShown (FXObject *, FXSelector, void *)
 
long onCmdRaise (FXObject *, FXSelector, void *)
 
long onCmdLower (FXObject *, FXSelector, void *)
 
long onCmdEnable (FXObject *, FXSelector, void *)
 
long onCmdDisable (FXObject *, FXSelector, void *)
 
long onUpdToggleEnabled (FXObject *, FXSelector, void *)
 
long onCmdToggleEnabled (FXObject *, FXSelector, void *)
 
long onCmdUpdate (FXObject *, FXSelector, void *)
 
long onUpdYes (FXObject *, FXSelector, void *)
 
long onCmdDelete (FXObject *, FXSelector, void *)
 
 FXWindow (FXComposite *p, FXuint opts=0, FXint x=0, FXint y=0, FXint w=0, FXint h=0)
 Constructor.
 
FXWindowgetParent () const
 Return a pointer to the parent window.
 
FXWindowgetOwner () const
 Return a pointer to the owner window.
 
FXWindowgetNext () const
 Return a pointer to the next (sibling) window, if any.
 
FXWindowgetPrev () const
 Return a pointer to the previous (sibling) window , if any.
 
FXWindowgetFirst () const
 Return a pointer to this window's first child window , if any.
 
FXWindowgetLast () const
 Return a pointer to this window's last child window, if any.
 
FXWindowgetFocus () const
 Return a pointer to the currently focused child window.
 
FXWindowgetShell () const
 Return a pointer to the shell window.
 
FXWindowgetRoot () const
 Return a pointer to the root window.
 
virtual WindowClass getWindowClass () const
 Get window class.
 
void setKey (FXuint k)
 Change window key.
 
FXuint getKey () const
 Return window key.
 
FXWindowgetChildWithKey (FXuint k) const
 Return child window with given window key.
 
void setTarget (FXObject *t)
 Set the message target object for this window.
 
FXObjectgetTarget () const
 Get the message target object for this window, if any.
 
void setSelector (FXSelector sel)
 Set the message identifier for this window.
 
FXSelector getSelector () const
 Get the message identifier for this window.
 
FXint getX () const
 Get this window's x-coordinate, in the parent's coordinate system.
 
FXint getY () const
 Get this window's y-coordinate, in the parent's coordinate system.
 
virtual FXint getWidthForHeight (FXint givenheight)
 Return width for given height.
 
virtual FXint getHeightForWidth (FXint givenwidth)
 Return height for given width.
 
void setX (FXint x)
 Set this window's x-coordinate, in the parent's coordinate system.
 
void setY (FXint y)
 Set this window's y-coordinate, in the parent's coordinate system.
 
void setWidth (FXint w)
 Set the window width; and flag the widget as being in need of layout by its parent. More...
 
void setHeight (FXint h)
 Set the window height; and flag the widget as being in need of layout by its parent. More...
 
void setLayoutHints (FXuint lout)
 Set layout hints for this window.
 
FXuint getLayoutHints () const
 Get layout hints for this window.
 
FXAccelTablegetAccelTable () const
 Return a pointer to the accelerator table.
 
void setAccelTable (FXAccelTable *acceltable)
 Set the accelerator table.
 
void addHotKey (FXHotKey code)
 Add a hot key.
 
void remHotKey (FXHotKey code)
 Remove a hot key.
 
void setHelpTag (const FXString &text)
 Change help tag for this widget.
 
const FXStringgetHelpTag () const
 Get the help tag for this widget.
 
FXbool isShell () const
 Return true if window is a shell window.
 
FXbool isOwnerOf (const FXWindow *window) const
 Return true if specified window is owned by this window.
 
FXbool isChildOf (const FXWindow *window) const
 Return true if specified window is ancestor of this window.
 
FXbool containsChild (const FXWindow *child) const
 Return true if this window contains child in its subtree.
 
FXWindowgetChildAt (FXint x, FXint y) const
 Return the child window at specified coordinates.
 
FXint numChildren () const
 Return the number of child windows for this window.
 
FXint indexOfChild (const FXWindow *window) const
 Return the index (starting from zero) of the specified child window, or -1 if the window is not a child or NULL.
 
FXWindowchildAtIndex (FXint index) const
 Return the child window at specified index, or NULL if the index is negative or out of range.
 
FXComposeContextgetComposeContext () const
 Return compose context.
 
void createComposeContext ()
 Create compose context.
 
void destroyComposeContext ()
 Destroy compose context.
 
FXbool cursorShown () const
 Is cursor shown.
 
void showCursor (FXbool flag=true)
 Show or hide the cursor.
 
void setDefaultCursor (FXCursor *cur)
 Set the default cursor for this window.
 
FXCursorgetDefaultCursor () const
 Return the default cursor for this window.
 
void setDragCursor (FXCursor *cur)
 Set the drag cursor for this window.
 
FXCursorgetDragCursor () const
 Return the drag cursor for this window.
 
FXbool getCursorPosition (FXint &x, FXint &y, FXuint &buttons) const
 Return the cursor position and mouse button-state.
 
FXbool setCursorPosition (FXint x, FXint y)
 Warp the cursor to the new position.
 
FXbool isActive () const
 Return true if the window is active.
 
FXbool hasFocus () const
 Return true if this window has the focus.
 
FXbool inFocusChain () const
 Return true if this window is in focus chain.
 
FXbool isDefault () const
 Return true if this is the default window.
 
virtual void setDefault (FXuchar flag=true)
 This changes the default window which responds to the Return key in a dialog. More...
 
FXWindowfindDefault () const
 Find default window among this window's children.
 
FXbool isInitial () const
 Return true if this is the initial default window.
 
void setInitial (FXbool flag=true)
 Make this window the initial default window.
 
FXWindowfindInitial () const
 Find inital default window among this window's children.
 
FXbool isEnabled () const
 Return true if this window is able to receive mouse and keyboard events.
 
virtual void attach (FXID w)
 Attach foreign window handle to this window.
 
virtual void setShape (const FXRegion &region)
 Set window shape by means of region.
 
virtual void setShape (FXBitmap *bitmap)
 Set window shape by means of bitmap.
 
virtual void setShape (FXIcon *icon)
 Set window shape by means of icon.
 
virtual void clearShape ()
 Clear window shape.
 
virtual void raise ()
 Raise this window to the top of the stacking order.
 
virtual void lower ()
 Lower this window to the bottom of the stacking order.
 
virtual void move (FXint x, FXint y)
 Move the window immediately, in the parent's coordinate system. More...
 
virtual void resize (FXint w, FXint h)
 Resize the window to the specified width and height immediately, updating the server representation as well, if the window was realized. More...
 
virtual void position (FXint x, FXint y, FXint w, FXint h)
 Move and resize the window immediately, in the parent's coordinate system. More...
 
void forceRefresh ()
 Generate a SEL_UPDATE message for the window and its children.
 
virtual void reparent (FXWindow *father, FXWindow *other=nullptr)
 Reparent this window under new father before other.
 
void scroll (FXint x, FXint y, FXint w, FXint h, FXint dx, FXint dy) const
 Scroll rectangle x,y,w,h by a shift of dx,dy.
 
void update (FXint x, FXint y, FXint w, FXint h) const
 Mark the specified rectangle to be repainted later.
 
void update () const
 Mark the entire window to be repainted later.
 
void repaint (FXint x, FXint y, FXint w, FXint h) const
 Process any outstanding repaint messages immediately, for the given rectangle.
 
void repaint () const
 Process any outstanding repaint messages immediately.
 
FXbool grabbed () const
 Return true if the window has been grabbed.
 
void grab ()
 Grab the mouse to this window; future mouse events will be reported to this window even while the cursor goes outside of this window.
 
void ungrab ()
 Release the mouse grab.
 
FXbool grabbedKeyboard () const
 Return true if active grab is in effect.
 
void grabKeyboard ()
 Grab keyboard device.
 
void ungrabKeyboard ()
 Ungrab keyboard device.
 
FXbool shown () const
 Return true if the window is shown.
 
virtual void show ()
 Show this window.
 
virtual void hide ()
 Hide this window.
 
FXbool underCursor () const
 Return true if the window is under the cursor.
 
FXbool hasSelection () const
 Return true if this window owns the primary selection.
 
FXbool acquireSelection (const FXDragType *types, FXuint numtypes)
 Try to acquire the primary selection, given a list of drag types.
 
FXbool releaseSelection ()
 Release the primary selection.
 
FXbool hasClipboard () const
 Return true if this window owns the clipboard.
 
FXbool acquireClipboard (const FXDragType *types, FXuint numtypes)
 Try to acquire the clipboard, given a list of drag types.
 
FXbool releaseClipboard ()
 Release the clipboard.
 
FXbool isDropEnabled () const
 Return true if this window is able to receive drops.
 
virtual void dropEnable ()
 Enable this window to receive drops.
 
virtual void dropDisable ()
 Disable this window from receiving drops.
 
FXbool isDragging () const
 Return true if a drag operaion has been initiated from this window.
 
FXbool beginDrag (const FXDragType *types, FXuint numtypes)
 Initiate a drag operation with a list of previously registered drag types.
 
FXbool handleDrag (FXint x, FXint y, FXDragAction action=DRAG_COPY)
 When dragging, inform the drop-target of the new position and the drag action.
 
FXDragAction endDrag (FXbool drop=true)
 Terminate the drag operation with or without actually dropping the data Returns the action performed by the target.
 
FXbool isDropTarget () const
 Return true if this window is the target of a drop.
 
void setDragRectangle (FXint x, FXint y, FXint w, FXint h, FXbool wantupdates=true) const
 When being dragged over, indicate that no further SEL_DND_MOTION messages are required while the cursor is inside the given rectangle.
 
void clearDragRectangle () const
 When being dragged over, indicate we want to receive SEL_DND_MOTION messages every time the cursor moves.
 
void acceptDrop (FXDragAction action=DRAG_ACCEPT) const
 When being dragged over, indicate acceptance or rejection of the dragged data.
 
FXDragAction didAccept () const
 The target accepted our drop.
 
void dropFinished (FXDragAction action=DRAG_REJECT) const
 Sent by the drop target in response to SEL_DND_DROP. More...
 
FXbool inquireDNDTypes (FXDNDOrigin origin, FXDragType *&types, FXuint &numtypes) const
 When being dragged over, inquire the drag types which are being offered.
 
FXbool offeredDNDType (FXDNDOrigin origin, FXDragType type) const
 When being dragged over, return true if we are offered the given drag type.
 
FXDragAction inquireDNDAction () const
 When being dragged over, return the drag action.
 
FXbool setDNDData (FXDNDOrigin origin, FXDragType type, FXuchar *data, FXuint size) const
 Set DND data; the array must be allocated with allocElms() and ownership is transferred to the system.
 
FXbool setDNDData (FXDNDOrigin origin, FXDragType type, const FXString &string) const
 Set DND data from string value.
 
FXbool getDNDData (FXDNDOrigin origin, FXDragType type, FXuchar *&data, FXuint &size) const
 Get DND data; the caller becomes the owner of the array and must free it with freeElms().
 
FXbool getDNDData (FXDNDOrigin origin, FXDragType type, FXString &string) const
 Get DND data into string value.
 
virtual FXbool contains (FXint parentx, FXint parenty) const
 Return true if window logically contains the given point.
 
void translateCoordinatesFrom (FXint &tox, FXint &toy, const FXWindow *fromwindow, FXint fromx, FXint fromy) const
 Translate coordinates from fromwindow's coordinate space to this window's coordinate space.
 
void translateCoordinatesTo (FXint &tox, FXint &toy, const FXWindow *towindow, FXint fromx, FXint fromy) const
 Translate coordinates from this window's coordinate space to towindow's coordinate space.
 
virtual void setBackColor (FXColor clr)
 Set window background color.
 
FXColor getBackColor () const
 Get background color.
 
virtual FXbool doesSaveUnder () const
 Does save-unders.
 
virtual const FXchar * tr (const FXchar *text, const FXchar *hint=nullptr, FXint count=-1) const FX_FORMAT(2)
 Translate message for localization; using the current FXTranslator, an attempt is made to translate the given message into the current language. More...
 
virtual ~FXWindow ()
 Destroy window.
 
- Public Member Functions inherited from FX::FXDrawable
FXVisualgetVisual () const
 Get the visual.
 
FXint getWidth () const
 Width of drawable.
 
FXint getHeight () const
 Height of drawable.
 
void setVisual (FXVisual *vis)
 Change visual.
 
virtual ~FXDrawable ()
 Cleanup.
 
- Public Member Functions inherited from FX::FXId
FXAppgetApp () const
 Get application.
 
FXID id () const
 Get XID handle.
 
void setUserData (FXptr ptr)
 Set user data pointer.
 
FXptr getUserData () const
 Get user data pointer.
 
virtual ~FXId ()
 Destructor.
 
- Public Member Functions inherited from FX::FXObject
const FXchar * getClassName () const
 Get class name of some object.
 
FXbool isMemberOf (const FXMetaClass *metaclass) const
 Check if object is member of metaclass.
 
virtual long tryHandle (FXObject *sender, FXSelector sel, void *ptr)
 Try handle message safely, catching certain exceptions.
 
virtual long onDefault (FXObject *, FXSelector, void *)
 Called for unhandled messages.
 
virtual ~FXObject ()
 Virtual destructor.
 

Static Public Attributes

static const FXchar textDelimiters []
 Default text delimiters.
 
- Static Public Attributes inherited from FX::FXWindow
static FXDragType octetType
 
static FXDragType deleteType
 
static FXDragType textType
 
static FXDragType colorType
 
static FXDragType urilistType
 
static FXDragType utf8Type
 
static FXDragType utf16Type
 
static FXDragType actionType
 
static const FXDragType stringType
 
static const FXDragType imageType
 
static const FXchar octetTypeName []
 
static const FXchar deleteTypeName []
 
static const FXchar textTypeName []
 
static const FXchar colorTypeName []
 
static const FXchar urilistTypeName []
 
static const FXchar utf8TypeName []
 
static const FXchar utf16TypeName []
 
static const FXchar actionTypeName []
 

Protected Types

enum  {
  MOUSE_NONE, MOUSE_CHARS, MOUSE_WORDS, MOUSE_LINES,
  MOUSE_BLOCK, MOUSE_SCROLL, MOUSE_DRAG, MOUSE_TRYDRAG
}
 
- Protected Types inherited from FX::FXWindow
enum  {
  FLAG_SHOWN = 0x00000001, FLAG_ENABLED = 0x00000002, FLAG_UPDATE = 0x00000004, FLAG_DROPTARGET = 0x00000008,
  FLAG_FOCUSED = 0x00000010, FLAG_DIRTY = 0x00000020, FLAG_RECALC = 0x00000040, FLAG_TIP = 0x00000080,
  FLAG_HELP = 0x00000100, FLAG_DEFAULT = 0x00000200, FLAG_INITIAL = 0x00000400, FLAG_SHELL = 0x00000800,
  FLAG_ACTIVE = 0x00001000, FLAG_PRESSED = 0x00002000, FLAG_KEY = 0x00004000, FLAG_CARET = 0x00008000,
  FLAG_CHANGED = 0x00010000, FLAG_LASSO = 0x00020000, FLAG_TRYDRAG = 0x00040000, FLAG_DODRAG = 0x00080000,
  FLAG_SCROLLINSIDE = 0x00100000, FLAG_SCROLLING = 0x00200000, FLAG_OWNED = 0x00400000, FLAG_CURSOR = 0x00800000
}
 

Protected Member Functions

void movegap (FXint pos)
 
void sizegap (FXint sz)
 
FXwchar nxtChar (FXint &pos) const
 
FXwchar prvChar (FXint &pos) const
 
FXint charWidth (FXwchar ch, FXint indent) const
 
FXint xoffset (FXint start, FXint pos) const
 
FXint wrap (FXint start) const
 
FXint rowFromPos (FXint pos) const
 
FXint posFromRow (FXint row) const
 
FXint columnFromPos (FXint start, FXint pos) const
 
FXint posFromColumn (FXint start, FXint col) const
 
FXint indentOfLine (FXint start, FXint pos) const
 
FXbool isdelimiter (FXwchar w) const
 
FXint measureText (FXint start, FXint end, FXint &wmax, FXint &hmax) const
 
void calcVisRows (FXint s, FXint e)
 
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)
 
FXint changeBeg (FXint pos) const
 
FXint changeEnd (FXint pos) const
 
void mutation (FXint pos, FXint ncins, FXint ncdel, FXint nrins, FXint nrdel)
 
FXint overstruck (FXint start, FXint end, const FXchar *text, FXint num)
 
void drawCursor (FXuint state)
 
virtual void paintCursor (FXDCWindow &dc) const
 
virtual void eraseCursor (FXDCWindow &dc) const
 
virtual void eraseCursorOverhang ()
 
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 FXuint styleOf (FXint beg, FXint end, FXint row, FXint col, FXint pos) const
 
virtual void drawTextRow (FXDCWindow &dc, FXint row) const
 
virtual void drawContents (FXDCWindow &dc) const
 
virtual void drawNumbers (FXDCWindow &dc) const
 
virtual void replace (FXint pos, FXint del, const FXchar *text, FXint ins, FXint style)
 
void updateRow (FXint row) const
 
void updateLines (FXint startpos, FXint endpos) const
 
void updateRange (FXint startpos, FXint endpos) const
 
FXint shiftText (FXint startpos, FXint endpos, FXint shift, FXbool notify)
 
FXbool deletePendingSelection (FXbool notify)
 
- Protected Member Functions inherited from FX::FXScrollArea
 FXScrollArea (FXComposite *p, FXuint opts, FXint x, FXint y, FXint w, FXint h)
 
FXbool startAutoScroll (FXEvent *event, FXbool onlywheninside=false)
 
void stopAutoScroll ()
 
void placeScrollBars (FXint vw, FXint vh)
 
- Protected Member Functions inherited from FX::FXComposite
 FXComposite (FXApp *a, FXVisual *vis)
 
 FXComposite (FXApp *a, FXWindow *own, FXuint opts, FXint x, FXint y, FXint w, FXint h)
 
- Protected Member Functions inherited from FX::FXWindow
virtual FXbool doesOverrideRedirect () const
 
void addColormapWindows ()
 
void remColormapWindows ()
 
 FXWindow (FXApp *a, FXVisual *vis)
 
 FXWindow (FXApp *a, FXWindow *own, FXuint opts, FXint x, FXint y, FXint w, FXint h)
 
- Protected Member Functions inherited from FX::FXDrawable
 FXDrawable (FXApp *a, FXint w, FXint h)
 
- Protected Member Functions inherited from FX::FXId
 FXId (FXApp *a)
 

Protected Attributes

FXchar * buffer
 
FXchar * sbuffer
 
FXint * visrows
 
FXint nvisrows
 
FXint gapbeg
 
FXint gaplen
 
FXint gapend
 
FXint length
 
FXint nrows
 
FXint toppos
 
FXint toprow
 
FXint keeppos
 
FXTextSelection select
 
FXTextSelection hilite
 
FXint anchorpos
 
FXint anchorrow
 
FXint anchorcol
 
FXint anchorvcol
 
FXint cursorpos
 
FXint cursorrow
 
FXint cursorcol
 
FXint cursorvcol
 
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
 
const FXchar * delimiters
 
FXString clipped
 
FXint vrows
 
FXint vcols
 
FXString help
 
FXString tip
 
FXHiliteStylehilitestyles
 
FXuint blink
 
FXTime matchtime
 
FXint grabx
 
FXint graby
 
FXuchar mode
 
FXbool modified
 
- Protected Attributes inherited from FX::FXScrollArea
FXScrollBarhorizontal
 
FXScrollBarvertical
 
FXScrollCornercorner
 
FXint pos_x
 
FXint pos_y
 
- Protected Attributes inherited from FX::FXWindow
FXComposeContextcomposeContext
 
FXCursordefaultCursor
 
FXCursordragCursor
 
FXAccelTableaccelTable
 
FXObjecttarget
 
FXSelector message
 
FXint xpos
 
FXint ypos
 
FXColor backColor
 
FXString tag
 
FXuint flags
 
FXuint options
 
- Protected Attributes inherited from FX::FXDrawable
FXVisualvisual
 
FXint width
 
FXint height
 
- Protected Attributes inherited from FX::FXId
FXID xid
 

Additional Inherited Members

- Static Public Member Functions inherited from FX::FXWindow
static FXWindowcommonAncestor (FXWindow *a, FXWindow *b)
 Return the common ancestor of window a and window b.
 
static FXbool before (const FXWindow *a, const FXWindow *b)
 Return true if sibling a <= sibling b in list.
 
static FXbool after (const FXWindow *a, const FXWindow *b)
 Return true if sibling a >= sibling b in list.
 

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 affected text affected as an array of four numbers: position, number of bytes, column, number of columns.

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. 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. The flag TEXT_SHOWMATCH will briefly flash the matching brace, parenthesis, or bracket when the cursor is positioned at brace, parenthesis, or bracket.

Member Function Documentation

◆ countCols()

FXint FX::FXText::countCols ( FXint  start,
FXint  end 
) const

Count number of columns taken up by some text.

Start should be on a row start.

◆ countLines()

FXint FX::FXText::countLines ( FXint  start,
FXint  end 
) const

Count number of newlines.

Start should be on a line start.

◆ countRows()

FXint FX::FXText::countRows ( FXint  start,
FXint  end 
) const

Count number of rows taken up by some text.

Start and end should be on a row start.

◆ findText()

FXbool FX::FXText::findText ( const FXString string,
FXint *  beg = nullptr,
FXint *  end = nullptr,
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. If neither SEARCH_FORWARD or SEARCH_BACKWARD flags are set, an anchored match is performed at the given starting position. 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.

◆ getRowColumnAt()

FXint FX::FXText::getRowColumnAt ( FXint  x,
FXint  y,
FXint &  row,
FXint &  col 
) const

Return closest position and (row,col) of given x,y coordinate.

The (row,col) is unconstrained, i.e. calculated as if tabs and area past the newline is comprised of spaces; the returned position however is inside the text. Note that when using proportional fonts, the width of a logical space inside a tab is variable, to account for the logical columns in a tab.

◆ setHiliteMatchTime()

void FX::FXText::setHiliteMatchTime ( FXTime  t)
inline

Change brace and parenthesis match highlighting time, in nanoseconds.

If highlighting for a small interval, only flash if the matching brace is visible. If the highlighting interval is set to forever, highlighting stays on till cursor moves, and the brace is highlighted even if not (yet) visible. Note that this may be expensive as a large part of the text buffer could be visited to find the matching brace.

◆ setHiliteStyles()

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.


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

Copyright © 1997-2022 Jeroen van der Zijp