FXTable.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                            T a b l e   W i d g e t                            *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1999,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: FXTable.h,v 1.166.2.1 2006/06/07 15:51:04 fox Exp $                          *
00023 ********************************************************************************/
00024 #ifndef FXTABLE_H
00025 #define FXTABLE_H
00026 
00027 #ifndef FXSCROLLAREA_H
00028 #include "FXScrollArea.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00034 class FXIcon;
00035 class FXFont;
00036 class FXTable;
00037 class FXHeader;
00038 class FXButton;
00039 
00040 
00042 enum { DEFAULT_MARGIN = 2 };
00043 
00044 
00045 
00047 enum {
00048   TABLE_COL_SIZABLE     = 0x00100000,   
00049   TABLE_ROW_SIZABLE     = 0x00200000,   
00050   TABLE_NO_COLSELECT    = 0x00400000,   
00051   TABLE_NO_ROWSELECT    = 0x00800000,   
00052   TABLE_READONLY        = 0x01000000,   
00053   TABLE_COL_RENUMBER    = 0x02000000,   
00054   TABLE_ROW_RENUMBER    = 0x04000000    
00055   };
00056 
00057 
00059 struct FXTablePos {
00060   FXint  row;
00061   FXint  col;
00062   };
00063 
00064 
00066 struct FXTableRange {
00067   FXTablePos fm;
00068   FXTablePos to;
00069   };
00070 
00071 
00073 class FXAPI FXTableItem : public FXObject {
00074   FXDECLARE(FXTableItem)
00075   friend class FXTable;
00076 protected:
00077   FXString    label;
00078   FXIcon     *icon;
00079   void       *data;
00080   FXuint      state;
00081 private:
00082   FXTableItem(const FXTableItem&);
00083   FXTableItem& operator=(const FXTableItem&);
00084 protected:
00085   FXTableItem():icon(NULL),data(NULL),state(0){}
00086   virtual void draw(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
00087   virtual void drawBorders(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
00088   virtual void drawContent(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
00089   virtual void drawPattern(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
00090   virtual void drawBackground(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
00091 public:
00092   enum{
00093     SELECTED   = 0x00000001,    
00094     FOCUS      = 0x00000002,    
00095     DISABLED   = 0x00000004,    
00096     DRAGGABLE  = 0x00000008,    
00097     RESERVED1  = 0x00000010,    
00098     RESERVED2  = 0x00000020,    
00099     ICONOWNED  = 0x00000040,    
00100     RIGHT      = 0x00002000,    
00101     LEFT       = 0x00004000,    
00102     CENTER_X   = 0,             
00103     TOP        = 0x00008000,    
00104     BOTTOM     = 0x00010000,    
00105     CENTER_Y   = 0,             
00106     BEFORE     = 0x00020000,    
00107     AFTER      = 0x00040000,    
00108     ABOVE      = 0x00080000,    
00109     BELOW      = 0x00100000,    
00110     LBORDER    = 0x00200000,    
00111     RBORDER    = 0x00400000,    
00112     TBORDER    = 0x00800000,    
00113     BBORDER    = 0x01000000     
00114     };
00115 public:
00116 
00118   FXTableItem(const FXString& text,FXIcon* ic=NULL,void* ptr=NULL):label(text),icon(ic),data(ptr),state(RIGHT|CENTER_Y){}
00119 
00121   virtual void setText(const FXString& txt);
00122 
00124   virtual FXString getText() const { return label; }
00125 
00127   virtual void setIcon(FXIcon* icn,FXbool owned=FALSE);
00128 
00130   virtual FXIcon* getIcon() const { return icon; }
00131 
00133   void setData(void* ptr){ data=ptr; }
00134 
00136   void* getData() const { return data; }
00137 
00139   virtual void setFocus(FXbool focus);
00140 
00142   FXbool hasFocus() const { return (state&FOCUS)!=0; }
00143 
00145   virtual void setSelected(FXbool selected);
00146 
00148   FXbool isSelected() const { return (state&SELECTED)!=0; }
00149 
00151   virtual void setEnabled(FXbool enabled);
00152 
00154   FXbool isEnabled() const { return (state&DISABLED)==0; }
00155 
00157   virtual void setDraggable(FXbool draggable);
00158 
00160   FXbool isDraggable() const { return (state&DRAGGABLE)!=0; }
00161 
00163   virtual void setJustify(FXuint justify=RIGHT|CENTER_Y);
00164 
00166   FXuint getJustify() const { return state&(RIGHT|LEFT|TOP|BOTTOM); }
00167 
00169   virtual void setIconPosition(FXuint mode);
00170 
00172   FXuint getIconPosition() const { return state&(BEFORE|AFTER|ABOVE|BELOW); }
00173 
00175   virtual void setBorders(FXuint borders=0);
00176 
00178   FXuint getBorders() const { return state&(LBORDER|RBORDER|TBORDER|BBORDER); }
00179 
00181   virtual void setStipple(FXStipplePattern pattern);
00182 
00184   FXStipplePattern getStipple() const;
00185 
00187   virtual FXWindow *getControlFor(FXTable* table);
00188 
00190   virtual void setFromControl(FXWindow *control);
00191 
00193   virtual FXint getWidth(const FXTable* table) const;
00194 
00196   virtual FXint getHeight(const FXTable* table) const;
00197 
00199   virtual void create();
00200 
00202   virtual void detach();
00203 
00205   virtual void destroy();
00206 
00208   virtual void save(FXStream& store) const;
00209 
00211   virtual void load(FXStream& store);
00212 
00214   virtual ~FXTableItem();
00215   };
00216 
00217 
00219 class FXAPI FXComboTableItem : public FXTableItem {
00220   FXDECLARE(FXComboTableItem)
00221 protected:
00222   FXString selections;
00223 private:
00224   FXComboTableItem(const FXComboTableItem&);
00225   FXComboTableItem& operator=(const FXComboTableItem&);
00226 protected:
00227   FXComboTableItem(){}
00228 public:
00229 
00231   FXComboTableItem(const FXString& text,FXIcon* ic=NULL,void* ptr=NULL);
00232 
00234   virtual FXWindow *getControlFor(FXTable* table);
00235 
00237   virtual void setFromControl(FXWindow *control);
00238 
00240   void setSelections(const FXString& strings);
00241 
00243   const FXString& getSelections() const { return selections; }
00244   };
00245 
00246 
00283 class FXAPI FXTable : public FXScrollArea {
00284   FXDECLARE(FXTable)
00285 protected:
00286   FXHeader     *colHeader;              // Column header
00287   FXHeader     *rowHeader;              // Row header
00288   FXButton     *cornerButton;           // Corner button
00289   FXTableItem **cells;                  // Cells
00290   FXWindow     *editor;                 // Editor widget
00291   FXFont       *font;                   // Font
00292   FXint         nrows;                  // Number of rows
00293   FXint         ncols;                  // Number of columns
00294   FXint         visiblerows;            // Visible rows
00295   FXint         visiblecols;            // Visible columns
00296   FXint         margintop;              // Margin top
00297   FXint         marginbottom;           // Margin bottom
00298   FXint         marginleft;             // Margin left
00299   FXint         marginright;            // Margin right
00300   FXColor       textColor;              // Normal text color
00301   FXColor       baseColor;              // Base color
00302   FXColor       hiliteColor;            // Highlight color
00303   FXColor       shadowColor;            // Shadow color
00304   FXColor       borderColor;            // Border color
00305   FXColor       selbackColor;           // Select background color
00306   FXColor       seltextColor;           // Select text color
00307   FXColor       gridColor;              // Grid line color
00308   FXColor       stippleColor;           // Stipple color
00309   FXColor       cellBorderColor;        // Cell border color
00310   FXint         cellBorderWidth;        // Cell border width
00311   FXColor       cellBackColor[2][2];    // Row/Column even/odd background color
00312   FXint         defColWidth;            // Default column width [if uniform columns]
00313   FXint         defRowHeight;           // Default row height [if uniform rows]
00314   FXTablePos    current;                // Current position
00315   FXTablePos    anchor;                 // Anchor position
00316   FXTableRange  input;                  // Input cell
00317   FXTableRange  selection;              // Range of selected cells
00318   FXString      clipped;                // Clipped text
00319   FXbool        hgrid;                  // Horizontal grid lines shown
00320   FXbool        vgrid;                  // Vertical grid lines shown
00321   FXuchar       mode;                   // Mode widget is in
00322   FXint         grabx;                  // Grab point x
00323   FXint         graby;                  // Grab point y
00324   FXint         rowcol;                 // Row or column being resized
00325   FXString      help;
00326 public:
00327   static FXDragType csvType;
00328   static const FXchar *csvTypeName;
00329 protected:
00330   FXTable();
00331   FXint startRow(FXint row,FXint col) const;
00332   FXint startCol(FXint row,FXint col) const;
00333   FXint endRow(FXint row,FXint col) const;
00334   FXint endCol(FXint row,FXint col) const;
00335   void spanningRange(FXint& sr,FXint& er,FXint& sc,FXint& ec,FXint anchrow,FXint anchcol,FXint currow,FXint curcol);
00336   virtual void moveContents(FXint x,FXint y);
00337   virtual void drawCell(FXDC& dc,FXint sr,FXint er,FXint sc,FXint ec);
00338   virtual void drawRange(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
00339   virtual void drawHGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
00340   virtual void drawVGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
00341   virtual void drawContents(FXDC& dc,FXint x,FXint y,FXint w,FXint h);
00342   virtual FXTableItem* createItem(const FXString& text,FXIcon* icon,void* ptr);
00343   virtual FXWindow *getControlForItem(FXint r,FXint c);
00344   virtual void setItemFromControl(FXint r,FXint c,FXWindow *control);
00345   virtual void updateColumnNumbers(FXint lo,FXint hi);
00346   virtual void updateRowNumbers(FXint lo,FXint hi);
00347 protected:
00348   enum {
00349     MOUSE_NONE,
00350     MOUSE_SCROLL,
00351     MOUSE_DRAG,
00352     MOUSE_SELECT
00353     };
00354 private:
00355   FXTable(const FXTable&);
00356   FXTable& operator=(const FXTable&);
00357 public:
00358   long onPaint(FXObject*,FXSelector,void*);
00359   long onFocusIn(FXObject*,FXSelector,void*);
00360   long onFocusOut(FXObject*,FXSelector,void*);
00361   long onMotion(FXObject*,FXSelector,void*);
00362   long onKeyPress(FXObject*,FXSelector,void*);
00363   long onKeyRelease(FXObject*,FXSelector,void*);
00364   long onLeftBtnPress(FXObject*,FXSelector,void*);
00365   long onLeftBtnRelease(FXObject*,FXSelector,void*);
00366   long onRightBtnPress(FXObject*,FXSelector,void*);
00367   long onRightBtnRelease(FXObject*,FXSelector,void*);
00368   long onUngrabbed(FXObject*,FXSelector,void*);
00369   long onSelectionLost(FXObject*,FXSelector,void*);
00370   long onSelectionGained(FXObject*,FXSelector,void*);
00371   long onSelectionRequest(FXObject*,FXSelector,void* ptr);
00372   long onClipboardLost(FXObject*,FXSelector,void*);
00373   long onClipboardGained(FXObject*,FXSelector,void*);
00374   long onClipboardRequest(FXObject*,FXSelector,void*);
00375   long onAutoScroll(FXObject*,FXSelector,void*);
00376   long onCommand(FXObject*,FXSelector,void*);
00377   long onClicked(FXObject*,FXSelector,void*);
00378   long onDoubleClicked(FXObject*,FXSelector,void*);
00379   long onTripleClicked(FXObject*,FXSelector,void*);
00380 
00381   long onCmdToggleEditable(FXObject*,FXSelector,void*);
00382   long onUpdToggleEditable(FXObject*,FXSelector,void*);
00383 
00384   // Visual characteristics
00385   long onCmdHorzGrid(FXObject*,FXSelector,void*);
00386   long onUpdHorzGrid(FXObject*,FXSelector,void*);
00387   long onCmdVertGrid(FXObject*,FXSelector,void*);
00388   long onUpdVertGrid(FXObject*,FXSelector,void*);
00389 
00390   // Row/Column manipulations
00391   long onCmdDeleteColumn(FXObject*,FXSelector,void*);
00392   long onUpdDeleteColumn(FXObject*,FXSelector,void*);
00393   long onCmdDeleteRow(FXObject*,FXSelector,void*);
00394   long onUpdDeleteRow(FXObject*,FXSelector,void*);
00395   long onCmdInsertColumn(FXObject*,FXSelector,void*);
00396   long onUpdInsertColumn(FXObject*,FXSelector,void*);
00397   long onCmdInsertRow(FXObject*,FXSelector,void*);
00398   long onUpdInsertRow(FXObject*,FXSelector,void*);
00399 
00400   // Movement
00401   long onCmdMoveRight(FXObject*,FXSelector,void*);
00402   long onCmdMoveLeft(FXObject*,FXSelector,void*);
00403   long onCmdMoveUp(FXObject*,FXSelector,void*);
00404   long onCmdMoveDown(FXObject*,FXSelector,void*);
00405   long onCmdMoveHome(FXObject*,FXSelector,void*);
00406   long onCmdMoveEnd(FXObject*,FXSelector,void*);
00407   long onCmdMoveTop(FXObject*,FXSelector,void*);
00408   long onCmdMoveBottom(FXObject*,FXSelector,void*);
00409   long onCmdMovePageDown(FXObject*,FXSelector,void*);
00410   long onCmdMovePageUp(FXObject*,FXSelector,void*);
00411 
00412   // Mark and extend
00413   long onCmdMark(FXObject*,FXSelector,void*);
00414   long onCmdExtend(FXObject*,FXSelector,void*);
00415 
00416   // Changing Selection
00417   long onUpdSelectCell(FXObject*,FXSelector,void*);
00418   long onCmdSelectCell(FXObject*,FXSelector,void*);
00419   long onUpdSelectRow(FXObject*,FXSelector,void*);
00420   long onCmdSelectRow(FXObject*,FXSelector,void*);
00421   long onUpdSelectColumn(FXObject*,FXSelector,void*);
00422   long onCmdSelectColumn(FXObject*,FXSelector,void*);
00423   long onCmdSelectRowIndex(FXObject*,FXSelector,void*);
00424   long onCmdSelectColumnIndex(FXObject*,FXSelector,void*);
00425   long onUpdSelectAll(FXObject*,FXSelector,void*);
00426   long onCmdSelectAll(FXObject*,FXSelector,void*);
00427   long onUpdDeselectAll(FXObject*,FXSelector,void*);
00428   long onCmdDeselectAll(FXObject*,FXSelector,void*);
00429 
00430   // Manipulation Selection
00431   long onCmdCutSel(FXObject*,FXSelector,void*);
00432   long onCmdCopySel(FXObject*,FXSelector,void*);
00433   long onCmdDeleteSel(FXObject*,FXSelector,void*);
00434   long onCmdPasteSel(FXObject*,FXSelector,void*);
00435   long onUpdHaveSelection(FXObject*,FXSelector,void*);
00436 
00437   // Edit control
00438   long onCmdStartInput(FXObject*,FXSelector,void*);
00439   long onUpdStartInput(FXObject*,FXSelector,void*);
00440   long onCmdAcceptInput(FXObject*,FXSelector,void*);
00441   long onUpdAcceptInput(FXObject*,FXSelector,void*);
00442   long onCmdCancelInput(FXObject*,FXSelector,void*);
00443 public:
00444 
00445   enum {
00446     ID_HORZ_GRID=FXScrollArea::ID_LAST,
00447     ID_VERT_GRID,
00448     ID_TOGGLE_EDITABLE,
00449     ID_DELETE_COLUMN,
00450     ID_DELETE_ROW,
00451     ID_INSERT_COLUMN,
00452     ID_INSERT_ROW,
00453     ID_SELECT_COLUMN_INDEX,
00454     ID_SELECT_ROW_INDEX,
00455     ID_SELECT_COLUMN,
00456     ID_SELECT_ROW,
00457     ID_SELECT_CELL,
00458     ID_SELECT_ALL,
00459     ID_DESELECT_ALL,
00460     ID_MOVE_LEFT,
00461     ID_MOVE_RIGHT,
00462     ID_MOVE_UP,
00463     ID_MOVE_DOWN,
00464     ID_MOVE_HOME,
00465     ID_MOVE_END,
00466     ID_MOVE_TOP,
00467     ID_MOVE_BOTTOM,
00468     ID_MOVE_PAGEDOWN,
00469     ID_MOVE_PAGEUP,
00470     ID_START_INPUT,
00471     ID_CANCEL_INPUT,
00472     ID_ACCEPT_INPUT,
00473     ID_MARK,
00474     ID_EXTEND,
00475     ID_CUT_SEL,
00476     ID_COPY_SEL,
00477     ID_PASTE_SEL,
00478     ID_DELETE_SEL,
00479     ID_LAST
00480     };
00481 
00482 public:
00483 
00489   FXTable(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=DEFAULT_MARGIN,FXint pr=DEFAULT_MARGIN,FXint pt=DEFAULT_MARGIN,FXint pb=DEFAULT_MARGIN);
00490 
00492   virtual FXint getDefaultWidth();
00493 
00495   virtual FXint getDefaultHeight();
00496 
00498   virtual FXint getContentWidth();
00499 
00501   virtual FXint getContentHeight();
00502 
00504   virtual void create();
00505 
00507   virtual void detach();
00508 
00510   virtual void layout();
00511 
00513   virtual void recalc();
00514 
00516   virtual bool canFocus() const;
00517 
00519   virtual void setFocus();
00520 
00522   virtual void killFocus();
00523 
00525   virtual void changeFocus(FXWindow *child);
00526 
00528   FXButton* getCornerButton() const { return cornerButton; }
00529 
00531   FXHeader* getColumnHeader() const { return colHeader; }
00532 
00534   FXHeader* getRowHeader() const { return rowHeader; }
00535 
00537   void setVisibleRows(FXint nvrows);
00538 
00540   FXint getVisibleRows() const { return visiblerows; }
00541 
00543   void setVisibleColumns(FXint nvcols);
00544 
00546   FXint getVisibleColumns() const { return visiblecols; }
00547 
00549   FXbool isEditable() const;
00550 
00552   void setEditable(FXbool edit=TRUE);
00553 
00555   void showHorzGrid(FXbool on=TRUE);
00556 
00558   FXbool isHorzGridShown() const { return hgrid; }
00559 
00561   void showVertGrid(FXbool on=TRUE);
00562 
00564   FXbool isVertGridShown() const { return vgrid; }
00565 
00567   FXint getNumRows() const { return nrows; }
00568 
00570   FXint getNumColumns() const { return ncols; }
00571 
00573   void setMarginTop(FXint pt);
00574 
00576   FXint getMarginTop() const { return margintop; }
00577 
00579   void setMarginBottom(FXint pb);
00580 
00582   FXint getMarginBottom() const { return marginbottom; }
00583 
00585   void setMarginLeft(FXint pl);
00586 
00588   FXint getMarginLeft() const { return marginleft; }
00589 
00591   void setMarginRight(FXint pr);
00592 
00594   FXint getMarginRight() const { return marginright; }
00595 
00603   virtual void startInput(FXint row,FXint col);
00604 
00610   virtual void cancelInput();
00611 
00620   virtual void acceptInput(FXbool notify=FALSE);
00621 
00627   FXint colAtX(FXint x) const;
00628 
00634   FXint rowAtY(FXint y) const;
00635 
00637   FXTableItem *getItem(FXint row,FXint col) const;
00638 
00640   void setItem(FXint row,FXint col,FXTableItem* item,FXbool notify=FALSE);
00641 
00643   virtual void setTableSize(FXint nr,FXint nc,FXbool notify=FALSE);
00644 
00646   virtual void insertRows(FXint row,FXint nr=1,FXbool notify=FALSE);
00647 
00649   virtual void insertColumns(FXint col,FXint nc=1,FXbool notify=FALSE);
00650 
00652   virtual void removeRows(FXint row,FXint nr=1,FXbool notify=FALSE);
00653 
00655   virtual void removeColumns(FXint col,FXint nc=1,FXbool notify=FALSE);
00656 
00658   virtual FXTableItem* extractItem(FXint row,FXint col,FXbool notify=FALSE);
00659 
00661   virtual void removeItem(FXint row,FXint col,FXbool notify=FALSE);
00662 
00664   virtual void removeRange(FXint startrow,FXint endrow,FXint startcol,FXint endcol,FXbool notify=FALSE);
00665 
00667   virtual void clearItems(FXbool notify=FALSE);
00668 
00670   virtual void makePositionVisible(FXint r,FXint c);
00671 
00673   FXbool isItemVisible(FXint r,FXint c) const;
00674 
00681   void setColumnHeaderMode(FXuint hint=LAYOUT_FIX_HEIGHT);
00682 
00684   FXuint getColumnHeaderMode() const;
00685 
00692   void setRowHeaderMode(FXuint hint=LAYOUT_FIX_WIDTH);
00693 
00695   FXuint getRowHeaderMode() const;
00696 
00698   void setColumnHeaderFont(FXFont* fnt);
00699 
00701   FXFont* getColumnHeaderFont() const;
00702 
00704   void setRowHeaderFont(FXFont* fnt);
00705 
00707   FXFont* getRowHeaderFont() const;
00708 
00710   void setColumnHeaderHeight(FXint h);
00711 
00713   FXint getColumnHeaderHeight() const;
00714 
00716   void setRowHeaderWidth(FXint w);
00717 
00719   FXint getRowHeaderWidth() const;
00720 
00722   FXint getColumnX(FXint col) const;
00723 
00725   FXint getRowY(FXint row) const;
00726 
00728   virtual void setColumnWidth(FXint col,FXint cwidth);
00729 
00731   FXint getColumnWidth(FXint col) const;
00732 
00734   virtual void setRowHeight(FXint row,FXint rheight);
00735 
00737   FXint getRowHeight(FXint row) const;
00738 
00740   void setDefColumnWidth(FXint cwidth);
00741 
00743   FXint getDefColumnWidth() const { return defColWidth; }
00744 
00746   void setDefRowHeight(FXint rheight);
00747 
00749   FXint getDefRowHeight() const { return defRowHeight; }
00750 
00752   FXint getMinRowHeight(FXint r) const;
00753 
00755   FXint getMinColumnWidth(FXint c) const;
00756 
00758   void fitRowsToContents(FXint row,FXint nr=1);
00759 
00761   void fitColumnsToContents(FXint col,FXint nc=1);
00762 
00764   void setColumnText(FXint index,const FXString& text);
00765 
00767   FXString getColumnText(FXint index) const;
00768 
00770   void setRowText(FXint index,const FXString& text);
00771 
00773   FXString getRowText(FXint index) const;
00774 
00776   void setColumnIcon(FXint index,FXIcon* icon);
00777 
00779   FXIcon* getColumnIcon(FXint index) const;
00780 
00782   void setRowIcon(FXint index,FXIcon* icon);
00783 
00785   FXIcon* getRowIcon(FXint index) const;
00786 
00788   void setColumnIconPosition(FXint index,FXuint mode);
00789 
00791   FXuint getColumnIconPosition(FXint index) const;
00792 
00794   void setRowIconPosition(FXint index,FXuint mode);
00795 
00797   FXuint getRowIconPosition(FXint index) const;
00798 
00800   void setColumnJustify(FXint index,FXuint justify);
00801 
00803   FXuint getColumnJustify(FXint index) const;
00804 
00806   void setRowJustify(FXint index,FXuint justify);
00807 
00809   FXuint getRowJustify(FXint index) const;
00810 
00812   void setItemText(FXint r,FXint c,const FXString& text,FXbool notify=FALSE);
00813 
00815   FXString getItemText(FXint r,FXint c) const;
00816 
00818   void setItemIcon(FXint r,FXint c,FXIcon* icon,FXbool owned=FALSE,FXbool notify=FALSE);
00819 
00821   FXIcon* getItemIcon(FXint r,FXint c) const;
00822 
00824   void setItemData(FXint r,FXint c,void* ptr);
00825   void* getItemData(FXint r,FXint c) const;
00826 
00831   void extractText(FXchar*& text,FXint& size,FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXchar* cs="\t",const FXchar* rs="\n") const;
00832   void extractText(FXString& text,FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXchar* cs="\t",const FXchar* rs="\n") const;
00833 
00840   void overlayText(FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXchar* text,FXint size,const FXchar* cs="\t,",const FXchar* rs="\n",FXbool notify=FALSE);
00841   void overlayText(FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXString& text,const FXchar* cs="\t,",const FXchar* rs="\n",FXbool notify=FALSE);
00842 
00848   void countText(FXint& nr,FXint& nc,const FXchar* text,FXint size,const FXchar* cs="\t,",const FXchar* rs="\n") const;
00849   void countText(FXint& nr,FXint& nc,const FXString& text,const FXchar* cs="\t,",const FXchar* rs="\n") const;
00850 
00852   FXbool isItemSpanning(FXint r,FXint c) const;
00853 
00855   void updateRange(FXint sr,FXint er,FXint sc,FXint ec) const;
00856 
00858   void updateItem(FXint r,FXint c) const;
00859 
00861   virtual FXbool enableItem(FXint r,FXint c);
00862 
00864   virtual FXbool disableItem(FXint r,FXint c);
00865 
00867   FXbool isItemEnabled(FXint r,FXint c) const;
00868 
00876   void setItemJustify(FXint r,FXint c,FXuint justify);
00877 
00879   FXuint getItemJustify(FXint r,FXint c) const;
00880 
00888   void setItemIconPosition(FXint r,FXint c,FXuint mode);
00889 
00891   FXuint getItemIconPosition(FXint r,FXint c) const;
00892 
00898   void setItemBorders(FXint r,FXint c,FXuint borders);
00899 
00901   FXuint getItemBorders(FXint r,FXint c) const;
00902 
00904   void setItemStipple(FXint r,FXint c,FXStipplePattern pat);
00905 
00907   FXStipplePattern getItemStipple(FXint r,FXint c) const;
00908 
00910   virtual void setCurrentItem(FXint r,FXint c,FXbool notify=FALSE);
00911 
00913   FXint getCurrentRow() const { return current.row; }
00914 
00916   FXint getCurrentColumn() const { return current.col; }
00917 
00919   FXbool isItemCurrent(FXint r,FXint c) const;
00920 
00922   void setAnchorItem(FXint r,FXint c);
00923 
00925   FXint getAnchorRow() const { return anchor.row; }
00926 
00928   FXint getAnchorColumn() const { return anchor.col; }
00929 
00931   FXint getSelStartRow() const { return selection.fm.row; }
00932 
00934   FXint getSelStartColumn() const { return selection.fm.col; }
00935 
00937   FXint getSelEndRow() const { return selection.to.row; }
00938 
00940   FXint getSelEndColumn() const { return selection.to.col; }
00941 
00943   FXbool isItemSelected(FXint r,FXint c) const;
00944 
00946   FXbool isRowSelected(FXint r) const;
00947 
00949   FXbool isColumnSelected(FXint c) const;
00950 
00952   FXbool isAnythingSelected() const;
00953 
00955   virtual FXbool selectRow(FXint row,FXbool notify=FALSE);
00956 
00958   virtual FXbool selectColumn(FXint col,FXbool notify=FALSE);
00959 
00961   virtual FXbool selectRange(FXint startrow,FXint endrow,FXint startcol,FXint endcol,FXbool notify=FALSE);
00962 
00964   virtual FXbool extendSelection(FXint r,FXint c,FXbool notify=FALSE);
00965 
00967   virtual FXbool killSelection(FXbool notify=FALSE);
00968 
00970   void setFont(FXFont* fnt);
00971 
00973   FXFont* getFont() const { return font; }
00974 
00976   FXColor getTextColor() const { return textColor; }
00977   FXColor getBaseColor() const { return baseColor; }
00978   FXColor getHiliteColor() const { return hiliteColor; }
00979   FXColor getShadowColor() const { return shadowColor; }
00980   FXColor getBorderColor() const { return borderColor; }
00981   FXColor getSelBackColor() const { return selbackColor; }
00982   FXColor getSelTextColor() const { return seltextColor; }
00983   FXColor getGridColor() const { return gridColor; }
00984   FXColor getStippleColor() const { return stippleColor; }
00985   FXColor getCellBorderColor() const { return cellBorderColor; }
00986 
00988   void setTextColor(FXColor clr);
00989   void setBaseColor(FXColor clr);
00990   void setHiliteColor(FXColor clr);
00991   void setShadowColor(FXColor clr);
00992   void setBorderColor(FXColor clr);
00993   void setSelBackColor(FXColor clr);
00994   void setSelTextColor(FXColor clr);
00995   void setGridColor(FXColor clr);
00996   void setStippleColor(FXColor clr);
00997   void setCellBorderColor(FXColor clr);
00998 
01000   void setCellColor(FXint r,FXint c,FXColor clr);
01001 
01003   FXColor getCellColor(FXint r,FXint c) const;
01004 
01006   void setCellBorderWidth(FXint borderwidth);
01007 
01009   FXint getCellBorderWidth() const { return cellBorderWidth; }
01010 
01012   void setTableStyle(FXuint style);
01013 
01015   FXuint getTableStyle() const;
01016 
01018   void setColumnRenumbering(FXbool flag);
01019 
01021   FXbool getColumnRenumbering() const;
01022 
01024   void setRowRenumbering(FXbool flag);
01025 
01027   FXbool getRowRenumbering() const;
01028 
01030   void setHelpText(const FXString& text){ help=text; }
01031   const FXString& getHelpText() const { return help; }
01032 
01034   virtual void save(FXStream& store) const;
01035   virtual void load(FXStream& store);
01036 
01037   virtual ~FXTable();
01038   };
01039 
01040 }
01041 
01042 #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