adpbar.c

This example demonstrates the usage of the ProgressBar-feature.

A ProgressBar is being setup and a dummy process is being shown

00001 /*
00002         Advanved Dialogs v1.05 - Example program
00003         Copyright (C) 2005-2007 Jonas Gehring
00004 
00005         Advanced Dialogs is free software; you can redistribute it and/or modify
00006         it under the terms of the GNU Lesser General Public License as published by
00007         the Free Software Foundation; either version 2 of the License, or
00008         (at your option) any later version.
00009 
00010         Advanced Dialogs is distributed in the hope that it will be useful,
00011         but WITHOUT ANY WARRANTY; without even the implied warranty of
00012         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013         GNU Lesser General Public License for more details.
00014 
00015         You should have received a copy of the GNU Lesser General Public License
00016         along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 
00020 // C Source File
00021 // Created 14.03.2005; 22:27:21
00022 
00023 
00024 #include <tigcclib.h>                                   // Include all standard header files
00025 
00026 #include "extgraph.h"                                   // Include ExtGraph v2.00beta5 by TI-Chess Team
00027 #include "AdvDialogs.h"                                 // Powered by Advanced Dialogs v1.05
00028 
00029 
00030 // Main Function
00031 void _main(void)
00032 {
00033         LCD_BUFFER *screen;
00034         unsigned int i;
00035         
00036         // Allocate space for the LCD buffer
00037         if (((screen = malloc(sizeof(LCD_BUFFER))) == NULL))
00038         {
00039                 return;
00040         }
00041         
00042         LCD_save(screen);                                               // Save LCD contents
00043         
00044         if (!GrayOn())
00045         {
00046                 free(screen);
00047                 return;
00048         }
00049 
00050         AdvDlgProgressBar("Advanced Dialogs", "Processing...", 90);             // Initialize ProgressBar
00051         
00052         for (i = 0; i < UINT_MAX; i++)          // Perform loop 65535 times
00053         {
00054                 if (!(i%(UINT_MAX/90)))                 // Add one step every 65535/90 time (so that we add 90 steps in total)
00055                         AdvDlgProgressUp();
00056         }
00057 
00058         GrayOff();
00059         LCD_restore(screen);
00060         free(screen);   
00061         ST_helpMsg("http://www.boolsoft.org");
00062 }
00063 

Generated on Thu Oct 4 19:42:03 2007 for Advanced Dialogs by  doxygen 1.5.1