Duckcpp 2.1.0
Duckcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
IGUITable.hpp
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 duckcpp/duckcpp.hpp
4
5#ifndef DCPP_I_GUI_TABLE_HPP_INCLUDED
6#define DCPP_I_GUI_TABLE_HPP_INCLUDED
7
8#include <duckcpp/core/engine/IGUIElement.hpp>
9#include <duckcpp/core/engine/SColor.hpp>
10
11namespace dcpp
12{
13namespace gui
14{
15 class IGUIFont;
16 class IGUIScrollBar;
17
39
42 {
43 "none",
44 "custom",
45 "ascend",
46 "descend",
47 "ascend_descend",
48 0,
49 };
50
66
67 const dcpp::char_kt* 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
84
89 class IGUITable : public IGUIElement
90 {
91 public:
94 : IGUIElement(EGUIET_TABLE, environment, parent, id, rectangle) {}
95
97
98 virtual void addColumn(const wchar_t* caption, dcpp::int32_kt columnIndex=-1) = 0;
99
101 virtual void removeColumn(dcpp::uint32_kt columnIndex) = 0;
102
104 virtual dcpp::int32_kt getColumnCount() const = 0;
105
107
110 virtual bool setActiveColumn(dcpp::int32_kt idx, bool doOrder=false) = 0;
111
113 virtual dcpp::int32_kt getActiveColumn() const = 0;
114
117
119 virtual void setColumnWidth(dcpp::uint32_kt columnIndex, dcpp::uint32_kt width) = 0;
120
122 virtual dcpp::uint32_kt getColumnWidth(dcpp::uint32_kt columnIndex) const = 0;
123
125 virtual void setResizableColumns(bool resizable) = 0;
126
128 virtual bool hasResizableColumns() const = 0;
129
131
133 virtual void setColumnOrdering(dcpp::uint32_kt columnIndex, EGUI_COLUMN_ORDERING mode) = 0;
134
136 virtual dcpp::int32_kt getSelected() const = 0;
137
139 virtual void setSelected( dcpp::int32_kt index ) = 0;
140
142 virtual dcpp::int32_kt getRowCount() const = 0;
143
145
153
155 virtual void removeRow(dcpp::uint32_kt rowIndex) = 0;
156
158 virtual void clearRows() = 0;
159
161 virtual void swapRows(dcpp::uint32_kt rowIndexA, dcpp::uint32_kt rowIndexB) = 0;
162
164
170 virtual void orderRows(dcpp::int32_kt columnIndex=-1, EGUI_ORDERING_MODE mode=EGOM_NONE) = 0;
171
173 virtual void setCellText(dcpp::uint32_kt rowIndex, dcpp::uint32_kt columnIndex, const dcpp::nub::wstring& text) = 0;
174
176 virtual void setCellText(dcpp::uint32_kt rowIndex, dcpp::uint32_kt columnIndex, const dcpp::nub::wstring& text, dcpp::video::SColor color) = 0;
177
179 virtual void setCellData(dcpp::uint32_kt rowIndex, dcpp::uint32_kt columnIndex, void *data) = 0;
180
182 virtual void setCellColor(dcpp::uint32_kt rowIndex, dcpp::uint32_kt columnIndex, dcpp::video::SColor color) = 0;
183
185 virtual const wchar_t* getCellText(dcpp::uint32_kt rowIndex, dcpp::uint32_kt columnIndex ) const = 0;
186
188 virtual void* getCellData(dcpp::uint32_kt rowIndex, dcpp::uint32_kt columnIndex ) const = 0;
189
191 virtual void clear() = 0;
192
194 virtual void setDrawFlags(dcpp::int32_kt flags) = 0;
195
197 virtual dcpp::int32_kt getDrawFlags() const = 0;
198
200
202 virtual void setOverrideFont(IGUIFont* font=0) = 0;
203
205
206 virtual IGUIFont* getOverrideFont(void) const = 0;
207
209
211 virtual IGUIFont* getActiveFont() const = 0;
212
214 virtual dcpp::int32_kt getItemHeight() const = 0;
215
218
221
223 virtual void setDrawBackground(bool draw) = 0;
224
226
227 virtual bool isDrawBackgroundEnabled() const = 0;
228 };
229
230
231} // end namespace gui
232} // end namespace dcpp
233
234#endif
Base class of all GUI elements.
Definition IGUIElement.hpp:24
virtual void draw()
Draws the element and its children.
Definition IGUIElement.hpp:331
GUI Environment. Used as factory and manager of all other GUI elements.
Definition IGUIEnvironment.hpp:73
Font interface.
Definition IGUIFont.hpp:40
Default scroll bar GUI element.
Definition IGUIScrollBar.hpp:20
Default list box GUI element.
Definition IGUITable.hpp:90
virtual IGUIScrollBar * getVerticalScrollBar() const =0
Access the vertical scrollbar.
virtual void swapRows(dcpp::uint32_kt rowIndexA, dcpp::uint32_kt rowIndexB)=0
Swap two row positions.
virtual dcpp::int32_kt getDrawFlags() const =0
Get the flags, as defined in EGUI_TABLE_DRAW_FLAGS, which influence the layout.
virtual IGUIScrollBar * getHorizontalScrollBar() const =0
Access the horizontal scrollbar.
virtual void setCellText(dcpp::uint32_kt rowIndex, dcpp::uint32_kt columnIndex, const dcpp::nub::wstring &text, dcpp::video::SColor color)=0
Set the text of a cell, and set a color of this cell.
virtual IGUIFont * getActiveFont() const =0
Get the font which is used right now for drawing.
virtual void setSelected(dcpp::int32_kt index)=0
set which row is currently selected
virtual dcpp::int32_kt getRowCount() const =0
Get amount of rows in the tabcontrol.
virtual void setColumnWidth(dcpp::uint32_kt columnIndex, dcpp::uint32_kt width)=0
Set the width of a column.
virtual void removeRow(dcpp::uint32_kt rowIndex)=0
Remove a row from the table.
virtual void setCellColor(dcpp::uint32_kt rowIndex, dcpp::uint32_kt columnIndex, dcpp::video::SColor color)=0
Set the color of a cell text.
virtual dcpp::uint32_kt getColumnWidth(dcpp::uint32_kt columnIndex) const =0
Get the width of a column.
virtual void clear()=0
clears the table, deletes all items in the table
virtual void clearRows()=0
clears the table rows, but keeps the columns intact
virtual dcpp::int32_kt getSelected() const =0
Returns which row is currently selected.
virtual EGUI_ORDERING_MODE getActiveColumnOrdering() const =0
Returns the ordering used by the currently active column.
virtual dcpp::int32_kt getItemHeight() const =0
Get the height of items/rows.
virtual dcpp::uint32_kt addRow(dcpp::uint32_kt rowIndex)=0
adds a row to the table
virtual void setCellData(dcpp::uint32_kt rowIndex, dcpp::uint32_kt columnIndex, void *data)=0
Set the data of a cell.
virtual IGUIFont * getOverrideFont(void) const =0
Gets the override font (if any)
virtual void addColumn(const wchar_t *caption, dcpp::int32_kt columnIndex=-1)=0
Adds a column.
virtual void setCellText(dcpp::uint32_kt rowIndex, dcpp::uint32_kt columnIndex, const dcpp::nub::wstring &text)=0
Set the text of a cell.
virtual void setDrawBackground(bool draw)=0
Sets whether to draw the background.
virtual void setDrawFlags(dcpp::int32_kt flags)=0
Set flags, as defined in EGUI_TABLE_DRAW_FLAGS, which influence the layout.
IGUITable(IGUIEnvironment *environment, IGUIElement *parent, dcpp::int32_kt id, dcpp::nub::recti rectangle)
constructor
Definition IGUITable.hpp:93
virtual void setColumnOrdering(dcpp::uint32_kt columnIndex, EGUI_COLUMN_ORDERING mode)=0
This tells the table control which ordering mode should be used when a column header is clicked.
virtual void setOverrideFont(IGUIFont *font=0)=0
Sets another skin independent font.
virtual void * getCellData(dcpp::uint32_kt rowIndex, dcpp::uint32_kt columnIndex) const =0
Get the data of a cell.
virtual void removeColumn(dcpp::uint32_kt columnIndex)=0
remove a column from the table
virtual bool setActiveColumn(dcpp::int32_kt idx, bool doOrder=false)=0
Makes a column active. This will trigger an ordering process.
virtual const wchar_t * getCellText(dcpp::uint32_kt rowIndex, dcpp::uint32_kt columnIndex) const =0
Get the text of a cell.
virtual void setResizableColumns(bool resizable)=0
columns can be resized by drag 'n drop
virtual bool isDrawBackgroundEnabled() const =0
Checks if background drawing is enabled.
virtual dcpp::int32_kt getActiveColumn() const =0
Returns which header is currently active.
virtual void orderRows(dcpp::int32_kt columnIndex=-1, EGUI_ORDERING_MODE mode=EGOM_NONE)=0
This tells the table to start ordering all the rows.
virtual bool hasResizableColumns() const =0
can columns be resized by drag 'n drop?
virtual dcpp::int32_kt getColumnCount() const =0
Returns the number of columns in the table control.
Rectangle template.
Definition rect.hpp:27
Class representing a 32 bit ARGB color.
Definition SColor.hpp:317
@ EGUIET_TABLE
A Table.
Definition EGUIElementTypes.hpp:77
const dcpp::char_kt *const GUIColumnOrderingNames[]
Names for EGUI_COLUMN_ORDERING types.
Definition IGUITable.hpp:41
EGUI_COLUMN_ORDERING
modes for ordering used when a column header is clicked
Definition IGUITable.hpp:20
@ EGCO_FLIP_ASCENDING_DESCENDING
Sort it ascending on first click, descending on next, etc.
Definition IGUITable.hpp:34
@ EGCO_CUSTOM
Send a EGET_TABLE_HEADER_CHANGED message when a column header is clicked.
Definition IGUITable.hpp:25
@ EGCO_DESCENDING
Sort it descending by it's ascii value like: z,x,y,...
Definition IGUITable.hpp:31
@ EGCO_COUNT
Not used as mode, only to get maximum value for this enum.
Definition IGUITable.hpp:37
@ EGCO_NONE
Do not use ordering.
Definition IGUITable.hpp:22
@ EGCO_ASCENDING
Sort it ascending by it's ascii value like: a,b,c,...
Definition IGUITable.hpp:28
EGUI_ORDERING_MODE
Definition IGUITable.hpp:52
@ EGOM_ASCENDING
Elements are ordered from the smallest to the largest.
Definition IGUITable.hpp:57
@ EGOM_COUNT
Definition IGUITable.hpp:64
@ EGOM_DESCENDING
Elements are ordered from the largest to the smallest.
Definition IGUITable.hpp:60
@ EGOM_NONE
No element ordering.
Definition IGUITable.hpp:54
As of Duckcpp 1.6, position2d is a synonym for vector2d.
Definition shared_device.hpp:34
char char_kt
8 bit character variable.
Definition irrTypes.hpp:37
unsigned int uint32_kt
32 bit unsigned variable.
Definition irrTypes.hpp:64
signed int int32_kt
32 bit signed variable.
Definition irrTypes.hpp:72

Duckcpp    @cppfx.xyz