void printLabel(u8 chRow,u8 chColumn,enum CONSOLE_FONT_COLORS FONT_BGCOLOR,enum CONSOLE_FONT_COLORS FONT_FGCOLOR,enum CONSOLE_FONT_WEIGHTS FONT_WEIGHT,unsigned char chLabelSize,struct stConsoleCursorLocation *stConcatLabelLocation,const char *strFormatLabel,...) { static char strLabelText[256]; va_list pArguments; unsigned char chLabelLength; saveCursorPosition(); va_start(pArguments,strFormatLabel); vsnprintf(strLabelText,chLabelSize+1,strFormatLabel,pArguments); va_end(pArguments); setCursorPosition(getTextBoxRow(chRow),getTextBoxColumn(chColumn)); setFontStyle(FONT_BGCOLOR,FONT_FGCOLOR,FONT_WEIGHT); printf("%.*s",(unsigned int) chLabelSize,strLabelText); CON_GetPosition(&stConcatLabelLocation->intColumn,&stConcatLabelLocation->intRow); resetPreviousFontStyle(); chLabelLength=strlen(strLabelText); printf("%*s",(unsigned int) ((chLabelLength>chLabelSize)?0:chLabelSize-chLabelLength),""); resetSavedCursorPosition(); }
void drawProgressBar(u8 chProgressBarRow,u8 chProgressBarColumn,u8 chProgressBarSize,enum CONSOLE_FONT_COLORS FONT_BGCOLOR,enum CONSOLE_FONT_COLORS FONT_FGCOLOR,enum CONSOLE_FONT_WEIGHTS FONT_WEIGHT,enum CONSOLE_FONT_COLORS PROGRESS_BAR_BGCOLOR,u8 chProgressBarTextSize,u8 chProgressBarTextColumn,u8 chProgressBarTextRow,enum CONSOLE_FONT_COLORS PROGRESSCOLOR,unsigned int intOperationsCount,struct stProgressBar *stProgressBarSettings,struct stConsoleCursorLocation *stProgressBarLabelLocation,const char *strFormatLabel,...) { static char strLabel[51]; va_list pArguments; va_start(pArguments,strFormatLabel); vsnprintf(strLabel,sizeof(strLabel),strFormatLabel,pArguments); va_end(pArguments); printStyledText(chProgressBarRow,chProgressBarColumn,FONT_BGCOLOR,FONT_FGCOLOR,FONT_WEIGHT,stProgressBarLabelLocation,"%s",strLabel); printf(" "); CON_GetPosition(&stProgressBarSettings->stProgressBarLocation.intColumn,&stProgressBarSettings->stProgressBarLocation.intRow); setFontBgColor(PROGRESS_BAR_BGCOLOR); stProgressBarSettings->chProgressBarSize=chProgressBarSize; printf("%*s",(unsigned int) chProgressBarSize,""); resetPreviousBgColor(); stProgressBarSettings->intValue=0; stProgressBarSettings->chProgressBarTextSize=chProgressBarTextSize; stProgressBarSettings->stProgressBarTextLocation.intColumn=chProgressBarTextColumn; stProgressBarSettings->stProgressBarTextLocation.intRow=chProgressBarTextRow; stProgressBarSettings->PROGRESSBAR_COLOR=PROGRESSCOLOR; stProgressBarSettings->intOperationsCount=intOperationsCount; }
void drawLabel(u8 chRow,u8 chColumn,enum CONSOLE_FONT_COLORS FONT_BGCOLOR,enum CONSOLE_FONT_COLORS FONT_FGCOLOR,enum CONSOLE_FONT_WEIGHTS FONT_WEIGHT,const char *strLabelCaption,u8 chLabelSize,struct stLabel *stLabelSettings,struct stConsoleCursorLocation *stLabelCaptionLocation) { printStyledText(chRow,chColumn,FONT_BGCOLOR,FONT_FGCOLOR,FONT_WEIGHT,stLabelCaptionLocation,strLabelCaption); CON_GetPosition(&stLabelSettings->stLabelLocation.intColumn,&stLabelSettings->stLabelLocation.intRow); stLabelSettings->chLabelSize=chLabelSize; printf("%*s",(unsigned int) stLabelSettings->chLabelSize,""); }
int getConsoleRow() { int intConsoleColumn,intConsoleRow; CON_GetPosition(&intConsoleColumn,&intConsoleRow); return intConsoleRow; }