Obtener entrada de teclado
Signed-off-by: somebody_master <somebody_master@somebodyserver.mooo.com>
This commit is contained in:
parent
698d388b4a
commit
2b7305360d
@ -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);
|
||||
|
@ -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());
|
||||
|
||||
|
11
src/ui.cpp
11
src/ui.cpp
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user