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
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285 class FXAPI FXTable : public FXScrollArea {
00286 FXDECLARE(FXTable)
00287 protected:
00288 FXHeader *colHeader;
00289 FXHeader *rowHeader;
00290 FXButton *cornerButton;
00291 FXTableItem **cells;
00292 FXWindow *editor;
00293 FXFont *font;
00294 FXint nrows;
00295 FXint ncols;
00296 FXint visiblerows;
00297 FXint visiblecols;
00298 FXint margintop;
00299 FXint marginbottom;
00300 FXint marginleft;
00301 FXint marginright;
00302 FXColor textColor;
00303 FXColor baseColor;
00304 FXColor hiliteColor;
00305 FXColor shadowColor;
00306 FXColor borderColor;
00307 FXColor selbackColor;
00308 FXColor seltextColor;
00309 FXColor gridColor;
00310 FXColor stippleColor;
00311 FXColor cellBorderColor;
00312 FXint cellBorderWidth;
00313 FXColor cellBackColor[2][2];
00314 FXint defColWidth;
00315 FXint defRowHeight;
00316 FXTablePos current;
00317 FXTablePos anchor;
00318 FXTableRange input;
00319 FXTableRange selection;
00320 FXString clipped;
00321 FXbool hgrid;
00322 FXbool vgrid;
00323 FXuchar mode;
00324 FXint grabx;
00325 FXint graby;
00326 FXint rowcol;
00327 FXString help;
00328 public:
00329 static FXDragType csvType;
00330 static const FXchar csvTypeName[];
00331 protected:
00332 FXTable();
00333 FXint startRow(FXint row,FXint col) const;
00334 FXint startCol(FXint row,FXint col) const;
00335 FXint endRow(FXint row,FXint col) const;
00336 FXint endCol(FXint row,FXint col) const;
00337 void spanningRange(FXint& sr,FXint& er,FXint& sc,FXint& ec,FXint anchrow,FXint anchcol,FXint currow,FXint curcol);
00338 virtual void moveContents(FXint x,FXint y);
00339 virtual void drawCell(FXDC& dc,FXint sr,FXint er,FXint sc,FXint ec);
00340 virtual void drawRange(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
00341 virtual void drawHGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
00342 virtual void drawVGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
00343 virtual void drawContents(FXDC& dc,FXint x,FXint y,FXint w,FXint h);
00344 virtual FXTableItem* createItem(const FXString& text,FXIcon* icon,void* ptr);
00345 virtual FXWindow *getControlForItem(FXint r,FXint c);
00346 virtual void setItemFromControl(FXint r,FXint c,FXWindow *control);
00347 virtual void updateColumnNumbers(FXint lo,FXint hi);
00348 virtual void updateRowNumbers(FXint lo,FXint hi);
00349 protected:
00350 enum {
00351 MOUSE_NONE,
00352 MOUSE_SCROLL,
00353 MOUSE_DRAG,
00354 MOUSE_SELECT
00355 };
00356 private:
00357 FXTable(const FXTable&);
00358 FXTable& operator=(const FXTable&);
00359 public:
00360 long onPaint(FXObject*,FXSelector,void*);
00361 long onFocusIn(FXObject*,FXSelector,void*);
00362 long onFocusOut(FXObject*,FXSelector,void*);
00363 long onMotion(FXObject*,FXSelector,void*);
00364 long onKeyPress(FXObject*,FXSelector,void*);
00365 long onKeyRelease(FXObject*,FXSelector,void*);
00366 long onLeftBtnPress(FXObject*,FXSelector,void*);
00367 long onLeftBtnRelease(FXObject*,FXSelector,void*);
00368 long onRightBtnPress(FXObject*,FXSelector,void*);
00369 long onRightBtnRelease(FXObject*,FXSelector,void*);
00370 long onUngrabbed(FXObject*,FXSelector,void*);
00371 long onSelectionLost(FXObject*,FXSelector,void*);
00372 long onSelectionGained(FXObject*,FXSelector,void*);
00373 long onSelectionRequest(FXObject*,FXSelector,void* ptr);
00374 long onClipboardLost(FXObject*,FXSelector,void*);
00375 long onClipboardGained(FXObject*,FXSelector,void*);
00376 long onClipboardRequest(FXObject*,FXSelector,void*);
00377 long onAutoScroll(FXObject*,FXSelector,void*);
00378 long onCommand(FXObject*,FXSelector,void*);
00379 long onClicked(FXObject*,FXSelector,void*);
00380 long onDoubleClicked(FXObject*,FXSelector,void*);
00381 long onTripleClicked(FXObject*,FXSelector,void*);
00382
00383 long onCmdToggleEditable(FXObject*,FXSelector,void*);
00384 long onUpdToggleEditable(FXObject*,FXSelector,void*);
00385
00386
00387 long onCmdHorzGrid(FXObject*,FXSelector,void*);
00388 long onUpdHorzGrid(FXObject*,FXSelector,void*);
00389 long onCmdVertGrid(FXObject*,FXSelector,void*);
00390 long onUpdVertGrid(FXObject*,FXSelector,void*);
00391
00392
00393 long onCmdDeleteColumn(FXObject*,FXSelector,void*);
00394 long onUpdDeleteColumn(FXObject*,FXSelector,void*);
00395 long onCmdDeleteRow(FXObject*,FXSelector,void*);
00396 long onUpdDeleteRow(FXObject*,FXSelector,void*);
00397 long onCmdInsertColumn(FXObject*,FXSelector,void*);
00398 long onUpdInsertColumn(FXObject*,FXSelector,void*);
00399 long onCmdInsertRow(FXObject*,FXSelector,void*);
00400 long onUpdInsertRow(FXObject*,FXSelector,void*);
00401
00402
00403 long onCmdMoveRight(FXObject*,FXSelector,void*);
00404 long onCmdMoveLeft(FXObject*,FXSelector,void*);
00405 long onCmdMoveUp(FXObject*,FXSelector,void*);
00406 long onCmdMoveDown(FXObject*,FXSelector,void*);
00407 long onCmdMoveHome(FXObject*,FXSelector,void*);
00408 long onCmdMoveEnd(FXObject*,FXSelector,void*);
00409 long onCmdMoveTop(FXObject*,FXSelector,void*);
00410 long onCmdMoveBottom(FXObject*,FXSelector,void*);
00411 long onCmdMovePageDown(FXObject*,FXSelector,void*);
00412 long onCmdMovePageUp(FXObject*,FXSelector,void*);
00413
00414
00415 long onCmdMark(FXObject*,FXSelector,void*);
00416 long onCmdExtend(FXObject*,FXSelector,void*);
00417
00418
00419 long onUpdSelectCell(FXObject*,FXSelector,void*);
00420 long onCmdSelectCell(FXObject*,FXSelector,void*);
00421 long onUpdSelectRow(FXObject*,FXSelector,void*);
00422 long onCmdSelectRow(FXObject*,FXSelector,void*);
00423 long onUpdSelectColumn(FXObject*,FXSelector,void*);
00424 long onCmdSelectColumn(FXObject*,FXSelector,void*);
00425 long onCmdSelectRowIndex(FXObject*,FXSelector,void*);
00426 long onCmdSelectColumnIndex(FXObject*,FXSelector,void*);
00427 long onUpdSelectAll(FXObject*,FXSelector,void*);
00428 long onCmdSelectAll(FXObject*,FXSelector,void*);
00429 long onUpdDeselectAll(FXObject*,FXSelector,void*);
00430 long onCmdDeselectAll(FXObject*,FXSelector,void*);
00431
00432
00433 long onCmdCutSel(FXObject*,FXSelector,void*);
00434 long onCmdCopySel(FXObject*,FXSelector,void*);
00435 long onCmdDeleteSel(FXObject*,FXSelector,void*);
00436 long onCmdPasteSel(FXObject*,FXSelector,void*);
00437 long onUpdHaveSelection(FXObject*,FXSelector,void*);
00438
00439
00440 long onCmdStartInput(FXObject*,FXSelector,void*);
00441 long onUpdStartInput(FXObject*,FXSelector,void*);
00442 long onCmdAcceptInput(FXObject*,FXSelector,void*);
00443 long onUpdAcceptInput(FXObject*,FXSelector,void*);
00444 long onCmdCancelInput(FXObject*,FXSelector,void*);
00445 public:
00446
00447 enum {
00448 ID_HORZ_GRID=FXScrollArea::ID_LAST,
00449 ID_VERT_GRID,
00450 ID_TOGGLE_EDITABLE,
00451 ID_DELETE_COLUMN,
00452 ID_DELETE_ROW,
00453 ID_INSERT_COLUMN,
00454 ID_INSERT_ROW,
00455 ID_SELECT_COLUMN_INDEX,
00456 ID_SELECT_ROW_INDEX,
00457 ID_SELECT_COLUMN,
00458 ID_SELECT_ROW,
00459 ID_SELECT_CELL,
00460 ID_SELECT_ALL,
00461 ID_DESELECT_ALL,
00462 ID_MOVE_LEFT,
00463 ID_MOVE_RIGHT,
00464 ID_MOVE_UP,
00465 ID_MOVE_DOWN,
00466 ID_MOVE_HOME,
00467 ID_MOVE_END,
00468 ID_MOVE_TOP,
00469 ID_MOVE_BOTTOM,
00470 ID_MOVE_PAGEDOWN,
00471 ID_MOVE_PAGEUP,
00472 ID_START_INPUT,
00473 ID_CANCEL_INPUT,
00474 ID_ACCEPT_INPUT,
00475 ID_MARK,
00476 ID_EXTEND,
00477 ID_CUT_SEL,
00478 ID_COPY_SEL,
00479 ID_PASTE_SEL,
00480 ID_DELETE_SEL,
00481 ID_LAST
00482 };
00483
00484 public:
00485
00486
00487
00488
00489
00490
00491 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);
00492
00493
00494 virtual FXint getDefaultWidth();
00495
00496
00497 virtual FXint getDefaultHeight();
00498
00499
00500 virtual FXint getContentWidth();
00501
00502
00503 virtual FXint getContentHeight();
00504
00505
00506 virtual void create();
00507
00508
00509 virtual void detach();
00510
00511
00512 virtual void layout();
00513
00514
00515 virtual void recalc();
00516
00517
00518 virtual bool canFocus() const;
00519
00520
00521 virtual void setFocus();
00522
00523
00524 virtual void killFocus();
00525
00526
00527 virtual void changeFocus(FXWindow *child);
00528
00529
00530 FXButton* getCornerButton() const { return cornerButton; }
00531
00532
00533 FXHeader* getColumnHeader() const { return colHeader; }
00534
00535
00536 FXHeader* getRowHeader() const { return rowHeader; }
00537
00538
00539 void setVisibleRows(FXint nvrows);
00540
00541
00542 FXint getVisibleRows() const { return visiblerows; }
00543
00544
00545 void setVisibleColumns(FXint nvcols);
00546
00547
00548 FXint getVisibleColumns() const { return visiblecols; }
00549
00550
00551 FXbool isEditable() const;
00552
00553
00554 void setEditable(FXbool edit=TRUE);
00555
00556
00557 void showHorzGrid(FXbool on=TRUE);
00558
00559
00560 FXbool isHorzGridShown() const { return hgrid; }
00561
00562
00563 void showVertGrid(FXbool on=TRUE);
00564
00565
00566 FXbool isVertGridShown() const { return vgrid; }
00567
00568
00569 FXint getNumRows() const { return nrows; }
00570
00571
00572 FXint getNumColumns() const { return ncols; }
00573
00574
00575 void setMarginTop(FXint pt);
00576
00577
00578 FXint getMarginTop() const { return margintop; }
00579
00580
00581 void setMarginBottom(FXint pb);
00582
00583
00584 FXint getMarginBottom() const { return marginbottom; }
00585
00586
00587 void setMarginLeft(FXint pl);
00588
00589
00590 FXint getMarginLeft() const { return marginleft; }
00591
00592
00593 void setMarginRight(FXint pr);
00594
00595
00596 FXint getMarginRight() const { return marginright; }
00597
00598
00599
00600
00601
00602
00603
00604
00605 virtual void startInput(FXint row,FXint col);
00606
00607
00608
00609
00610
00611
00612 virtual void cancelInput();
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622 virtual void acceptInput(FXbool notify=FALSE);
00623
00624
00625
00626
00627
00628
00629 FXint colAtX(FXint x) const;
00630
00631
00632
00633
00634
00635
00636 FXint rowAtY(FXint y) const;
00637
00638
00639 FXTableItem *getItem(FXint row,FXint col) const;
00640
00641
00642 void setItem(FXint row,FXint col,FXTableItem* item,FXbool notify=FALSE);
00643
00644
00645 virtual void setTableSize(FXint nr,FXint nc,FXbool notify=FALSE);
00646
00647
00648 virtual void insertRows(FXint row,FXint nr=1,FXbool notify=FALSE);
00649
00650
00651 virtual void insertColumns(FXint col,FXint nc=1,FXbool notify=FALSE);
00652
00653
00654 virtual void removeRows(FXint row,FXint nr=1,FXbool notify=FALSE);
00655
00656
00657 virtual void removeColumns(FXint col,FXint nc=1,FXbool notify=FALSE);
00658
00659
00660 virtual FXTableItem* extractItem(FXint row,FXint col,FXbool notify=FALSE);
00661
00662
00663 virtual void removeItem(FXint row,FXint col,FXbool notify=FALSE);
00664
00665
00666 virtual void removeRange(FXint startrow,FXint endrow,FXint startcol,FXint endcol,FXbool notify=FALSE);
00667
00668
00669 virtual void clearItems(FXbool notify=FALSE);
00670
00671
00672 virtual void makePositionVisible(FXint r,FXint c);
00673
00674
00675 FXbool isItemVisible(FXint r,FXint c) const;
00676
00677
00678
00679
00680
00681
00682
00683 void setColumnHeaderMode(FXuint hint=LAYOUT_FIX_HEIGHT);
00684
00685
00686 FXuint getColumnHeaderMode() const;
00687
00688
00689
00690
00691
00692
00693
00694 void setRowHeaderMode(FXuint hint=LAYOUT_FIX_WIDTH);
00695
00696
00697 FXuint getRowHeaderMode() const;
00698
00699
00700 void setColumnHeaderFont(FXFont* fnt);
00701
00702
00703 FXFont* getColumnHeaderFont() const;
00704
00705
00706 void setRowHeaderFont(FXFont* fnt);
00707
00708
00709 FXFont* getRowHeaderFont() const;
00710
00711
00712 void setColumnHeaderHeight(FXint h);
00713
00714
00715 FXint getColumnHeaderHeight() const;
00716
00717
00718 void setRowHeaderWidth(FXint w);
00719
00720
00721 FXint getRowHeaderWidth() const;
00722
00723
00724 FXint getColumnX(FXint col) const;
00725
00726
00727 FXint getRowY(FXint row) const;
00728
00729
00730 virtual void setColumnWidth(FXint col,FXint cwidth);
00731
00732
00733 FXint getColumnWidth(FXint col) const;
00734
00735
00736 virtual void setRowHeight(FXint row,FXint rheight);
00737
00738
00739 FXint getRowHeight(FXint row) const;
00740
00741
00742 void setDefColumnWidth(FXint cwidth);
00743
00744
00745 FXint getDefColumnWidth() const { return defColWidth; }
00746
00747
00748 void setDefRowHeight(FXint rheight);
00749
00750
00751 FXint getDefRowHeight() const { return defRowHeight; }
00752
00753
00754 FXint getMinRowHeight(FXint r) const;
00755
00756
00757 FXint getMinColumnWidth(FXint c) const;
00758
00759
00760 void fitRowsToContents(FXint row,FXint nr=1);
00761
00762
00763 void fitColumnsToContents(FXint col,FXint nc=1);
00764
00765
00766 void setColumnText(FXint index,const FXString& text);
00767
00768
00769 FXString getColumnText(FXint index) const;
00770
00771
00772 void setRowText(FXint index,const FXString& text);
00773
00774
00775 FXString getRowText(FXint index) const;
00776
00777
00778 void setColumnIcon(FXint index,FXIcon* icon);
00779
00780
00781 FXIcon* getColumnIcon(FXint index) const;
00782
00783
00784 void setRowIcon(FXint index,FXIcon* icon);
00785
00786
00787 FXIcon* getRowIcon(FXint index) const;
00788
00789
00790 void setColumnIconPosition(FXint index,FXuint mode);
00791
00792
00793 FXuint getColumnIconPosition(FXint index) const;
00794
00795
00796 void setRowIconPosition(FXint index,FXuint mode);
00797
00798
00799 FXuint getRowIconPosition(FXint index) const;
00800
00801
00802 void setColumnJustify(FXint index,FXuint justify);
00803
00804
00805 FXuint getColumnJustify(FXint index) const;
00806
00807
00808 void setRowJustify(FXint index,FXuint justify);
00809
00810
00811 FXuint getRowJustify(FXint index) const;
00812
00813
00814 void setItemText(FXint r,FXint c,const FXString& text,FXbool notify=FALSE);
00815
00816
00817 FXString getItemText(FXint r,FXint c) const;
00818
00819
00820 void setItemIcon(FXint r,FXint c,FXIcon* icon,FXbool owned=FALSE,FXbool notify=FALSE);
00821
00822
00823 FXIcon* getItemIcon(FXint r,FXint c) const;
00824
00825
00826 void setItemData(FXint r,FXint c,void* ptr);
00827 void* getItemData(FXint r,FXint c) const;
00828
00829
00830
00831
00832
00833 void extractText(FXchar*& text,FXint& size,FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXchar* cs="\t",const FXchar* rs="\n") const;
00834 void extractText(FXString& text,FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXchar* cs="\t",const FXchar* rs="\n") const;
00835
00836
00837
00838
00839
00840
00841
00842 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);
00843 void overlayText(FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXString& text,const FXchar* cs="\t,",const FXchar* rs="\n",FXbool notify=FALSE);
00844
00845
00846
00847
00848
00849
00850 void countText(FXint& nr,FXint& nc,const FXchar* text,FXint size,const FXchar* cs="\t,",const FXchar* rs="\n") const;
00851 void countText(FXint& nr,FXint& nc,const FXString& text,const FXchar* cs="\t,",const FXchar* rs="\n") const;
00852
00853
00854 FXbool isItemSpanning(FXint r,FXint c) const;
00855
00856
00857 void updateRange(FXint sr,FXint er,FXint sc,FXint ec) const;
00858
00859
00860 void updateItem(FXint r,FXint c) const;
00861
00862
00863 virtual FXbool enableItem(FXint r,FXint c);
00864
00865
00866 virtual FXbool disableItem(FXint r,FXint c);
00867
00868
00869 FXbool isItemEnabled(FXint r,FXint c) const;
00870
00871
00872
00873
00874
00875
00876
00877
00878 void setItemJustify(FXint r,FXint c,FXuint justify);
00879
00880
00881 FXuint getItemJustify(FXint r,FXint c) const;
00882
00883
00884
00885
00886
00887
00888
00889
00890 void setItemIconPosition(FXint r,FXint c,FXuint mode);
00891
00892
00893 FXuint getItemIconPosition(FXint r,FXint c) const;
00894
00895
00896
00897
00898
00899
00900 void setItemBorders(FXint r,FXint c,FXuint borders);
00901
00902
00903 FXuint getItemBorders(FXint r,FXint c) const;
00904
00905
00906 void setItemStipple(FXint r,FXint c,FXStipplePattern pat);
00907
00908
00909 FXStipplePattern getItemStipple(FXint r,FXint c) const;
00910
00911
00912 virtual void setCurrentItem(FXint r,FXint c,FXbool notify=FALSE);
00913
00914
00915 FXint getCurrentRow() const { return current.row; }
00916
00917
00918 FXint getCurrentColumn() const { return current.col; }
00919
00920
00921 FXbool isItemCurrent(FXint r,FXint c) const;
00922
00923
00924 void setAnchorItem(FXint r,FXint c);
00925
00926
00927 FXint getAnchorRow() const { return anchor.row; }
00928
00929
00930 FXint getAnchorColumn() const { return anchor.col; }
00931
00932
00933 FXint getSelStartRow() const { return selection.fm.row; }
00934
00935
00936 FXint getSelStartColumn() const { return selection.fm.col; }
00937
00938
00939 FXint getSelEndRow() const { return selection.to.row; }
00940
00941
00942 FXint getSelEndColumn() const { return selection.to.col; }
00943
00944
00945 FXbool isItemSelected(FXint r,FXint c) const;
00946
00947
00948 FXbool isRowSelected(FXint r) const;
00949
00950
00951 FXbool isColumnSelected(FXint c) const;
00952
00953
00954 FXbool isAnythingSelected() const;
00955
00956
00957 virtual FXbool selectRow(FXint row,FXbool notify=FALSE);
00958
00959
00960 virtual FXbool selectColumn(FXint col,FXbool notify=FALSE);
00961
00962
00963 virtual FXbool selectRange(FXint startrow,FXint endrow,FXint startcol,FXint endcol,FXbool notify=FALSE);
00964
00965
00966 virtual FXbool extendSelection(FXint r,FXint c,FXbool notify=FALSE);
00967
00968
00969 virtual FXbool killSelection(FXbool notify=FALSE);
00970
00971
00972 void setFont(FXFont* fnt);
00973
00974
00975 FXFont* getFont() const { return font; }
00976
00977
00978 FXColor getTextColor() const { return textColor; }
00979 FXColor getBaseColor() const { return baseColor; }
00980 FXColor getHiliteColor() const { return hiliteColor; }
00981 FXColor getShadowColor() const { return shadowColor; }
00982 FXColor getBorderColor() const { return borderColor; }
00983 FXColor getSelBackColor() const { return selbackColor; }
00984 FXColor getSelTextColor() const { return seltextColor; }
00985 FXColor getGridColor() const { return gridColor; }
00986 FXColor getStippleColor() const { return stippleColor; }
00987 FXColor getCellBorderColor() const { return cellBorderColor; }
00988
00989
00990 void setTextColor(FXColor clr);
00991 void setBaseColor(FXColor clr);
00992 void setHiliteColor(FXColor clr);
00993 void setShadowColor(FXColor clr);
00994 void setBorderColor(FXColor clr);
00995 void setSelBackColor(FXColor clr);
00996 void setSelTextColor(FXColor clr);
00997 void setGridColor(FXColor clr);
00998 void setStippleColor(FXColor clr);
00999 void setCellBorderColor(FXColor clr);
01000
01001
01002 void setCellColor(FXint r,FXint c,FXColor clr);
01003
01004
01005 FXColor getCellColor(FXint r,FXint c) const;
01006
01007
01008 void setCellBorderWidth(FXint borderwidth);
01009
01010
01011 FXint getCellBorderWidth() const { return cellBorderWidth; }
01012
01013
01014 void setTableStyle(FXuint style);
01015
01016
01017 FXuint getTableStyle() const;
01018
01019
01020 void setColumnRenumbering(FXbool flag);
01021
01022
01023 FXbool getColumnRenumbering() const;
01024
01025
01026 void setRowRenumbering(FXbool flag);
01027
01028
01029 FXbool getRowRenumbering() const;
01030
01031
01032 void setHelpText(const FXString& text){ help=text; }
01033 const FXString& getHelpText() const { return help; }
01034
01035
01036 virtual void save(FXStream& store) const;
01037 virtual void load(FXStream& store);
01038
01039 virtual ~FXTable();
01040 };
01041
01042 }
01043
01044 #endif