FXText.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                    M u l t i - L i ne   T e x t   W i d g e t                 *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1998,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (at your option) any later version.            *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXText.h,v 1.166 2006/02/06 03:03:40 fox Exp $                           *
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 
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 
00048 enum FXTextSelectionMode {
00049   SELECT_CHARS,
00050   SELECT_WORDS,
00051   SELECT_LINES
00052   };
00053 
00054 
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 
00074 struct FXTextChange {
00075   FXint   pos;          
00076   FXint   ndel;         
00077   FXint   nins;         
00078   FXchar *ins;          
00079   FXchar *del;          
00080   };
00081 
00082 
00093 class FXAPI FXText : public FXScrollArea {
00094   FXDECLARE(FXText)
00095 protected:
00096   FXchar        *buffer;              // Text buffer being edited
00097   FXchar        *sbuffer;             // Text style buffer
00098   FXint         *visrows;             // Starts of rows in buffer
00099   FXint          length;              // Length of the actual text in the buffer
00100   FXint          nvisrows;            // Number of visible rows
00101   FXint          nrows;               // Total number of rows
00102   FXint          gapstart;            // Start of the insertion point (the gap)
00103   FXint          gapend;              // End of the insertion point+1
00104   FXint          toppos;              // Start position of first visible row
00105   FXint          keeppos;             // Position to keep on top visible row
00106   FXint          toprow;              // Row number of first visible row
00107   FXint          selstartpos;         // Start of selection
00108   FXint          selendpos;           // End of selection
00109   FXint          hilitestartpos;      // Hightlight start position
00110   FXint          hiliteendpos;        // Hightlight end position
00111   FXint          anchorpos;           // Anchor position
00112   FXint          cursorpos;           // Cursor position
00113   FXint          revertpos;           // Position of cursor prior to dragging
00114   FXint          cursorstart;         // Cursor row start pos
00115   FXint          cursorend;           // Cursor row end pos
00116   FXint          cursorrow;           // Cursor row
00117   FXint          cursorcol;           // Cursor column indent (not character offset!)
00118   FXint          prefcol;             // Preferred cursor column
00119   FXint          margintop;           // Margins top
00120   FXint          marginbottom;        // Margin bottom
00121   FXint          marginleft;          // Margin left
00122   FXint          marginright;         // Margin right
00123   FXint          wrapwidth;           // Wrap width in pixels
00124   FXint          wrapcolumns;         // Wrap columns
00125   FXint          tabwidth;            // Tab width in pixels
00126   FXint          tabcolumns;          // Tab columns
00127   FXint          barwidth;            // Line number width
00128   FXint          barcolumns;          // Line number columns
00129   FXFont        *font;                // Text font
00130   FXColor        textColor;           // Normal text color
00131   FXColor        selbackColor;        // Select background color
00132   FXColor        seltextColor;        // Select text color
00133   FXColor        hilitebackColor;     // Highlight background color
00134   FXColor        hilitetextColor;     // Highlight text color
00135   FXColor        activebackColor;     // Background color for active line
00136   FXColor        numberColor;         // Line number color
00137   FXColor        cursorColor;         // Cursor color
00138   FXColor        barColor;            // Bar background color
00139   FXint          textWidth;           // Total width of all text
00140   FXint          textHeight;          // Total height of all text
00141   FXString       searchstring;        // String of last search
00142   FXuint         searchflags;         // Flags of last search
00143   const FXchar  *delimiters;          // Delimiters
00144   FXString       clipped;             // Clipped text
00145   FXint          vrows;               // Default visible rows
00146   FXint          autovrows;           // Max number of auto visible rows
00147   FXint          vcols;               // Default visible columns
00148   FXString       help;                // Status line help
00149   FXString       tip;                 // Tooltip
00150   const FXHiliteStyle *hilitestyles;  // Style definitions
00151   FXuint         matchtime;           // Match time (ms)
00152   FXint          grabx;               // Grab point x
00153   FXint          graby;               // Grab point y
00154   FXuchar        mode;                // Mode widget is in
00155   FXbool         modified;            // User has modified text
00156 protected:
00157   FXText();
00158   void calcVisRows(FXint s,FXint e);
00159   virtual void eraseCursorOverhang();
00160   virtual void drawCursor(FXuint state);
00161   virtual FXuint style(FXint row,FXint beg,FXint end,FXint pos) const;
00162   virtual void drawBufferText(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXint pos,FXint n,FXuint style) const;
00163   virtual void fillBufferRect(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h,FXuint style) const;
00164   virtual void drawTextRow(FXDCWindow& dc,FXint line,FXint left,FXint right) const;
00165   virtual void drawContents(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h) const;
00166   virtual void drawNumbers(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h) const;
00167   FXint posToLine(FXint pos,FXint ln) const;
00168   FXbool posVisible(FXint pos) const;
00169   void updateRange(FXint beg,FXint end) const;
00170   void movegap(FXint pos);
00171   void sizegap(FXint sz);
00172   void squeezegap();
00173   FXint charWidth(FXwchar ch,FXint indent) const;
00174   FXint wrap(FXint start) const;
00175   FXint measureText(FXint start,FXint end,FXint& wmax,FXint& hmax) const;
00176   FXint lineWidth(FXint pos,FXint n) const;
00177   FXint getYOfPos(FXint pos) const;
00178   FXint getXOfPos(FXint pos) const;
00179   FXint changeBeg(FXint pos) const;
00180   FXint changeEnd(FXint pos) const;
00181   FXint indentFromPos(FXint start,FXint pos) const;
00182   FXint posFromIndent(FXint start,FXint indent) const;
00183   void mutation(FXint pos,FXint ncins,FXint ncdel,FXint nrins,FXint nrdel);
00184   virtual void replace(FXint pos,FXint m,const FXchar *text,FXint n,FXint style);
00185   void recompute();
00186   FXint matchForward(FXint pos,FXint end,FXwchar l,FXwchar r,FXint level) const;
00187   FXint matchBackward(FXint pos,FXint beg,FXwchar l,FXwchar r,FXint level) const;
00188   FXint findMatching(FXint pos,FXint beg,FXint end,FXwchar ch,FXint level) const;
00189   void flashMatching();
00190   void moveContents(FXint x,FXint y);
00191 protected:
00192   enum {
00193     STYLE_MASK      = 0x00FF,   // Mask color table
00194     STYLE_TEXT      = 0x0100,   // Draw some content
00195     STYLE_SELECTED  = 0x0200,   // Selected
00196     STYLE_CONTROL   = 0x0400,   // Control character
00197     STYLE_HILITE    = 0x0800,   // Highlighted
00198     STYLE_ACTIVE    = 0x1000    // Active
00199     };
00200   enum {
00201     MOUSE_NONE,                 // No mouse operation
00202     MOUSE_CHARS,                // Selecting characters
00203     MOUSE_WORDS,                // Selecting words
00204     MOUSE_LINES,                // Selecting lines
00205     MOUSE_SCROLL,               // Scrolling
00206     MOUSE_DRAG,                 // Dragging text
00207     MOUSE_TRYDRAG               // Tentative drag
00208     };
00209 public:
00210   enum {
00211     STYLE_UNDERLINE = 0x0001,   
00212     STYLE_STRIKEOUT = 0x0002,   
00213     STYLE_BOLD      = 0x0004    
00214     };
00215 private:
00216   FXText(const FXText&);
00217   FXText& operator=(const FXText&);
00218 public:
00219   long onPaint(FXObject*,FXSelector,void*);
00220   long onFocusIn(FXObject*,FXSelector,void*);
00221   long onFocusOut(FXObject*,FXSelector,void*);
00222   long onLeftBtnPress(FXObject*,FXSelector,void*);
00223   long onLeftBtnRelease(FXObject*,FXSelector,void*);
00224   long onMiddleBtnPress(FXObject*,FXSelector,void*);
00225   long onMiddleBtnRelease(FXObject*,FXSelector,void*);
00226   long onRightBtnPress(FXObject*,FXSelector,void*);
00227   long onRightBtnRelease(FXObject*,FXSelector,void*);
00228   long onUngrabbed(FXObject*,FXSelector,void*);
00229   long onMotion(FXObject*,FXSelector,void*);
00230   long onBeginDrag(FXObject*,FXSelector,void*);
00231   long onEndDrag(FXObject*,FXSelector,void*);
00232   long onDragged(FXObject*,FXSelector,void*);
00233   long onDNDEnter(FXObject*,FXSelector,void*);
00234   long onDNDLeave(FXObject*,FXSelector,void*);
00235   long onDNDMotion(FXObject*,FXSelector,void*);
00236   long onDNDDrop(FXObject*,FXSelector,void*);
00237   long onDNDRequest(FXObject*,FXSelector,void*);
00238   long onSelectionLost(FXObject*,FXSelector,void*);
00239   long onSelectionGained(FXObject*,FXSelector,void*);
00240   long onSelectionRequest(FXObject*,FXSelector,void* ptr);
00241   long onClipboardLost(FXObject*,FXSelector,void*);
00242   long onClipboardGained(FXObject*,FXSelector,void*);
00243   long onClipboardRequest(FXObject*,FXSelector,void*);
00244   long onKeyPress(FXObject*,FXSelector,void*);
00245   long onKeyRelease(FXObject*,FXSelector,void*);
00246   long onBlink(FXObject*,FXSelector,void*);
00247   long onFlash(FXObject*,FXSelector,void*);
00248   long onAutoScroll(FXObject*,FXSelector,void*);
00249   long onQueryHelp(FXObject*,FXSelector,void*);
00250   long onQueryTip(FXObject*,FXSelector,void*);
00251 
00252   // Control commands
00253   long onCmdToggleEditable(FXObject*,FXSelector,void*);
00254   long onUpdToggleEditable(FXObject*,FXSelector,void*);
00255   long onCmdToggleOverstrike(FXObject*,FXSelector,void*);
00256   long onUpdToggleOverstrike(FXObject*,FXSelector,void*);
00257   long onCmdCursorRow(FXObject*,FXSelector,void*);
00258   long onUpdCursorRow(FXObject*,FXSelector,void*);
00259   long onCmdCursorColumn(FXObject*,FXSelector,void*);
00260   long onUpdCursorColumn(FXObject*,FXSelector,void*);
00261   long onUpdHaveSelection(FXObject*,FXSelector,void*);
00262   long onUpdSelectAll(FXObject*,FXSelector,void*);
00263   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00264   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00265   long onCmdSearch(FXObject*,FXSelector,void*);
00266   long onCmdReplace(FXObject*,FXSelector,void*);
00267   long onCmdSearchNext(FXObject*,FXSelector,void*);
00268   long onCmdSearchSel(FXObject*,FXSelector,void*);
00269 
00270   // Cursor movement
00271   long onCmdCursorTop(FXObject*,FXSelector,void*);
00272   long onCmdCursorBottom(FXObject*,FXSelector,void*);
00273   long onCmdCursorHome(FXObject*,FXSelector,void*);
00274   long onCmdCursorEnd(FXObject*,FXSelector,void*);
00275   long onCmdCursorRight(FXObject*,FXSelector,void*);
00276   long onCmdCursorLeft(FXObject*,FXSelector,void*);
00277   long onCmdCursorUp(FXObject*,FXSelector,void*);
00278   long onCmdCursorDown(FXObject*,FXSelector,void*);
00279   long onCmdCursorWordLeft(FXObject*,FXSelector,void*);
00280   long onCmdCursorWordRight(FXObject*,FXSelector,void*);
00281   long onCmdCursorWordStart(FXObject*,FXSelector,void*);
00282   long onCmdCursorWordEnd(FXObject*,FXSelector,void*);
00283   long onCmdCursorPageDown(FXObject*,FXSelector,void*);
00284   long onCmdCursorPageUp(FXObject*,FXSelector,void*);
00285   long onCmdCursorScreenTop(FXObject*,FXSelector,void*);
00286   long onCmdCursorScreenBottom(FXObject*,FXSelector,void*);
00287   long onCmdCursorScreenCenter(FXObject*,FXSelector,void*);
00288   long onCmdCursorParHome(FXObject*,FXSelector,void*);
00289   long onCmdCursorParEnd(FXObject*,FXSelector,void*);
00290   long onCmdBlockBeg(FXObject*,FXSelector,void*);
00291   long onCmdBlockEnd(FXObject*,FXSelector,void*);
00292   long onCmdGotoMatching(FXObject*,FXSelector,void*);
00293   long onCmdGotoSelected(FXObject*,FXSelector,void*);
00294   long onCmdGotoLine(FXObject*,FXSelector,void*);
00295   long onCmdScrollUp(FXObject*,FXSelector,void*);
00296   long onCmdScrollDown(FXObject*,FXSelector,void*);
00297 
00298   // Mark and extend
00299   long onCmdMark(FXObject*,FXSelector,void*);
00300   long onCmdExtend(FXObject*,FXSelector,void*);
00301 
00302   // Inserting
00303   long onCmdOverstString(FXObject*,FXSelector,void*);
00304   long onCmdInsertString(FXObject*,FXSelector,void*);
00305   long onCmdInsertNewline(FXObject*,FXSelector,void*);
00306   long onCmdInsertTab(FXObject*,FXSelector,void*);
00307 
00308   // Manipulation Selection
00309   long onCmdCutSel(FXObject*,FXSelector,void*);
00310   long onCmdCopySel(FXObject*,FXSelector,void*);
00311   long onCmdPasteSel(FXObject*,FXSelector,void*);
00312   long onCmdDeleteSel(FXObject*,FXSelector,void*);
00313   long onCmdChangeCase(FXObject*,FXSelector,void*);
00314   long onCmdShiftText(FXObject*,FXSelector,void*);
00315   long onCmdPasteMiddle(FXObject*,FXSelector,void*);
00316 
00317   // Changing Selection
00318   long onCmdSelectChar(FXObject*,FXSelector,void*);
00319   long onCmdSelectWord(FXObject*,FXSelector,void*);
00320   long onCmdSelectLine(FXObject*,FXSelector,void*);
00321   long onCmdSelectAll(FXObject*,FXSelector,void*);
00322   long onCmdSelectMatching(FXObject*,FXSelector,void*);
00323   long onCmdSelectBlock(FXObject*,FXSelector,void*);
00324   long onCmdDeselectAll(FXObject*,FXSelector,void*);
00325 
00326   // Deletion
00327   long onCmdBackspace(FXObject*,FXSelector,void*);
00328   long onCmdBackspaceWord(FXObject*,FXSelector,void*);
00329   long onCmdBackspaceBol(FXObject*,FXSelector,void*);
00330   long onCmdDelete(FXObject*,FXSelector,void*);
00331   long onCmdDeleteWord(FXObject*,FXSelector,void*);
00332   long onCmdDeleteEol(FXObject*,FXSelector,void*);
00333   long onCmdDeleteAll(FXObject*,FXSelector,void*);
00334   long onCmdDeleteLine(FXObject*,FXSelector,void*);
00335 
00336 public:
00337   static const FXchar *textDelimiters;
00338 
00339 public:
00340 
00341   enum {
00342     ID_CURSOR_TOP=FXScrollArea::ID_LAST,
00343     ID_CURSOR_BOTTOM,
00344     ID_CURSOR_HOME,
00345     ID_CURSOR_END,
00346     ID_CURSOR_RIGHT,
00347     ID_CURSOR_LEFT,
00348     ID_CURSOR_UP,
00349     ID_CURSOR_DOWN,
00350     ID_CURSOR_WORD_LEFT,
00351     ID_CURSOR_WORD_RIGHT,
00352     ID_CURSOR_WORD_START,
00353     ID_CURSOR_WORD_END,
00354     ID_CURSOR_PAGEDOWN,
00355     ID_CURSOR_PAGEUP,
00356     ID_CURSOR_SCRNTOP,
00357     ID_CURSOR_SCRNBTM,
00358     ID_CURSOR_SCRNCTR,
00359     ID_CURSOR_PAR_HOME,
00360     ID_CURSOR_PAR_END,
00361     ID_SCROLL_UP,
00362     ID_SCROLL_DOWN,
00363     ID_MARK,
00364     ID_EXTEND,
00365     ID_OVERST_STRING,
00366     ID_INSERT_STRING,
00367     ID_INSERT_NEWLINE,
00368     ID_INSERT_TAB,
00369     ID_CUT_SEL,
00370     ID_COPY_SEL,
00371     ID_DELETE_SEL,
00372     ID_PASTE_SEL,
00373     ID_PASTE_MIDDLE,
00374     ID_SELECT_CHAR,
00375     ID_SELECT_WORD,
00376     ID_SELECT_LINE,
00377     ID_SELECT_ALL,
00378     ID_SELECT_MATCHING,
00379     ID_SELECT_BRACE,
00380     ID_SELECT_BRACK,
00381     ID_SELECT_PAREN,
00382     ID_SELECT_ANG,
00383     ID_DESELECT_ALL,
00384     ID_BACKSPACE,
00385     ID_BACKSPACE_WORD,
00386     ID_BACKSPACE_BOL,
00387     ID_DELETE,
00388     ID_DELETE_WORD,
00389     ID_DELETE_EOL,
00390     ID_DELETE_ALL,
00391     ID_DELETE_LINE,
00392     ID_TOGGLE_EDITABLE,
00393     ID_TOGGLE_OVERSTRIKE,
00394     ID_CURSOR_ROW,
00395     ID_CURSOR_COLUMN,
00396     ID_CLEAN_INDENT,
00397     ID_SHIFT_LEFT,
00398     ID_SHIFT_RIGHT,
00399     ID_SHIFT_TABLEFT,
00400     ID_SHIFT_TABRIGHT,
00401     ID_UPPER_CASE,
00402     ID_LOWER_CASE,
00403     ID_GOTO_MATCHING,
00404     ID_GOTO_SELECTED,
00405     ID_GOTO_LINE,
00406     ID_SEARCH_FORW_SEL,
00407     ID_SEARCH_BACK_SEL,
00408     ID_SEARCH_FORW,
00409     ID_SEARCH_BACK,
00410     ID_SEARCH,
00411     ID_REPLACE,
00412     ID_LEFT_BRACE,
00413     ID_LEFT_BRACK,
00414     ID_LEFT_PAREN,
00415     ID_LEFT_ANG,
00416     ID_RIGHT_BRACE,
00417     ID_RIGHT_BRACK,
00418     ID_RIGHT_PAREN,
00419     ID_RIGHT_ANG,
00420     ID_BLINK,
00421     ID_FLASH,
00422     ID_LAST
00423     };
00424 
00425 public:
00426 
00428   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);
00429 
00431   virtual void create();
00432 
00434   virtual void detach();
00435 
00437   virtual void layout();
00438 
00440   virtual FXint getDefaultWidth();
00441 
00443   virtual FXint getDefaultHeight();
00444 
00446   virtual void enable();
00447 
00449   virtual void disable();
00450 
00452   virtual void recalc();
00453 
00455   virtual FXint getContentWidth();
00456 
00458   virtual FXint getContentHeight();
00459 
00461   virtual bool canFocus() const;
00462 
00464   virtual void setFocus();
00465 
00467   virtual void killFocus();
00468 
00470   void setMarginTop(FXint pt);
00471 
00473   FXint getMarginTop() const { return margintop; }
00474 
00476   void setMarginBottom(FXint pb);
00477 
00479   FXint getMarginBottom() const { return marginbottom; }
00480 
00482   void setMarginLeft(FXint pl);
00483 
00485   FXint getMarginLeft() const { return marginleft; }
00486 
00488   void setMarginRight(FXint pr);
00489 
00491   FXint getMarginRight() const { return marginright; }
00492 
00494   FXint getWrapColumns() const { return wrapcolumns; }
00495 
00497   void setWrapColumns(FXint cols);
00498 
00500   FXint getTabColumns() const { return tabcolumns; }
00501 
00503   void setTabColumns(FXint cols);
00504 
00506   FXint getBarColumns() const { return barcolumns; }
00507 
00509   void setBarColumns(FXint cols);
00510 
00512   FXbool isModified() const { return modified; }
00513 
00515   void setModified(FXbool mod=TRUE){ modified=mod; }
00516 
00518   void setEditable(FXbool edit=TRUE);
00519 
00521   FXbool isEditable() const;
00522 
00524   void setOverstrike(FXbool over=TRUE);
00525 
00527   FXbool isOverstrike() const;
00528 
00530   void setStyled(FXbool styled=TRUE);
00531 
00533   FXbool isStyled() const { return (sbuffer!=NULL); }
00534 
00536   void setDelimiters(const FXchar* delims=textDelimiters){ delimiters=delims; }
00537 
00539   const FXchar* getDelimiters() const { return delimiters; }
00540 
00542   void setFont(FXFont* fnt);
00543 
00545   FXFont* getFont() const { return font; }
00546 
00548   void setTextColor(FXColor clr);
00549 
00551   FXColor getTextColor() const { return textColor; }
00552 
00554   void setSelBackColor(FXColor clr);
00555 
00557   FXColor getSelBackColor() const { return selbackColor; }
00558 
00560   void setSelTextColor(FXColor clr);
00561 
00563   FXColor getSelTextColor() const { return seltextColor; }
00564 
00566   void setHiliteTextColor(FXColor clr);
00567 
00569   FXColor getHiliteTextColor() const { return hilitetextColor; }
00570 
00572   void setHiliteBackColor(FXColor clr);
00573 
00575   FXColor getHiliteBackColor() const { return hilitebackColor; }
00576 
00578   void setActiveBackColor(FXColor clr);
00579 
00581   FXColor getActiveBackColor() const { return activebackColor; }
00582 
00584   void setCursorColor(FXColor clr);
00585 
00587   FXColor getCursorColor() const { return cursorColor; }
00588 
00590   void setNumberColor(FXColor clr);
00591 
00593   FXColor getNumberColor() const { return numberColor; }
00594 
00596   void setBarColor(FXColor clr);
00597 
00599   FXColor getBarColor() const { return barColor; }
00600 
00602   void setHelpText(const FXString& text){ help=text; }
00603 
00605   FXString getHelpText() const { return help; }
00606 
00608   void setTipText(const FXString& text){ tip=text; }
00609 
00611   FXString getTipText() const { return tip; }
00612 
00614   FXint getByte(FXint pos) const;
00615 
00617   FXwchar getChar(FXint pos) const;
00618 
00620   FXint getCharLen(FXint pos) const;
00621 
00623   FXint getStyle(FXint pos) const;
00624 
00626   void extractText(FXchar *text,FXint pos,FXint n) const;
00627   void extractText(FXString& text,FXint pos,FXint n) const;
00628 
00630   void extractStyle(FXString& text,FXint pos,FXint n) const;
00631   void extractStyle(FXchar *style,FXint pos,FXint n) const;
00632 
00634   virtual void replaceText(FXint pos,FXint m,const FXchar *text,FXint n,FXbool notify=FALSE);
00635   virtual void replaceText(FXint pos,FXint m,const FXString& text,FXbool notify=FALSE);
00636 
00638   virtual void replaceStyledText(FXint pos,FXint m,const FXchar *text,FXint n,FXint style=0,FXbool notify=FALSE);
00639   virtual void replaceStyledText(FXint pos,FXint m,const FXString& text,FXint style=0,FXbool notify=FALSE);
00640 
00642   virtual void appendText(const FXchar *text,FXint n,FXbool notify=FALSE);
00643   virtual void appendText(const FXString& text,FXbool notify=FALSE);
00644 
00646   virtual void appendStyledText(const FXchar *text,FXint n,FXint style=0,FXbool notify=FALSE);
00647   virtual void appendStyledText(const FXString& text,FXint style=0,FXbool notify=FALSE);
00648 
00650   virtual void insertText(FXint pos,const FXchar *text,FXint n,FXbool notify=FALSE);
00651   virtual void insertText(FXint pos,const FXString& text,FXbool notify=FALSE);
00652 
00654   virtual void insertStyledText(FXint pos,const FXchar *text,FXint n,FXint style=0,FXbool notify=FALSE);
00655   virtual void insertStyledText(FXint pos,const FXString& text,FXint style=0,FXbool notify=FALSE);
00656 
00658   virtual void removeText(FXint pos,FXint n,FXbool notify=FALSE);
00659 
00661   virtual void changeStyle(FXint pos,FXint n,FXint style);
00662 
00664   virtual void changeStyle(FXint pos,const FXchar* style,FXint n);
00665   virtual void changeStyle(FXint pos,const FXString& style);
00666 
00668   virtual void setText(const FXchar* text,FXint n,FXbool notify=FALSE);
00669   virtual void setText(const FXString& text,FXbool notify=FALSE);
00670 
00672   virtual void setStyledText(const FXchar* text,FXint n,FXint style=0,FXbool notify=FALSE);
00673   virtual void setStyledText(const FXString& text,FXint style=0,FXbool notify=FALSE);
00674 
00676   void getText(FXchar* text,FXint n) const;
00677   void getText(FXString& text) const;
00678 
00680   FXString getText() const;
00681 
00683   FXint getLength() const { return length; }
00684 
00686   FXint getNumRows() const { return nrows; }
00687   
00689   FXint shiftText(FXint start,FXint end,FXint amount,FXbool notify=FALSE);
00690 
00705   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);
00706 
00708   FXbool isPosSelected(FXint pos) const;
00709 
00711   FXbool isPosVisible(FXint pos) const;
00712 
00714   FXint getPosAt(FXint x,FXint y) const;
00715 
00717   FXint countRows(FXint start,FXint end) const;
00718 
00720   FXint countCols(FXint start,FXint end) const;
00721 
00723   FXint countLines(FXint start,FXint end) const;
00724 
00726   FXint lineStart(FXint pos) const;
00727 
00729   FXint lineEnd(FXint pos) const;
00730 
00732   FXint nextLine(FXint pos,FXint nl=1) const;
00733 
00735   FXint prevLine(FXint pos,FXint nl=1) const;
00736 
00738   FXint rowStart(FXint pos) const;
00739 
00741   FXint rowEnd(FXint pos) const;
00742 
00744   FXint nextRow(FXint pos,FXint nr=1) const;
00745 
00747   FXint prevRow(FXint pos,FXint nr=1) const;
00748 
00750   FXint leftWord(FXint pos) const;
00751 
00753   FXint rightWord(FXint pos) const;
00754 
00756   FXint wordStart(FXint pos) const;
00757 
00759   FXint wordEnd(FXint pos) const;
00760 
00762   FXint validPos(FXint pos) const;
00763 
00765   FXint dec(FXint pos) const;
00766 
00768   FXint inc(FXint pos) const;
00769 
00771   void setTopLine(FXint pos);
00772 
00774   FXint getTopLine() const;
00775 
00777   void setBottomLine(FXint pos);
00778 
00780   FXint getBottomLine() const;
00781 
00783   void setCenterLine(FXint pos);
00784 
00786   void setAnchorPos(FXint pos);
00787 
00789   FXint getAnchorPos() const { return anchorpos; }
00790 
00792   virtual void setCursorPos(FXint pos,FXbool notify=FALSE);
00793 
00795   void setCursorRow(FXint row,FXbool notify=FALSE);
00796 
00798   FXint getCursorRow() const { return cursorrow; }
00799 
00801   void setCursorColumn(FXint col,FXbool notify=FALSE);
00802 
00804   FXint getCursorColumn() const { return cursorcol; }
00805 
00807   FXint getCursorPos() const { return cursorpos; }
00808 
00810   FXint getSelStartPos() const { return selstartpos; }
00811 
00813   FXint getSelEndPos() const { return selendpos; }
00814 
00816   FXbool selectAll(FXbool notify=FALSE);
00817 
00819   virtual FXbool extendSelection(FXint pos,FXTextSelectionMode select=SELECT_CHARS,FXbool notify=FALSE);
00820 
00822   FXbool setSelection(FXint pos,FXint len,FXbool notify=FALSE);
00823 
00825   virtual FXbool killSelection(FXbool notify=FALSE);
00826 
00828   FXbool setHighlight(FXint start,FXint len);
00829 
00831   FXbool killHighlight();
00832 
00834   void makePositionVisible(FXint pos);
00835 
00837   void setTextStyle(FXuint style);
00838 
00840   FXuint getTextStyle() const;
00841 
00843   void setVisibleRows(FXint rows);
00844 
00846   FXint getVisibleRows() const { return vrows; }
00847 
00849   void setAutoVisibleRows(FXint rows);
00850 
00852   FXint getAutoVisibleRows() const { return autovrows; }
00853 
00855   void setVisibleColumns(FXint cols);
00856 
00858   FXint getVisibleColumns() const { return vcols; }
00859 
00864   void setHiliteMatchTime(FXuint t){ matchtime=t; }
00865 
00869   FXuint getHiliteMatchTime() const { return matchtime; }
00870 
00872   void setHiliteStyles(const FXHiliteStyle* styles);
00873 
00875   const FXHiliteStyle* getHiliteStyles() const { return hilitestyles; }
00876 
00878   virtual void save(FXStream& store) const;
00879 
00881   virtual void load(FXStream& store);
00882 
00884   virtual ~FXText();
00885   };
00886 
00887 
00888 }
00889 
00890 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:24 2009 for TnFOX by doxygen v1.4.7