Odamex
Setting the Standard in Multiplayer Doom
textscreen/txt_table.cpp File Reference

Functions

void TXT_ClearTable (TXT_UNCAST_ARG(table))
 Remove all widgets from a table.
void TXT_AddWidget (TXT_UNCAST_ARG(table), TXT_UNCAST_ARG(widget))
 Add a widget to a table.
void TXT_AddWidgets (TXT_UNCAST_ARG(table),...)
 Add multiple widgets to a table.
void TXT_InitTable (txt_table_t *table, int columns)
txt_table_tTXT_NewTable (int columns)
 Create a new table.
txt_table_tTXT_NewHorizBox (TXT_UNCAST_ARG(first_widget),...)
 Create a table containing the specified widgets packed horizontally, from left to right.
txt_widget_tTXT_GetSelectedWidget (TXT_UNCAST_ARG(table))
 Get the currently selected widget within a table.
int TXT_SelectWidget (TXT_UNCAST_ARG(table), TXT_UNCAST_ARG(widget))
 Select the given widget that is contained within the specified table.
void TXT_SetColumnWidths (TXT_UNCAST_ARG(table),...)
 Set the widths of the columns of the table.
int TXT_PageTable (TXT_UNCAST_ARG(table), int pagex, int pagey)
 Hack to move the selection in a table by a 'page', triggered by the scrollpane.

Variables

txt_widget_class_t txt_table_class

Function Documentation

void TXT_AddWidget ( TXT_UNCAST_ARG(table)  ,
TXT_UNCAST_ARG(widget)   
)

Add a widget to a table.

Widgets are added to tables horizontally, from left to right. For example, for a table with three columns, the first call to this function will add a widget to the first column, the second call to the second column, the third call to the third column, and the fourth will return to the first column, starting a new row.

For adding many widgets, it may be easier to use TXT_AddWidgets.

Parameters:
tableThe table.
widgetThe widget to add.
void TXT_AddWidgets ( TXT_UNCAST_ARG(table)  ,
  ... 
)

Add multiple widgets to a table.

Widgets are added as described in the documentation for the TXT_AddWidget function. This function adds multiple widgets. The number of arguments is variable, and the argument list must be terminated by a NULL pointer.

Parameters:
tableThe table.
void TXT_ClearTable ( TXT_UNCAST_ARG(table)  )

Remove all widgets from a table.

Parameters:
tableThe table.
txt_widget_t* TXT_GetSelectedWidget ( TXT_UNCAST_ARG(table)  )

Get the currently selected widget within a table.

This function will recurse through subtables if necessary.

Parameters:
tableThe table.
Returns:
Pointer to the widget that is currently selected.
void TXT_InitTable ( txt_table_t table,
int  columns 
)
txt_table_t* TXT_NewHorizBox ( TXT_UNCAST_ARG(first_widget)  ,
  ... 
)

Create a table containing the specified widgets packed horizontally, from left to right.

The arguments to this function are variable. Each argument must be a pointer to a widget, and the list is terminated with a NULL.

Returns:
Pointer to the new table structure.
txt_table_t* TXT_NewTable ( int  columns)

Create a new table.

Parameters:
columnsThe number of columns in the new table.
Returns:
Pointer to the new table structure.
int TXT_PageTable ( TXT_UNCAST_ARG(table)  ,
int  pagex,
int  pagey 
)

Hack to move the selection in a table by a 'page', triggered by the scrollpane.

This acts as per the keyboard events for the arrows, but moves the selection by at least the specified number of characters.

Parameters:
tableThe table.
pagexMinimum distance to move the selection horizontally.
pageyMinimum distance to move the selection vertically.
Returns:
Non-zero if the selection has been changed.
int TXT_SelectWidget ( TXT_UNCAST_ARG(table)  ,
TXT_UNCAST_ARG(widget)   
)

Select the given widget that is contained within the specified table.

This function will recursively search through subtables if necessary.

Parameters:
tableThe table.
widgetThe widget to select.
Returns:
Non-zero (true) if it has been selected, or zero (false) if it was not found within this table.
void TXT_SetColumnWidths ( TXT_UNCAST_ARG(table)  ,
  ... 
)

Set the widths of the columns of the table.

The arguments to this function are variable, and correspond to the number of columns in the table. For example, if a table has five columns, the width of each of the five columns must be specified.

The width values are in number of characters.

Note that this function only sets the minimum widths for columns; if the columns contain widgets that are wider than the widths specified, they will be larger.

Parameters:
tableThe table.

Variable Documentation

Initial value:
{
    TXT_CalcTableSize,
    TXT_TableDrawer,
    TXT_TableKeyPress,
    TXT_TableDestructor,
    TXT_TableMousePress,
    TXT_TableLayout,
}
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends