summaryrefslogtreecommitdiff
path: root/apps/recorder
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-04-28 22:20:27 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-04-28 22:20:27 +0000
commitbd3d297b3186185d43dff5924f80545f736db446 (patch)
tree0c34dc230305b5af5329cf0e6ac8f56a04eb6f6e /apps/recorder
parentfc2fc47d016e3042a19c6dda5d79a6bf0c445f87 (diff)
downloadrockbox-bd3d297b3186185d43dff5924f80545f736db446.tar.gz
rockbox-bd3d297b3186185d43dff5924f80545f736db446.zip
A checkbox widget
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4559 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/widgets.c25
-rw-r--r--apps/recorder/widgets.h1
2 files changed, 26 insertions, 0 deletions
diff --git a/apps/recorder/widgets.c b/apps/recorder/widgets.c
index 99257495cf..4008d2b4c2 100644
--- a/apps/recorder/widgets.c
+++ b/apps/recorder/widgets.c
@@ -210,4 +210,29 @@ void scrollbar(int x, int y, int width, int height, int items, int min_shown,
210 } 210 }
211 } 211 }
212} 212}
213
214/*
215 * Print a checkbox
216 */
217void checkbox(int x, int y, int width, int height, bool checked)
218{
219 /* check position and dimensions */
220 if((x < 0) || (x + width > LCD_WIDTH) ||
221 (y < 0) || (y + height > LCD_HEIGHT) ||
222 (width < 4 ) || (height < 4 ))
223 {
224 return;
225 }
226
227 lcd_drawrect(x, y, width, height);
228
229 if (checked){
230 lcd_drawline(x + 2, y + 2, x + width - 2 - 1 , y + height - 2 - 1);
231 lcd_drawline(x + 2, y + height - 2 - 1, x + width - 2 - 1, y + 2);
232 } else {
233 /* be sure to clear box */
234 lcd_clearrect(x + 1, y + 1, width - 2, height - 2);
235 }
236}
237
213#endif 238#endif
diff --git a/apps/recorder/widgets.h b/apps/recorder/widgets.h
index 18f59a8893..de8e78520f 100644
--- a/apps/recorder/widgets.h
+++ b/apps/recorder/widgets.h
@@ -38,5 +38,6 @@ enum {
38extern void progressbar(int x, int y, int width, int height, int percent, int direction); 38extern void progressbar(int x, int y, int width, int height, int percent, int direction);
39extern void slidebar(int x, int y, int width, int height, int percent, int direction); 39extern void slidebar(int x, int y, int width, int height, int percent, int direction);
40extern void scrollbar(int x, int y, int width, int height, int items, int min_shown, int max_shown, int orientation); 40extern void scrollbar(int x, int y, int width, int height, int items, int min_shown, int max_shown, int orientation);
41extern void checkbox(int x, int y, int width, int height, bool checked);
41#endif /* HAVE_LCD_BITMAP */ 42#endif /* HAVE_LCD_BITMAP */
42#endif /* __WIDGETS_H__ */ 43#endif /* __WIDGETS_H__ */