Wt
4.0.0
|
A table column. More...
#include <Wt/WTableColumn.h>
Public Member Functions | |
WTableColumn () | |
Creates a new table column. More... | |
~WTableColumn () | |
Destructor. | |
WTable * | table () const |
Returns the table to which this column belongs. More... | |
WTableCell * | elementAt (int row) |
Access the column element at the given row. More... | |
int | columnNum () const |
Returns the column number of this column in the table. More... | |
void | setWidth (const WLength &width) |
Sets the column width. More... | |
WLength | width () const |
Returns the column width. More... | |
void | setStyleClass (const WString &style) |
Sets the CSS style class for this column. More... | |
const WString & | styleClass () const |
Returns the CSS style class for this column. More... | |
void | setId (const std::string &id) |
Sets the CSS Id. More... | |
virtual const std::string | id () const override |
Returns the (unique) identifier for this object. More... | |
![]() | |
void | addChild (std::unique_ptr< WObject > child) |
Add a child WObject whose lifetime is determined by this WObject. | |
template<typename Child > | |
Child * | addChild (std::unique_ptr< Child > child) |
Add a child WObject, returning a raw pointer. More... | |
std::unique_ptr< WObject > | removeChild (WObject *child) |
Remove a child WObject, so its lifetime is no longer determined by this WObject. | |
virtual void | setObjectName (const std::string &name) |
Sets an object name. More... | |
virtual std::string | objectName () const |
Returns the object name. More... | |
void | resetLearnedSlots () |
Resets learned stateless slot implementations. More... | |
template<class T > | |
void | resetLearnedSlot (void(T::*method)()) |
Resets a learned stateless slot implementation. More... | |
template<class T > | |
WStatelessSlot * | implementStateless (void(T::*method)()) |
Declares a slot to be stateless and learn client-side behaviour on first invocation. More... | |
template<class T > | |
WStatelessSlot * | implementStateless (void(T::*method)(), void(T::*undoMethod)()) |
Declares a slot to be stateless and learn client-side behaviour in advance. More... | |
void | isNotStateless () |
Marks the current function as not stateless. More... | |
template<class T > | |
WStatelessSlot * | implementJavaScript (void(T::*method)(), const std::string &jsCode) |
Provides a JavaScript implementation for a method. More... | |
![]() | |
observable () | |
Default constructor. | |
virtual | ~observable () |
Destructor. More... | |
template<typename... Args, typename C > | |
auto | bindSafe (void(C::*method)(Args...)) |
Protects a method call against object destruction. More... | |
template<typename... Args, typename C > | |
auto | bindSafe (void(C::*method)(Args...) const) const |
Protects a const method call against object destruction. More... | |
template<typename Function > | |
auto | bindSafe (const Function &function) |
Protects a function against object destruction. More... | |
Additional Inherited Members | |
![]() | |
typedef void(WObject::* | Method) () |
Typedef for a WObject method without arguments. | |
![]() | |
virtual WStatelessSlot * | getStateless (Method method) |
On-demand stateless slot implementation. More... | |
A table column.
A WTableColumn is returned by WTable::columnAt() and managing various properties of a single column in a table (it is however not a widget).
A table column corresponds to the HTML <col>
tag.
Wt::WTableColumn::WTableColumn | ( | ) |
Creates a new table column.
Table columns must be added to a table using WTable::insertColumn() before you can access contents in it using elementAt().
int Wt::WTableColumn::columnNum | ( | ) | const |
Returns the column number of this column in the table.
Returns -1 if the column is not yet part of a table.
WTableCell * Wt::WTableColumn::elementAt | ( | int | row | ) |
Access the column element at the given row.
Like WTable::elementAt(), if the row is beyond the current table dimensions, then the table is expanded automatically.
The column must be inserted within a table first.
|
overridevirtual |
Returns the (unique) identifier for this object.
For a WWidget, this corresponds to the id of the DOM element that represents the widget. This is not entirely unique, since a composite widget shares the same id as its implementation.
By default, the id is auto-generated, unless a custom id is set for a widget using WWidget::setId().
Reimplemented from Wt::WObject.
void Wt::WTableColumn::setId | ( | const std::string & | id | ) |
Sets the CSS Id.
Sets a custom Id. Note that the Id must be unique across the whole widget tree, can only be set right after construction and cannot be changed.
void Wt::WTableColumn::setStyleClass | ( | const WString & | style | ) |
Sets the CSS style class for this column.
The style is inherited by all table cells in this column.
void Wt::WTableColumn::setWidth | ( | const WLength & | width | ) |
Sets the column width.
The default column width is WLength::Auto.
const WString& Wt::WTableColumn::styleClass | ( | ) | const |
Returns the CSS style class for this column.
WTable* Wt::WTableColumn::table | ( | ) | const |
Returns the table to which this column belongs.
WLength Wt::WTableColumn::width | ( | ) | const |
Returns the column width.