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