Obtener entrada de teclado

Signed-off-by: somebody_master <somebody_master@somebodyserver.mooo.com>
This commit is contained in:
Somebody Master 2020-10-26 09:56:24 +01:00
parent 698d388b4a
commit 2b7305360d
Signed by: somebody_master
GPG Key ID: 78315CFDF0B25505
3 changed files with 14 additions and 6 deletions

View File

@ -14,9 +14,10 @@ void closeUI();
void showCentralInputBox(std::vector<std::string> *textos,
const int8_t *num_box,
std::vector<std::string> *elems);
void showCentralInputBox(std::vector<std::string> *textos,
const int8_t *num_box, std::vector<std::string> *elems,
long title_size);
std::vector<std::string> showCentralInputBox(std::vector<std::string> *textos,
const int8_t *num_box,
std::vector<std::string> *elems,
long title_size);
void showCenterMensaje(std::vector<std::string> *mensaje,
const int8_t *menu_color);
void showTopTitle(const std::vector<std::string> *titulo);

View File

@ -96,7 +96,7 @@ void userInterface(const int8_t *num_menu, vector<string> *mensaje) {
vector<string> textos_init = {
"Toda la configuración se escribirá en " + cf::g_cofigFile, "", ""};
vector<string> elemens = {"- Número de hilos\t> ", "- Tiempo\t\t> "};
ui::showTopTitle(&TITULO_PRINCIPAL);
ui::showCentralInputBox(&textos_init, &CONFIGURAR_TODO, &elemens,
TITULO_PRINCIPAL.size());

View File

@ -56,8 +56,12 @@ void ui::showCentralInputBox(std::vector<std::string> *textos,
ui::showCentralInputBox(textos, num_box, elems, 0);
}
void ui::showCentralInputBox(vector<string> *textos, const int8_t *num_box,
vector<string> *elems, long title_size) {
vector<string> ui::showCentralInputBox(vector<string> *textos,
const int8_t *num_box,
vector<string> *elems, long title_size) {
vector<string> entrada;
int start_ver_window = 1;
if (title_size != 0) {
start_ver_window = title_size + 4;
@ -81,6 +85,7 @@ void ui::showCentralInputBox(vector<string> *textos, const int8_t *num_box,
wrefresh(centralBOX);
char input[10];
wgetnstr(centralBOX, input, 10);
entrada.push_back(input);
}
curs_set(0);
noecho();
@ -89,6 +94,8 @@ void ui::showCentralInputBox(vector<string> *textos, const int8_t *num_box,
// std::chrono::milliseconds timespan(10000); // or whatever
// std::this_thread::sleep_for(timespan);
return entrada;
}
void ui::showTopTitle(const vector<string> *titulo) {