/*************************************************************************** * __________ __ ___. * 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