From de8fbf00a8a4a2c85fc9ee4b2758881f4ec435d9 Mon Sep 17 00:00:00 2001 From: Markus Braun Date: Wed, 7 Aug 2002 10:35:26 +0000 Subject: Added status bar to file browser and wps git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1582 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/widgets.c | 161 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 apps/recorder/widgets.c (limited to 'apps/recorder/widgets.c') diff --git a/apps/recorder/widgets.c b/apps/recorder/widgets.c new file mode 100644 index 0000000000..1c3f0b1a10 --- /dev/null +++ b/apps/recorder/widgets.c @@ -0,0 +1,161 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: not checked in + * + * Copyright (C) 2002 Markus Braun + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#include + +#include "widgets.h" + +#ifdef HAVE_LCD_BITMAP +/* + * Print a progress bar + */ +void progressbar(int x, int y, int width, int height, int percent, int direction) +{ + int pos; + int i,j; + + /* draw horizontal lines */ + for(i=x+1;i<=x+width-2;i++) { + DRAW_PIXEL(i,y); + DRAW_PIXEL(i,(y+height-1)); + } + + /* draw vertical lines */ + for(i=1;i100) + pos=100; + + switch (direction) + { + case Grow_Right: + pos=(width-2)*pos/100; + for(i=1;i<=pos;i++) + for(j=1;j100) + pos=100; + + switch (direction) + { + case Grow_Right: + pos=(width-height-1)*pos/100; + break; + case Grow_Left: + pos=(width-height-1)*(100-pos)/100; + break; + case Grow_Down: + pos=(height-width-1)*pos/100; + break; + case Grow_Up: + pos=(height-width-1)*(100-pos)/100; + break; + } + + if(direction == Grow_Left || direction == Grow_Right) + for(i=1;i