summaryrefslogtreecommitdiff
path: root/textscreen/txt_radiobutton.c
diff options
context:
space:
mode:
authorSimon Howard2006-06-02 19:29:24 +0000
committerSimon Howard2006-06-02 19:29:24 +0000
commit517af9477b7269564f3ba8c0ccc6ef53c78a7abb (patch)
tree1d60d219a7c71b90330baee90acf06a05670fb0f /textscreen/txt_radiobutton.c
parentb3e5170bbba1c3048da86a5291cd45524abfeac2 (diff)
downloadchocolate-doom-517af9477b7269564f3ba8c0ccc6ef53c78a7abb.tar.gz
chocolate-doom-517af9477b7269564f3ba8c0ccc6ef53c78a7abb.tar.bz2
chocolate-doom-517af9477b7269564f3ba8c0ccc6ef53c78a7abb.zip
textscreen: Rejig how the entire drawing process works. Add a recursive
layout method that assigns the position and size of widgets for the whole window before drawing. Add another method that responds to mouse button presses. Allow windows to have no title bar by specifying NULL as the title. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 547
Diffstat (limited to 'textscreen/txt_radiobutton.c')
-rw-r--r--textscreen/txt_radiobutton.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/textscreen/txt_radiobutton.c b/textscreen/txt_radiobutton.c
index e221896e..d5f694f7 100644
--- a/textscreen/txt_radiobutton.c
+++ b/textscreen/txt_radiobutton.c
@@ -9,20 +9,23 @@
#include "txt_main.h"
#include "txt_window.h"
-static void TXT_RadioButtonSizeCalc(TXT_UNCAST_ARG(radiobutton), int *w, int *h)
+static void TXT_RadioButtonSizeCalc(TXT_UNCAST_ARG(radiobutton))
{
TXT_CAST_ARG(txt_radiobutton_t, radiobutton);
// Minimum width is the string length + two spaces for padding
- *w = strlen(radiobutton->label) + 6;
- *h = 1;
+ radiobutton->widget.w = strlen(radiobutton->label) + 6;
+ radiobutton->widget.h = 1;
}
-static void TXT_RadioButtonDrawer(TXT_UNCAST_ARG(radiobutton), int w, int selected)
+static void TXT_RadioButtonDrawer(TXT_UNCAST_ARG(radiobutton), int selected)
{
TXT_CAST_ARG(txt_radiobutton_t, radiobutton);
int i;
+ int w;
+
+ w = radiobutton->widget.w;
TXT_BGColor(TXT_COLOR_BLUE, 0);
TXT_FGColor(TXT_COLOR_BRIGHT_CYAN);