Irrlicht 3D Engine
IGUITable.h
Go to the documentation of this file.
1 // Copyright (C) 2003-2012 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __I_GUI_TABLE_H_INCLUDED__
6 #define __I_GUI_TABLE_H_INCLUDED__
7 
8 #include "IGUIElement.h"
9 #include "irrTypes.h"
10 #include "SColor.h"
11 #include "IGUISkin.h"
12 
13 namespace irr
14 {
15 namespace gui
16 {
17 
20  {
23 
26 
29 
32 
35 
38  };
39 
41  const c8* const GUIColumnOrderingNames[] =
42  {
43  "none",
44  "custom",
45  "ascend",
46  "descend",
47  "ascend_descend",
48  0,
49  };
50 
52  {
55 
58 
61 
65  };
66 
67  const c8* const GUIOrderingModeNames[] =
68  {
69  "none",
70  "ascending",
71  "descending",
72  0
73  };
74 
76  {
81  };
82 
84 
89  class IGUITable : public IGUIElement
90  {
91  public:
93  IGUITable(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
94  : IGUIElement(EGUIET_TABLE, environment, parent, id, rectangle) {}
95 
97 
98  virtual void addColumn(const wchar_t* caption, s32 columnIndex=-1) = 0;
99 
101  virtual void removeColumn(u32 columnIndex) = 0;
102 
104  virtual s32 getColumnCount() const = 0;
105 
107 
110  virtual bool setActiveColumn(s32 idx, bool doOrder=false) = 0;
111 
113  virtual s32 getActiveColumn() const = 0;
114 
116  virtual EGUI_ORDERING_MODE getActiveColumnOrdering() const = 0;
117 
119  virtual void setColumnWidth(u32 columnIndex, u32 width) = 0;
120 
122  virtual u32 getColumnWidth(u32 columnIndex) const = 0;
123 
125  virtual void setResizableColumns(bool resizable) = 0;
126 
128  virtual bool hasResizableColumns() const = 0;
129 
131 
133  virtual void setColumnOrdering(u32 columnIndex, EGUI_COLUMN_ORDERING mode) = 0;
134 
136  virtual s32 getSelected() const = 0;
137 
139  virtual void setSelected( s32 index ) = 0;
140 
142  virtual s32 getRowCount() const = 0;
143 
145 
152  virtual u32 addRow(u32 rowIndex) = 0;
153 
155  virtual void removeRow(u32 rowIndex) = 0;
156 
158  virtual void clearRows() = 0;
159 
161  virtual void swapRows(u32 rowIndexA, u32 rowIndexB) = 0;
162 
164 
170  virtual void orderRows(s32 columnIndex=-1, EGUI_ORDERING_MODE mode=EGOM_NONE) = 0;
171 
173  virtual void setCellText(u32 rowIndex, u32 columnIndex, const core::stringw& text) = 0;
174 
176  virtual void setCellText(u32 rowIndex, u32 columnIndex, const core::stringw& text, video::SColor color) = 0;
177 
179  virtual void setCellData(u32 rowIndex, u32 columnIndex, void *data) = 0;
180 
182  virtual void setCellColor(u32 rowIndex, u32 columnIndex, video::SColor color) = 0;
183 
185  virtual const wchar_t* getCellText(u32 rowIndex, u32 columnIndex ) const = 0;
186 
188  virtual void* getCellData(u32 rowIndex, u32 columnIndex ) const = 0;
189 
191  virtual void clear() = 0;
192 
194  virtual void setDrawFlags(s32 flags) = 0;
195 
197  virtual s32 getDrawFlags() const = 0;
198  };
199 
200 
201 } // end namespace gui
202 } // end namespace irr
203 
204 #endif
205 
irr::gui::EGCO_NONE
@ EGCO_NONE
Do not use ordering.
Definition: IGUITable.h:22
irr::gui::IGUITable::setSelected
virtual void setSelected(s32 index)=0
set wich row is currently selected
irr::gui::IGUITable::getActiveColumnOrdering
virtual EGUI_ORDERING_MODE getActiveColumnOrdering() const =0
Returns the ordering used by the currently active column.
irr::gui::EGTDF_ROWS
@ EGTDF_ROWS
Definition: IGUITable.h:77
irr::gui::IGUITable
Default list box GUI element.
Definition: IGUITable.h:89
IGUISkin.h
irr::gui::IGUITable::getColumnCount
virtual s32 getColumnCount() const =0
Returns the number of columns in the table control.
irr::gui::EGOM_ASCENDING
@ EGOM_ASCENDING
Elements are ordered from the smallest to the largest.
Definition: IGUITable.h:57
irr::gui::IGUITable::addColumn
virtual void addColumn(const wchar_t *caption, s32 columnIndex=-1)=0
Adds a column.
irr::c8
char c8
8 bit character variable.
Definition: irrTypes.h:31
irr::gui::EGOM_COUNT
@ EGOM_COUNT
Definition: IGUITable.h:64
irr::gui::EGUI_COLUMN_ORDERING
EGUI_COLUMN_ORDERING
modes for ordering used when a column header is clicked
Definition: IGUITable.h:19
irr::gui::IGUITable::setColumnWidth
virtual void setColumnWidth(u32 columnIndex, u32 width)=0
Set the width of a column.
irr::gui::EGUIET_TABLE
@ EGUIET_TABLE
A Table.
Definition: EGUIElementTypes.h:77
irr::gui::IGUITable::getSelected
virtual s32 getSelected() const =0
Returns which row is currently selected.
irr::gui::EGCO_FLIP_ASCENDING_DESCENDING
@ EGCO_FLIP_ASCENDING_DESCENDING
Sort it ascending on first click, descending on next, etc.
Definition: IGUITable.h:34
irr::gui::IGUITable::getRowCount
virtual s32 getRowCount() const =0
Get amount of rows in the tabcontrol.
irr::gui::IGUITable::removeRow
virtual void removeRow(u32 rowIndex)=0
Remove a row from the table.
irr::gui::IGUITable::setActiveColumn
virtual bool setActiveColumn(s32 idx, bool doOrder=false)=0
Makes a column active. This will trigger an ordering process.
irr::gui::EGTDF_ACTIVE_ROW
@ EGTDF_ACTIVE_ROW
Definition: IGUITable.h:79
irr::gui::IGUITable::getActiveColumn
virtual s32 getActiveColumn() const =0
Returns which header is currently active.
irr::gui::EGCO_COUNT
@ EGCO_COUNT
Not used as mode, only to get maximum value for this enum.
Definition: IGUITable.h:37
irr::gui::EGTDF_COLUMNS
@ EGTDF_COLUMNS
Definition: IGUITable.h:78
irr::s32
signed int s32
32 bit signed variable.
Definition: irrTypes.h:66
irr::gui::IGUITable::setDrawFlags
virtual void setDrawFlags(s32 flags)=0
Set flags, as defined in EGUI_TABLE_DRAW_FLAGS, which influence the layout.
irr::gui::IGUITable::clearRows
virtual void clearRows()=0
clears the table rows, but keeps the columns intact
irr::gui::IGUITable::clear
virtual void clear()=0
clears the table, deletes all items in the table
irr::gui::IGUITable::getCellData
virtual void * getCellData(u32 rowIndex, u32 columnIndex) const =0
Get the data of a cell.
irr::gui::IGUITable::setCellText
virtual void setCellText(u32 rowIndex, u32 columnIndex, const core::stringw &text)=0
Set the text of a cell.
irr::gui::EGCO_ASCENDING
@ EGCO_ASCENDING
Sort it ascending by it's ascii value like: a,b,c,...
Definition: IGUITable.h:28
irr::gui::IGUITable::getCellText
virtual const wchar_t * getCellText(u32 rowIndex, u32 columnIndex) const =0
Get the text of a cell.
irr::gui::IGUITable::swapRows
virtual void swapRows(u32 rowIndexA, u32 rowIndexB)=0
Swap two row positions.
irr::gui::EGOM_DESCENDING
@ EGOM_DESCENDING
Elements are ordered from the largest to the smallest.
Definition: IGUITable.h:60
irr::gui::IGUITable::setResizableColumns
virtual void setResizableColumns(bool resizable)=0
columns can be resized by drag 'n drop
IGUIElement.h
irr::gui::IGUITable::addRow
virtual u32 addRow(u32 rowIndex)=0
adds a row to the table
irr::core::string
Definition: irrString.h:73
irr::gui::GUIOrderingModeNames
const c8 *const GUIOrderingModeNames[]
Definition: IGUITable.h:67
irr::gui::EGTDF_COUNT
@ EGTDF_COUNT
Definition: IGUITable.h:80
irr::gui::IGUITable::hasResizableColumns
virtual bool hasResizableColumns() const =0
can columns be resized by dran 'n drop?
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition: aabbox3d.h:12
irr::core::rect< s32 >
irrTypes.h
irr::u32
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:58
irr::gui::IGUITable::IGUITable
IGUITable(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
constructor
Definition: IGUITable.h:93
irr::gui::IGUITable::removeColumn
virtual void removeColumn(u32 columnIndex)=0
remove a column from the table
irr::gui::IGUITable::setCellData
virtual void setCellData(u32 rowIndex, u32 columnIndex, void *data)=0
Set the data of a cell.
irr::gui::IGUITable::setCellColor
virtual void setCellColor(u32 rowIndex, u32 columnIndex, video::SColor color)=0
Set the color of a cell text.
irr::gui::IGUIEnvironment
GUI Environment. Used as factory and manager of all other GUI elements.
Definition: IGUIEnvironment.h:70
irr::gui::IGUITable::getDrawFlags
virtual s32 getDrawFlags() const =0
Get the flags, as defined in EGUI_TABLE_DRAW_FLAGS, which influence the layout.
irr::gui::GUIColumnOrderingNames
const c8 *const GUIColumnOrderingNames[]
Names for EGUI_COLUMN_ORDERING types.
Definition: IGUITable.h:41
irr::gui::IGUITable::orderRows
virtual void orderRows(s32 columnIndex=-1, EGUI_ORDERING_MODE mode=EGOM_NONE)=0
This tells the table to start ordering all the rows.
irr::gui::IGUITable::setColumnOrdering
virtual void setColumnOrdering(u32 columnIndex, EGUI_COLUMN_ORDERING mode)=0
This tells the table control which ordering mode should be used when a column header is clicked.
irr::gui::EGUI_ORDERING_MODE
EGUI_ORDERING_MODE
Definition: IGUITable.h:51
irr::video::SColor
Class representing a 32 bit ARGB color.
Definition: SColor.h:201
irr::gui::IGUITable::getColumnWidth
virtual u32 getColumnWidth(u32 columnIndex) const =0
Get the width of a column.
irr::gui::EGCO_CUSTOM
@ EGCO_CUSTOM
Send a EGET_TABLE_HEADER_CHANGED message when a column header is clicked.
Definition: IGUITable.h:25
irr::gui::EGUI_TABLE_DRAW_FLAGS
EGUI_TABLE_DRAW_FLAGS
Definition: IGUITable.h:75
irr::gui::EGOM_NONE
@ EGOM_NONE
No element ordering.
Definition: IGUITable.h:54
irr::gui::IGUIElement
Base class of all GUI elements.
Definition: IGUIElement.h:25
SColor.h
irr::gui::EGCO_DESCENDING
@ EGCO_DESCENDING
Sort it descending by it's ascii value like: z,x,y,...
Definition: IGUITable.h:31