From 517af9477b7269564f3ba8c0ccc6ef53c78a7abb Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 2 Jun 2006 19:29:24 +0000 Subject: 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 --- textscreen/txt_radiobutton.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'textscreen/txt_radiobutton.c') 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); -- cgit v1.2.3