summaryrefslogtreecommitdiffstats
path: root/apps/recorder
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-07-08 13:14:44 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-07-08 13:14:44 +0000
commit244106176447effe0330ef194ad93ccaadf589ff (patch)
tree0d50f243af7c625a1af4e425cc909de66182dd8a /apps/recorder
parente7bb8c04287ec8baf6f89dd4f169b00ccb7d7171 (diff)
downloadrockbox-244106176447effe0330ef194ad93ccaadf589ff.tar.gz
rockbox-244106176447effe0330ef194ad93ccaadf589ff.zip
Removed progressbar() and slidebar()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4854 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/widgets.c115
-rw-r--r--apps/recorder/widgets.h2
2 files changed, 12 insertions, 105 deletions
diff --git a/apps/recorder/widgets.c b/apps/recorder/widgets.c
index 4008d2b4c2..7ac647024a 100644
--- a/apps/recorder/widgets.c
+++ b/apps/recorder/widgets.c
@@ -23,7 +23,7 @@
#ifdef HAVE_LCD_BITMAP
/* Valid dimensions return true, invalid false */
-bool valid_dimensions(int x, int y, int width, int height)
+static bool valid_dimensions(int x, int y, int width, int height)
{
if((x < 0) || (x + width > LCD_WIDTH) ||
(y < 0) || (y + height > LCD_HEIGHT))
@@ -34,107 +34,6 @@ bool valid_dimensions(int x, int y, int width, int height)
return true;
}
-void init_bar(int x, int y, int width, int height)
-{
- /* draw box */
- lcd_drawrect(x, y, width, height);
-
- /* clear edge pixels */
- lcd_clearpixel(x, y);
- lcd_clearpixel((x + width - 1), y);
- lcd_clearpixel(x, (y + height - 1));
- lcd_clearpixel((x + width - 1), (y + height - 1));
-
- /* clear pixels in progress bar */
- lcd_clearrect(x + 1, y + 1, width - 2, height - 2);
-}
-
-/*
- * Print a progress bar
- */
-void progressbar(int x, int y, int width, int height, int percent,
- int direction)
-{
- int pos;
-
- /* check position and dimensions */
- if (!valid_dimensions(x, y, width, height))
- return;
-
- init_bar(x, y, width, height);
-
- /* draw bar */
- pos = percent;
- if(pos < 0)
- pos = 0;
- if(pos > 100)
- pos = 100;
-
- switch (direction)
- {
- case Grow_Right:
- pos=(width - 2) * pos / 100;
- lcd_fillrect(x + 1, y + 1, pos, height - 2);
- break;
- case Grow_Left:
- pos=(width - 2) * (100 - pos) / 100;
- lcd_fillrect(x + pos, y + 1, width - 1 - pos, height - 2);
- break;
- case Grow_Down:
- pos=(height - 2) * pos / 100;
- lcd_fillrect(x + 1, y + 1, width - 2, pos);
- break;
- case Grow_Up:
- pos=(height - 2) * (100 - pos) / 100;
- lcd_fillrect(x + 1, y + pos, width - 2, height - 1 - pos);
- break;
- }
-}
-
-
-/*
- * Print a slidebar bar
- */
-void slidebar(int x, int y, int width, int height, int percent, int direction)
-{
- int pos;
-
- /* check position and dimensions */
- if (!valid_dimensions(x, y, width, height))
- return;
-
- init_bar(x, y, width, height);
-
- /* draw knob */
- pos = percent;
- if(pos < 0)
- pos = 0;
- if(pos > 100)
- pos = 100;
-
- switch (direction)
- {
- case Grow_Right:
- pos = (width - height) * pos / 100;
- break;
- case Grow_Left:
- pos=(width - height) * (100 - pos) / 100;
- break;
- case Grow_Down:
- pos=(height - width) * pos / 100;
- break;
- case Grow_Up:
- pos=(height - width) * (100 - pos) / 100;
- break;
- }
-
- if(direction == Grow_Left || direction == Grow_Right)
- lcd_fillrect(x + pos + 1, y + 1, height - 2, height - 2);
- else
- lcd_fillrect(x + 1, y + pos + 1, width - 2, width - 2);
-}
-
-
/*
* Print a scroll bar
*/
@@ -150,7 +49,17 @@ void scrollbar(int x, int y, int width, int height, int items, int min_shown,
if (!valid_dimensions(x, y, width, height))
return;
- init_bar(x, y, width, height);
+ /* draw box */
+ lcd_drawrect(x, y, width, height);
+
+ /* clear edge pixels */
+ lcd_clearpixel(x, y);
+ lcd_clearpixel((x + width - 1), y);
+ lcd_clearpixel(x, (y + height - 1));
+ lcd_clearpixel((x + width - 1), (y + height - 1));
+
+ /* clear pixels in progress bar */
+ lcd_clearrect(x + 1, y + 1, width - 2, height - 2);
/* min should be min */
if(min_shown < max_shown) {
diff --git a/apps/recorder/widgets.h b/apps/recorder/widgets.h
index de8e78520f..44d849b628 100644
--- a/apps/recorder/widgets.h
+++ b/apps/recorder/widgets.h
@@ -35,8 +35,6 @@ enum {
HORIZONTAL
};
-extern void progressbar(int x, int y, int width, int height, int percent, int direction);
-extern void slidebar(int x, int y, int width, int height, int percent, int direction);
extern void scrollbar(int x, int y, int width, int height, int items, int min_shown, int max_shown, int orientation);
extern void checkbox(int x, int y, int width, int height, bool checked);
#endif /* HAVE_LCD_BITMAP */