void DeleteTree(const Path& pth) { TraverseChildren(pth, [&](NodeCategory c, const string& name){ const auto child(pth / name); if(c == NodeCategory::Directory) DeleteTree(child); uremove(string(child).c_str()); }); }
void CaptureNumber() { while (!key[KEY_ESC]) { Letteri= readkey(); if(key[KEY_ENTER]) break; if(key[KEY_ESC]) exit(0); if(key[KEY_LEFT]) CaptureName(); if(key[KEY_BACKSPACE]) { Letteri=NULL; uremove(Number,-1); } Letterj= Letteri; strcat(Number, &Letterj); textprintf_ex(screen, font, 770, 190, 0, WHITE, "%s ", Number); } ControlType(); }
/* Different functions for each field so I can program their navigation easier */ void CaptureName() { while (!key[KEY_ESC]) { Letteri= readkey(); if(key[KEY_ENTER]) break; if(key[KEY_RIGHT]) CaptureNumber(); if(key[KEY_BACKSPACE]) { Letteri=NULL; uremove(Name,-1); } Letterj= Letteri; strcat(Name, &Letterj); textprintf_ex(screen, font, 70, 190, 0, WHITE, "%s ", Name); if (strcmp(Name, "PaeZ")==0) Validate(); if (strcmp(Name, "Inge Cesar")==0) Validate(); } CaptureNumber(); }
void ManSettings() { blit(GainBox, screen, 0, 0, 300, 400, 114,55); while (!key[KEY_ESC]) { Letteri= readkey(); if(key[KEY_ENTER]) break; if(key[KEY_ESC]) exit(0); if(key[KEY_BACKSPACE]) { Letteri=NULL; uremove(Gain,-1); } if(uisdigit(Letteri)!=0) { Letterj= Letteri; strcat(Gain, &Letterj); } textprintf_ex(screen, font, 320, 415, 0, WHITE, "%s ", Gain); } Proceed(); }
void AutoSettings() { blit(ModeBox, screen, 0, 0, 100, 400, 114,55); while (!key[KEY_ESC]) { Letteri= readkey(); if(key[KEY_ENTER]) if ((ustrcmp(Mode,"P")==0) || (ustrcmp(Mode,"PI")==0) || (ustrcmp(Mode,"PID")==0)) break; else { uremove(Mode,-1); uremove(Mode,-1); uremove(Mode,-1); AutoSettings(); } if(key[KEY_ESC]) exit(0); if(key[KEY_BACKSPACE]) { Letteri=NULL; uremove(Mode,-1); } Letterj= Letteri; strcat(Mode, &Letterj); ustrupr(Mode); textprintf_ex(screen, font, 120, 415, 0, WHITE, "%s ", Mode); } if (ustrcmp(Mode,"P")==0) { blit(GainBox, screen, 0, 0, 300, 400, 114,55); while (!key[KEY_ESC]) { Letteri= readkey(); if(key[KEY_ENTER]) break; if(key[KEY_ESC]) exit(0); if(key[KEY_BACKSPACE]) { Letteri=NULL; uremove(Gain,-1); } Letterj= Letteri; strcat(Gain, &Letterj); textprintf_ex(screen, font, 320, 415, 0, WHITE, "%s ", Gain); } Proceed(); } if (ustrcmp(Mode,"PI")==0) { blit(GainBox, screen, 0, 0, 300, 400, 114,55); while (!key[KEY_ESC]) { Letteri= readkey(); if(key[KEY_ENTER]) break; if(key[KEY_ESC]) exit(0); if(key[KEY_BACKSPACE]) { Letteri=NULL; uremove(Gain,-1); } Letterj= Letteri; strcat(Gain, &Letterj); textprintf_ex(screen, font, 320, 415, 0, WHITE, "%s ", Gain); } blit(TiBox, screen, 0, 0, 500, 400, 114,55); while (!key[KEY_ESC]) { Letteri= readkey(); if(key[KEY_ENTER]) break; if(key[KEY_ESC]) exit(0); if(key[KEY_BACKSPACE]) { Letteri=NULL; uremove(Gain,-1); } Letterj= Letteri; strcat(Ti, &Letterj); textprintf_ex(screen, font, 520, 415, 0, WHITE, "%s ", Ti); } Proceed(); } if (ustrcmp(Mode,"PID")==0) { blit(GainBox, screen, 0, 0, 300, 400, 114,55); while (!key[KEY_ESC]) { Letteri= readkey(); if(key[KEY_ENTER]) break; if(key[KEY_ESC]) exit(0); if(key[KEY_BACKSPACE]) { Letteri=NULL; uremove(Gain,-1); } Letterj= Letteri; strcat(Gain, &Letterj); textprintf_ex(screen, font, 320, 415, 0, WHITE, "%s ", Gain); } blit(TiBox, screen, 0, 0, 500, 400, 114,55); while (!key[KEY_ESC]) { Letteri= readkey(); if(key[KEY_ENTER]) break; if(key[KEY_ESC]) exit(0); if(key[KEY_BACKSPACE]) { Letteri=NULL; uremove(Ti,-1); } Letterj= Letteri; strcat(Ti, &Letterj); textprintf_ex(screen, font, 520, 415, 0, WHITE, "%s ", Ti); } blit(TdBox, screen, 0, 0, 700, 400, 114,55); while (!key[KEY_ESC]) { Letteri= readkey(); if(key[KEY_ENTER]) break; if(key[KEY_ESC]) exit(0); if(key[KEY_BACKSPACE]) { Letteri=NULL; uremove(Td,-1); } Letterj= Letteri; strcat(Td, &Letterj); textprintf_ex(screen, font, 720, 415, 0, WHITE, "%s ", Td); } Proceed(); } rest(1000); Proceed(); }