From 8d188ff3d11c199621c56275d4fd6730d6f63c1b Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 22 May 2006 00:26:34 +0000 Subject: More signals to detect when checkboxes/radiobuttons are changed. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 502 --- textscreen/txt_checkbox.c | 1 + textscreen/txt_radiobutton.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'textscreen') diff --git a/textscreen/txt_checkbox.c b/textscreen/txt_checkbox.c index f33781c1..a61822eb 100644 --- a/textscreen/txt_checkbox.c +++ b/textscreen/txt_checkbox.c @@ -71,6 +71,7 @@ static int TXT_CheckBoxKeyPress(txt_widget_t *widget, int key) if (key == KEY_ENTER || key == ' ') { *checkbox->variable = !*checkbox->variable; + TXT_EmitSignal(widget, "changed"); return 1; } diff --git a/textscreen/txt_radiobutton.c b/textscreen/txt_radiobutton.c index 45412f28..c0a87455 100644 --- a/textscreen/txt_radiobutton.c +++ b/textscreen/txt_radiobutton.c @@ -70,7 +70,11 @@ static int TXT_RadioButtonKeyPress(txt_widget_t *widget, int key) if (key == KEY_ENTER || key == ' ') { - *radiobutton->variable = radiobutton->value; + if (*radiobutton->variable != radiobutton->value) + { + *radiobutton->variable = radiobutton->value; + TXT_EmitSignal(widget, "selected"); + } return 1; } -- cgit v1.2.3