00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
#ifndef 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
00041
00042
enum { DEFAULT_MARGIN = 2 };
00043
00044
00045
00046
00047
enum {
00048
TABLE_COL_SIZABLE = 0x00100000,
00049
TABLE_ROW_SIZABLE = 0x00200000,
00050
TABLE_HEADERS_SIZABLE = 0x00400000,
00051
TABLE_NO_COLSELECT = 0x00900000,
00052
TABLE_NO_ROWSELECT = 0x01000000,
00053
TABLE_READONLY = 0x02000000
00054 };
00055
00056
00057
00058
struct FXTablePos {
00059 FXint row;
00060 FXint col;
00061 };
00062
00063
00064
00065
struct FXTableRange {
00066 FXTablePos fm;
00067
FXTablePos to;
00068 };
00069
00070
00071
00072
class FXAPI FXTableItem :
public FXObject {
00073 FXDECLARE(FXTableItem)
00074 friend class
FXTable;
00075 protected:
00076
FXString label;
00077
FXIcon *icon;
00078
void *data;
00079 FXuint state;
00080 protected:
00081 FXTableItem():icon(NULL),data(NULL),state(0){}
00082 FXint textWidth(
const FXTable* table)
const;
00083 FXint textHeight(
const FXTable* table)
const;
00084
virtual void draw(
const FXTable* table,
FXDC& dc,FXint x,FXint y,FXint w,FXint h)
const;
00085 virtual void drawBorders(
const FXTable* table,
FXDC& dc,FXint x,FXint y,FXint w,FXint h)
const;
00086
virtual void drawContent(
const FXTable* table,
FXDC& dc,FXint x,FXint y,FXint w,FXint h)
const;
00087
virtual void drawPattern(
const FXTable* table,
FXDC& dc,FXint x,FXint y,FXint w,FXint h)
const;
00088
virtual void drawBackground(
const FXTable* table,
FXDC& dc,FXint x,FXint y,FXint w,FXint h)
const;
00089
public:
00090
enum{
00091 SELECTED = 0x00000001,
00092 FOCUS = 0x00000002,
00093 DISABLED = 0x00000004,
00094 DRAGGABLE = 0x00000008,
00095 RESERVED1 = 0x00000010,
00096 RESERVED2 = 0x00000020,
00097 ICONOWNED = 0x00000040,
00098 RIGHT = 0x00002000,
00099 LEFT = 0x00004000,
00100 CENTER_X = 0,
00101 TOP = 0x00008000,
00102 BOTTOM = 0x00010000,
00103 CENTER_Y = 0,
00104 BEFORE = 0x00020000,
00105 AFTER = 0x00040000,
00106 ABOVE = 0x00080000,
00107 BELOW = 0x00100000,
00108 LBORDER = 0x00200000,
00109 RBORDER = 0x00400000,
00110 TBORDER = 0x00800000,
00111 BBORDER = 0x01000000
00112 };
00113
public:
00114
00115
00116 FXTableItem(
const FXString& text,
FXIcon* ic=NULL,
void* ptr=NULL):label(text),icon(ic),data(ptr),state(RIGHT|CENTER_Y){}
00117
00118
00119
virtual void setText(
const FXString& txt);
00120
00121
00122
virtual FXString getText()
const {
return label; }
00123
00124
00125
virtual void setIcon(
FXIcon* icn,FXbool owned=FALSE);
00126
00127
00128
virtual FXIcon* getIcon()
const {
return icon; }
00129
00130
00131
void setData(
void* ptr){ data=ptr; }
00132
00133
00134
void* getData()
const {
return data; }
00135
00136
00137
virtual void setFocus(FXbool focus);
00138
00139
00140 FXbool hasFocus()
const {
return (state&FOCUS)!=0; }
00141
00142
00143
virtual void setSelected(FXbool selected);
00144
00145
00146 FXbool isSelected()
const {
return (state&SELECTED)!=0; }
00147
00148
00149
virtual void setEnabled(FXbool enabled);
00150
00151
00152 FXbool isEnabled()
const {
return (state&DISABLED)==0; }
00153
00154
00155
virtual void setDraggable(FXbool draggable);
00156
00157
00158 FXbool isDraggable()
const {
return (state&DRAGGABLE)!=0; }
00159
00160
00161
virtual void setJustify(FXuint justify=RIGHT|CENTER_Y);
00162
00163
00164 FXuint getJustify()
const {
return state&(RIGHT|LEFT|TOP|BOTTOM); }
00165
00166
00167
virtual void setIconPosition(FXuint mode);
00168
00169
00170 FXuint getIconPosition()
const {
return state&(BEFORE|AFTER|ABOVE|BELOW); }
00171
00172
00173
virtual void setBorders(FXuint borders=0);
00174
00175
00176 FXuint getBorders()
const {
return state&(LBORDER|RBORDER|TBORDER|BBORDER); }
00177
00178
00179
virtual void setStipple(FXStipplePattern pattern);
00180
00181
00182
FXStipplePattern getStipple() const;
00183
00184
00185 virtual
FXWindow *getControlFor(
FXTable* table);
00186
00187
00188 virtual
void setFromControl(
FXWindow *control);
00189
00190
00191 virtual FXint getWidth(const
FXTable* table) const;
00192
00193
00194 virtual FXint getHeight(const
FXTable* table) const;
00195
00196
00197 virtual
void create();
00198
00199
00200 virtual
void detach();
00201
00202
00203 virtual
void destroy();
00204
00205
00206 virtual
void save(
FXStream& store) const;
00207
00208
00209 virtual
void load(
FXStream& store);
00210
00211
00212 virtual ~FXTableItem();
00213 };
00214
00215
00216
00217
00218 class FXAPI
FXTable : public
FXScrollArea {
00219 FXDECLARE(
FXTable)
00220 protected:
00221
FXHeader *colHeader;
00222 FXHeader *rowHeader;
00223
FXButton *cornerButton;
00224 FXTableItem **cells;
00225
FXWindow *editor;
00226
FXFont *font;
00227 FXint nrows;
00228 FXint ncols;
00229 FXint visiblerows;
00230 FXint visiblecols;
00231 FXint margintop;
00232 FXint marginbottom;
00233 FXint marginleft;
00234 FXint marginright;
00235 FXColor textColor;
00236 FXColor baseColor;
00237 FXColor hiliteColor;
00238 FXColor shadowColor;
00239 FXColor borderColor;
00240 FXColor selbackColor;
00241 FXColor seltextColor;
00242 FXColor gridColor;
00243 FXColor stippleColor;
00244 FXColor cellBorderColor;
00245 FXint cellBorderWidth;
00246 FXColor cellBackColor[2][2];
00247 FXint defColWidth;
00248 FXint defRowHeight;
00249
FXTablePos current;
00250
FXTablePos anchor;
00251
FXTableRange input;
00252
FXTableRange selection;
00253 FXchar *clipbuffer;
00254 FXint cliplength;
00255 FXbool hgrid;
00256 FXbool vgrid;
00257 FXuchar mode;
00258 FXint grabx;
00259 FXint graby;
00260 FXint rowcol;
00261
FXString help;
00262 public:
00263 static FXDragType csvType;
00264 static const FXchar csvTypeName[];
00265 protected:
00266
FXTable();
00267 FXint startRow(FXint row,FXint col) const;
00268 FXint startCol(FXint row,FXint col) const;
00269 FXint endRow(FXint row,FXint col) const;
00270 FXint endCol(FXint row,FXint col) const;
00271
void spanningRange(FXint& sr,FXint& er,FXint& sc,FXint& ec,FXint anchrow,FXint anchcol,FXint currow,FXint curcol);
00272 virtual
void moveContents(FXint x,FXint y);
00273 virtual
void drawCell(
FXDC& dc,FXint sr,FXint er,FXint sc,FXint ec);
00274 virtual
void drawRange(
FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
00275 virtual
void drawHGrid(
FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
00276 virtual
void drawVGrid(
FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
00277 virtual
void drawContents(
FXDC& dc,FXint x,FXint y,FXint w,FXint h);
00278 virtual FXTableItem* createItem(const
FXString& text,
FXIcon* icon,
void* ptr);
00279 virtual
FXWindow *getControlForItem(FXint r,FXint c);
00280 virtual
void setItemFromControl(FXint r,FXint c,
FXWindow *control);
00281
void countText(FXint& nr,FXint& nc,const FXchar* text,FXint size,FXchar cs='\t',FXchar rs='\n') const;
00282 protected:
00283 enum {
00284 MOUSE_NONE,
00285 MOUSE_SCROLL,
00286 MOUSE_DRAG,
00287 MOUSE_SELECT,
00288 MOUSE_COL_SIZE,
00289 MOUSE_ROW_SIZE
00290 };
00291
private:
00292
FXTable(
const FXTable&);
00293
FXTable& operator=(
const FXTable&);
00294
public:
00295
long onPaint(
FXObject*,FXSelector,
void*);
00296
long onFocusIn(
FXObject*,FXSelector,
void*);
00297
long onFocusOut(
FXObject*,FXSelector,
void*);
00298
long onMotion(
FXObject*,FXSelector,
void*);
00299
long onKeyPress(
FXObject*,FXSelector,
void*);
00300
long onKeyRelease(
FXObject*,FXSelector,
void*);
00301
long onLeftBtnPress(
FXObject*,FXSelector,
void*);
00302
long onLeftBtnRelease(
FXObject*,FXSelector,
void*);
00303
long onRightBtnPress(
FXObject*,FXSelector,
void*);
00304
long onRightBtnRelease(
FXObject*,FXSelector,
void*);
00305
long onUngrabbed(
FXObject*,FXSelector,
void*);
00306
long onSelectionLost(
FXObject*,FXSelector,
void*);
00307
long onSelectionGained(
FXObject*,FXSelector,
void*);
00308
long onSelectionRequest(
FXObject*,FXSelector,
void* ptr);
00309
long onClipboardLost(
FXObject*,FXSelector,
void*);
00310
long onClipboardGained(
FXObject*,FXSelector,
void*);
00311
long onClipboardRequest(
FXObject*,FXSelector,
void*);
00312
long onAutoScroll(
FXObject*,FXSelector,
void*);
00313
long onCommand(
FXObject*,FXSelector,
void*);
00314
long onClicked(
FXObject*,FXSelector,
void*);
00315
long onDoubleClicked(
FXObject*,FXSelector,
void*);
00316
long onTripleClicked(
FXObject*,FXSelector,
void*);
00317
00318
long onCmdToggleEditable(
FXObject*,FXSelector,
void*);
00319
long onUpdToggleEditable(
FXObject*,FXSelector,
void*);
00320
00321
00322
long onCmdHorzGrid(
FXObject*,FXSelector,
void*);
00323
long onUpdHorzGrid(
FXObject*,FXSelector,
void*);
00324
long onCmdVertGrid(
FXObject*,FXSelector,
void*);
00325
long onUpdVertGrid(
FXObject*,FXSelector,
void*);
00326
00327
00328
long onCmdDeleteColumn(
FXObject*,FXSelector,
void*);
00329
long onUpdDeleteColumn(
FXObject*,FXSelector,
void*);
00330
long onCmdDeleteRow(
FXObject*,FXSelector,
void*);
00331
long onUpdDeleteRow(
FXObject*,FXSelector,
void*);
00332
long onCmdInsertColumn(
FXObject*,FXSelector,
void*);
00333
long onUpdInsertColumn(
FXObject*,FXSelector,
void*);
00334
long onCmdInsertRow(
FXObject*,FXSelector,
void*);
00335
long onUpdInsertRow(
FXObject*,FXSelector,
void*);
00336
00337
00338
long onCmdMoveRight(
FXObject*,FXSelector,
void*);
00339
long onCmdMoveLeft(
FXObject*,FXSelector,
void*);
00340
long onCmdMoveUp(
FXObject*,FXSelector,
void*);
00341
long onCmdMoveDown(
FXObject*,FXSelector,
void*);
00342
long onCmdMoveHome(
FXObject*,FXSelector,
void*);
00343
long onCmdMoveEnd(
FXObject*,FXSelector,
void*);
00344
long onCmdMoveTop(
FXObject*,FXSelector,
void*);
00345
long onCmdMoveBottom(
FXObject*,FXSelector,
void*);
00346
long onCmdMovePageDown(
FXObject*,FXSelector,
void*);
00347
long onCmdMovePageUp(
FXObject*,FXSelector,
void*);
00348
00349
00350
long onCmdMark(
FXObject*,FXSelector,
void*);
00351
long onCmdExtend(
FXObject*,FXSelector,
void*);
00352
00353
00354
long onCmdSelectCell(
FXObject*,FXSelector,
void*);
00355
long onCmdSelectRow(
FXObject*,FXSelector,
void*);
00356
long onCmdSelectColumn(
FXObject*,FXSelector,
void*);
00357 long onCmdSelectRowIndex(
FXObject*,FXSelector,
void*);
00358
long onCmdSelectColumnIndex(
FXObject*,FXSelector,
void*);
00359
long onCmdSelectAll(
FXObject*,FXSelector,
void*);
00360 long onCmdDeselectAll(
FXObject*,FXSelector,
void*);
00361
00362
00363
long onCmdCutSel(
FXObject*,FXSelector,
void*);
00364
long onCmdCopySel(
FXObject*,FXSelector,
void*);
00365
long onCmdDeleteSel(
FXObject*,FXSelector,
void*);
00366 long onCmdPasteSel(
FXObject*,FXSelector,
void*);
00367
long onUpdHaveSelection(
FXObject*,FXSelector,
void*);
00368
00369
00370
long onCmdStartInput(
FXObject*,FXSelector,
void*);
00371
long onUpdStartInput(
FXObject*,FXSelector,
void*);
00372 long onCmdAcceptInput(
FXObject*,FXSelector,
void*);
00373
long onUpdAcceptInput(
FXObject*,FXSelector,
void*);
00374
long onCmdCancelInput(
FXObject*,FXSelector,
void*);
00375
public:
00376
00377
enum {
00378 ID_HORZ_GRID=FXScrollArea::ID_LAST,
00379 ID_VERT_GRID,
00380 ID_TOGGLE_EDITABLE,
00381 ID_DELETE_COLUMN,
00382 ID_DELETE_ROW,
00383 ID_INSERT_COLUMN,
00384 ID_INSERT_ROW,
00385 ID_SELECT_COLUMN_INDEX,
00386 ID_SELECT_ROW_INDEX,
00387 ID_SELECT_COLUMN,
00388 ID_SELECT_ROW,
00389 ID_SELECT_CELL,
00390 ID_SELECT_ALL,
00391 ID_DESELECT_ALL,
00392 ID_MOVE_LEFT,
00393 ID_MOVE_RIGHT,
00394 ID_MOVE_UP,
00395 ID_MOVE_DOWN,
00396 ID_MOVE_HOME,
00397 ID_MOVE_END,
00398 ID_MOVE_TOP,
00399 ID_MOVE_BOTTOM,
00400 ID_MOVE_PAGEDOWN,
00401 ID_MOVE_PAGEUP,
00402 ID_START_INPUT,
00403 ID_CANCEL_INPUT,
00404 ID_ACCEPT_INPUT,
00405 ID_MARK,
00406 ID_EXTEND,
00407 ID_CUT_SEL,
00408 ID_COPY_SEL,
00409 ID_PASTE_SEL,
00410 ID_DELETE_SEL,
00411 ID_LAST
00412 };
00413
00414 public:
00415
00416
00417
00418
00419
00420
00421
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);
00422
00423
00424
virtual FXint getDefaultWidth();
00425
00426
00427
virtual FXint getDefaultHeight();
00428
00429
00430
virtual FXint getContentWidth();
00431
00432
00433
virtual FXint getContentHeight();
00434
00435
00436
virtual void create();
00437
00438
00439
virtual void detach();
00440
00441
00442
virtual void layout();
00443
00444
00445
virtual void recalc();
00446
00447
00448
virtual FXbool canFocus() const;
00449
00450
00451 virtual
void setFocus();
00452
00453
00454 virtual
void killFocus();
00455
00456
00457 virtual
void changeFocus(
FXWindow *child);
00458
00459
00460
FXHeader* getColumnHeader()
const {
return colHeader; }
00461
00462
00463
FXHeader* getRowHeader()
const {
return rowHeader; }
00464
00465
00466
void setVisibleRows(FXint nvrows);
00467
00468
00469 FXint getVisibleRows()
const {
return visiblerows; }
00470
00471
00472
void setVisibleColumns(FXint nvcols);
00473
00474
00475 FXint getVisibleColumns()
const {
return visiblecols; }
00476
00477
00478 FXbool isEditable() const;
00479
00480
00481
void setEditable(FXbool edit=TRUE);
00482
00483
00484
void showHorzGrid(FXbool on=TRUE);
00485
00486
00487 FXbool isHorzGridShown()
const {
return hgrid; }
00488
00489
00490
void showVertGrid(FXbool on=TRUE);
00491
00492
00493 FXbool isVertGridShown()
const {
return vgrid; }
00494
00495
00496 FXint getNumRows()
const {
return nrows; }
00497
00498
00499 FXint getNumColumns()
const {
return ncols; }
00500
00501
00502
void setMarginTop(FXint pt);
00503
00504
00505 FXint getMarginTop()
const {
return margintop; }
00506
00507
00508
void setMarginBottom(FXint pb);
00509
00510
00511 FXint getMarginBottom()
const {
return marginbottom; }
00512
00513
00514
void setMarginLeft(FXint pl);
00515
00516
00517 FXint getMarginLeft()
const {
return marginleft; }
00518
00519
00520
void setMarginRight(FXint pr);
00521
00522
00523 FXint getMarginRight()
const {
return marginright; }
00524
00525
00526
00527
00528
00529
00530
00531
00532
virtual void startInput(FXint row,FXint col);
00533
00534
00535
00536
00537
00538
00539
virtual void cancelInput();
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
virtual void acceptInput(FXbool notify=FALSE);
00550
00551
00552
00553
00554
00555
00556 FXint colAtX(FXint x)
const;
00557
00558
00559
00560
00561
00562
00563 FXint rowAtY(FXint y)
const;
00564
00565
00566 FXTableItem *getItem(FXint row,FXint col)
const;
00567
00568
00569
void setItem(FXint row,FXint col,FXTableItem* item,FXbool notify=FALSE);
00570
00571
00572
virtual void setTableSize(FXint nr,FXint nc,FXbool notify=FALSE);
00573
00574
00575
virtual void insertRows(FXint row,FXint nr=1,FXbool notify=FALSE);
00576
00577
00578
virtual void insertColumns(FXint col,FXint nc=1,FXbool notify=FALSE);
00579
00580
00581
virtual void removeRows(FXint row,FXint nr=1,FXbool notify=FALSE);
00582
00583
00584
virtual void removeColumns(FXint col,FXint nc=1,FXbool notify=FALSE);
00585
00586
00587
virtual void removeItem(FXint row,FXint col,FXbool notify=FALSE);
00588
00589
00590
virtual void removeRange(FXint startrow,FXint endrow,FXint startcol,FXint endcol,FXbool notify=FALSE);
00591
00592
00593
virtual void clearItems(FXbool notify=FALSE);
00594
00595
00596
virtual void makePositionVisible(FXint r,FXint c);
00597
00598
00599 FXbool isItemVisible(FXint r,FXint c)
const;
00600
00601
00602
00603
00604
00605
00606
00607
void setColumnHeaderMode(FXuint hint=LAYOUT_FIX_HEIGHT);
00608
00609
00610 FXuint getColumnHeaderMode() const;
00611
00612
00613
00614
00615
00616
00617
00618
void setRowHeaderMode(FXuint hint=LAYOUT_FIX_WIDTH);
00619
00620
00621 FXuint getRowHeaderMode() const;
00622
00623
00624
void setColumnHeaderHeight(FXint h);
00625
00626
00627 FXint getColumnHeaderHeight() const;
00628
00629
00630
void setRowHeaderWidth(FXint w);
00631
00632
00633 FXint getRowHeaderWidth() const;
00634
00635
00636 FXint getColumnX(FXint col) const;
00637
00638
00639 FXint getRowY(FXint row) const;
00640
00641
00642 virtual
void setColumnWidth(FXint col,FXint cwidth);
00643
00644
00645 FXint getColumnWidth(FXint col) const;
00646
00647
00648 virtual
void setRowHeight(FXint row,FXint rheight);
00649
00650
00651 FXint getRowHeight(FXint row) const;
00652
00653
00654
void setDefColumnWidth(FXint cwidth);
00655
00656
00657 FXint getDefColumnWidth()
const {
return defColWidth; }
00658
00659
00660
void setDefRowHeight(FXint rheight);
00661
00662
00663 FXint getDefRowHeight()
const {
return defRowHeight; }
00664
00665
00666 FXint getMinRowHeight(FXint r)
const;
00667
00668
00669 FXint getMinColumnWidth(FXint c)
const;
00670
00671
00672
void fitRowsToContents(FXint row,FXint nr=1);
00673
00674
00675
void fitColumnsToContents(FXint col,FXint nc=1);
00676
00677
00678
void setColumnText(FXint index,
const FXString& text);
00679
00680
00681
FXString getColumnText(FXint index)
const;
00682
00683
00684
void setRowText(FXint index,
const FXString& text);
00685
00686
00687
FXString getRowText(FXint index)
const;
00688
00689
00690
void setItemText(FXint r,FXint c,
const FXString& text);
00691
00692
00693
FXString getItemText(FXint r,FXint c)
const;
00694
00695
00696
void setItemIcon(FXint r,FXint c,
FXIcon* icon,FXbool owned=FALSE);
00697
00698
00699
FXIcon* getItemIcon(FXint r,FXint c)
const;
00700
00701
00702
void setItemData(FXint r,FXint c,
void* ptr);
00703
void* getItemData(FXint r,FXint c)
const;
00704
00705
00706
void extractText(FXchar*& text,FXint& size,FXint startrow,FXint endrow,FXint startcol,FXint endcol,FXchar cs=
'\t',FXchar rs=
'\n')
const;
00707
00708
00709
void overlayText(FXint startrow,FXint endrow,FXint startcol,FXint endcol,
const FXchar* text,FXint size,FXchar cs=
'\t',FXchar rs=
'\n');
00710
00711
00712 FXbool isItemSpanning(FXint r,FXint c)
const;
00713
00714
00715
void updateRange(FXint sr,FXint er,FXint sc,FXint ec)
const;
00716
00717
00718
void updateItem(FXint r,FXint c)
const;
00719
00720
00721
virtual FXbool enableItem(FXint r,FXint c);
00722
00723
00724
virtual FXbool disableItem(FXint r,FXint c);
00725
00726
00727 FXbool isItemEnabled(FXint r,FXint c)
const;
00728
00729
00730
00731
00732
00733
00734
00735
00736
void setItemJustify(FXint r,FXint c,FXuint justify);
00737
00738
00739 FXuint getItemJustify(FXint r,FXint c)
const;
00740
00741
00742
00743
00744
00745
00746
00747
00748
void setItemIconPosition(FXint r,FXint c,FXuint mode);
00749
00750
00751 FXuint getItemIconPosition(FXint r,FXint c)
const;
00752
00753
00754
00755
00756
00757
00758
void setItemBorders(FXint r,FXint c,FXuint borders);
00759
00760
00761 FXuint getItemBorders(FXint r,FXint c)
const;
00762
00763
00764
void setItemStipple(FXint r,FXint c,FXStipplePattern pat);
00765
00766
00767
FXStipplePattern getItemStipple(FXint r,FXint c)
const;
00768
00769
00770
virtual void setCurrentItem(FXint r,FXint c,FXbool notify=FALSE);
00771
00772
00773 FXint getCurrentRow()
const {
return current.row; }
00774
00775
00776 FXint getCurrentColumn()
const {
return current.col; }
00777
00778
00779 FXbool isItemCurrent(FXint r,FXint c)
const;
00780
00781
00782
void setAnchorItem(FXint r,FXint c);
00783
00784
00785 FXint getAnchorRow()
const {
return anchor.row; }
00786
00787
00788 FXint getAnchorColumn()
const {
return anchor.col; }
00789
00790
00791 FXint getSelStartRow()
const {
return selection.fm.row; }
00792
00793
00794 FXint getSelStartColumn()
const {
return selection.fm.col; }
00795
00796
00797 FXint getSelEndRow()
const {
return selection.to.row; }
00798
00799
00800 FXint getSelEndColumn()
const {
return selection.to.col; }
00801
00802
00803 FXbool isItemSelected(FXint r,FXint c)
const;
00804
00805
00806 FXbool isRowSelected(FXint r)
const;
00807
00808
00809 FXbool isColumnSelected(FXint c)
const;
00810
00811
00812 FXbool isAnythingSelected() const;
00813
00814
00815 virtual FXbool selectRow(FXint row,FXbool notify=FALSE);
00816
00817
00818 virtual FXbool selectColumn(FXint col,FXbool notify=FALSE);
00819
00820
00821 virtual FXbool selectRange(FXint startrow,FXint endrow,FXint startcol,FXint endcol,FXbool notify=FALSE);
00822
00823
00824 virtual FXbool extendSelection(FXint r,FXint c,FXbool notify=FALSE);
00825
00826
00827 virtual FXbool killSelection(FXbool notify=FALSE);
00828
00829
00830
void setFont(FXFont* fnt);
00831
00832
00833 FXFont* getFont()
const {
return font; }
00834
00835
00836 FXColor getTextColor()
const {
return textColor; }
00837 FXColor getBaseColor()
const {
return baseColor; }
00838 FXColor getHiliteColor()
const {
return hiliteColor; }
00839 FXColor getShadowColor()
const {
return shadowColor; }
00840 FXColor getBorderColor()
const {
return borderColor; }
00841 FXColor getSelBackColor()
const {
return selbackColor; }
00842 FXColor getSelTextColor()
const {
return seltextColor; }
00843 FXColor getGridColor()
const {
return gridColor; }
00844 FXColor getStippleColor()
const {
return stippleColor; }
00845 FXColor getCellBorderColor()
const {
return cellBorderColor; }
00846
00847
00848
void setTextColor(FXColor clr);
00849
void setBaseColor(FXColor clr);
00850
void setHiliteColor(FXColor clr);
00851
void setShadowColor(FXColor clr);
00852
void setBorderColor(FXColor clr);
00853
void setSelBackColor(FXColor clr);
00854
void setSelTextColor(FXColor clr);
00855
void setGridColor(FXColor clr);
00856
void setStippleColor(FXColor clr);
00857
void setCellBorderColor(FXColor clr);
00858
00859
00860
void setCellColor(FXint r,FXint c,FXColor clr);
00861
00862
00863 FXColor getCellColor(FXint r,FXint c)
const;
00864
00865
00866
void setCellBorderWidth(FXint borderwidth);
00867
00868
00869 FXint getCellBorderWidth()
const {
return cellBorderWidth; }
00870
00871
00872
void setTableStyle(FXuint style);
00873
00874
00875 FXuint getTableStyle() const;
00876
00877
00878
void setHelpText(const FXString& text){ help=text; }
00879
const FXString& getHelpText()
const {
return help; }
00880
00881
00882
virtual void save(FXStream& store)
const;
00883
virtual void load(FXStream& store);
00884
00885
virtual ~FXTable();
00886 };
00887
00888 }
00889
00890
#endif