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