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

FXTable.h
1 /********************************************************************************
2 * *
3 * T a b l e W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1999,2017 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXTABLE_H
22 #define FXTABLE_H
23 
24 #ifndef FXSCROLLAREA_H
25 #include "FXScrollArea.h"
26 #endif
27 
28 namespace FX {
29 
30 class FXIcon;
31 class FXFont;
32 class FXTable;
33 class FXHeader;
34 class FXButton;
35 
36 
38 enum { DEFAULT_MARGIN = 2 };
39 
40 
42 enum {
43  TABLE_COL_SIZABLE = 0x00100000,
44  TABLE_ROW_SIZABLE = 0x00200000,
45  TABLE_NO_COLSELECT = 0x00400000,
46  TABLE_NO_ROWSELECT = 0x00800000,
47  TABLE_READONLY = 0x01000000
48  };
49 
50 
52 struct FXTablePos {
53  FXint row;
54  FXint col;
55  };
56 
57 
59 struct FXTableRange {
60  FXTablePos fm;
61  FXTablePos to;
62  };
63 
64 
66 class FXAPI FXTableItem : public FXObject {
67  FXDECLARE(FXTableItem)
68  friend class FXTable;
69 protected:
70  FXString label;
71  FXString tip;
72  FXIcon *icon;
73  FXptr data;
74  FXuint state;
75 private:
76  FXTableItem(const FXTableItem&);
77  FXTableItem& operator=(const FXTableItem&);
78 protected:
79  FXTableItem():icon(NULL),data(NULL),state(0){}
80  FXint textWidth(const FXTable* table) const;
81  FXint textHeight(const FXTable* table) const;
82  virtual void draw(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
83  virtual void drawBorders(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
84  virtual void drawContent(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
85  virtual void drawPattern(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
86  virtual void drawBackground(const FXTable* table,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
87 public:
88  enum{
89  SELECTED = 0x00000001,
90  FOCUS = 0x00000002,
91  DISABLED = 0x00000004,
92  DRAGGABLE = 0x00000008,
93  RESERVED1 = 0x00000010,
94  RESERVED2 = 0x00000020,
95  ICONOWNED = 0x00000040,
96  RIGHT = 0x00002000,
97  LEFT = 0x00004000,
98  CENTER_X = 0,
99  TOP = 0x00008000,
100  BOTTOM = 0x00010000,
101  CENTER_Y = 0,
102  BEFORE = 0x00020000,
103  AFTER = 0x00040000,
104  ABOVE = 0x00080000,
105  BELOW = 0x00100000,
106  LBORDER = 0x00200000,
107  RBORDER = 0x00400000,
108  TBORDER = 0x00800000,
109  BBORDER = 0x01000000
110  };
111 public:
112 
114  FXTableItem(const FXString& text,FXIcon* ic=NULL,FXptr ptr=NULL):label(text),icon(ic),data(ptr),state(RIGHT|CENTER_Y){}
115 
117  virtual void setText(const FXString& txt);
118 
120  virtual FXString getText() const { return label; }
121 
123  virtual void setIcon(FXIcon* icn,FXbool owned=false);
124 
126  virtual FXIcon* getIcon() const { return icon; }
127 
129  void setTipText(const FXString& text){ tip=text; }
130 
132  const FXString& getTipText() const { return tip; }
133 
135  void setData(FXptr ptr){ data=ptr; }
136 
138  FXptr getData() const { return data; }
139 
141  virtual void setFocus(FXbool focus);
142 
144  FXbool hasFocus() const { return (state&FOCUS)!=0; }
145 
147  virtual void setSelected(FXbool selected);
148 
150  FXbool isSelected() const { return (state&SELECTED)!=0; }
151 
153  virtual void setEnabled(FXbool enabled);
154 
156  FXbool isEnabled() const { return (state&DISABLED)==0; }
157 
159  virtual void setDraggable(FXbool draggable);
160 
162  FXbool isDraggable() const { return (state&DRAGGABLE)!=0; }
163 
165  virtual void setJustify(FXuint justify=RIGHT|CENTER_Y);
166 
168  FXuint getJustify() const { return state&(RIGHT|LEFT|TOP|BOTTOM); }
169 
171  virtual void setIconPosition(FXuint mode);
172 
174  FXuint getIconPosition() const { return state&(BEFORE|AFTER|ABOVE|BELOW); }
175 
177  virtual void setBorders(FXuint borders=0);
178 
180  FXuint getBorders() const { return state&(LBORDER|RBORDER|TBORDER|BBORDER); }
181 
183  virtual void setStipple(FXStipplePattern pattern);
184 
186  FXStipplePattern getStipple() const;
187 
189  virtual FXWindow* getControlFor(FXTable* table);
190 
192  virtual void setFromControl(FXWindow* control);
193 
195  virtual FXint getWidth(const FXTable* table) const;
196 
198  virtual FXint getHeight(const FXTable* table) const;
199 
201  virtual void create();
202 
204  virtual void detach();
205 
207  virtual void destroy();
208 
210  virtual void save(FXStream& store) const;
211 
213  virtual void load(FXStream& store);
214 
216  virtual ~FXTableItem();
217  };
218 
219 
221 class FXAPI FXComboTableItem : public FXTableItem {
222  FXDECLARE(FXComboTableItem)
223 protected:
224  FXString selections;
225 private:
227  FXComboTableItem& operator=(const FXComboTableItem&);
228 protected:
229  FXComboTableItem(){}
230 public:
231 
233  FXComboTableItem(const FXString& text,FXIcon* ic=NULL,void* ptr=NULL);
234 
236  virtual FXWindow *getControlFor(FXTable* table);
237 
239  virtual void setFromControl(FXWindow *control);
240 
242  void setSelections(const FXString& strings);
243 
245  const FXString& getSelections() const { return selections; }
246  };
247 
248 
288 class FXAPI FXTable : public FXScrollArea {
289  FXDECLARE(FXTable)
290 protected:
291  FXHeader *colHeader; // Column header
292  FXHeader *rowHeader; // Row header
293  FXButton *cornerButton; // Corner button
294  FXTableItem **cells; // Cells
295  FXWindow *editor; // Editor widget
296  FXFont *font; // Font
297  FXint nrows; // Number of rows
298  FXint ncols; // Number of columns
299  FXint visiblerows; // Visible rows
300  FXint visiblecols; // Visible columns
301  FXint margintop; // Margin top
302  FXint marginbottom; // Margin bottom
303  FXint marginleft; // Margin left
304  FXint marginright; // Margin right
305  FXColor textColor; // Normal text color
306  FXColor baseColor; // Base color
307  FXColor hiliteColor; // Highlight color
308  FXColor shadowColor; // Shadow color
309  FXColor borderColor; // Border color
310  FXColor selbackColor; // Select background color
311  FXColor seltextColor; // Select text color
312  FXColor gridColor; // Grid line color
313  FXColor stippleColor; // Stipple color
314  FXColor cellBorderColor; // Cell border color
315  FXint cellBorderWidth; // Cell border width
316  FXColor cellBackColor[2][2]; // Row/Column even/odd background color
317  FXint defColWidth; // Default column width [if uniform columns]
318  FXint defRowHeight; // Default row height [if uniform rows]
319  FXTablePos current; // Current position
320  FXTablePos anchor; // Anchor position
321  FXTableRange input; // Input cell
322  FXTableRange selection; // Range of selected cells
323  FXString clipped; // Clipped text
324  FXbool hgrid; // Horizontal grid lines shown
325  FXbool vgrid; // Vertical grid lines shown
326  FXuchar mode; // Mode widget is in
327  FXint grabx; // Grab point x
328  FXint graby; // Grab point y
329  FXint rowcol; // Row or column being resized
330  FXString help;
331 public:
332  static FXDragType csvType;
333  static const FXchar csvTypeName[];
334 protected:
335  FXTable();
336  virtual void moveContents(FXint x,FXint y);
337  virtual void drawCell(FXDC& dc,FXint sr,FXint er,FXint sc,FXint ec);
338  virtual void drawRange(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
339  virtual void drawHGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
340  virtual void drawVGrid(FXDC& dc,FXint rlo,FXint rhi,FXint clo,FXint chi);
341  virtual void drawContents(FXDC& dc,FXint x,FXint y,FXint w,FXint h);
342  virtual FXTableItem* createItem(const FXString& text,FXIcon* icon,void* ptr);
343  virtual FXWindow* getControlForItem(FXint r,FXint c);
344  virtual void setItemFromControl(FXint r,FXint c,FXWindow* control);
345 protected:
346  enum {
347  MOUSE_NONE,
348  MOUSE_SCROLL,
349  MOUSE_DRAG,
350  MOUSE_SELECT
351  };
352 private:
353  FXTable(const FXTable&);
354  FXTable& operator=(const FXTable&);
355 public:
356  long onPaint(FXObject*,FXSelector,void*);
357  long onEnter(FXObject*,FXSelector,void*);
358  long onLeave(FXObject*,FXSelector,void*);
359  long onFocusIn(FXObject*,FXSelector,void*);
360  long onFocusOut(FXObject*,FXSelector,void*);
361  long onMotion(FXObject*,FXSelector,void*);
362  long onKeyPress(FXObject*,FXSelector,void*);
363  long onKeyRelease(FXObject*,FXSelector,void*);
364  long onLeftBtnPress(FXObject*,FXSelector,void*);
365  long onLeftBtnRelease(FXObject*,FXSelector,void*);
366  long onRightBtnPress(FXObject*,FXSelector,void*);
367  long onRightBtnRelease(FXObject*,FXSelector,void*);
368  long onUngrabbed(FXObject*,FXSelector,void*);
369  long onSelectionLost(FXObject*,FXSelector,void*);
370  long onSelectionGained(FXObject*,FXSelector,void*);
371  long onSelectionRequest(FXObject*,FXSelector,void* ptr);
372  long onClipboardLost(FXObject*,FXSelector,void*);
373  long onClipboardGained(FXObject*,FXSelector,void*);
374  long onClipboardRequest(FXObject*,FXSelector,void*);
375  long onAutoScroll(FXObject*,FXSelector,void*);
376  long onCommand(FXObject*,FXSelector,void*);
377  long onClicked(FXObject*,FXSelector,void*);
378  long onDoubleClicked(FXObject*,FXSelector,void*);
379  long onTripleClicked(FXObject*,FXSelector,void*);
380  long onQueryTip(FXObject*,FXSelector,void*);
381  long onQueryHelp(FXObject*,FXSelector,void*);
382  long onTipTimer(FXObject*,FXSelector,void*);
383 
384  long onCmdToggleEditable(FXObject*,FXSelector,void*);
385  long onUpdToggleEditable(FXObject*,FXSelector,void*);
386 
387  // Visual characteristics
388  long onCmdHorzGrid(FXObject*,FXSelector,void*);
389  long onUpdHorzGrid(FXObject*,FXSelector,void*);
390  long onCmdVertGrid(FXObject*,FXSelector,void*);
391  long onUpdVertGrid(FXObject*,FXSelector,void*);
392 
393  // Row/Column manipulations
394  long onCmdDeleteColumn(FXObject*,FXSelector,void*);
395  long onUpdDeleteColumn(FXObject*,FXSelector,void*);
396  long onCmdDeleteRow(FXObject*,FXSelector,void*);
397  long onUpdDeleteRow(FXObject*,FXSelector,void*);
398  long onCmdInsertColumn(FXObject*,FXSelector,void*);
399  long onUpdInsertColumn(FXObject*,FXSelector,void*);
400  long onCmdInsertRow(FXObject*,FXSelector,void*);
401  long onUpdInsertRow(FXObject*,FXSelector,void*);
402 
403  // Movement
404  long onCmdMoveRight(FXObject*,FXSelector,void*);
405  long onCmdMoveLeft(FXObject*,FXSelector,void*);
406  long onCmdMoveUp(FXObject*,FXSelector,void*);
407  long onCmdMoveDown(FXObject*,FXSelector,void*);
408  long onCmdMoveHome(FXObject*,FXSelector,void*);
409  long onCmdMoveEnd(FXObject*,FXSelector,void*);
410  long onCmdMoveTop(FXObject*,FXSelector,void*);
411  long onCmdMoveBottom(FXObject*,FXSelector,void*);
412  long onCmdMovePageDown(FXObject*,FXSelector,void*);
413  long onCmdMovePageUp(FXObject*,FXSelector,void*);
414 
415  // Mark and extend
416  long onCmdMark(FXObject*,FXSelector,void*);
417  long onCmdExtend(FXObject*,FXSelector,void*);
418 
419  // Changing Selection
420  long onUpdSelectCell(FXObject*,FXSelector,void*);
421  long onCmdSelectCell(FXObject*,FXSelector,void*);
422  long onUpdSelectRow(FXObject*,FXSelector,void*);
423  long onCmdSelectRow(FXObject*,FXSelector,void*);
424  long onUpdSelectColumn(FXObject*,FXSelector,void*);
425  long onCmdSelectColumn(FXObject*,FXSelector,void*);
426  long onCmdSelectRowIndex(FXObject*,FXSelector,void*);
427  long onCmdSelectColumnIndex(FXObject*,FXSelector,void*);
428  long onUpdSelectAll(FXObject*,FXSelector,void*);
429  long onCmdSelectAll(FXObject*,FXSelector,void*);
430  long onUpdDeselectAll(FXObject*,FXSelector,void*);
431  long onCmdDeselectAll(FXObject*,FXSelector,void*);
432 
433  // Manipulation Selection
434  long onCmdCutSel(FXObject*,FXSelector,void*);
435  long onCmdCopySel(FXObject*,FXSelector,void*);
436  long onCmdDeleteSel(FXObject*,FXSelector,void*);
437  long onCmdPasteSel(FXObject*,FXSelector,void*);
438  long onUpdHaveSelection(FXObject*,FXSelector,void*);
439 
440  // Edit control
441  long onCmdStartInput(FXObject*,FXSelector,void*);
442  long onUpdStartInput(FXObject*,FXSelector,void*);
443  long onCmdAcceptInput(FXObject*,FXSelector,void*);
444  long onUpdAcceptInput(FXObject*,FXSelector,void*);
445  long onCmdCancelInput(FXObject*,FXSelector,void*);
446 public:
447 
448  enum {
449  ID_HORZ_GRID=FXScrollArea::ID_LAST,
450  ID_VERT_GRID,
451  ID_TOGGLE_EDITABLE,
452  ID_DELETE_COLUMN,
453  ID_DELETE_ROW,
454  ID_INSERT_COLUMN,
455  ID_INSERT_ROW,
456  ID_SELECT_COLUMN_INDEX,
457  ID_SELECT_ROW_INDEX,
458  ID_SELECT_COLUMN,
459  ID_SELECT_ROW,
460  ID_SELECT_CELL,
461  ID_SELECT_ALL,
462  ID_DESELECT_ALL,
463  ID_MOVE_LEFT,
464  ID_MOVE_RIGHT,
465  ID_MOVE_UP,
466  ID_MOVE_DOWN,
467  ID_MOVE_HOME,
468  ID_MOVE_END,
469  ID_MOVE_TOP,
470  ID_MOVE_BOTTOM,
471  ID_MOVE_PAGEDOWN,
472  ID_MOVE_PAGEUP,
473  ID_START_INPUT,
474  ID_CANCEL_INPUT,
475  ID_ACCEPT_INPUT,
476  ID_MARK,
477  ID_EXTEND,
478  ID_CUT_SEL,
479  ID_COPY_SEL,
480  ID_PASTE_SEL,
481  ID_DELETE_SEL,
482  ID_LAST
483  };
484 
485 public:
486 
492  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);
493 
495  virtual void create();
496 
498  virtual void detach();
499 
501  virtual FXint getContentWidth();
502 
504  virtual FXint getContentHeight();
505 
507  virtual FXint getVisibleX() const;
508 
510  virtual FXint getVisibleY() const;
511 
513  virtual FXint getVisibleWidth() const;
514 
516  virtual FXint getVisibleHeight() const;
517 
519  virtual FXint getDefaultWidth();
520 
522  virtual FXint getDefaultHeight();
523 
525  virtual void layout();
526 
528  virtual void recalc();
529 
531  virtual FXbool canFocus() const;
532 
534  virtual void setFocus();
535 
537  virtual void killFocus();
538 
540  virtual void changeFocus(FXWindow *child);
541 
543  FXButton* getCornerButton() const { return cornerButton; }
544 
546  FXHeader* getColumnHeader() const { return colHeader; }
547 
549  FXHeader* getRowHeader() const { return rowHeader; }
550 
552  void setVisibleRows(FXint nvrows);
553 
555  FXint getVisibleRows() const { return visiblerows; }
556 
558  void setVisibleColumns(FXint nvcols);
559 
561  FXint getVisibleColumns() const { return visiblecols; }
562 
564  FXbool isEditable() const;
565 
567  void setEditable(FXbool edit=true);
568 
570  void showHorzGrid(FXbool on=true);
571 
573  FXbool isHorzGridShown() const { return hgrid; }
574 
576  void showVertGrid(FXbool on=true);
577 
579  FXbool isVertGridShown() const { return vgrid; }
580 
582  FXint getNumRows() const { return nrows; }
583 
585  FXint getNumColumns() const { return ncols; }
586 
588  void setMarginTop(FXint pt);
589 
591  FXint getMarginTop() const { return margintop; }
592 
594  void setMarginBottom(FXint pb);
595 
597  FXint getMarginBottom() const { return marginbottom; }
598 
600  void setMarginLeft(FXint pl);
601 
603  FXint getMarginLeft() const { return marginleft; }
604 
606  void setMarginRight(FXint pr);
607 
609  FXint getMarginRight() const { return marginright; }
610 
619  virtual FXbool startInput(FXint row,FXint col);
620 
627  virtual FXbool cancelInput();
628 
638  virtual FXbool acceptInput(FXbool notify=false);
639 
645  FXint colAtX(FXint x) const;
646 
652  FXint rowAtY(FXint y) const;
653 
655  void setItem(FXint row,FXint col,FXTableItem* item,FXbool notify=false);
656 
658  FXTableItem *getItem(FXint row,FXint col) const;
659 
661  virtual void setTableSize(FXint nr,FXint nc,FXbool notify=false);
662 
664  virtual void insertRows(FXint row,FXint nr=1,FXbool notify=false);
665 
667  virtual void insertColumns(FXint col,FXint nc=1,FXbool notify=false);
668 
670  virtual void removeRows(FXint row,FXint nr=1,FXbool notify=false);
671 
673  virtual void removeColumns(FXint col,FXint nc=1,FXbool notify=false);
674 
676  virtual FXTableItem* extractItem(FXint row,FXint col,FXbool notify=false);
677 
679  virtual void removeItem(FXint row,FXint col,FXbool notify=false);
680 
682  virtual void removeRange(FXint startrow,FXint endrow,FXint startcol,FXint endcol,FXbool notify=false);
683 
685  virtual void clearItems(FXbool notify=false);
686 
688  virtual void makePositionVisible(FXint row,FXint col);
689 
691  FXbool isItemVisible(FXint row,FXint col) const;
692 
701  void setColumnHeaderMode(FXuint hint=LAYOUT_FIX_HEIGHT);
702 
704  FXuint getColumnHeaderMode() const;
705 
714  void setRowHeaderMode(FXuint hint=LAYOUT_FIX_WIDTH);
715 
717  FXuint getRowHeaderMode() const;
718 
720  void setColumnHeaderFont(FXFont* fnt);
721 
723  FXFont* getColumnHeaderFont() const;
724 
726  void setRowHeaderFont(FXFont* fnt);
727 
729  FXFont* getRowHeaderFont() const;
730 
732  void setColumnHeaderHeight(FXint h);
733 
735  FXint getColumnHeaderHeight() const;
736 
738  void setRowHeaderWidth(FXint w);
739 
741  FXint getRowHeaderWidth() const;
742 
744  FXint getColumnX(FXint col) const;
745 
747  FXint getRowY(FXint row) const;
748 
750  virtual void setColumnWidth(FXint col,FXint cwidth);
751 
753  FXint getColumnWidth(FXint col) const;
754 
756  virtual void setRowHeight(FXint row,FXint rheight);
757 
759  FXint getRowHeight(FXint row) const;
760 
762  void setDefColumnWidth(FXint cwidth);
763 
765  FXint getDefColumnWidth() const { return defColWidth; }
766 
768  void setDefRowHeight(FXint rheight);
769 
771  FXint getDefRowHeight() const { return defRowHeight; }
772 
774  FXint getMinRowHeight(FXint row) const;
775 
777  FXint getMinColumnWidth(FXint col) const;
778 
780  void fitRowsToContents(FXint row,FXint nr=1);
781 
783  void fitColumnsToContents(FXint col,FXint nc=1);
784 
786  void setColumnText(FXint col,const FXString& text);
787 
789  FXString getColumnText(FXint col) const;
790 
792  void setRowText(FXint row,const FXString& text);
793 
795  FXString getRowText(FXint row) const;
796 
798  void setColumnIcon(FXint col,FXIcon* icon);
799 
801  FXIcon* getColumnIcon(FXint col) const;
802 
804  void setRowIcon(FXint row,FXIcon* icon);
805 
807  FXIcon* getRowIcon(FXint row) const;
808 
810  void setColumnTipText(FXint col,const FXString& text);
811 
813  FXString getColumnTipText(FXint col) const;
814 
816  void setRowTipText(FXint row,const FXString& text);
817 
819  FXString getRowTipText(FXint row) const;
820 
822  void setColumnIconPosition(FXint col,FXuint m);
823 
825  FXuint getColumnIconPosition(FXint col) const;
826 
828  void setRowIconPosition(FXint row,FXuint m);
829 
831  FXuint getRowIconPosition(FXint row) const;
832 
834  void setColumnJustify(FXint col,FXuint justify);
835 
837  FXuint getColumnJustify(FXint col) const;
838 
840  void setRowJustify(FXint row,FXuint justify);
841 
843  FXuint getRowJustify(FXint row) const;
844 
846  void setItemText(FXint row,FXint col,const FXString& text,FXbool notify=false);
847 
849  FXString getItemText(FXint row,FXint col) const;
850 
852  void setItemTipText(FXint row,FXint col,const FXString& text);
853 
855  FXString getItemTipText(FXint row,FXint col) const;
856 
858  void setItemIcon(FXint row,FXint col,FXIcon* icon,FXbool owned=false,FXbool notify=false);
859 
861  FXIcon* getItemIcon(FXint row,FXint col) const;
862 
864  void setItemData(FXint row,FXint col,FXptr ptr);
865 
867  FXptr getItemData(FXint row,FXint col) const;
868 
873  void extractText(FXchar*& text,FXint& size,FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXchar* cs="\t",const FXchar* rs="\n") const;
874  void extractText(FXString& text,FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXchar* cs="\t",const FXchar* rs="\n") const;
875 
882  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);
883  void overlayText(FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXString& text,const FXchar* cs="\t,",const FXchar* rs="\n",FXbool notify=false);
884 
890  void countText(FXint& nr,FXint& nc,const FXchar* text,FXint size,const FXchar* cs="\t,",const FXchar* rs="\n") const;
891  void countText(FXint& nr,FXint& nc,const FXString& text,const FXchar* cs="\t,",const FXchar* rs="\n") const;
892 
894  virtual FXbool setSpanningRange(FXint row,FXint col,FXint fr,FXint lr,FXint fc,FXint lc,FXbool notify=false);
895 
897  void getSpanningRange(FXint row,FXint col,FXint& fr,FXint& lr,FXint& fc,FXint& lc) const;
898 
900  FXbool isItemSpanning(FXint row,FXint col) const;
901 
903  FXbool isItemHorizontalSpanning(FXint row,FXint col) const;
904 
906  FXbool isItemVerticalSpanning(FXint row,FXint col) const;
907 
909  void updateRange(FXint sr,FXint er,FXint sc,FXint ec) const;
910 
912  void updateItem(FXint row,FXint col) const;
913 
915  virtual FXbool enableItem(FXint row,FXint col);
916 
918  virtual FXbool disableItem(FXint row,FXint col);
919 
921  FXbool isItemEnabled(FXint row,FXint col) const;
922 
930  void setItemJustify(FXint row,FXint col,FXuint justify);
931 
933  FXuint getItemJustify(FXint row,FXint col) const;
934 
942  void setItemIconPosition(FXint row,FXint col,FXuint m);
943 
945  FXuint getItemIconPosition(FXint row,FXint col) const;
946 
952  void setItemBorders(FXint row,FXint col,FXuint borders);
953 
955  FXuint getItemBorders(FXint row,FXint col) const;
956 
958  void setItemStipple(FXint row,FXint col,FXStipplePattern pat);
959 
961  FXStipplePattern getItemStipple(FXint row,FXint col) const;
962 
964  virtual void setCurrentItem(FXint row,FXint col,FXbool notify=false);
965 
967  FXint getCurrentRow() const { return current.row; }
968 
970  FXint getCurrentColumn() const { return current.col; }
971 
973  FXbool isItemCurrent(FXint row,FXint col) const;
974 
976  void setAnchorItem(FXint row,FXint col);
977 
979  FXint getAnchorRow() const { return anchor.row; }
980 
982  FXint getAnchorColumn() const { return anchor.col; }
983 
985  FXint getSelStartRow() const { return selection.fm.row; }
986 
988  FXint getSelStartColumn() const { return selection.fm.col; }
989 
991  FXint getSelEndRow() const { return selection.to.row; }
992 
994  FXint getSelEndColumn() const { return selection.to.col; }
995 
997  FXbool isItemSelected(FXint row,FXint col) const;
998 
1000  FXbool isRowSelected(FXint row) const;
1001 
1003  FXbool isColumnSelected(FXint col) const;
1004 
1006  FXbool isAnythingSelected() const;
1007 
1009  virtual FXbool selectCell(FXint row,FXint col,FXbool notify=false);
1010 
1012  virtual FXbool selectRow(FXint row,FXbool notify=false);
1013 
1015  virtual FXbool selectColumn(FXint col,FXbool notify=false);
1016 
1018  virtual FXbool selectRange(FXint nrlo,FXint nrhi,FXint nclo,FXint nchi,FXbool notify=false);
1019 
1021  virtual FXbool extendSelection(FXint row,FXint col,FXbool notify=false);
1022 
1024  virtual FXbool killSelection(FXbool notify=false);
1025 
1027  void setFont(FXFont* fnt);
1028 
1030  FXFont* getFont() const { return font; }
1031 
1033  FXColor getTextColor() const { return textColor; }
1034  FXColor getBaseColor() const { return baseColor; }
1035  FXColor getHiliteColor() const { return hiliteColor; }
1036  FXColor getShadowColor() const { return shadowColor; }
1037  FXColor getBorderColor() const { return borderColor; }
1038  FXColor getSelBackColor() const { return selbackColor; }
1039  FXColor getSelTextColor() const { return seltextColor; }
1040  FXColor getGridColor() const { return gridColor; }
1041  FXColor getStippleColor() const { return stippleColor; }
1042  FXColor getCellBorderColor() const { return cellBorderColor; }
1043 
1045  void setTextColor(FXColor clr);
1046  void setBaseColor(FXColor clr);
1047  void setHiliteColor(FXColor clr);
1048  void setShadowColor(FXColor clr);
1049  void setBorderColor(FXColor clr);
1050  void setSelBackColor(FXColor clr);
1051  void setSelTextColor(FXColor clr);
1052  void setGridColor(FXColor clr);
1053  void setStippleColor(FXColor clr);
1054  void setCellBorderColor(FXColor clr);
1055 
1057  void setCellColor(FXint row,FXint col,FXColor clr);
1058 
1060  FXColor getCellColor(FXint row,FXint col) const;
1061 
1063  void setCellBorderWidth(FXint borderwidth);
1064 
1066  FXint getCellBorderWidth() const { return cellBorderWidth; }
1067 
1069  void setTableStyle(FXuint style);
1070 
1072  FXuint getTableStyle() const;
1073 
1075  void setColumnRenumbering(FXNumberingFunc func);
1076 
1078  FXNumberingFunc getColumnRenumbering() const;
1079 
1081  void setRowRenumbering(FXNumberingFunc func);
1082 
1084  FXNumberingFunc getRowRenumbering() const;
1085 
1087  void setHelpText(const FXString& text){ help=text; }
1088  const FXString& getHelpText() const { return help; }
1089 
1091  virtual void save(FXStream& store) const;
1092  virtual void load(FXStream& store);
1093 
1094  virtual ~FXTable();
1095  };
1096 
1097 }
1098 
1099 #endif

Copyright © 1997-2016 Jeroen van der Zijp