gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
Table Class Reference

#include <Table.H>

Inheritance diagram for Table:
[legend]
Collaboration diagram for Table:
[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 i)
 
Tableoperator, (int i)
 
Tableoperator<< (int *region)
 
Tableoperator<< (GtkWidget *obj)
 
Tableoperator<< (LinkList< GtkWidget *> &ll)
 
Tableoperator<< (Container &b)
 
Tableoperator<< (Container *b)
 
Tableoperator<< (Widget &b)
 
Tableoperator<< (Widget *b)
 
Tableoperator>> (GtkWidget *obj)
 
Tableoperator>> (Container *c)
 
Tableoperator>> (Container &c)
 
Tableoperator>> (LinkList< GtkWidget *> &ll)
 
- Public Member Functions inherited from Container
void setBorder (unsigned int size)
 
unsigned int getBorder (void)
 
Containeroperator<< (Container &c)
 
Containeroperator<< (Container *c)
 
Containeroperator<< (Widget &w)
 
Containeroperator<< (Widget *w)
 
Containeroperator<< (LinkList< GtkWidget *> &ll)
 
Containeroperator>> (GtkWidget *w)
 
Containeroperator>> (Container *c)
 
Containeroperator>> (Container &c)
 
Containeroperator>> (LinkList< GtkWidget *> &ll)
 
void setChildrensSensitivity (bool sens)
 
bool areAnyChildrensSensitive (void)
 
unsigned int size ()
 
- Public Member Functions inherited from Widget
 Widget ()
 Construcotr. More...
 
 Widget (GtkWidget *w)
 
virtual ~Widget ()
 Destructor. More...
 
GtkWidget * ref (void)
 
void unref (void)
 
GtkWidget * show (void)
 
GtkWidget * hide (void)
 
bool getVisible (void)
 
GtkWidget * getWidget (void)
 
bool getSensitive (void)
 
void setSensitive (bool sens)
 
void getSize (int &width, int &height)
 
virtual void setSize (int width, int height)
 
void getLocationSize (int &x, int &y, int &width, int &height)
 
void queueDraw ()
 
GdkWindow * getWindow ()
 
void connect (const char *event, GCallback callback, gpointer data)
 
void connectAfter (const char *event, GCallback callback, gpointer data)
 
void connectExposeEventCallback (GCallback callback, void *data)
 
void connectExposeEventCallback (GtkWidget *w, GCallback callback, void *data)
 
void connectConfigureEventCallback (GCallback callback, void *data)
 
void connectConfigureEventCallback (GtkWidget *w, GCallback callback, void *data)
 
Widgetoperator<< (DragNDrop &dnd)
 
Widgetoperator>> (DragNDrop &dnd)
 

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...
 
std::vector< int > regionTemp
 This region starts empty, when it gets 4 elements, it sets the region. 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 Member Functions inherited from Widget
virtual bool checkDropValidity (GtkWidget *w, GtkWidget *sourceWidget, int info, const unsigned char *selectionStoredData)
 
virtual bool dragDataReceived (GtkWidget *w, GtkWidget *sourceWidget, int info, const unsigned char *selectionStoredData, int length)
 
virtual void dragLeave (GtkWidget *w, GtkWidget *sourceWidget)
 
virtual bool dragMotion (GtkWidget *w, GtkWidget *sourceWidget, int x, int y)
 
virtual int chooseTheTargetToUse (GtkWidget *w, GtkWidget *sourceWidget, DragNDrop &dnd)
 
virtual void dragDataGet (GtkWidget *w, GtkSelectionData *selectionData, guint info)
 
virtual void dragDataDelete (GtkWidget *w)
 
virtual void dragBegin (GtkWidget *w)
 
virtual void dragEnd (GtkWidget *w)
 
- 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.

TableTest.jpg

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<<0, 1, 0, 1<<buttons.grab(1); // top left
table<<1, 2, 0, 1<<buttons.grab(2); // top right
table<<0, 1, 1, 2<<buttons.grab(3); // bottom left
table<<1, 2, 1, 2<<buttons.grab(4); // bottom right
Examples:
TableTest.C.

Definition at line 43 of file Table.H.

Constructor & Destructor Documentation

◆ Table() [1/2]

Table::Table ( void  )
inline

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

Definition at line 60 of file Table.H.

Here is the call graph for this function:

◆ Table() [2/2]

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 73 of file Table.H.

Here is the call graph for this function:

Member Function Documentation

◆ getSize()

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 159 of file Table.H.

Here is the caller graph for this function:

◆ initialise()

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 87 of file Table.H.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator,()

Table& Table::operator, ( int  i)
inline

Operator to set the location of the next widget to load.

This must be used like so :

Table t; t<<1, 2, 1, 2; // xStart, xEnd, yStart, yEnd
Parameters
iThe new region point, must be specified in this order : {xStart, xEnd, yStart, yEnd}
Returns
CommaRegionSpec for further region or widget or LinkedList operator handling.

Definition at line 212 of file Table.H.

Here is the call graph for this function:

◆ operator<<() [1/8]

Table& Table::operator<< ( int  i)
inline

Operator to set the location of the next widget to load.

This must be used like so :

Table t; t<<1, 2, 1, 2; // xStart, xEnd, yStart, yEnd
Parameters
iThe new region point, must be specified in this order : {xStart, xEnd, yStart, yEnd}
Returns
CommaRegionSpec for further region or widget or LinkedList operator handling.

Definition at line 191 of file Table.H.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator<<() [2/8]

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 219 of file Table.H.

Here is the call graph for this function:

◆ operator<<() [3/8]

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
objThe widget to load in the table.
Returns
This Table for further operator handling.

Reimplemented from Container.

Definition at line 230 of file Table.H.

Here is the call graph for this function:

◆ operator<<() [4/8]

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

Pack a LinkList of GtkWidget into the table.

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

Definition at line 239 of file Table.H.

Here is the call graph for this function:

◆ operator<<() [5/8]

Table& Table::operator<< ( Container b)
inline

Operator to pack a Container in this table

Parameters
bThe Container to add.
Returns
Returns a Container reference for further processing.

Definition at line 249 of file Table.H.

Here is the call graph for this function:

◆ operator<<() [6/8]

Table& Table::operator<< ( Container b)
inline

Operator to pack a pointed to Container

Parameters
bA pointer to the Container to add.
Returns
Returns a Container reference for further processing.

Definition at line 257 of file Table.H.

Here is the call graph for this function:

◆ operator<<() [7/8]

Table& Table::operator<< ( Widget b)
inline

Operator to pack a Widget class

Parameters
bThe widget to add.
Returns
Returns a Container reference for further processing.

Definition at line 265 of file Table.H.

Here is the call graph for this function:

◆ operator<<() [8/8]

Table& Table::operator<< ( Widget b)
inline

Operator to pack a Widget pointer

Parameters
bA pointer to the Widget to add.
Returns
Returns a Container reference for further processing.

Definition at line 273 of file Table.H.

Here is the call graph for this function:

◆ operator>>() [1/4]

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

Unload the widget from the table

Parameters
objThe widget to unload from the table
Returns
Returns a Table reference for further processing.

Definition at line 281 of file Table.H.

◆ operator>>() [2/4]

Table& Table::operator>> ( Container c)
inline

Unload the container from the table

Parameters
cThe container to unload from the table
Returns
Returns a Table reference for further processing.

Definition at line 290 of file Table.H.

Here is the call graph for this function:

◆ operator>>() [3/4]

Table& Table::operator>> ( Container c)
inline

Unload the container from the table

Parameters
cThe container to unload from the table
Returns
Returns a Table reference for further processing.

Definition at line 299 of file Table.H.

Here is the call graph for this function:

◆ operator>>() [4/4]

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

Unpack a LinkList of GtkWidget from the table.

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

Definition at line 308 of file Table.H.

Here is the call graph for this function:

◆ placeWidget() [1/2]

void Table::placeWidget ( GtkWidget *  obj,
GtkAttachOptions  xOpt,
GtkAttachOptions  yOpt 
)
inline

Places a widget into the table.

Parameters
objthe widget to palce.
xOptThe GtkAttachOptions for horizonal fill.
yOptThe GtkAttachOptions for vertical fill.

Definition at line 126 of file Table.H.

Here is the caller graph for this function:

◆ placeWidget() [2/2]

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
objthe widget to palce.

Definition at line 139 of file Table.H.

Here is the call graph for this function:

◆ resize()

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 178 of file Table.H.

◆ setHomogeneous()

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 97 of file Table.H.

◆ setOptions()

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.
Examples:
TableTest.C.

Definition at line 105 of file Table.H.

Here is the caller graph for this function:

◆ setPadding()

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 170 of file Table.H.

Here is the caller graph for this function:

◆ setRegion()

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 116 of file Table.H.

Here is the caller graph for this function:

Member Data Documentation

◆ regionTemp

std::vector<int> Table::regionTemp
private

This region starts empty, when it gets 4 elements, it sets the region.

Definition at line 49 of file Table.H.

◆ xEnd

short int Table::xEnd
private

The table column location to end attachment.

Definition at line 45 of file Table.H.

◆ xOptions

GtkAttachOptions Table::xOptions
private

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

Definition at line 53 of file Table.H.

◆ xPadding

guint Table::xPadding
private

The horizontal padding between widgets.

Definition at line 51 of file Table.H.

◆ xStart

short int Table::xStart
private

The table column location to start attachment from.

Definition at line 44 of file Table.H.

◆ yEnd

short int Table::yEnd
private

The table row location to end attachment.

Definition at line 47 of file Table.H.

◆ yOptions

GtkAttachOptions Table::yOptions
private

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

Definition at line 54 of file Table.H.

◆ yPadding

guint Table::yPadding
private

The vertical padding between widgets.

Definition at line 52 of file Table.H.

◆ yStart

short int Table::yStart
private

The table row location to start attachment from.

Definition at line 46 of file Table.H.


The documentation for this class was generated from the following file:
gtkIOStream: Table Class Reference
GTK+ IOStream  Beta