void key_SetRelaxsTariff(void) { if (bKey == bKEY_ENTER) { if (enKeyboard == KBD_ENTER) { if (boRelaxsFlag == true) { enKeyboard = KBD_POSTENTER; Clear(); LoadSlide(pszRelaxs); ShowChar(ibRelaxsTariff+1); } else BlockProgram(bSET_RELAXS_FLAG); } else if (enKeyboard == KBD_POSTINPUT1) { enKeyboard = KBD_POSTENTER; ibX = GetCharLo(6,8); if ((ibX > 0) && (ibX <= bTARIFFS)) { ibRelaxsTariff = ibX-1; SaveCache(&chRelaxsTariff); ShowChar(ibRelaxsTariff+1); } else { enKeyboard = KBD_INPUT1; LongBeep(); ShowLo(szMaskRelaxs); } } else Beep(); } else if (bKey < 10) { if ((enGlobal != GLB_WORK) && (enKeyboard == KBD_POSTENTER)) { enKeyboard = KBD_INPUT1; ShowLo(szMaskRelaxs); } if ((enKeyboard == KBD_INPUT1) || (enKeyboard == KBD_POSTINPUT1)) { enKeyboard = KBD_POSTINPUT1; ShiftLo(6,8); } } else Beep(); }
int main(void) { int i; for( i = 0; i < HEIGHT; i++ ) { ShowChar(32,HEIGHT-i-1); // 前面必須輸出空白 ShowChar(65+i,i*2+1); //輸出的字元數依序為: 1,3,5,... printf("\n"); // 每行輸出完畢,要換行 } system("pause"); return(0); }
int main(void) { int i; int iNum[7] = {1,3,5,7,5,3,1}; for( i = 0 ; i < 7 ; i++ ) { ShowChar(32,HEIGHT-(iNum[i]+1)/2); // 輸出前面必要的空白 ShowChar(48+i,iNum[i]); // 每次都是單一的 iNum[i] 的內容傳遞到函式中 printf("\n"); // 每行輸出完畢,要換行 } system("pause"); return(0); }
void LCD_Print(unsigned char line, char *str) { int i = 0; do { ShowChar(line, i, *str++); i++; if (i > 15) break; } while (*str != '\0'); }
/* copy-pasted mostly from gpsp emulator by Exophaze thanks for it */ void print_string(const char *s, u16 fg_color, u16 bg_color, int x, int y) { int i, j = strlen(s); for(i = 0; i < j; i++, x += 8) ShowChar(menuSurface, x, y, s[i], fg_color, bg_color); }
void ShowStringEx(int x, int y, const char *s) { int i, j = strlen(s); for(i = 0; i < j; i++, x += 8) ShowChar(mainSurface, x, y, s[i], 0xFFFF, 0); }
static void Show(void) { (bPortGps == 0) ? sprintf(szHi+11,": нет") : sprintf(szHi+11,": да "); ShowChar(bPortGps); sprintf(szLo+2,"порт:"); }