00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <extgraph.h>
00025
00026 #include "AdvDialogs.h"
00027
00028
00029
00030 static short progress, psteps;
00031
00032
00033
00034 void AdvDlgProgressUp(void)
00035 {
00036 if (progress > psteps)
00037 {
00038 return;
00039 }
00040
00041 const short CX = (LCD_WIDTH - 160) >> 1;
00042 const short CY = (LCD_HEIGHT - 100) >> 1;
00043
00044
00045 progress++;
00046
00047
00048 if (36+((90/psteps)*progress)+CX < 125+CX)
00049 GrayDrawRect(36+CX, 53+CY, 36+((90/psteps)*progress)+CX, 59+CY, COLOR_BLACK, RECT_FILLED);
00050 else
00051 GrayDrawRect(36+CX, 53+CY, 125+CX, 59+CY, COLOR_BLACK, RECT_FILLED);
00052 }
00053
00054
00055
00056 void AdvDlgProgressBar(const char *title, const char *msg, short steps)
00057 {
00058 const short CX = (LCD_WIDTH - 160) >> 1;
00059 const short CY = (LCD_HEIGHT - 100) >> 1;
00060
00061
00062 GrayDrawRect(30+CX, 37+CY, 130+CX, 70+CY, COLOR_LIGHTGRAY, RECT_FILLED);
00063 GrayDrawRect(30+CX, 30+CY, 130+CX, 37+CY, COLOR_BLACK, RECT_FILLED);
00064 GrayFastDrawLine(31+CX, 71+CY, 131+CX, 71+CY, COLOR_BLACK);
00065 GrayFastDrawLine(131+CX, 31+CY, 131+CX, 71+CY, COLOR_BLACK);
00066
00067
00068 GrayDrawStrExt(0, 31+CY, title, A_XOR | A_CENTERED, F_4x6);
00069
00070
00071 GrayDrawStrExt(TXTSTART+CX, 42+CY, msg, A_NORMAL, F_4x6);
00072
00073
00074 GrayDrawRect(35+CX, 52+CY, 125+CX, 60+CY, COLOR_BLACK, RECT_EMPTY);
00075
00076
00077 progress = 0;
00078 psteps = steps;
00079 }
00080
00081
00082