Obtener entrada de teclado
Signed-off-by: somebody_master <somebody_master@somebodyserver.mooo.com>
This commit is contained in:
		| @@ -14,8 +14,9 @@ void closeUI(); | |||||||
| void showCentralInputBox(std::vector<std::string> *textos, | void showCentralInputBox(std::vector<std::string> *textos, | ||||||
|                          const int8_t *num_box, |                          const int8_t *num_box, | ||||||
|                          std::vector<std::string> *elems); |                          std::vector<std::string> *elems); | ||||||
| void showCentralInputBox(std::vector<std::string> *textos, | std::vector<std::string> showCentralInputBox(std::vector<std::string> *textos, | ||||||
|                          const int8_t *num_box, std::vector<std::string> *elems, |                                              const int8_t *num_box, | ||||||
|  |                                              std::vector<std::string> *elems, | ||||||
|                                              long title_size); |                                              long title_size); | ||||||
| void showCenterMensaje(std::vector<std::string> *mensaje, | void showCenterMensaje(std::vector<std::string> *mensaje, | ||||||
|                        const int8_t *menu_color); |                        const int8_t *menu_color); | ||||||
|   | |||||||
| @@ -96,7 +96,7 @@ void userInterface(const int8_t *num_menu, vector<string> *mensaje) { | |||||||
|     vector<string> textos_init = { |     vector<string> textos_init = { | ||||||
|         "Toda la configuración se escribirá en " + cf::g_cofigFile, "", ""}; |         "Toda la configuración se escribirá en " + cf::g_cofigFile, "", ""}; | ||||||
|     vector<string> elemens = {"- Número de hilos\t> ", "- Tiempo\t\t> "}; |     vector<string> elemens = {"- Número de hilos\t> ", "- Tiempo\t\t> "}; | ||||||
|  |     ui::showTopTitle(&TITULO_PRINCIPAL); | ||||||
|     ui::showCentralInputBox(&textos_init, &CONFIGURAR_TODO, &elemens, |     ui::showCentralInputBox(&textos_init, &CONFIGURAR_TODO, &elemens, | ||||||
|                             TITULO_PRINCIPAL.size()); |                             TITULO_PRINCIPAL.size()); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -56,8 +56,12 @@ void ui::showCentralInputBox(std::vector<std::string> *textos, | |||||||
|   ui::showCentralInputBox(textos, num_box, elems, 0); |   ui::showCentralInputBox(textos, num_box, elems, 0); | ||||||
| } | } | ||||||
|  |  | ||||||
| void ui::showCentralInputBox(vector<string> *textos, const int8_t *num_box, | vector<string> ui::showCentralInputBox(vector<string> *textos, | ||||||
|  |                                        const int8_t *num_box, | ||||||
|                                        vector<string> *elems, long title_size) { |                                        vector<string> *elems, long title_size) { | ||||||
|  |  | ||||||
|  |   vector<string> entrada; | ||||||
|  |  | ||||||
|   int start_ver_window = 1; |   int start_ver_window = 1; | ||||||
|   if (title_size != 0) { |   if (title_size != 0) { | ||||||
|     start_ver_window = title_size + 4; |     start_ver_window = title_size + 4; | ||||||
| @@ -81,6 +85,7 @@ void ui::showCentralInputBox(vector<string> *textos, const int8_t *num_box, | |||||||
|     wrefresh(centralBOX); |     wrefresh(centralBOX); | ||||||
|     char input[10]; |     char input[10]; | ||||||
|     wgetnstr(centralBOX, input, 10); |     wgetnstr(centralBOX, input, 10); | ||||||
|  |     entrada.push_back(input); | ||||||
|   } |   } | ||||||
|   curs_set(0); |   curs_set(0); | ||||||
|   noecho(); |   noecho(); | ||||||
| @@ -89,6 +94,8 @@ void ui::showCentralInputBox(vector<string> *textos, const int8_t *num_box, | |||||||
|   // std::chrono::milliseconds timespan(10000); // or whatever |   // std::chrono::milliseconds timespan(10000); // or whatever | ||||||
|  |  | ||||||
|   // std::this_thread::sleep_for(timespan); |   // std::this_thread::sleep_for(timespan); | ||||||
|  |  | ||||||
|  |   return entrada; | ||||||
| } | } | ||||||
|  |  | ||||||
| void ui::showTopTitle(const vector<string> *titulo) { | void ui::showTopTitle(const vector<string> *titulo) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user