void dialogAlert(char *message) { brogueButton OKButton; initializeButton(&OKButton); strcpy(OKButton.text, " OK "); OKButton.hotkey[0] = RETURN_KEY; OKButton.hotkey[1] = ENTER_KEY; OKButton.hotkey[2] = ACKNOWLEDGE_KEY; printTextBox(message, COLS/3, &white, &interfaceBoxColor, &OKButton, 1); }
void updateTableCell(u8 chRow,u8 chColumn,enum CONSOLE_FONT_COLORS BGCOLOR,enum CONSOLE_FONT_COLORS FONT_COLOR,enum CONSOLE_FONT_WEIGHTS FONT_WEIGHT,double dbHorizontalAlign,double dbVerticalAlign,struct stTable *stTableSettings,struct stConsoleCursorLocation *stCellTextLocation,const char *strFormatCellText,...) { static char strCellText[1024]; va_list pArguments; if ((chRow<stTableSettings->chRowsCount) && (chColumn<stTableSettings->chColumnsCount)) { va_start(pArguments,strFormatCellText); vsnprintf(strCellText,sizeof(strCellText),strFormatCellText,pArguments); va_end(pArguments); printTextBox(1+stTableSettings->stTableLocation.intRow+chRow*stTableSettings->chCellHeight,1+stTableSettings->stTableLocation.intColumn+stTableSettings->chCellWidth*chColumn,stTableSettings->stTableLocation.intRow+(chRow+1)*stTableSettings->chCellHeight-1,stTableSettings->stTableLocation.intColumn+stTableSettings->chCellWidth*(chColumn+1)-1,dbHorizontalAlign,dbVerticalAlign,NO_BORDER,stTableSettings->BORDER_STYLE,stTableSettings->BORDER_COLOR,NO_JUNCTION,NO_JUNCTION,NO_JUNCTION,NO_JUNCTION,BGCOLOR,FONT_COLOR,FONT_WEIGHT,true,true,stCellTextLocation,"%s",strCellText); } }
void dialogAlert(char *message) { cellDisplayBuffer rbuf[COLS][ROWS]; brogueButton OKButton; initializeButton(&OKButton); strcpy(OKButton.text, " OK "); OKButton.hotkey[0] = RETURN_KEY; OKButton.hotkey[1] = ENTER_KEY; OKButton.hotkey[2] = ACKNOWLEDGE_KEY; printTextBox(message, COLS/3, ROWS/3, COLS/3, &white, &interfaceBoxColor, rbuf, &OKButton, 1); overlayDisplayBuffer(rbuf, NULL); }
void printAlignedTextBox(u8 chFrameMinRow,u8 chFrameMinColumn,u8 chFrameMaxRow,u8 chFrameMaxColumn,double dbRow,double dbColumn,double dbHeight,double dbWidth,double dbHorizontalAlign,double dbVerticalAlign,enum BORDERS BORDER_TYPE,enum BORDER_STYLES BORDER_STYLE,enum CONSOLE_FONT_COLORS BORDER_COLOR,enum FRAME_JUNCTIONS TOP_LEFT_JUNCTION,enum FRAME_JUNCTIONS TOP_RIGHT_JUNCTION,enum FRAME_JUNCTIONS BOTTOM_LEFT_JUNCTION,enum FRAME_JUNCTIONS BOTTOM_RIGHT_JUNCTION,enum CONSOLE_FONT_COLORS BGCOLOR,enum CONSOLE_FONT_COLORS FONT_FGCOLOR,enum CONSOLE_FONT_WEIGHTS FONT_WEIGHT,bool blnMultiLine,bool blnHideOverflowText,struct stConsoleCursorLocation *stTexteLocation,const char *strFormatValue,...) { static char strTextBuffer[1024]; va_list pArguments; double dbTextContainerX[2]={dbColumn,dbColumn},dbTextContainerY[2]={dbRow,dbRow}; va_start(pArguments,strFormatValue); vsnprintf(strTextBuffer,sizeof(strTextBuffer),strFormatValue,pArguments); va_end(pArguments); if (chFrameMinRow>chFrameMaxRow) { permutePointers((void *) &chFrameMinRow,(void *) &chFrameMaxRow); } if (chFrameMinColumn>chFrameMaxColumn) { permutePointers((void *) &chFrameMinColumn,(void *) &chFrameMaxColumn); } dbWidth=fabs(dbWidth); dbHeight=fabs(dbHeight); if (dbWidth<=1) { dbWidth=(double) (chFrameMaxColumn-chFrameMinColumn+1)*dbWidth; dbTextContainerX[0]=0; dbTextContainerX[1]=dbWidth; } if (dbHeight<=1) { dbHeight=(double) (chFrameMaxRow-chFrameMinRow+1)*dbHeight; dbTextContainerY[0]=0; dbTextContainerY[1]=dbHeight; } if (dbWidth==AUTOSIZE) { dbWidth=getTextBoxAutoWidth(BORDER_TYPE,"%s",strTextBuffer); dbTextContainerX[0]=0; dbTextContainerX[1]=dbWidth; } if (dbHeight==AUTOSIZE) { dbHeight=getTextBoxAutoHeight(BORDER_TYPE,"%s",strTextBuffer); dbTextContainerY[0]=0; dbTextContainerY[1]=dbHeight; } dbColumn=getRoundNumber(getPolyContainerPosition(&dbTextContainerX[0],2,chFrameMinColumn,chFrameMaxColumn,dbColumn)); dbRow=getRoundNumber(getPolyContainerPosition(&dbTextContainerY[0],2,chFrameMinRow,chFrameMaxRow,dbRow)); printTextBox(dbRow,dbColumn,getRoundNumber(dbRow+dbHeight-1),getRoundNumber(dbColumn+dbWidth-1),dbHorizontalAlign,dbVerticalAlign,BORDER_TYPE,BORDER_STYLE,BORDER_COLOR,TOP_LEFT_JUNCTION,TOP_RIGHT_JUNCTION,BOTTOM_LEFT_JUNCTION,BOTTOM_RIGHT_JUNCTION,BGCOLOR,FONT_FGCOLOR,FONT_WEIGHT,blnMultiLine,blnHideOverflowText,stTexteLocation,"%s",strTextBuffer); }