GTK+ IOStream  Beta
<< GTK+ >> add C++ IOStream operators to GTK+. Now with extra abilities ... like network serialisation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
Table Class Reference

#include <Table.H>

Inheritance diagram for Table:
Inheritance graph
[legend]
Collaboration diagram for Table:
Collaboration graph
[legend]

Public Member Functions

 Table (void)
 
 Table (short int rows, short int cols, bool homogeneous=true, GtkAttachOptions xOpt=GTK_EXPAND, GtkAttachOptions yOpt=GTK_EXPAND, uint xPad=0, uint yPad=0)
 
void initialise (short int rows=2, short int cols=2, bool homogeneous=true, GtkAttachOptions xOpt=GTK_FILL, GtkAttachOptions yOpt=GTK_FILL, uint xPad=0, uint yPad=0)
 
void setHomogeneous (bool homogeneous)
 
void setOptions (GtkAttachOptions xOpt, GtkAttachOptions yOpt)
 
void setRegion (short int x_s, short int x_e, short int y_s, short int y_e)
 
void placeWidget (GtkWidget *obj, GtkAttachOptions xOpt, GtkAttachOptions yOpt)
 
void placeWidget (GtkWidget *obj)
 
void getSize (uint *rows, uint *cols)
 
void setPadding (uint xPad, uint yPad)
 
void resize (uint rows, uint cols)
 
Tableoperator<< (int *region)
 
Tableoperator<< (GtkWidget *obj)
 
Tableoperator<< (LinkList< GtkWidget * > &ll)
 
Tableoperator>> (GtkWidget *obj)
 
- Public Member Functions inherited from Container
GtkWidget * getWidget (void)
 
GtkWidget * show (void)
 
GtkWidget * hide (void)
 
void setBorder (unsigned int size)
 
unsigned int getBorder (void)
 
Containeroperator<< (Container &b)
 
Containeroperator<< (Container *b)
 
Containeroperator<< (LinkList< GtkWidget * > &ll)
 
Containeroperator>> (GtkWidget *b)
 
Containeroperator>> (Container *b)
 
Containeroperator>> (Container &b)
 
- Public Member Functions inherited from Widget
virtual ~Widget ()
 Destructor. More...
 
GtkWidget * ref (void)
 
void unref (void)
 

Private Attributes

short int xStart
 The table column location to start attachment from. More...
 
short int xEnd
 The table column location to end attachment. More...
 
short int yStart
 The table row location to start attachment from. More...
 
short int yEnd
 The table row location to end attachment. More...
 
guint xPadding
 The horizontal padding between widgets. More...
 
guint yPadding
 The vertical padding between widgets. More...
 
GtkAttachOptions xOptions
 The horizontal fill options, one of : GTK_EXPAND, GTK_SHRINK, GTK_FILL. More...
 
GtkAttachOptions yOptions
 The vertical fill options, one of : GTK_EXPAND, GTK_SHRINK, GTK_FILL. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Container
virtual void pack (GtkWidget *obj)
 
- Protected Attributes inherited from Widget
GtkWidget * widget
 The container based widget. More...
 

Detailed Description

Table

This class allows both auto and manual widget placement into a table.

Allows you to set-up a table like so :

a 2x2 table Table table(2, 2); table.show();

auto-place 4 buttons into the table table<<buttons.grab(1)<<buttons.grab(2)<<buttons.grab(3)<<buttons.grab(4);

manually place 4 buttons into the table : table<<(int[4]){0, 1, 0, 1}<<buttons.grab(1); // top left table<<(int[4]){1, 2, 0, 1}<<buttons.grab(2); // top right table<<(int[4]){0, 1, 1, 2}<<buttons.grab(3); // bottom left table<<(int[4]){1, 2, 1, 2}<<buttons.grab(4); // bottom right

Definition at line 41 of file Table.H.

Constructor & Destructor Documentation

Table::Table ( void  )
inline
Constructor

Sets up a table with 2 rows and 2 columns and everything else default. See initialise

Definition at line 55 of file Table.H.

Here is the call graph for this function:

Table::Table ( short int  rows,
short int  cols,
bool  homogeneous = true,
GtkAttachOptions  xOpt = GTK_EXPAND,
GtkAttachOptions  yOpt = GTK_EXPAND,
uint  xPad = 0,
uint  yPad = 0 
)
inline
Constructor
Parameters
rowsthe number of rows in the table
colsthe number of columns in the table
homogeneous(optional) If true, resizes the table cells to the largest widget. Defaults to true.
xOpt(optional) the default GtkAttachOptions for the horizontal fill type. Defaults to GTK_EXPAND.
yOpt(optional) the default GtkAttachOptions for the horizontal fill type. Defaults to GTK_EXPAND.
xPad(optional) the default horizontal padding. Defaults to 0.
yPad(optional) the default vertical padding. Defaults to 0.

Definition at line 68 of file Table.H.

Here is the call graph for this function:

Member Function Documentation

void Table::getSize ( uint *  rows,
uint *  cols 
)
inline
Get the row and column count of the table
Parameters
[out]rowsThe pointer to the uint to set the row count to
[out]colsThe pointer to the uint to set the column count to

Definition at line 154 of file Table.H.

Here is the caller graph for this function:

void Table::initialise ( short int  rows = 2,
short int  cols = 2,
bool  homogeneous = true,
GtkAttachOptions  xOpt = GTK_FILL,
GtkAttachOptions  yOpt = GTK_FILL,
uint  xPad = 0,
uint  yPad = 0 
)
inline
Initialiser

The actual table setup method.

Parameters
rowsthe number of rows in the table
colsthe number of columns in the table
homogeneous(optional) If true, resizes the table cells to the largest widget. Defaults to true.
xOpt(optional) the default GtkAttachOptions for the horizontal fill type. Defaults to GTK_FILL.
yOpt(optional) the default GtkAttachOptions for the horizontal fill type. Defaults to GTK_FILL.
xPad(optional) the default horizontal padding. Defaults to 0.
yPad(optional) the default vertical padding. Defaults to 0.

Definition at line 82 of file Table.H.

Here is the call graph for this function:

Here is the caller graph for this function:

Table& Table::operator<< ( int region)
inline
Operator to set the location of the next widget to load.
Parameters
regiona pointer to short int array of the following form : {xStart, xEnd, yStart, yEnd}
Returns
This Table for further operator handling.

Definition at line 181 of file Table.H.

Here is the call graph for this function:

Table& Table::operator<< ( GtkWidget *  obj)
inlinevirtual
Operator to load a widget into the table.

This call should be preceeded with either operator<<(short int *region) i.e. << {1,2,1,2} or setRegion. This preceeding call with setup where to load the widget into the table.

Parameters
widgetThe widget to load in the table.
Returns
This Table for further operator handling.

Reimplemented from Container.

Definition at line 192 of file Table.H.

Here is the call graph for this function:

Table& Table::operator<< ( LinkList< GtkWidget * > &  ll)
inline

Pack a LinkList of GtkWidget into the box.

Parameters
llA LinkList of GtkWidget* for packing from the first to the last
Returns
Returns a Box reference for further processing.

Definition at line 201 of file Table.H.

Here is the call graph for this function:

Table& Table::operator>> ( GtkWidget *  obj)
inline

Definition at line 207 of file Table.H.

void Table::placeWidget ( GtkWidget *  obj,
GtkAttachOptions  xOpt,
GtkAttachOptions  yOpt 
)
inline
Places a widget into the table.
Parameters
widgetthe widget to palce.
xOptionsThe GtkAttachOptions for horizonal fill.
yOptionsThe GtkAttachOptions for vertical fill.

Definition at line 121 of file Table.H.

Here is the caller graph for this function:

void Table::placeWidget ( GtkWidget *  obj)
inline
Places a widget into the table.

The options, start, end, padding parameters have previously been set, see setRegion, setPadding and placeWidget Upon placement, it steps to the next column (right) to auto update the xStart, xEnd, yStart and yEnd variables. If the end of the row has been reached, the next row column 1 is set (down one row, left side). If you placeWidget to the last cell (bottom right) it will auto-wrap to the top left. This allows you to load in many widgets one after another and auto-shifts to the next ` cell.

Parameters
widgetthe widget to palce.

Definition at line 134 of file Table.H.

Here is the call graph for this function:

void Table::resize ( uint  rows,
uint  cols 
)
inline
Resizes the table
Parameters
rowsThe number of rows to resize to > 0
colsThe number of rows to resize to > 0

Definition at line 173 of file Table.H.

void Table::setHomogeneous ( bool  homogeneous)
inline
Set whether the table is homogeneous
Parameters
homogeneous(optional) If true, resizes the table cells to the largest widget.

Definition at line 92 of file Table.H.

void Table::setOptions ( GtkAttachOptions  xOpt,
GtkAttachOptions  yOpt 
)
inline
Set the widget expansion options.
Parameters
xOpt(optional) the default GtkAttachOptions for the horizontal fill type.
yOpt(optional) the default GtkAttachOptions for the horizontal fill type.

Definition at line 100 of file Table.H.

Here is the caller graph for this function:

void Table::setPadding ( uint  xPad,
uint  yPad 
)
inline
Sets the ammount of padding to use when placeWidget is called.
Parameters
xPadthe default horizontal padding.
yPadthe default vertical padding.

Definition at line 165 of file Table.H.

Here is the caller graph for this function:

void Table::setRegion ( short int  x_s,
short int  x_e,
short int  y_s,
short int  y_e 
)
inline
Selects the region of the table to load the widget into.
Parameters
x_sthe starting column to place the widget in.
x_ethe end column to place the widget in.
y_sthe starting row to place the widget in.
y_ethe end row to place the widget in.

Definition at line 111 of file Table.H.

Here is the caller graph for this function:

Member Data Documentation

short int Table::xEnd
private

The table column location to end attachment.

Definition at line 43 of file Table.H.

GtkAttachOptions Table::xOptions
private

The horizontal fill options, one of : GTK_EXPAND, GTK_SHRINK, GTK_FILL.

Definition at line 48 of file Table.H.

guint Table::xPadding
private

The horizontal padding between widgets.

Definition at line 46 of file Table.H.

short int Table::xStart
private

The table column location to start attachment from.

Definition at line 42 of file Table.H.

short int Table::yEnd
private

The table row location to end attachment.

Definition at line 45 of file Table.H.

GtkAttachOptions Table::yOptions
private

The vertical fill options, one of : GTK_EXPAND, GTK_SHRINK, GTK_FILL.

Definition at line 49 of file Table.H.

guint Table::yPadding
private

The vertical padding between widgets.

Definition at line 47 of file Table.H.

short int Table::yStart
private

The table row location to start attachment from.

Definition at line 44 of file Table.H.


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