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

Functions

void TXT_SetWindowAction (txt_window_t *window, txt_horiz_align_t position, txt_window_action_t *action)
 Set a window action for a given window.
txt_window_tTXT_NewWindow (char *title)
 Open a new window.
void TXT_CloseWindow (txt_window_t *window)
 Close a window.
void TXT_LayoutWindow (txt_window_t *window)
void TXT_DrawWindow (txt_window_t *window, int selected)
void TXT_SetWindowPosition (txt_window_t *window, txt_horiz_align_t horiz_align, txt_vert_align_t vert_align, int x, int y)
 Set the position of a window on the screen.
void TXT_WindowKeyPress (txt_window_t *window, int c)
void TXT_SetKeyListener (txt_window_t *window, TxtWindowKeyPress key_listener, void *user_data)
 Set a callback function to be invoked whenever a key is pressed within a window.
void TXT_SetMouseListener (txt_window_t *window, TxtWindowMousePress mouse_listener, void *user_data)
 Set a callback function to be invoked whenever a mouse button is pressed within a window.

Function Documentation

void TXT_CloseWindow ( txt_window_t window)

Close a window.

Parameters:
windowTine window to close.
void TXT_DrawWindow ( txt_window_t window,
int  selected 
)
void TXT_LayoutWindow ( txt_window_t window)
txt_window_t* TXT_NewWindow ( char *  title)

Open a new window.

Parameters:
titleTitle to display in the titlebar of the new window.
Returns:
Pointer to a new txt_window_t structure representing the new window.
void TXT_SetKeyListener ( txt_window_t window,
TxtWindowKeyPress  key_listener,
void *  user_data 
)

Set a callback function to be invoked whenever a key is pressed within a window.

Parameters:
windowThe window.
key_listenerCallback function.
user_dataUser-specified pointer to pass to the callback function.
void TXT_SetMouseListener ( txt_window_t window,
TxtWindowMousePress  mouse_listener,
void *  user_data 
)

Set a callback function to be invoked whenever a mouse button is pressed within a window.

Parameters:
windowThe window.
mouse_listenerCallback function.
user_dataUser-specified pointer to pass to the callback function.
void TXT_SetWindowAction ( txt_window_t window,
txt_horiz_align_t  position,
txt_window_action_t action 
)

Set a window action for a given window.

Each window can have up to three window actions, which provide keyboard shortcuts that can be used within a given window.

Parameters:
windowThe window.
positionThe window action slot to set (left, center or right).
actionThe window action widget. If this is NULL, any current window action in the given slot is removed.
void TXT_SetWindowPosition ( txt_window_t window,
txt_horiz_align_t  horiz_align,
txt_vert_align_t  vert_align,
int  x,
int  y 
)

Set the position of a window on the screen.

The window is specified as coordinates relative to a predefined position on the screen (eg. center of the screen, top left of the screen, etc).

Parameters:
windowThe window.
horiz_alignHorizontal position on the screen to which the coordinates are relative (left side, right side or center).
vert_alignVertical position on the screen to which the coordinates are relative (top, bottom or center).
xX coordinate (horizonal axis) for window position.
yY coordinate (vertical axis) for window position.
void TXT_WindowKeyPress ( txt_window_t window,
int  c 
)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends