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

FXTable.h

00001 /********************************************************************************
00002 *                                                                               *
00003 *                            T a b l e   W i d g e t                            *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1999,2004 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.120 2004/02/08 16:33:17 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 //////////////////////////////  UNDER DEVELOPMENT  //////////////////////////////
00035 
00036 class FXIcon;
00037 class FXFont;
00038 class FXTable;
00039 class FXHeader;
00040 class FXButton;
00041 
00042 
00043 /// Default cell margin
00044 enum { DEFAULT_MARGIN = 2 };
00045 
00046 
00047 
00048 /// Table options
00049 enum {
00050   TABLE_COL_SIZABLE     = 0x00100000,   /// Columns are resizable
00051   TABLE_ROW_SIZABLE     = 0x00200000,   /// Rows are resizable
00052   TABLE_HEADERS_SIZABLE = 0x00400000,   /// Headers are sizable
00053   TABLE_NO_COLSELECT    = 0x00900000,   /// Disallow column selections
00054   TABLE_NO_ROWSELECT    = 0x01000000    /// Disallow row selections
00055   };
00056 
00057 
00058 /// Position in table
00059 struct FXTablePos {
00060   FXint  row;
00061   FXint  col;
00062   };
00063 
00064 
00065 /// Range of table cells
00066 struct FXTableRange {
00067   FXTablePos fm;
00068   FXTablePos to;
00069   };
00070 
00071 
00072 /// Item in table
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 protected:
00082   FXTableItem():icon(NULL),data(NULL),state(0){}
00083   FXint textWidth(const FXTable* table) const;
00084   FXint textHeight(const FXTable* table) const;
00085   virtual void draw(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
00086   virtual void drawBorders(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
00087   virtual void drawContent(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
00088   virtual void drawPattern(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
00089   virtual void drawBackground(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
00090 protected:
00091   enum{
00092     SELECTED   = 0x00000001,
00093     FOCUS      = 0x00000002,
00094     DISABLED   = 0x00000004,
00095     DRAGGABLE  = 0x00000008,
00096     RESERVED1  = 0x00000010,
00097     RESERVED2  = 0x00000020,
00098     ICONOWNED  = 0x00000040
00099     };
00100 public:
00101   enum{
00102     RIGHT      = 0x00002000,      /// Align on right
00103     LEFT       = 0x00004000,      /// Align on left
00104     CENTER_X   = 0,               /// Aling centered horizontally (default)
00105     TOP        = 0x00008000,      /// Align on top
00106     BOTTOM     = 0x00010000,      /// Align on bottom
00107     CENTER_Y   = 0,               /// Aling centered vertically (default)
00108     BEFORE     = 0x00020000,      /// Icon before the text
00109     AFTER      = 0x00040000,      /// Icon after the text
00110     ABOVE      = 0x00080000,      /// Icon above the text
00111     BELOW      = 0x00100000,      /// Icon below the text
00112     LBORDER    = 0x00200000,      /// Draw left border
00113     RBORDER    = 0x00400000,      /// Draw right border
00114     TBORDER    = 0x00800000,      /// Draw top border
00115     BBORDER    = 0x01000000       /// Draw bottom border
00116     };
00117 public:
00118   FXTableItem(const FXString& text,FXIcon* ic=NULL,void* ptr=NULL):label(text),icon(ic),data(ptr),state(FXTableItem::RIGHT){}
00119   virtual void setText(const FXString& txt){ label=txt; }
00120   const FXString& getText() const { return label; }
00121   virtual void setIcon(FXIcon* icn){ icon=icn; }
00122   FXIcon* getIcon() const { return icon; }
00123   void setData(void* ptr){ data=ptr; }
00124   void* getData() const { return data; }
00125   virtual void setFocus(FXbool focus);
00126   FXbool hasFocus() const { return (state&FOCUS)!=0; }
00127   virtual void setSelected(FXbool selected);
00128   FXbool isSelected() const { return (state&SELECTED)!=0; }
00129   virtual void setEnabled(FXbool enabled);
00130   FXbool isEnabled() const { return (state&DISABLED)==0; }
00131   virtual void setDraggable(FXbool draggable);
00132   FXbool isDraggable() const { return (state&DRAGGABLE)!=0; }
00133   void setJustify(FXuint justify);
00134   FXuint getJustify() const { return state&(RIGHT|LEFT|TOP|BOTTOM); }
00135   void setIconPosition(FXuint mode);
00136   FXuint getIconPosition() const { return state&(BEFORE|AFTER|ABOVE|BELOW); }
00137   void setBorders(FXuint borders);
00138   FXuint getBorders() const { return state&(LBORDER|RBORDER|TBORDER|BBORDER); }
00139   void setStipple(FXStipplePattern pattern);
00140   FXStipplePattern getStipple() const;
00141   virtual void setIconOwned(FXuint owned=ICONOWNED);
00142   FXuint isIconOwned() const { return (state&ICONOWNED); }
00143   virtual FXint getWidth(const FXTable* table) const;
00144   virtual FXint getHeight(const FXTable* table) const;
00145   virtual void create();
00146   virtual void detach();
00147   virtual void destroy();
00148   virtual void save(FXStream& store) const;
00149   virtual void load(FXStream& store);
00150   virtual ~FXTableItem();
00151   };
00152 
00153 
00154 
00155 /// Table Widget
00156 class FXAPI FXTable : public FXScrollArea {
00157   FXDECLARE(FXTable)
00158 protected:
00159   FXHeader     *colHeader;              // Column header
00160   FXHeader     *rowHeader;              // Row header
00161   FXButton     *cornerButton;           // Corner button
00162   FXTableItem **cells;                  // Cells
00163   FXFont       *font;                   // Font
00164   FXint         nrows;                  // Logically allocated rows
00165   FXint         ncols;                  // Logically allocated columns
00166   FXint         visiblerows;            // Visible rows
00167   FXint         visiblecols;            // Visible columns
00168   FXint         margintop;              // Margin top
00169   FXint         marginbottom;           // Margin bottom
00170   FXint         marginleft;             // Margin left
00171   FXint         marginright;            // Margin right
00172   FXColor       textColor;              // Normal text color
00173   FXColor       baseColor;              // Base color
00174   FXColor       hiliteColor;            // Highlight color
00175   FXColor       shadowColor;            // Shadow color
00176   FXColor       borderColor;            // Border color
00177   FXColor       selbackColor;           // Select background color
00178   FXColor       seltextColor;           // Select text color
00179   FXColor       gridColor;              // Grid line color
00180   FXColor       stippleColor;           // Stipple color
00181   FXColor       cellBorderColor;        // Cell border color
00182   FXint         cellBorderWidth;        // Cell border width
00183   FXColor       cellBackColor[2][2];    // Row/Column even/odd background color
00184   FXint         defColWidth;            // Default column width [if uniform columns]
00185   FXint         defRowHeight;           // Default row height [if uniform rows]
00186   FXTablePos    current;                // Current position
00187   FXTablePos    anchor;                 // Anchor position
00188   FXTableRange  selection;              // Range of selected cells
00189   FXint         cellcursor;             // Cursor position in cell
00190   FXint         cellanchor;             // Anchor position in cell
00191   FXint         cellscroll;             // Scolled amount in cell
00192   FXbool        hgrid;                  // Horizontal grid lines shown
00193   FXbool        vgrid;                  // Vertical grid lines shown
00194   FXuchar       mode;                   // Mode widget is in
00195   FXint         grabx;                  // Grab point x
00196   FXint         graby;                  // Grab point y
00197   FXint         rowcol;                 // Row or column being resized
00198   FXString      help;
00199 public:
00200   static FXDragType csvType;
00201   static const FXchar csvTypeName[];
00202 protected:
00203   FXTable();
00204   FXint startRow(FXint row,FXint col) const;
00205   FXint startCol(FXint row,FXint col) const;
00206   FXint endRow(FXint row,FXint col) const;
00207   FXint endCol(FXint row,FXint col) const;
00208   void findExtent(FXint& sr,FXint& er,FXint& sc,FXint& ec,FXint anchrow,FXint anchcol,FXint currow,FXint curcol);
00209   void drawCursor(FXuint state);
00210   virtual void moveContents(FXint x,FXint y);
00211   virtual void drawCell(FXDC& dc,FXint sr,FXint er,FXint sc,FXint ec);
00212   virtual void drawRange(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
00213   virtual void drawHGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
00214   virtual void drawVGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
00215   virtual void drawContents(FXDC& dc,FXint x,FXint y,FXint w,FXint h);
00216   virtual FXTableItem* createItem(const FXString& text,FXIcon* icon,void* ptr);
00217 protected:
00218   enum {
00219     MOUSE_NONE,
00220     MOUSE_SCROLL,
00221     MOUSE_DRAG,
00222     MOUSE_SELECT,
00223     MOUSE_COL_SIZE,
00224     MOUSE_ROW_SIZE
00225     };
00226 private:
00227   FXTable(const FXTable&);
00228   FXTable& operator=(const FXTable&);
00229 public:
00230   long onPaint(FXObject*,FXSelector,void*);
00231   long onFocusIn(FXObject*,FXSelector,void*);
00232   long onFocusOut(FXObject*,FXSelector,void*);
00233   long onMotion(FXObject*,FXSelector,void*);
00234   long onKeyPress(FXObject*,FXSelector,void*);
00235   long onKeyRelease(FXObject*,FXSelector,void*);
00236   long onLeftBtnPress(FXObject*,FXSelector,void*);
00237   long onLeftBtnRelease(FXObject*,FXSelector,void*);
00238   long onRightBtnPress(FXObject*,FXSelector,void*);
00239   long onRightBtnRelease(FXObject*,FXSelector,void*);
00240   long onUngrabbed(FXObject*,FXSelector,void*);
00241   long onBlink(FXObject*,FXSelector,void*);
00242   long onSelectionLost(FXObject*,FXSelector,void*);
00243   long onSelectionGained(FXObject*,FXSelector,void*);
00244   long onSelectionRequest(FXObject*,FXSelector,void* ptr);
00245   long onClipboardLost(FXObject*,FXSelector,void*);
00246   long onClipboardGained(FXObject*,FXSelector,void*);
00247   long onClipboardRequest(FXObject*,FXSelector,void*);
00248   long onAutoScroll(FXObject*,FXSelector,void*);
00249   long onCommand(FXObject*,FXSelector,void*);
00250   long onClicked(FXObject*,FXSelector,void*);
00251   long onDoubleClicked(FXObject*,FXSelector,void*);
00252   long onTripleClicked(FXObject*,FXSelector,void*);
00253 
00254   // Visual characteristics
00255   long onCmdHorzGrid(FXObject*,FXSelector,void*);
00256   long onUpdHorzGrid(FXObject*,FXSelector,void*);
00257   long onCmdVertGrid(FXObject*,FXSelector,void*);
00258   long onUpdVertGrid(FXObject*,FXSelector,void*);
00259 
00260   // Row/Column manipulations
00261   long onCmdDeleteColumn(FXObject*,FXSelector,void*);
00262   long onUpdDeleteColumn(FXObject*,FXSelector,void*);
00263   long onCmdDeleteRow(FXObject*,FXSelector,void*);
00264   long onUpdDeleteRow(FXObject*,FXSelector,void*);
00265   long onCmdInsertColumn(FXObject*,FXSelector,void*);
00266   long onCmdInsertRow(FXObject*,FXSelector,void*);
00267 
00268   // Movement
00269   long onCmdMoveRight(FXObject*,FXSelector,void*);
00270   long onCmdMoveLeft(FXObject*,FXSelector,void*);
00271   long onCmdMoveUp(FXObject*,FXSelector,void*);
00272   long onCmdMoveDown(FXObject*,FXSelector,void*);
00273   long onCmdMoveHome(FXObject*,FXSelector,void*);
00274   long onCmdMoveEnd(FXObject*,FXSelector,void*);
00275   long onCmdMoveTop(FXObject*,FXSelector,void*);
00276   long onCmdMoveBottom(FXObject*,FXSelector,void*);
00277   long onCmdMovePageDown(FXObject*,FXSelector,void*);
00278   long onCmdMovePageUp(FXObject*,FXSelector,void*);
00279 
00280   // Mark and extend
00281   long onCmdMark(FXObject*,FXSelector,void*);
00282   long onCmdExtend(FXObject*,FXSelector,void*);
00283 
00284   // Changing Selection
00285   long onCmdSelectCell(FXObject*,FXSelector,void*);
00286   long onCmdSelectRow(FXObject*,FXSelector,void*);
00287   long onCmdSelectColumn(FXObject*,FXSelector,void*);
00288   long onCmdSelectRowIndex(FXObject*,FXSelector,void*);
00289   long onCmdSelectColumnIndex(FXObject*,FXSelector,void*);
00290   long onCmdSelectAll(FXObject*,FXSelector,void*);
00291   long onCmdDeselectAll(FXObject*,FXSelector,void*);
00292 
00293 public:
00294 
00295   enum {
00296     ID_HORZ_GRID=FXScrollArea::ID_LAST,
00297     ID_VERT_GRID,
00298     ID_DELETE_COLUMN,
00299     ID_DELETE_ROW,
00300     ID_INSERT_COLUMN,
00301     ID_INSERT_ROW,
00302     ID_SELECT_COLUMN_INDEX,
00303     ID_SELECT_ROW_INDEX,
00304     ID_SELECT_COLUMN,
00305     ID_SELECT_ROW,
00306     ID_SELECT_CELL,
00307     ID_SELECT_ALL,
00308     ID_DESELECT_ALL,
00309     ID_MOVE_LEFT,
00310     ID_MOVE_RIGHT,
00311     ID_MOVE_UP,
00312     ID_MOVE_DOWN,
00313     ID_MOVE_HOME,
00314     ID_MOVE_END,
00315     ID_MOVE_TOP,
00316     ID_MOVE_BOTTOM,
00317     ID_MOVE_PAGEDOWN,
00318     ID_MOVE_PAGEUP,
00319     ID_MARK,
00320     ID_EXTEND,
00321     ID_CUT_SEL,
00322     ID_COPY_SEL,
00323     ID_PASTE_SEL,
00324     ID_BLINK,
00325     ID_LAST
00326     };
00327 
00328 public:
00329 
00330   /**
00331   * Construct a new table.
00332   * The table is initially empty, and reports a default size based on
00333   * the scroll areas's scrollbar placement policy.
00334   */
00335   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);
00336 
00337   /// Create the server-side resources
00338   virtual void create();
00339 
00340   /// Detach the server-side resources
00341   virtual void detach();
00342 
00343   /// Perform layout
00344   virtual void layout();
00345 
00346   /// Mark this window's layout as dirty
00347   virtual void recalc();
00348 
00349   /// Table widget can receive focus
00350   virtual FXbool canFocus() const;
00351 
00352   /// Move the focus to this window
00353   virtual void setFocus();
00354 
00355   /// Remove the focus from this window
00356   virtual void killFocus();
00357 
00358   /// Return column header control
00359   FXHeader* getColumnHeader() const { return colHeader; }
00360 
00361   /// Return row header control
00362   FXHeader* getRowHeader() const { return rowHeader; }
00363 
00364   /// Change visible rows/columns
00365   void setVisibleRows(FXint nvrows);
00366   FXint getVisibleRows() const { return visiblerows; }
00367   void setVisibleColumns(FXint nvcols);
00368   FXint getVisibleColumns() const { return visiblecols; }
00369 
00370   /// Show or hide horizontal grid
00371   void showHorzGrid(FXbool on=TRUE);
00372 
00373   /// Is horizontal grid shown
00374   FXbool isHorzGridShown() const { return hgrid; }
00375 
00376   /// Show or hide vertical grid
00377   void showVertGrid(FXbool on=TRUE);
00378 
00379   /// Is vertical grid shown
00380   FXbool isVertGridShown() const { return vgrid; }
00381 
00382   /// Return default width
00383   virtual FXint getDefaultWidth();
00384 
00385   /// Return default height
00386   virtual FXint getDefaultHeight();
00387 
00388   /// Compute content size
00389   virtual FXint getContentWidth();
00390   virtual FXint getContentHeight();
00391 
00392   /// Set the table size to nr rows and nc columns; all existing items will be removed
00393   virtual void setTableSize(FXint nr,FXint nc,FXbool notify=FALSE);
00394 
00395   /// Get number of rows
00396   FXint getNumRows() const { return nrows; }
00397 
00398   /// Get number of columns
00399   FXint getNumColumns() const { return ncols; }
00400 
00401   /// Change top cell margin
00402   void setMarginTop(FXint pt);
00403 
00404   /// Return top cell margin
00405   FXint getMarginTop() const { return margintop; }
00406 
00407   /// Change bottom cell margin
00408   void setMarginBottom(FXint pb);
00409 
00410   /// Return bottom cell margin
00411   FXint getMarginBottom() const { return marginbottom; }
00412 
00413   /// Change left cell margin
00414   void setMarginLeft(FXint pl);
00415 
00416   /// Return left cell margin
00417   FXint getMarginLeft() const { return marginleft; }
00418 
00419   /// Change right cell margin
00420   void setMarginRight(FXint pr);
00421 
00422   /// Return right cell margin
00423   FXint getMarginRight() const { return marginright; }
00424 
00425   /// Change table style
00426   FXuint getTableStyle() const;
00427   void setTableStyle(FXuint style);
00428 
00429   /**
00430   * Determine row containing y.
00431   * Returns -1 if y above first row, and nrows if y below last row;
00432   * otherwise, returns row in table containing y.
00433   */
00434   FXint rowAtY(FXint y) const;
00435 
00436   /**
00437   * Determine column containing x.
00438   * Returns -1 if x left of first column, and ncols if x right of last column;
00439   * otherwise, returns columns in table containing x.
00440   */
00441   FXint colAtX(FXint x) const;
00442 
00443   /// Return the item at the given index
00444   FXTableItem *getItem(FXint row,FXint col) const;
00445 
00446   /// Replace the item with a [possibly subclassed] item
00447   void setItem(FXint row,FXint col,FXTableItem* item,FXbool notify=FALSE);
00448 
00449   /// Insert new row
00450   virtual void insertRows(FXint row,FXint nr=1,FXbool notify=FALSE);
00451 
00452   /// Insert new column
00453   virtual void insertColumns(FXint col,FXint nc=1,FXbool notify=FALSE);
00454 
00455   /// Remove rows of cells
00456   virtual void removeRows(FXint row,FXint nr=1,FXbool notify=FALSE);
00457 
00458   /// Remove column of cells
00459   virtual void removeColumns(FXint col,FXint nc=1,FXbool notify=FALSE);
00460 
00461   /// Remove single cell
00462   virtual void removeItem(FXint row,FXint col,FXbool notify=FALSE);
00463 
00464   /// Remove all items from table
00465   virtual void clearItems(FXbool notify=FALSE);
00466 
00467   /// Scroll to make cell at r,c fully visible
00468   void makePositionVisible(FXint r,FXint c);
00469 
00470   /// Change column width
00471   virtual void setColumnWidth(FXint col,FXint cwidth);
00472   FXint getColumnWidth(FXint col) const;
00473 
00474   /// Change row height
00475   virtual void setRowHeight(FXint row,FXint rheight);
00476   FXint getRowHeight(FXint row) const;
00477 
00478   /// Change X coordinate of column c
00479   virtual void setColumnX(FXint col,FXint x);
00480   FXint getColumnX(FXint col) const;
00481 
00482   /// Change Y coordinate of row r
00483   virtual void setRowY(FXint row,FXint y);
00484   FXint getRowY(FXint row) const;
00485 
00486   /// Change default column width
00487   void setDefColumnWidth(FXint cwidth);
00488   FXint getDefColumnWidth() const { return defColWidth; }
00489 
00490   /// Change default row height
00491   void setDefRowHeight(FXint rheight);
00492   FXint getDefRowHeight() const { return defRowHeight; }
00493 
00494   /// Return minimum row height
00495   FXint getMinRowHeight(FXint r) const;
00496 
00497   /// Return minimum column width
00498   FXint getMinColumnWidth(FXint c) const;
00499 
00500   /// Change column header
00501   void setColumnText(FXint index,const FXString& text);
00502 
00503   /// Return text of column header at index
00504   FXString getColumnText(FXint index) const;
00505 
00506   /// Change row header
00507   void setRowText(FXint index,const FXString& text);
00508 
00509   /// Return text of row header at index
00510   FXString getRowText(FXint index) const;
00511 
00512   /// Modify cell text
00513   void setItemText(FXint r,FXint c,const FXString& text);
00514   FXString getItemText(FXint r,FXint c) const;
00515 
00516   /// Modify cell icon
00517   void setItemIcon(FXint r,FXint c,FXIcon* icon);
00518   FXIcon* getItemIcon(FXint r,FXint c) const;
00519 
00520   /// Modify cell user-data
00521   void setItemData(FXint r,FXint c,void* ptr);
00522   void* getItemData(FXint r,FXint c) const;
00523 
00524   /// Is cell selected, current, visible, enabled
00525   FXbool isItemSelected(FXint r,FXint c) const;
00526   FXbool isItemCurrent(FXint r,FXint c) const;
00527   FXbool isItemVisible(FXint r,FXint c) const;
00528   FXbool isItemEnabled(FXint r,FXint c) const;
00529 
00530   /// Return TRUE if its a spanning cell
00531   FXbool isItemSpanning(FXint r,FXint c) const;
00532 
00533   /// Repaint cells between grid lines sr,er and grid lines sc,ec
00534   void updateRange(FXint sr,FXint er,FXint sc,FXint ec) const;
00535 
00536   /// Repaint cell at r,c
00537   void updateItem(FXint r,FXint c) const;
00538 
00539   /// Enable item
00540   FXbool enableItem(FXint r,FXint c);
00541 
00542   /// Disable item
00543   FXbool disableItem(FXint r,FXint c);
00544 
00545   /// Select item
00546   virtual FXbool selectItem(FXint r,FXint c,FXbool notify=FALSE);
00547 
00548   /// Deselect item
00549   virtual FXbool deselectItem(FXint r,FXint c,FXbool notify=FALSE);
00550 
00551   /// Toggle item
00552   virtual FXbool toggleItem(FXint r,FXint c,FXbool notify=FALSE);
00553 
00554   /// Change item justification
00555   void setItemJustify(FXint r,FXint c,FXuint justify);
00556 
00557   /// Return item justification
00558   FXuint getItemJustify(FXint r,FXint c) const;
00559 
00560   /// Change relative position of icon and text of item
00561   void setItemIconPosition(FXint r,FXint c,FXuint mode);
00562 
00563   /// Return relative icon and text position
00564   FXuint getItemIconPosition(FXint r,FXint c) const;
00565 
00566   /// Change item border style
00567   void setItemBorders(FXint r,FXint c,FXuint borders);
00568 
00569   /// Return item border style
00570   FXuint getItemBorders(FXint r,FXint c) const;
00571 
00572   /// Change item background stipple style
00573   void setItemStipple(FXint r,FXint c,FXStipplePattern pat);
00574 
00575   /// return item background stipple style
00576   FXStipplePattern getItemStipple(FXint r,FXint c) const;
00577 
00578   /// Change current item
00579   virtual void setCurrentItem(FXint r,FXint c,FXbool notify=FALSE);
00580 
00581   /// Get row number of current item
00582   FXint getCurrentRow() const { return current.row; }
00583 
00584   /// Get column number of current item
00585   FXint getCurrentColumn() const { return current.col; }
00586 
00587   /// Change anchor item
00588   void setAnchorItem(FXint r,FXint c);
00589 
00590   /// Get row number of anchor item
00591   FXint getAnchorRow() const { return anchor.row; }
00592 
00593   /// Get column number of anchor item
00594   FXint getAnchorColumn() const { return anchor.col; }
00595 
00596   /// Get selection start row; returns -1 if no selection
00597   FXint getSelStartRow() const { return selection.fm.row; }
00598 
00599   /// Get selection start column; returns -1 if no selection
00600   FXint getSelStartColumn() const { return selection.fm.col; }
00601 
00602   /// Get selection end row; returns -1 if no selection
00603   FXint getSelEndRow() const { return selection.to.row; }
00604 
00605   /// Get selection end column; returns -1 if no selection
00606   FXint getSelEndColumn() const { return selection.to.col; }
00607 
00608   /// Select range
00609   virtual FXbool selectRange(FXint sr,FXint er,FXint sc,FXint ec,FXbool notify=FALSE);
00610 
00611   /// Extend selection
00612   virtual FXbool extendSelection(FXint r,FXint c,FXbool notify=FALSE);
00613 
00614   /// Kill selection
00615   virtual FXbool killSelection(FXbool notify=FALSE);
00616 
00617   /// Change font
00618   void setFont(FXFont* fnt);
00619   FXFont* getFont() const { return font; }
00620 
00621   /// Obtain colors of various parts
00622   FXColor getTextColor() const { return textColor; }
00623   FXColor getBaseColor() const { return baseColor; }
00624   FXColor getHiliteColor() const { return hiliteColor; }
00625   FXColor getShadowColor() const { return shadowColor; }
00626   FXColor getBorderColor() const { return borderColor; }
00627   FXColor getSelBackColor() const { return selbackColor; }
00628   FXColor getSelTextColor() const { return seltextColor; }
00629   FXColor getGridColor() const { return gridColor; }
00630   FXColor getStippleColor() const { return stippleColor; }
00631   FXColor getCellBorderColor() const { return cellBorderColor; }
00632 
00633   /// Change colors of various parts
00634   void setTextColor(FXColor clr);
00635   void setBaseColor(FXColor clr);
00636   void setHiliteColor(FXColor clr);
00637   void setShadowColor(FXColor clr);
00638   void setBorderColor(FXColor clr);
00639   void setSelBackColor(FXColor clr);
00640   void setSelTextColor(FXColor clr);
00641   void setGridColor(FXColor clr);
00642   void setStippleColor(FXColor clr);
00643   void setCellBorderColor(FXColor clr);
00644 
00645   /// Change cell background color for even/odd rows/columns
00646   void setCellColor(FXint r,FXint c,FXColor clr);
00647 
00648   /// Obtain cell background color for even/odd rows/columns
00649   FXColor getCellColor(FXint r,FXint c) const;
00650 
00651   /// Change cell border width
00652   void setCellBorderWidth(FXint borderwidth);
00653 
00654   /// Return cell border width
00655   FXint getCellBorderWidth() const { return cellBorderWidth; }
00656 
00657   /// Change help text
00658   void setHelpText(const FXString& text);
00659   FXString getHelpText() const { return help; }
00660 
00661   /// Serialize
00662   virtual void save(FXStream& store) const;
00663   virtual void load(FXStream& store);
00664 
00665   virtual ~FXTable();
00666   };
00667 
00668 }
00669 
00670 #endif

Copyright © 1997-2004 Jeroen van der Zijp