Odamex
Setting the Standard in Multiplayer Doom
textscreen/txt_widget.h File Reference

Base "widget" GUI component class. More...

Go to the source code of this file.

Data Structures

struct  txt_widget_class_s
struct  txt_widget_s

Typedefs

typedef struct txt_widget_s txt_widget_t
 A GUI widget.
typedef struct txt_widget_class_s txt_widget_class_t
typedef struct txt_callback_table_s txt_callback_table_t
typedef void(* TxtWidgetSizeCalc )(TXT_UNCAST_ARG(widget))
typedef void(* TxtWidgetDrawer )(TXT_UNCAST_ARG(widget), int selected)
typedef void(* TxtWidgetDestroy )(TXT_UNCAST_ARG(widget))
typedef int(* TxtWidgetKeyPress )(TXT_UNCAST_ARG(widget), int key)
typedef void(* TxtWidgetSignalFunc )(TXT_UNCAST_ARG(widget), void *user_data)
typedef void(* TxtMousePressFunc )(TXT_UNCAST_ARG(widget), int x, int y, int b)
typedef void(* TxtWidgetLayoutFunc )(TXT_UNCAST_ARG(widget))

Enumerations

enum  txt_vert_align_t { TXT_VERT_TOP, TXT_VERT_CENTER, TXT_VERT_BOTTOM }
enum  txt_horiz_align_t { TXT_HORIZ_LEFT, TXT_HORIZ_CENTER, TXT_HORIZ_RIGHT }

Functions

void TXT_InitWidget (TXT_UNCAST_ARG(widget), txt_widget_class_t *widget_class)
void TXT_CalcWidgetSize (TXT_UNCAST_ARG(widget))
void TXT_DrawWidget (TXT_UNCAST_ARG(widget), int selected)
void TXT_EmitSignal (TXT_UNCAST_ARG(widget), const char *signal_name)
int TXT_WidgetKeyPress (TXT_UNCAST_ARG(widget), int key)
void TXT_WidgetMousePress (TXT_UNCAST_ARG(widget), int x, int y, int b)
void TXT_DestroyWidget (TXT_UNCAST_ARG(widget))
void TXT_LayoutWidget (TXT_UNCAST_ARG(widget))
void TXT_SignalConnect (TXT_UNCAST_ARG(widget), const char *signal_name, TxtWidgetSignalFunc func, void *user_data)
 Set a callback function to be invoked when a signal occurs.
void TXT_SetWidgetAlign (TXT_UNCAST_ARG(widget), txt_horiz_align_t horiz_align)
 Set the policy for how a widget should be aligned within a table.

Detailed Description

Base "widget" GUI component class.


Typedef Documentation

typedef struct txt_widget_s txt_widget_t

A GUI widget.

A widget is an individual component of a GUI. Various different widget types exist.

Widgets may emit signals. The types of signal emitted by a widget depend on the type of the widget. It is possible to be notified when a signal occurs using the TXT_SignalConnect function.

typedef void(* TxtMousePressFunc)(TXT_UNCAST_ARG(widget), int x, int y, int b)
typedef void(* TxtWidgetDestroy)(TXT_UNCAST_ARG(widget))
typedef void(* TxtWidgetDrawer)(TXT_UNCAST_ARG(widget), int selected)
typedef int(* TxtWidgetKeyPress)(TXT_UNCAST_ARG(widget), int key)
typedef void(* TxtWidgetLayoutFunc)(TXT_UNCAST_ARG(widget))
typedef void(* TxtWidgetSignalFunc)(TXT_UNCAST_ARG(widget), void *user_data)
typedef void(* TxtWidgetSizeCalc)(TXT_UNCAST_ARG(widget))

Enumeration Type Documentation

Enumerator:
TXT_HORIZ_LEFT 
TXT_HORIZ_CENTER 
TXT_HORIZ_RIGHT 
Enumerator:
TXT_VERT_TOP 
TXT_VERT_CENTER 
TXT_VERT_BOTTOM 

Function Documentation

void TXT_CalcWidgetSize ( TXT_UNCAST_ARG(widget)  )
void TXT_DestroyWidget ( TXT_UNCAST_ARG(widget)  )
void TXT_DrawWidget ( TXT_UNCAST_ARG(widget)  ,
int  selected 
)
void TXT_EmitSignal ( TXT_UNCAST_ARG(widget)  ,
const char *  signal_name 
)
void TXT_InitWidget ( TXT_UNCAST_ARG(widget)  ,
txt_widget_class_t widget_class 
)
void TXT_LayoutWidget ( TXT_UNCAST_ARG(widget)  )
void TXT_SetWidgetAlign ( TXT_UNCAST_ARG(widget)  ,
txt_horiz_align_t  horiz_align 
)

Set the policy for how a widget should be aligned within a table.

By default, widgets are aligned to the left of the column.

Parameters:
widgetThe widget.
horiz_alignThe alignment to use.
void TXT_SignalConnect ( TXT_UNCAST_ARG(widget)  ,
const char *  signal_name,
TxtWidgetSignalFunc  func,
void *  user_data 
)

Set a callback function to be invoked when a signal occurs.

Parameters:
widgetThe widget to watch.
signal_nameThe signal to watch.
funcThe callback function to invoke.
user_dataUser-specified pointer to pass to the callback function.
int TXT_WidgetKeyPress ( TXT_UNCAST_ARG(widget)  ,
int  key 
)
void TXT_WidgetMousePress ( TXT_UNCAST_ARG(widget)  ,
int  x,
int  y,
int  b 
)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends