summaryrefslogtreecommitdiff
path: root/textscreen/txt_window.h
diff options
context:
space:
mode:
authorSimon Howard2006-05-20 15:15:17 +0000
committerSimon Howard2006-05-20 15:15:17 +0000
commitf761f821f95a3fbf8af1eb645d8ae9412abdc541 (patch)
treec6699ce7a4487043391ee014bca9582bf29b7559 /textscreen/txt_window.h
parentc63afd766a9fdb19bc2c3a650f859bbba4699e8f (diff)
downloadchocolate-doom-f761f821f95a3fbf8af1eb645d8ae9412abdc541.tar.gz
chocolate-doom-f761f821f95a3fbf8af1eb645d8ae9412abdc541.tar.bz2
chocolate-doom-f761f821f95a3fbf8af1eb645d8ae9412abdc541.zip
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
Diffstat (limited to 'textscreen/txt_window.h')
-rw-r--r--textscreen/txt_window.h24
1 files changed, 22 insertions, 2 deletions
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 */