summaryrefslogtreecommitdiff
path: root/components/rtgui/widgets
diff options
context:
space:
mode:
author[email protected] <[email protected]>2010-05-26 23:58:47 +0000
committer[email protected] <[email protected]>2010-05-26 23:58:47 +0000
commit5b91286805b21d39b9d0321dd515dc2bcd7ff8b3 (patch)
treeefd6467d84800483f35f80fb923ccffdb36e339f /components/rtgui/widgets
parent94e758a2cd408c737d626d12baa629fca0c1f5c0 (diff)
add radiobutton drawing.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@737 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/rtgui/widgets')
-rw-r--r--components/rtgui/widgets/radiobox.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/components/rtgui/widgets/radiobox.c b/components/rtgui/widgets/radiobox.c
index babf9f9ce1..5fbb79f0a6 100644
--- a/components/rtgui/widgets/radiobox.c
+++ b/components/rtgui/widgets/radiobox.c
@@ -224,13 +224,19 @@ void rtgui_radiobox_set_orientation(struct rtgui_radiobox* radiobox, int orienta
void rtgui_radiobox_set_selection(struct rtgui_radiobox* radiobox, int selection)
{
+ rt_uint16_t old_item;
+
+ if (selection == radiobox->item_selection) return;
+
+ old_item = radiobox->item_selection;
if (selection >= 0 && selection < radiobox->item_count)
{
radiobox->item_selection = selection;
}
/* update radiobox widget */
- rtgui_theme_draw_radiobox(radiobox);
+ rtgui_theme_draw_radiobutton(radiobox, old_item);
+ rtgui_theme_draw_radiobutton(radiobox, radiobox->item_selection);
}
int rtgui_radiobox_get_selection(struct rtgui_radiobox* radiobox)