Rocket::Controls::ElementDataGrid Class Reference

#include <ElementDataGrid.h>

Inheritance diagram for Rocket::Controls::ElementDataGrid:
Collaboration diagram for Rocket::Controls::ElementDataGrid:

Public Member Functions

 ElementDataGrid (const Rocket::Core::String &tag)
void SetDataSource (const Rocket::Core::String &data_source_name)
bool AddColumn (const Rocket::Core::String &fields, const Rocket::Core::String &formatter, float initial_width, const Rocket::Core::String &header_rml)
void AddColumn (const Rocket::Core::String &fields, const Rocket::Core::String &formatter, float initial_width, Core::Element *header_element)
int GetNumColumns ()
 Returns the number of columns in this table.
const ColumnGetColumn (int column_index)
 Returns the column at the specified index.
const Rocket::Core::StringGetAllColumnFields ()
 Returns a CSV string containing all the fields that each column requires, in order.
ElementDataGridRowAddRow (ElementDataGridRow *parent, int index)
void RemoveRows (int index, int num_rows=1)
int GetNumRows () const
 Returns the number of rows in the table.
ElementDataGridRowGetRow (int index) const

Protected Member Functions

virtual void OnUpdate ()
 Called during the update loop after children are updated.
virtual void ProcessEvent (Core::Event &event)
virtual void GetInnerRML (Rocket::Core::String &content) const

Data Structures

struct  Column

Detailed Description

A table driven from a data source.

Author:
Robert Curry

Member Function Documentation

void Rocket::Controls::ElementDataGrid::SetDataSource ( const Rocket::Core::String data_source_name  ) 

Sets a new data source for the contents of the data grid.

Parameters:
[in] data_source_name The name of the new data source.

bool Rocket::Controls::ElementDataGrid::AddColumn ( const Rocket::Core::String fields,
const Rocket::Core::String formatter,
float  initial_width,
const Rocket::Core::String header_rml 
)

Adds a column to the table.

Parameters:
[in] fields A comma-separated list of fields that this column reads from the data source.
[in] formatter The name of the data formatter to be used to format the raw column data into RML.
[in] initial_width The initial width, in pixels, of the column.
[in] header_rml The RML to use as the column header.
Returns:
True if the column was added successfully, false if not.

void Rocket::Controls::ElementDataGrid::AddColumn ( const Rocket::Core::String fields,
const Rocket::Core::String formatter,
float  initial_width,
Core::Element header_element 
)

Adds a column to the table.

Parameters:
[in] fields A comma-separated list of fields that this column reads from the data source.
[in] formatter The name of the data formatter to be used to format the raw column data into RML.
[in] initial_width The initial width, in pixels, of the column.
[in] header_element The element hierarchy to use as the column header.

ElementDataGridRow * Rocket::Controls::ElementDataGrid::AddRow ( ElementDataGridRow parent,
int  index 
)

Adds a new row to the table. This is only called from child rows.

Parameters:
[in] parent The parent row that the row is being added under.
[in] index The index of the child, relative to its parent.
Returns:
A pointer to the newly created row.

void Rocket::Controls::ElementDataGrid::RemoveRows ( int  index,
int  num_rows = 1 
)

Removes a series of rows from the table.

Parameters:
[in] index The index of the first row, relative to the table.
[in] num_rows The number of rows to remove. Defaults to one.

ElementDataGridRow * Rocket::Controls::ElementDataGrid::GetRow ( int  index  )  const

Returns the row at the given index in the table.

Parameters:
[in] index The index of the row, relative to the table.

void Rocket::Controls::ElementDataGrid::ProcessEvent ( Core::Event event  )  [protected, virtual]

Called for every event sent to this element or one of its descendants.

Parameters:
[in] event The event to process.

Reimplemented from Rocket::Core::Element.

void Rocket::Controls::ElementDataGrid::GetInnerRML ( Rocket::Core::String content  )  const [protected, virtual]

Gets the markup and content of the element.

Parameters:
content[out] The content of the element.

Reimplemented from Rocket::Core::Element.


The documentation for this class was generated from the following files: