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,2022 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(nullptr),data(nullptr),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=nullptr,FXptr ptr=nullptr):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=nullptr,void* ptr=nullptr);
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=nullptr,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  FXButton* getCornerButton() const { return cornerButton; }
541 
543  FXHeader* getColumnHeader() const { return colHeader; }
544 
546  FXHeader* getRowHeader() const { return rowHeader; }
547 
549  void setVisibleRows(FXint nvrows);
550 
552  FXint getVisibleRows() const { return visiblerows; }
553 
555  void setVisibleColumns(FXint nvcols);
556 
558  FXint getVisibleColumns() const { return visiblecols; }
559 
561  FXbool isEditable() const;
562 
564  void setEditable(FXbool edit=true);
565 
567  void showHorzGrid(FXbool on=true);
568 
570  FXbool isHorzGridShown() const { return hgrid; }
571 
573  void showVertGrid(FXbool on=true);
574 
576  FXbool isVertGridShown() const { return vgrid; }
577 
579  FXint getNumRows() const { return nrows; }
580 
582  FXint getNumColumns() const { return ncols; }
583 
585  void setMarginTop(FXint pt);
586 
588  FXint getMarginTop() const { return margintop; }
589 
591  void setMarginBottom(FXint pb);
592 
594  FXint getMarginBottom() const { return marginbottom; }
595 
597  void setMarginLeft(FXint pl);
598 
600  FXint getMarginLeft() const { return marginleft; }
601 
603  void setMarginRight(FXint pr);
604 
606  FXint getMarginRight() const { return marginright; }
607 
616  virtual FXbool startInput(FXint row,FXint col);
617 
624  virtual FXbool cancelInput();
625 
635  virtual FXbool acceptInput(FXbool notify=false);
636 
642  FXint colAtX(FXint x) const;
643 
649  FXint rowAtY(FXint y) const;
650 
652  void setItem(FXint row,FXint col,FXTableItem* item,FXbool notify=false);
653 
655  FXTableItem *getItem(FXint row,FXint col) const;
656 
658  virtual void setTableSize(FXint nr,FXint nc,FXbool notify=false);
659 
661  virtual void insertRows(FXint row,FXint nr=1,FXbool notify=false);
662 
664  virtual void insertColumns(FXint col,FXint nc=1,FXbool notify=false);
665 
667  virtual void removeRows(FXint row,FXint nr=1,FXbool notify=false);
668 
670  virtual void removeColumns(FXint col,FXint nc=1,FXbool notify=false);
671 
673  virtual FXTableItem* extractItem(FXint row,FXint col,FXbool notify=false);
674 
676  virtual void removeItem(FXint row,FXint col,FXbool notify=false);
677 
679  virtual void removeRange(FXint startrow,FXint endrow,FXint startcol,FXint endcol,FXbool notify=false);
680 
682  virtual void clearItems(FXbool notify=false);
683 
685  virtual void makePositionVisible(FXint row,FXint col);
686 
688  FXbool isItemVisible(FXint row,FXint col) const;
689 
698  void setColumnHeaderMode(FXuint hint=LAYOUT_FIX_HEIGHT);
699 
701  FXuint getColumnHeaderMode() const;
702 
711  void setRowHeaderMode(FXuint hint=LAYOUT_FIX_WIDTH);
712 
714  FXuint getRowHeaderMode() const;
715 
717  void setColumnHeaderFont(FXFont* fnt);
718 
720  FXFont* getColumnHeaderFont() const;
721 
723  void setRowHeaderFont(FXFont* fnt);
724 
726  FXFont* getRowHeaderFont() const;
727 
729  void setColumnHeaderHeight(FXint h);
730 
732  FXint getColumnHeaderHeight() const;
733 
735  void setRowHeaderWidth(FXint w);
736 
738  FXint getRowHeaderWidth() const;
739 
741  FXint getColumnX(FXint col) const;
742 
744  FXint getRowY(FXint row) const;
745 
747  virtual void setColumnWidth(FXint col,FXint cwidth);
748 
750  FXint getColumnWidth(FXint col) const;
751 
753  virtual void setRowHeight(FXint row,FXint rheight);
754 
756  FXint getRowHeight(FXint row) const;
757 
759  void setDefColumnWidth(FXint cwidth);
760 
762  FXint getDefColumnWidth() const { return defColWidth; }
763 
765  void setDefRowHeight(FXint rheight);
766 
768  FXint getDefRowHeight() const { return defRowHeight; }
769 
771  FXint getMinRowHeight(FXint row) const;
772 
774  FXint getMinColumnWidth(FXint col) const;
775 
777  void fitRowsToContents(FXint row,FXint nr=1);
778 
780  void fitColumnsToContents(FXint col,FXint nc=1);
781 
783  void setColumnText(FXint col,const FXString& text);
784 
786  FXString getColumnText(FXint col) const;
787 
789  void setRowText(FXint row,const FXString& text);
790 
792  FXString getRowText(FXint row) const;
793 
795  void setColumnIcon(FXint col,FXIcon* icon);
796 
798  FXIcon* getColumnIcon(FXint col) const;
799 
801  void setRowIcon(FXint row,FXIcon* icon);
802 
804  FXIcon* getRowIcon(FXint row) const;
805 
807  void setColumnTipText(FXint col,const FXString& text);
808 
810  FXString getColumnTipText(FXint col) const;
811 
813  void setRowTipText(FXint row,const FXString& text);
814 
816  FXString getRowTipText(FXint row) const;
817 
819  void setColumnIconPosition(FXint col,FXuint m);
820 
822  FXuint getColumnIconPosition(FXint col) const;
823 
825  void setRowIconPosition(FXint row,FXuint m);
826 
828  FXuint getRowIconPosition(FXint row) const;
829 
831  void setColumnJustify(FXint col,FXuint justify);
832 
834  FXuint getColumnJustify(FXint col) const;
835 
837  void setRowJustify(FXint row,FXuint justify);
838 
840  FXuint getRowJustify(FXint row) const;
841 
843  void setItemText(FXint row,FXint col,const FXString& text,FXbool notify=false);
844 
846  FXString getItemText(FXint row,FXint col) const;
847 
849  void setItemTipText(FXint row,FXint col,const FXString& text);
850 
852  FXString getItemTipText(FXint row,FXint col) const;
853 
855  void setItemIcon(FXint row,FXint col,FXIcon* icon,FXbool owned=false,FXbool notify=false);
856 
858  FXIcon* getItemIcon(FXint row,FXint col) const;
859 
861  void setItemData(FXint row,FXint col,FXptr ptr);
862 
864  FXptr getItemData(FXint row,FXint col) const;
865 
870  void extractText(FXchar*& text,FXint& size,FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXchar* cs="\t",const FXchar* rs="\n") const;
871  void extractText(FXString& text,FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXchar* cs="\t",const FXchar* rs="\n") const;
872 
879  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);
880  void overlayText(FXint startrow,FXint endrow,FXint startcol,FXint endcol,const FXString& text,const FXchar* cs="\t,",const FXchar* rs="\n",FXbool notify=false);
881 
887  void countText(FXint& nr,FXint& nc,const FXchar* text,FXint size,const FXchar* cs="\t,",const FXchar* rs="\n") const;
888  void countText(FXint& nr,FXint& nc,const FXString& text,const FXchar* cs="\t,",const FXchar* rs="\n") const;
889 
891  virtual FXbool setSpanningRange(FXint row,FXint col,FXint fr,FXint lr,FXint fc,FXint lc,FXbool notify=false);
892 
894  void getSpanningRange(FXint row,FXint col,FXint& fr,FXint& lr,FXint& fc,FXint& lc) const;
895 
897  FXbool isItemSpanning(FXint row,FXint col) const;
898 
900  FXbool isItemHorizontalSpanning(FXint row,FXint col) const;
901 
903  FXbool isItemVerticalSpanning(FXint row,FXint col) const;
904 
906  void updateRange(FXint sr,FXint er,FXint sc,FXint ec) const;
907 
909  void updateItem(FXint row,FXint col) const;
910 
912  virtual FXbool enableItem(FXint row,FXint col);
913 
915  virtual FXbool disableItem(FXint row,FXint col);
916 
918  FXbool isItemEnabled(FXint row,FXint col) const;
919 
927  void setItemJustify(FXint row,FXint col,FXuint justify);
928 
930  FXuint getItemJustify(FXint row,FXint col) const;
931 
939  void setItemIconPosition(FXint row,FXint col,FXuint m);
940 
942  FXuint getItemIconPosition(FXint row,FXint col) const;
943 
949  void setItemBorders(FXint row,FXint col,FXuint borders);
950 
952  FXuint getItemBorders(FXint row,FXint col) const;
953 
955  void setItemStipple(FXint row,FXint col,FXStipplePattern pat);
956 
958  FXStipplePattern getItemStipple(FXint row,FXint col) const;
959 
961  virtual void setCurrentItem(FXint row,FXint col,FXbool notify=false);
962 
964  FXint getCurrentRow() const { return current.row; }
965 
967  FXint getCurrentColumn() const { return current.col; }
968 
970  FXbool isItemCurrent(FXint row,FXint col) const;
971 
973  void setAnchorItem(FXint row,FXint col);
974 
976  FXint getAnchorRow() const { return anchor.row; }
977 
979  FXint getAnchorColumn() const { return anchor.col; }
980 
982  FXint getSelStartRow() const { return selection.fm.row; }
983 
985  FXint getSelStartColumn() const { return selection.fm.col; }
986 
988  FXint getSelEndRow() const { return selection.to.row; }
989 
991  FXint getSelEndColumn() const { return selection.to.col; }
992 
994  FXbool isItemSelected(FXint row,FXint col) const;
995 
997  FXbool isRowSelected(FXint row) const;
998 
1000  FXbool isColumnSelected(FXint col) const;
1001 
1003  FXbool isAnythingSelected() const;
1004 
1006  virtual FXbool selectCell(FXint row,FXint col,FXbool notify=false);
1007 
1009  virtual FXbool selectRow(FXint row,FXbool notify=false);
1010 
1012  virtual FXbool selectColumn(FXint col,FXbool notify=false);
1013 
1015  virtual FXbool selectRange(FXint nrlo,FXint nrhi,FXint nclo,FXint nchi,FXbool notify=false);
1016 
1018  virtual FXbool extendSelection(FXint row,FXint col,FXbool notify=false);
1019 
1021  virtual FXbool killSelection(FXbool notify=false);
1022 
1024  void setFont(FXFont* fnt);
1025 
1027  FXFont* getFont() const { return font; }
1028 
1030  FXColor getTextColor() const { return textColor; }
1031  FXColor getBaseColor() const { return baseColor; }
1032  FXColor getHiliteColor() const { return hiliteColor; }
1033  FXColor getShadowColor() const { return shadowColor; }
1034  FXColor getBorderColor() const { return borderColor; }
1035  FXColor getSelBackColor() const { return selbackColor; }
1036  FXColor getSelTextColor() const { return seltextColor; }
1037  FXColor getGridColor() const { return gridColor; }
1038  FXColor getStippleColor() const { return stippleColor; }
1039  FXColor getCellBorderColor() const { return cellBorderColor; }
1040 
1042  void setTextColor(FXColor clr);
1043  void setBaseColor(FXColor clr);
1044  void setHiliteColor(FXColor clr);
1045  void setShadowColor(FXColor clr);
1046  void setBorderColor(FXColor clr);
1047  void setSelBackColor(FXColor clr);
1048  void setSelTextColor(FXColor clr);
1049  void setGridColor(FXColor clr);
1050  void setStippleColor(FXColor clr);
1051  void setCellBorderColor(FXColor clr);
1052 
1054  void setCellColor(FXint row,FXint col,FXColor clr);
1055 
1057  FXColor getCellColor(FXint row,FXint col) const;
1058 
1060  void setCellBorderWidth(FXint borderwidth);
1061 
1063  FXint getCellBorderWidth() const { return cellBorderWidth; }
1064 
1066  void setTableStyle(FXuint style);
1067 
1069  FXuint getTableStyle() const;
1070 
1072  void setColumnRenumbering(FXNumberingFunc func);
1073 
1075  FXNumberingFunc getColumnRenumbering() const;
1076 
1078  void setRowRenumbering(FXNumberingFunc func);
1079 
1081  FXNumberingFunc getRowRenumbering() const;
1082 
1084  void setHelpText(const FXString& text){ help=text; }
1085  const FXString& getHelpText() const { return help; }
1086 
1088  virtual void save(FXStream& store) const;
1089  virtual void load(FXStream& store);
1090 
1091  virtual ~FXTable();
1092  };
1093 
1094 }
1095 
1096 #endif
FXint getSelStartColumn() const
Get selection start column; returns -1 if no selection.
Definition: FXTable.h:985
FXint getVisibleRows() const
return number of visible rows
Definition: FXTable.h:552
Combobox Item.
Definition: FXTable.h:221
void setTipText(const FXString &text)
Set the tool tip message for this item.
Definition: FXTable.h:129
Item in table.
Definition: FXTable.h:66
FXButton * getCornerButton() const
Return button in the top/left corner.
Definition: FXTable.h:540
FXptr getData() const
Get item&#39;s user data.
Definition: FXTable.h:138
FXTableItem(const FXString &text, FXIcon *ic=nullptr, FXptr ptr=nullptr)
Construct new table item.
Definition: FXTable.h:114
virtual FXIcon * getIcon() const
Return item&#39;s icon.
Definition: FXTable.h:126
FXint getDefRowHeight() const
Get default row height.
Definition: FXTable.h:768
FXint getMarginRight() const
Return right cell margin.
Definition: FXTable.h:606
FXbool isSelected() const
Return true if this item is selected.
Definition: FXTable.h:150
Window is the base class for all widgets in FOX.
Definition: FXWindow.h:130
A button provides a push button, with optional icon and/or text label.
Definition: FXButton.h:70
FXint getSelEndRow() const
Get selection end row; returns -1 if no selection.
Definition: FXTable.h:988
FXint getAnchorRow() const
Get row number of anchor item.
Definition: FXTable.h:976
Base composite.
Definition: FXComposite.h:32
The Table widget displays a table of items, each with a text and optional icon.
Definition: FXTable.h:288
FXint getMarginTop() const
Return top cell margin.
Definition: FXTable.h:588
Header control may be placed over a table or list to provide a resizable captions above a number of c...
Definition: FXHeader.h:198
FXuint getIconPosition() const
Return item icon position.
Definition: FXTable.h:174
void setData(FXptr ptr)
Change item&#39;s user data.
Definition: FXTable.h:135
FXint getCellBorderWidth() const
Return cell border width.
Definition: FXTable.h:1063
Range of table cells.
Definition: FXTable.h:59
FXint getVisibleColumns() const
Return number of visible columns.
Definition: FXTable.h:558
FXbool hasFocus() const
Return true if item has focus.
Definition: FXTable.h:144
FXint getMarginBottom() const
Return bottom cell margin.
Definition: FXTable.h:594
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:78
FXFont * getFont() const
Return current font.
Definition: FXTable.h:1027
Abstract Device Context.
Definition: FXDC.h:153
FXbool isDraggable() const
Return true if this item is draggable.
Definition: FXTable.h:162
void setHelpText(const FXString &text)
Change help text.
Definition: FXTable.h:1084
const FXString & getTipText() const
Get the tool tip message for this item.
Definition: FXTable.h:132
Definition: FX4Splitter.h:28
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:42
virtual FXString getText() const
Return item&#39;s text label.
Definition: FXTable.h:120
FXbool isVertGridShown() const
Is vertical grid shown.
Definition: FXTable.h:576
FXint getSelEndColumn() const
Get selection end column; returns -1 if no selection.
Definition: FXTable.h:991
FXint getNumColumns() const
Get number of columns.
Definition: FXTable.h:582
FXuint getBorders() const
Return item borders.
Definition: FXTable.h:180
The scroll area widget manages a content area and a viewport area through which the content is viewed...
Definition: FXScrollArea.h:65
FXHeader * getColumnHeader() const
Return column header control.
Definition: FXTable.h:543
FXint getSelStartRow() const
Get selection start row; returns -1 if no selection.
Definition: FXTable.h:982
FXint getCurrentColumn() const
Get column number of current item.
Definition: FXTable.h:967
FXbool isHorzGridShown() const
Is horizontal grid shown.
Definition: FXTable.h:570
const FXString & getSelections() const
Return selections.
Definition: FXTable.h:245
FXint getCurrentRow() const
Get row number of current item.
Definition: FXTable.h:964
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:103
FXint getNumRows() const
Get number of rows.
Definition: FXTable.h:579
Position in table.
Definition: FXTable.h:52
FXColor getTextColor() const
Obtain colors of various parts.
Definition: FXTable.h:1030
FXint getMarginLeft() const
Return left cell margin.
Definition: FXTable.h:600
FXint getDefColumnWidth() const
Get default column width.
Definition: FXTable.h:762
FXbool isEnabled() const
Return true if this item is enabled.
Definition: FXTable.h:156
FXHeader * getRowHeader() const
Return row header control.
Definition: FXTable.h:546
FXuint getJustify() const
Return item content justification.
Definition: FXTable.h:168
Font class.
Definition: FXFont.h:137
FXint getAnchorColumn() const
Get column number of anchor item.
Definition: FXTable.h:979
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42

Copyright © 1997-2022 Jeroen van der Zijp