From f761f821f95a3fbf8af1eb645d8ae9412abdc541 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 20 May 2006 15:15:17 +0000 Subject: Add selectable and visible properties to widgets. Allow the position of windows to be set based on position of top/bottom/center,left/right,center coordinates. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 486 --- textscreen/txt_window.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'textscreen/txt_window.h') diff --git a/textscreen/txt_window.h b/textscreen/txt_window.h index 327bc06a..5dc799c7 100644 --- a/textscreen/txt_window.h +++ b/textscreen/txt_window.h @@ -27,6 +27,20 @@ typedef struct txt_window_s txt_window_t; +typedef enum +{ + TXT_VERT_TOP, + TXT_VERT_CENTER, + TXT_VERT_BOTTOM, +} txt_vert_align_t; + +typedef enum +{ + TXT_HORIZ_LEFT, + TXT_HORIZ_CENTER, + TXT_HORIZ_RIGHT, +} txt_horiz_align_t; + #include "txt_widget.h" struct txt_window_s @@ -35,8 +49,10 @@ struct txt_window_s char *title; - // Screen coordinates of the centerpoint of the window + // Screen coordinates of the window + txt_vert_align_t vert_align; + txt_horiz_align_t horiz_align; int x, y; // Widgets in this window @@ -49,9 +65,13 @@ struct txt_window_s int selected; }; -txt_window_t *TXT_NewWindow(char *title, int x, int y); +txt_window_t *TXT_NewWindow(char *title); void TXT_CloseWindow(txt_window_t *window); void TXT_AddWidget(txt_window_t *window, void *widget); +void TXT_SetWindowPosition(txt_window_t *window, + txt_horiz_align_t horiz_align, + txt_vert_align_t vert_align, + int x, int y); #endif /* #ifndef TXT_WINDOW_T */ -- cgit v1.2.3