diff options
Diffstat (limited to 'libraries/irrlicht-1.8/include/IGUITable.h')
-rw-r--r-- | libraries/irrlicht-1.8/include/IGUITable.h | 205 |
1 files changed, 0 insertions, 205 deletions
diff --git a/libraries/irrlicht-1.8/include/IGUITable.h b/libraries/irrlicht-1.8/include/IGUITable.h deleted file mode 100644 index 219d28d..0000000 --- a/libraries/irrlicht-1.8/include/IGUITable.h +++ /dev/null | |||
@@ -1,205 +0,0 @@ | |||
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 | |||
18 | //! modes for ordering used when a column header is clicked | ||
19 | enum EGUI_COLUMN_ORDERING | ||
20 | { | ||
21 | //! Do not use ordering | ||
22 | EGCO_NONE, | ||
23 | |||
24 | //! Send a EGET_TABLE_HEADER_CHANGED message when a column header is clicked. | ||
25 | EGCO_CUSTOM, | ||
26 | |||
27 | //! Sort it ascending by it's ascii value like: a,b,c,... | ||
28 | EGCO_ASCENDING, | ||
29 | |||
30 | //! Sort it descending by it's ascii value like: z,x,y,... | ||
31 | EGCO_DESCENDING, | ||
32 | |||
33 | //! Sort it ascending on first click, descending on next, etc | ||
34 | EGCO_FLIP_ASCENDING_DESCENDING, | ||
35 | |||
36 | //! Not used as mode, only to get maximum value for this enum | ||
37 | EGCO_COUNT | ||
38 | }; | ||
39 | |||
40 | //! Names for EGUI_COLUMN_ORDERING types | ||
41 | const c8* const GUIColumnOrderingNames[] = | ||
42 | { | ||
43 | "none", | ||
44 | "custom", | ||
45 | "ascend", | ||
46 | "descend", | ||
47 | "ascend_descend", | ||
48 | 0, | ||
49 | }; | ||
50 | |||
51 | enum EGUI_ORDERING_MODE | ||
52 | { | ||
53 | //! No element ordering | ||
54 | EGOM_NONE, | ||
55 | |||
56 | //! Elements are ordered from the smallest to the largest. | ||
57 | EGOM_ASCENDING, | ||
58 | |||
59 | //! Elements are ordered from the largest to the smallest. | ||
60 | EGOM_DESCENDING, | ||
61 | |||
62 | //! this value is not used, it only specifies the amount of default ordering types | ||
63 | //! available. | ||
64 | EGOM_COUNT | ||
65 | }; | ||
66 | |||
67 | const c8* const GUIOrderingModeNames[] = | ||
68 | { | ||
69 | "none", | ||
70 | "ascending", | ||
71 | "descending", | ||
72 | 0 | ||
73 | }; | ||
74 | |||
75 | enum EGUI_TABLE_DRAW_FLAGS | ||
76 | { | ||
77 | EGTDF_ROWS = 1, | ||
78 | EGTDF_COLUMNS = 2, | ||
79 | EGTDF_ACTIVE_ROW = 4, | ||
80 | EGTDF_COUNT | ||
81 | }; | ||
82 | |||
83 | //! Default list box GUI element. | ||
84 | /** \par This element can create the following events of type EGUI_EVENT_TYPE: | ||
85 | \li EGET_TABLE_CHANGED | ||
86 | \li EGET_TABLE_SELECTED_AGAIN | ||
87 | \li EGET_TABLE_HEADER_CHANGED | ||
88 | */ | ||
89 | class IGUITable : public IGUIElement | ||
90 | { | ||
91 | public: | ||
92 | //! constructor | ||
93 | IGUITable(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) | ||
94 | : IGUIElement(EGUIET_TABLE, environment, parent, id, rectangle) {} | ||
95 | |||
96 | //! Adds a column | ||
97 | /** If columnIndex is outside the current range, do push new colum at the end */ | ||
98 | virtual void addColumn(const wchar_t* caption, s32 columnIndex=-1) = 0; | ||
99 | |||
100 | //! remove a column from the table | ||
101 | virtual void removeColumn(u32 columnIndex) = 0; | ||
102 | |||
103 | //! Returns the number of columns in the table control | ||
104 | virtual s32 getColumnCount() const = 0; | ||
105 | |||
106 | //! Makes a column active. This will trigger an ordering process. | ||
107 | /** \param idx: The id of the column to make active. | ||
108 | \param doOrder: Do also the ordering which depending on mode for active column | ||
109 | \return True if successful. */ | ||
110 | virtual bool setActiveColumn(s32 idx, bool doOrder=false) = 0; | ||
111 | |||
112 | //! Returns which header is currently active | ||
113 | virtual s32 getActiveColumn() const = 0; | ||
114 | |||
115 | //! Returns the ordering used by the currently active column | ||
116 | virtual EGUI_ORDERING_MODE getActiveColumnOrdering() const = 0; | ||
117 | |||
118 | //! Set the width of a column | ||
119 | virtual void setColumnWidth(u32 columnIndex, u32 width) = 0; | ||
120 | |||
121 | //! Get the width of a column | ||
122 | virtual u32 getColumnWidth(u32 columnIndex) const = 0; | ||
123 | |||
124 | //! columns can be resized by drag 'n drop | ||
125 | virtual void setResizableColumns(bool resizable) = 0; | ||
126 | |||
127 | //! can columns be resized by dran 'n drop? | ||
128 | virtual bool hasResizableColumns() const = 0; | ||
129 | |||
130 | //! This tells the table control which ordering mode should be used when a column header is clicked. | ||
131 | /** \param columnIndex The index of the column header. | ||
132 | \param mode: One of the modes defined in EGUI_COLUMN_ORDERING */ | ||
133 | virtual void setColumnOrdering(u32 columnIndex, EGUI_COLUMN_ORDERING mode) = 0; | ||
134 | |||
135 | //! Returns which row is currently selected | ||
136 | virtual s32 getSelected() const = 0; | ||
137 | |||
138 | //! set wich row is currently selected | ||
139 | virtual void setSelected( s32 index ) = 0; | ||
140 | |||
141 | //! Get amount of rows in the tabcontrol | ||
142 | virtual s32 getRowCount() const = 0; | ||
143 | |||
144 | //! adds a row to the table | ||
145 | /** \param rowIndex Zero based index of rows. The row will be | ||
146 | inserted at this position, if a row already exist there, it | ||
147 | will be placed after it. If the row is larger than the actual | ||
148 | number of row by more than one, it won't be created. Note that | ||
149 | if you create a row that's not at the end, there might be | ||
150 | performance issues. | ||
151 | \return index of inserted row. */ | ||
152 | virtual u32 addRow(u32 rowIndex) = 0; | ||
153 | |||
154 | //! Remove a row from the table | ||
155 | virtual void removeRow(u32 rowIndex) = 0; | ||
156 | |||
157 | //! clears the table rows, but keeps the columns intact | ||
158 | virtual void clearRows() = 0; | ||
159 | |||
160 | //! Swap two row positions. | ||
161 | virtual void swapRows(u32 rowIndexA, u32 rowIndexB) = 0; | ||
162 | |||
163 | //! This tells the table to start ordering all the rows. | ||
164 | /** You need to explicitly tell the table to re order the rows | ||
165 | when a new row is added or the cells data is changed. This | ||
166 | makes the system more flexible and doesn't make you pay the | ||
167 | cost of ordering when adding a lot of rows. | ||
168 | \param columnIndex: When set to -1 the active column is used. | ||
169 | \param mode Ordering mode of the rows. */ | ||
170 | virtual void orderRows(s32 columnIndex=-1, EGUI_ORDERING_MODE mode=EGOM_NONE) = 0; | ||
171 | |||
172 | //! Set the text of a cell | ||
173 | virtual void setCellText(u32 rowIndex, u32 columnIndex, const core::stringw& text) = 0; | ||
174 | |||
175 | //! Set the text of a cell, and set a color of this cell. | ||
176 | virtual void setCellText(u32 rowIndex, u32 columnIndex, const core::stringw& text, video::SColor color) = 0; | ||
177 | |||
178 | //! Set the data of a cell | ||
179 | virtual void setCellData(u32 rowIndex, u32 columnIndex, void *data) = 0; | ||
180 | |||
181 | //! Set the color of a cell text | ||
182 | virtual void setCellColor(u32 rowIndex, u32 columnIndex, video::SColor color) = 0; | ||
183 | |||
184 | //! Get the text of a cell | ||
185 | virtual const wchar_t* getCellText(u32 rowIndex, u32 columnIndex ) const = 0; | ||
186 | |||
187 | //! Get the data of a cell | ||
188 | virtual void* getCellData(u32 rowIndex, u32 columnIndex ) const = 0; | ||
189 | |||
190 | //! clears the table, deletes all items in the table | ||
191 | virtual void clear() = 0; | ||
192 | |||
193 | //! Set flags, as defined in EGUI_TABLE_DRAW_FLAGS, which influence the layout | ||
194 | virtual void setDrawFlags(s32 flags) = 0; | ||
195 | |||
196 | //! Get the flags, as defined in EGUI_TABLE_DRAW_FLAGS, which influence the layout | ||
197 | virtual s32 getDrawFlags() const = 0; | ||
198 | }; | ||
199 | |||
200 | |||
201 | } // end namespace gui | ||
202 | } // end namespace irr | ||
203 | |||
204 | #endif | ||
205 | |||