00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FXTEXT_H
00025 #define FXTEXT_H
00026
00027 #ifndef FXSCROLLAREA_H
00028 #include "FXScrollArea.h"
00029 #endif
00030
00031 namespace FX {
00032
00033
00034
00035 enum {
00036 TEXT_READONLY = 0x00100000,
00037 TEXT_WORDWRAP = 0x00200000,
00038 TEXT_OVERSTRIKE = 0x00400000,
00039 TEXT_FIXEDWRAP = 0x00800000,
00040 TEXT_NO_TABS = 0x01000000,
00041 TEXT_AUTOINDENT = 0x02000000,
00042 TEXT_SHOWACTIVE = 0x04000000,
00043 TEXT_AUTOSCROLL = 0x08000000
00044 };
00045
00046
00047
00048 enum FXTextSelectionMode {
00049 SELECT_CHARS,
00050 SELECT_WORDS,
00051 SELECT_LINES
00052 };
00053
00054
00055
00056 struct FXHiliteStyle {
00057 FXColor normalForeColor;
00058 FXColor normalBackColor;
00059 FXColor selectForeColor;
00060 FXColor selectBackColor;
00061 FXColor hiliteForeColor;
00062 FXColor hiliteBackColor;
00063 FXColor activeBackColor;
00064 FXuint style;
00065 };
00066
00067
00068
00069
00070
00071
00072
00073
00074 struct FXTextChange {
00075 FXint pos;
00076 FXint ndel;
00077 FXint nins;
00078 FXchar *ins;
00079 FXchar *del;
00080 };
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 class FXAPI FXText : public FXScrollArea {
00094 FXDECLARE(FXText)
00095 protected:
00096 FXchar *buffer;
00097 FXchar *sbuffer;
00098 FXint *visrows;
00099 FXint length;
00100 FXint nvisrows;
00101 FXint nrows;
00102 FXint gapstart;
00103 FXint gapend;
00104 FXint toppos;
00105 FXint keeppos;
00106 FXint toprow;
00107 FXint selstartpos;
00108 FXint selendpos;
00109 FXint hilitestartpos;
00110 FXint hiliteendpos;
00111 FXint anchorpos;
00112 FXint cursorpos;
00113 FXint revertpos;
00114 FXint cursorstart;
00115 FXint cursorend;
00116 FXint cursorrow;
00117 FXint cursorcol;
00118 FXint prefcol;
00119 FXint margintop;
00120 FXint marginbottom;
00121 FXint marginleft;
00122 FXint marginright;
00123 FXint wrapwidth;
00124 FXint wrapcolumns;
00125 FXint tabwidth;
00126 FXint tabcolumns;
00127 FXint barwidth;
00128 FXint barcolumns;
00129 FXFont *font;
00130 FXColor textColor;
00131 FXColor selbackColor;
00132 FXColor seltextColor;
00133 FXColor hilitebackColor;
00134 FXColor hilitetextColor;
00135 FXColor activebackColor;
00136 FXColor numberColor;
00137 FXColor cursorColor;
00138 FXColor barColor;
00139 FXint textWidth;
00140 FXint textHeight;
00141 FXString searchstring;
00142 FXuint searchflags;
00143 const FXchar *delimiters;
00144 FXString clipped;
00145 FXint vrows;
00146 FXint vcols;
00147 FXString help;
00148 FXString tip;
00149 const FXHiliteStyle *hilitestyles;
00150 FXuint matchtime;
00151 FXint grabx;
00152 FXint graby;
00153 FXuchar mode;
00154 FXbool modified;
00155 protected:
00156 FXText();
00157 void calcVisRows(FXint s,FXint e);
00158 virtual void eraseCursorOverhang();
00159 virtual void drawCursor(FXuint state);
00160 virtual FXuint style(FXint row,FXint beg,FXint end,FXint pos) const;
00161 virtual void drawBufferText(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXint pos,FXint n,FXuint style) const;
00162 virtual void fillBufferRect(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXuint style) const;
00163 virtual void drawTextRow(FXDCWindow& dc,FXint line,FXint left,FXint right) const;
00164 virtual void drawContents(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h) const;
00165 virtual void drawNumbers(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h) const;
00166 FXint posToLine(FXint pos,FXint ln) const;
00167 FXbool posVisible(FXint pos) const;
00168 void updateRange(FXint beg,FXint end) const;
00169 void movegap(FXint pos);
00170 void sizegap(FXint sz);
00171 void squeezegap();
00172 FXint charWidth(FXwchar ch,FXint indent) const;
00173 FXint wrap(FXint start) const;
00174 FXint measureText(FXint start,FXint end,FXint& wmax,FXint& hmax) const;
00175 FXint lineWidth(FXint pos,FXint n) const;
00176 FXint getYOfPos(FXint pos) const;
00177 FXint getXOfPos(FXint pos) const;
00178 FXint changeBeg(FXint pos) const;
00179 FXint changeEnd(FXint pos) const;
00180 FXint indentFromPos(FXint start,FXint pos) const;
00181 FXint posFromIndent(FXint start,FXint indent) const;
00182 void mutation(FXint pos,FXint ncins,FXint ncdel,FXint nrins,FXint nrdel);
00183 virtual void replace(FXint pos,FXint m,const FXchar *text,FXint n,FXint style);
00184 void recompute();
00185 FXint matchForward(FXint pos,FXint end,FXwchar l,FXwchar r,FXint level) const;
00186 FXint matchBackward(FXint pos,FXint beg,FXwchar l,FXwchar r,FXint level) const;
00187 FXint findMatching(FXint pos,FXint beg,FXint end,FXwchar ch,FXint level) const;
00188 void flashMatching();
00189 void moveContents(FXint x,FXint y);
00190 protected:
00191 enum {
00192 STYLE_MASK = 0x00FF,
00193 STYLE_TEXT = 0x0100,
00194 STYLE_SELECTED = 0x0200,
00195 STYLE_CONTROL = 0x0400,
00196 STYLE_HILITE = 0x0800,
00197 STYLE_ACTIVE = 0x1000
00198 };
00199 enum {
00200 MOUSE_NONE,
00201 MOUSE_CHARS,
00202 MOUSE_WORDS,
00203 MOUSE_LINES,
00204 MOUSE_SCROLL,
00205 MOUSE_DRAG,
00206 MOUSE_TRYDRAG
00207 };
00208 public:
00209 enum {
00210 STYLE_UNDERLINE = 0x0001,
00211 STYLE_STRIKEOUT = 0x0002,
00212 STYLE_BOLD = 0x0004
00213 };
00214 private:
00215 FXText(const FXText&);
00216 FXText& operator=(const FXText&);
00217 public:
00218 long onPaint(FXObject*,FXSelector,void*);
00219 long onFocusIn(FXObject*,FXSelector,void*);
00220 long onFocusOut(FXObject*,FXSelector,void*);
00221 long onLeftBtnPress(FXObject*,FXSelector,void*);
00222 long onLeftBtnRelease(FXObject*,FXSelector,void*);
00223 long onMiddleBtnPress(FXObject*,FXSelector,void*);
00224 long onMiddleBtnRelease(FXObject*,FXSelector,void*);
00225 long onRightBtnPress(FXObject*,FXSelector,void*);
00226 long onRightBtnRelease(FXObject*,FXSelector,void*);
00227 long onUngrabbed(FXObject*,FXSelector,void*);
00228 long onMotion(FXObject*,FXSelector,void*);
00229 long onBeginDrag(FXObject*,FXSelector,void*);
00230 long onEndDrag(FXObject*,FXSelector,void*);
00231 long onDragged(FXObject*,FXSelector,void*);
00232 long onDNDEnter(FXObject*,FXSelector,void*);
00233 long onDNDLeave(FXObject*,FXSelector,void*);
00234 long onDNDMotion(FXObject*,FXSelector,void*);
00235 long onDNDDrop(FXObject*,FXSelector,void*);
00236 long onDNDRequest(FXObject*,FXSelector,void*);
00237 long onSelectionLost(FXObject*,FXSelector,void*);
00238 long onSelectionGained(FXObject*,FXSelector,void*);
00239 long onSelectionRequest(FXObject*,FXSelector,void* ptr);
00240 long onClipboardLost(FXObject*,FXSelector,void*);
00241 long onClipboardGained(FXObject*,FXSelector,void*);
00242 long onClipboardRequest(FXObject*,FXSelector,void*);
00243 long onKeyPress(FXObject*,FXSelector,void*);
00244 long onKeyRelease(FXObject*,FXSelector,void*);
00245 long onBlink(FXObject*,FXSelector,void*);
00246 long onFlash(FXObject*,FXSelector,void*);
00247 long onAutoScroll(FXObject*,FXSelector,void*);
00248 long onQueryHelp(FXObject*,FXSelector,void*);
00249 long onQueryTip(FXObject*,FXSelector,void*);
00250
00251
00252 long onCmdToggleEditable(FXObject*,FXSelector,void*);
00253 long onUpdToggleEditable(FXObject*,FXSelector,void*);
00254 long onCmdToggleOverstrike(FXObject*,FXSelector,void*);
00255 long onUpdToggleOverstrike(FXObject*,FXSelector,void*);
00256 long onCmdCursorRow(FXObject*,FXSelector,void*);
00257 long onUpdCursorRow(FXObject*,FXSelector,void*);
00258 long onCmdCursorColumn(FXObject*,FXSelector,void*);
00259 long onUpdCursorColumn(FXObject*,FXSelector,void*);
00260 long onUpdHaveSelection(FXObject*,FXSelector,void*);
00261 long onUpdSelectAll(FXObject*,FXSelector,void*);
00262 long onCmdSetStringValue(FXObject*,FXSelector,void*);
00263 long onCmdGetStringValue(FXObject*,FXSelector,void*);
00264 long onCmdSearch(FXObject*,FXSelector,void*);
00265 long onCmdReplace(FXObject*,FXSelector,void*);
00266 long onCmdSearchNext(FXObject*,FXSelector,void*);
00267 long onCmdSearchSel(FXObject*,FXSelector,void*);
00268
00269
00270 long onCmdCursorTop(FXObject*,FXSelector,void*);
00271 long onCmdCursorBottom(FXObject*,FXSelector,void*);
00272 long onCmdCursorHome(FXObject*,FXSelector,void*);
00273 long onCmdCursorEnd(FXObject*,FXSelector,void*);
00274 long onCmdCursorRight(FXObject*,FXSelector,void*);
00275 long onCmdCursorLeft(FXObject*,FXSelector,void*);
00276 long onCmdCursorUp(FXObject*,FXSelector,void*);
00277 long onCmdCursorDown(FXObject*,FXSelector,void*);
00278 long onCmdCursorWordLeft(FXObject*,FXSelector,void*);
00279 long onCmdCursorWordRight(FXObject*,FXSelector,void*);
00280 long onCmdCursorWordStart(FXObject*,FXSelector,void*);
00281 long onCmdCursorWordEnd(FXObject*,FXSelector,void*);
00282 long onCmdCursorPageDown(FXObject*,FXSelector,void*);
00283 long onCmdCursorPageUp(FXObject*,FXSelector,void*);
00284 long onCmdCursorScreenTop(FXObject*,FXSelector,void*);
00285 long onCmdCursorScreenBottom(FXObject*,FXSelector,void*);
00286 long onCmdCursorScreenCenter(FXObject*,FXSelector,void*);
00287 long onCmdCursorParHome(FXObject*,FXSelector,void*);
00288 long onCmdCursorParEnd(FXObject*,FXSelector,void*);
00289 long onCmdBlockBeg(FXObject*,FXSelector,void*);
00290 long onCmdBlockEnd(FXObject*,FXSelector,void*);
00291 long onCmdGotoMatching(FXObject*,FXSelector,void*);
00292 long onCmdGotoSelected(FXObject*,FXSelector,void*);
00293 long onCmdGotoLine(FXObject*,FXSelector,void*);
00294 long onCmdScrollUp(FXObject*,FXSelector,void*);
00295 long onCmdScrollDown(FXObject*,FXSelector,void*);
00296
00297
00298 long onCmdMark(FXObject*,FXSelector,void*);
00299 long onCmdExtend(FXObject*,FXSelector,void*);
00300
00301
00302 long onCmdOverstString(FXObject*,FXSelector,void*);
00303 long onCmdInsertString(FXObject*,FXSelector,void*);
00304 long onCmdInsertNewline(FXObject*,FXSelector,void*);
00305 long onCmdInsertTab(FXObject*,FXSelector,void*);
00306
00307
00308 long onCmdCutSel(FXObject*,FXSelector,void*);
00309 long onCmdCopySel(FXObject*,FXSelector,void*);
00310 long onCmdPasteSel(FXObject*,FXSelector,void*);
00311 long onCmdDeleteSel(FXObject*,FXSelector,void*);
00312 long onCmdChangeCase(FXObject*,FXSelector,void*);
00313 long onCmdShiftText(FXObject*,FXSelector,void*);
00314 long onCmdPasteMiddle(FXObject*,FXSelector,void*);
00315
00316
00317 long onCmdSelectChar(FXObject*,FXSelector,void*);
00318 long onCmdSelectWord(FXObject*,FXSelector,void*);
00319 long onCmdSelectLine(FXObject*,FXSelector,void*);
00320 long onCmdSelectAll(FXObject*,FXSelector,void*);
00321 long onCmdSelectMatching(FXObject*,FXSelector,void*);
00322 long onCmdSelectBlock(FXObject*,FXSelector,void*);
00323 long onCmdDeselectAll(FXObject*,FXSelector,void*);
00324
00325
00326 long onCmdBackspace(FXObject*,FXSelector,void*);
00327 long onCmdBackspaceWord(FXObject*,FXSelector,void*);
00328 long onCmdBackspaceBol(FXObject*,FXSelector,void*);
00329 long onCmdDelete(FXObject*,FXSelector,void*);
00330 long onCmdDeleteWord(FXObject*,FXSelector,void*);
00331 long onCmdDeleteEol(FXObject*,FXSelector,void*);
00332 long onCmdDeleteAll(FXObject*,FXSelector,void*);
00333 long onCmdDeleteLine(FXObject*,FXSelector,void*);
00334
00335 public:
00336 static const FXchar textDelimiters[];
00337
00338 public:
00339
00340 enum {
00341 ID_CURSOR_TOP=FXScrollArea::ID_LAST,
00342 ID_CURSOR_BOTTOM,
00343 ID_CURSOR_HOME,
00344 ID_CURSOR_END,
00345 ID_CURSOR_RIGHT,
00346 ID_CURSOR_LEFT,
00347 ID_CURSOR_UP,
00348 ID_CURSOR_DOWN,
00349 ID_CURSOR_WORD_LEFT,
00350 ID_CURSOR_WORD_RIGHT,
00351 ID_CURSOR_WORD_START,
00352 ID_CURSOR_WORD_END,
00353 ID_CURSOR_PAGEDOWN,
00354 ID_CURSOR_PAGEUP,
00355 ID_CURSOR_SCRNTOP,
00356 ID_CURSOR_SCRNBTM,
00357 ID_CURSOR_SCRNCTR,
00358 ID_CURSOR_PAR_HOME,
00359 ID_CURSOR_PAR_END,
00360 ID_SCROLL_UP,
00361 ID_SCROLL_DOWN,
00362 ID_MARK,
00363 ID_EXTEND,
00364 ID_OVERST_STRING,
00365 ID_INSERT_STRING,
00366 ID_INSERT_NEWLINE,
00367 ID_INSERT_TAB,
00368 ID_CUT_SEL,
00369 ID_COPY_SEL,
00370 ID_DELETE_SEL,
00371 ID_PASTE_SEL,
00372 ID_PASTE_MIDDLE,
00373 ID_SELECT_CHAR,
00374 ID_SELECT_WORD,
00375 ID_SELECT_LINE,
00376 ID_SELECT_ALL,
00377 ID_SELECT_MATCHING,
00378 ID_SELECT_BRACE,
00379 ID_SELECT_BRACK,
00380 ID_SELECT_PAREN,
00381 ID_SELECT_ANG,
00382 ID_DESELECT_ALL,
00383 ID_BACKSPACE,
00384 ID_BACKSPACE_WORD,
00385 ID_BACKSPACE_BOL,
00386 ID_DELETE,
00387 ID_DELETE_WORD,
00388 ID_DELETE_EOL,
00389 ID_DELETE_ALL,
00390 ID_DELETE_LINE,
00391 ID_TOGGLE_EDITABLE,
00392 ID_TOGGLE_OVERSTRIKE,
00393 ID_CURSOR_ROW,
00394 ID_CURSOR_COLUMN,
00395 ID_CLEAN_INDENT,
00396 ID_SHIFT_LEFT,
00397 ID_SHIFT_RIGHT,
00398 ID_SHIFT_TABLEFT,
00399 ID_SHIFT_TABRIGHT,
00400 ID_UPPER_CASE,
00401 ID_LOWER_CASE,
00402 ID_GOTO_MATCHING,
00403 ID_GOTO_SELECTED,
00404 ID_GOTO_LINE,
00405 ID_SEARCH_FORW_SEL,
00406 ID_SEARCH_BACK_SEL,
00407 ID_SEARCH_FORW,
00408 ID_SEARCH_BACK,
00409 ID_SEARCH,
00410 ID_REPLACE,
00411 ID_LEFT_BRACE,
00412 ID_LEFT_BRACK,
00413 ID_LEFT_PAREN,
00414 ID_LEFT_ANG,
00415 ID_RIGHT_BRACE,
00416 ID_RIGHT_BRACK,
00417 ID_RIGHT_PAREN,
00418 ID_RIGHT_ANG,
00419 ID_BLINK,
00420 ID_FLASH,
00421 ID_LAST
00422 };
00423
00424 public:
00425
00426
00427 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);
00428
00429
00430 virtual void create();
00431
00432
00433 virtual void detach();
00434
00435
00436 virtual void layout();
00437
00438
00439 virtual FXint getDefaultWidth();
00440
00441
00442 virtual FXint getDefaultHeight();
00443
00444
00445 virtual void enable();
00446
00447
00448 virtual void disable();
00449
00450
00451 virtual void recalc();
00452
00453
00454 virtual FXint getContentWidth();
00455
00456
00457 virtual FXint getContentHeight();
00458
00459
00460 virtual bool canFocus() const;
00461
00462
00463 virtual void setFocus();
00464
00465
00466 virtual void killFocus();
00467
00468
00469 void setMarginTop(FXint pt);
00470
00471
00472 FXint getMarginTop() const { return margintop; }
00473
00474
00475 void setMarginBottom(FXint pb);
00476
00477
00478 FXint getMarginBottom() const { return marginbottom; }
00479
00480
00481 void setMarginLeft(FXint pl);
00482
00483
00484 FXint getMarginLeft() const { return marginleft; }
00485
00486
00487 void setMarginRight(FXint pr);
00488
00489
00490 FXint getMarginRight() const { return marginright; }
00491
00492
00493 FXint getWrapColumns() const { return wrapcolumns; }
00494
00495
00496 void setWrapColumns(FXint cols);
00497
00498
00499 FXint getTabColumns() const { return tabcolumns; }
00500
00501
00502 void setTabColumns(FXint cols);
00503
00504
00505 FXint getBarColumns() const { return barcolumns; }
00506
00507
00508 void setBarColumns(FXint cols);
00509
00510
00511 FXbool isModified() const { return modified; }
00512
00513
00514 void setModified(FXbool mod=TRUE){ modified=mod; }
00515
00516
00517 void setEditable(FXbool edit=TRUE);
00518
00519
00520 FXbool isEditable() const;
00521
00522
00523 void setOverstrike(FXbool over=TRUE);
00524
00525
00526 FXbool isOverstrike() const;
00527
00528
00529 void setStyled(FXbool styled=TRUE);
00530
00531
00532 FXbool isStyled() const { return (sbuffer!=NULL); }
00533
00534
00535 void setDelimiters(const FXchar* delims=textDelimiters){ delimiters=delims; }
00536
00537
00538 const FXchar* getDelimiters() const { return delimiters; }
00539
00540
00541 void setFont(FXFont* fnt);
00542
00543
00544 FXFont* getFont() const { return font; }
00545
00546
00547 void setTextColor(FXColor clr);
00548
00549
00550 FXColor getTextColor() const { return textColor; }
00551
00552
00553 void setSelBackColor(FXColor clr);
00554
00555
00556 FXColor getSelBackColor() const { return selbackColor; }
00557
00558
00559 void setSelTextColor(FXColor clr);
00560
00561
00562 FXColor getSelTextColor() const { return seltextColor; }
00563
00564
00565 void setHiliteTextColor(FXColor clr);
00566
00567
00568 FXColor getHiliteTextColor() const { return hilitetextColor; }
00569
00570
00571 void setHiliteBackColor(FXColor clr);
00572
00573
00574 FXColor getHiliteBackColor() const { return hilitebackColor; }
00575
00576
00577 void setActiveBackColor(FXColor clr);
00578
00579
00580 FXColor getActiveBackColor() const { return activebackColor; }
00581
00582
00583 void setCursorColor(FXColor clr);
00584
00585
00586 FXColor getCursorColor() const { return cursorColor; }
00587
00588
00589 void setNumberColor(FXColor clr);
00590
00591
00592 FXColor getNumberColor() const { return numberColor; }
00593
00594
00595 void setBarColor(FXColor clr);
00596
00597
00598 FXColor getBarColor() const { return barColor; }
00599
00600
00601 void setHelpText(const FXString& text){ help=text; }
00602
00603
00604 FXString getHelpText() const { return help; }
00605
00606
00607 void setTipText(const FXString& text){ tip=text; }
00608
00609
00610 FXString getTipText() const { return tip; }
00611
00612
00613 FXint getByte(FXint pos) const;
00614
00615
00616 FXwchar getChar(FXint pos) const;
00617
00618
00619 FXint getCharLen(FXint pos) const;
00620
00621
00622 FXint getStyle(FXint pos) const;
00623
00624
00625 void extractText(FXchar *text,FXint pos,FXint n) const;
00626 void extractText(FXString& text,FXint pos,FXint n) const;
00627
00628
00629 void extractStyle(FXString& text,FXint pos,FXint n) const;
00630 void extractStyle(FXchar *style,FXint pos,FXint n) const;
00631
00632
00633 virtual void replaceText(FXint pos,FXint m,const FXchar *text,FXint n,FXbool notify=FALSE);
00634 virtual void replaceText(FXint pos,FXint m,const FXString& text,FXbool notify=FALSE);
00635
00636
00637 virtual void replaceStyledText(FXint pos,FXint m,const FXchar *text,FXint n,FXint style=0,FXbool notify=FALSE);
00638 virtual void replaceStyledText(FXint pos,FXint m,const FXString& text,FXint style=0,FXbool notify=FALSE);
00639
00640
00641 virtual void appendText(const FXchar *text,FXint n,FXbool notify=FALSE);
00642 virtual void appendText(const FXString& text,FXbool notify=FALSE);
00643
00644
00645 virtual void appendStyledText(const FXchar *text,FXint n,FXint style=0,FXbool notify=FALSE);
00646 virtual void appendStyledText(const FXString& text,FXint style=0,FXbool notify=FALSE);
00647
00648
00649 virtual void insertText(FXint pos,const FXchar *text,FXint n,FXbool notify=FALSE);
00650 virtual void insertText(FXint pos,const FXString& text,FXbool notify=FALSE);
00651
00652
00653 virtual void insertStyledText(FXint pos,const FXchar *text,FXint n,FXint style=0,FXbool notify=FALSE);
00654 virtual void insertStyledText(FXint pos,const FXString& text,FXint style=0,FXbool notify=FALSE);
00655
00656
00657 virtual void removeText(FXint pos,FXint n,FXbool notify=FALSE);
00658
00659
00660 virtual void changeStyle(FXint pos,FXint n,FXint style);
00661
00662
00663 virtual void changeStyle(FXint pos,const FXchar* style,FXint n);
00664 virtual void changeStyle(FXint pos,const FXString& style);
00665
00666
00667 virtual void setText(const FXchar* text,FXint n,FXbool notify=FALSE);
00668 virtual void setText(const FXString& text,FXbool notify=FALSE);
00669
00670
00671 virtual void setStyledText(const FXchar* text,FXint n,FXint style=0,FXbool notify=FALSE);
00672 virtual void setStyledText(const FXString& text,FXint style=0,FXbool notify=FALSE);
00673
00674
00675 void getText(FXchar* text,FXint n) const;
00676 void getText(FXString& text) const;
00677
00678
00679 FXString getText() const;
00680
00681
00682 FXint getLength() const { return length; }
00683
00684
00685 FXint getNumRows() const { return nrows; }
00686
00687
00688 FXint shiftText(FXint start,FXint end,FXint amount,FXbool notify=FALSE);
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704 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);
00705
00706
00707 FXbool isPosSelected(FXint pos) const;
00708
00709
00710 FXbool isPosVisible(FXint pos) const;
00711
00712
00713 FXint getPosAt(FXint x,FXint y) const;
00714
00715
00716 FXint countRows(FXint start,FXint end) const;
00717
00718
00719 FXint countCols(FXint start,FXint end) const;
00720
00721
00722 FXint countLines(FXint start,FXint end) const;
00723
00724
00725 FXint lineStart(FXint pos) const;
00726
00727
00728 FXint lineEnd(FXint pos) const;
00729
00730
00731 FXint nextLine(FXint pos,FXint nl=1) const;
00732
00733
00734 FXint prevLine(FXint pos,FXint nl=1) const;
00735
00736
00737 FXint rowStart(FXint pos) const;
00738
00739
00740 FXint rowEnd(FXint pos) const;
00741
00742
00743 FXint nextRow(FXint pos,FXint nr=1) const;
00744
00745
00746 FXint prevRow(FXint pos,FXint nr=1) const;
00747
00748
00749 FXint leftWord(FXint pos) const;
00750
00751
00752 FXint rightWord(FXint pos) const;
00753
00754
00755 FXint wordStart(FXint pos) const;
00756
00757
00758 FXint wordEnd(FXint pos) const;
00759
00760
00761 FXint validPos(FXint pos) const;
00762
00763
00764 FXint dec(FXint pos) const;
00765
00766
00767 FXint inc(FXint pos) const;
00768
00769
00770 void setTopLine(FXint pos);
00771
00772
00773 FXint getTopLine() const;
00774
00775
00776 void setBottomLine(FXint pos);
00777
00778
00779 FXint getBottomLine() const;
00780
00781
00782 void setCenterLine(FXint pos);
00783
00784
00785 void setAnchorPos(FXint pos);
00786
00787
00788 FXint getAnchorPos() const { return anchorpos; }
00789
00790
00791 virtual void setCursorPos(FXint pos,FXbool notify=FALSE);
00792
00793
00794 void setCursorRow(FXint row,FXbool notify=FALSE);
00795
00796
00797 FXint getCursorRow() const { return cursorrow; }
00798
00799
00800 void setCursorColumn(FXint col,FXbool notify=FALSE);
00801
00802
00803 FXint getCursorColumn() const { return cursorcol; }
00804
00805
00806 FXint getCursorPos() const { return cursorpos; }
00807
00808
00809 FXint getSelStartPos() const { return selstartpos; }
00810
00811
00812 FXint getSelEndPos() const { return selendpos; }
00813
00814
00815 FXbool selectAll(FXbool notify=FALSE);
00816
00817
00818 virtual FXbool extendSelection(FXint pos,FXTextSelectionMode select=SELECT_CHARS,FXbool notify=FALSE);
00819
00820
00821 FXbool setSelection(FXint pos,FXint len,FXbool notify=FALSE);
00822
00823
00824 virtual FXbool killSelection(FXbool notify=FALSE);
00825
00826
00827 FXbool setHighlight(FXint start,FXint len);
00828
00829
00830 FXbool killHighlight();
00831
00832
00833 void makePositionVisible(FXint pos);
00834
00835
00836 void setTextStyle(FXuint style);
00837
00838
00839 FXuint getTextStyle() const;
00840
00841
00842 void setVisibleRows(FXint rows);
00843
00844
00845 FXint getVisibleRows() const { return vrows; }
00846
00847
00848 void setVisibleColumns(FXint cols);
00849
00850
00851 FXint getVisibleColumns() const { return vcols; }
00852
00853
00854
00855
00856
00857 void setHiliteMatchTime(FXuint t){ matchtime=t; }
00858
00859
00860
00861
00862 FXuint getHiliteMatchTime() const { return matchtime; }
00863
00864
00865 void setHiliteStyles(const FXHiliteStyle* styles);
00866
00867
00868 const FXHiliteStyle* getHiliteStyles() const { return hilitestyles; }
00869
00870
00871 virtual void save(FXStream& store) const;
00872
00873
00874 virtual void load(FXStream& store);
00875
00876
00877 virtual ~FXText();
00878 };
00879
00880
00881 }
00882
00883 #endif