Aggiustati dettagli estetici e cambiate funzioni di print varie
This commit is contained in:
1 parent
7e6ae04dc4
commit
7037814c9d
6 files changed
+15
-11
No files matched your search
Binary file not shown.
+1
-1
@@ -15,6 +15,6 @@ void status(char *msg);
|
||||
WINDOW *create_newwin(int height, int width, int starty, int startx);
|
||||
void destroy_win(WINDOW *local_win);
|
||||
void print_menu(WINDOW *menu_win, int y, int x, int highlight);
|
||||
void word_wrap_print(WINDOW *win, int start_y, int start_x, int max_width, const char *str);
|
||||
void wwrap_print(WINDOW *win, int start_y, int start_x, const char *str);
|
||||
|
||||
#endif
|
||||
@@ -5,7 +5,7 @@ SRC_DIR = src
|
||||
BUILD_DIR = build
|
||||
SOURCES = $(wildcard $(SRC_DIR)/*.c)
|
||||
OBJECTS = $(patsubst $(SRC_DIR)/%.c,$(BUILD_DIR)/%.o,$(SOURCES))
|
||||
EXEC = newCounter
|
||||
EXEC = productManager
|
||||
|
||||
DEPS = $(OBJECTS:.o=.d)
|
||||
|
||||
|
||||
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
+13
-9
@@ -33,14 +33,15 @@ int runMainMenu(){
|
||||
int c;
|
||||
|
||||
keypad(mainWin, TRUE);
|
||||
mvwprintw(mainWin, 2, 2, "Usa le FRECCETTE ed INVIO per scegliere un'opzione!");
|
||||
mvwprintw(mainWin, 3, 2, "In alternativa ci sono J e K con SPAZIO!");
|
||||
wwrap_print(mainWin, 1, 2, "Usa le FRECCETTE ed INVIO per scegliere un'opzione,\nin alternativa ci sono i movement di vim e SPAZIO.");
|
||||
refresh();
|
||||
print_menu(mainWin, 6, width / 2 - 10, highlight);
|
||||
print_menu(mainWin, height / 2 - 3, width / 2 - 9, highlight);
|
||||
while(1)
|
||||
{ c = wgetch(mainWin);
|
||||
switch(c)
|
||||
{ case KEY_UP:
|
||||
case KEY_LEFT:
|
||||
case 'h':
|
||||
case 'k':
|
||||
if(highlight == 1)
|
||||
highlight = n_mainMenu;
|
||||
@@ -48,6 +49,8 @@ int runMainMenu(){
|
||||
--highlight;
|
||||
break;
|
||||
case KEY_DOWN:
|
||||
case KEY_RIGHT:
|
||||
case 'l':
|
||||
case 'j':
|
||||
if(highlight == n_mainMenu)
|
||||
highlight = 1;
|
||||
@@ -63,7 +66,7 @@ int runMainMenu(){
|
||||
refresh();
|
||||
break;
|
||||
}
|
||||
print_menu(mainWin, 6, width / 2 - 10, highlight);
|
||||
print_menu(mainWin, height / 2 - 3, width / 2 - 9, highlight);
|
||||
if(choice != 0) /* User did a choice come out of the infinite loop */
|
||||
break;
|
||||
}
|
||||
@@ -143,7 +146,7 @@ void warningf(const char *fmt, ...) {
|
||||
void warning(char *string){
|
||||
WINDOW *warningWin;
|
||||
int startx, starty, width, height;
|
||||
height = LINES / 2 - 3;
|
||||
height = LINES / 2 - 2;
|
||||
width = COLS / 2;
|
||||
starty = LINES / 2;
|
||||
startx = 0;
|
||||
@@ -151,7 +154,7 @@ void warning(char *string){
|
||||
wbkgd(warningWin, COLOR_PAIR(1));
|
||||
|
||||
mvwprintw(warningWin, 2, 2, "ATTENZIONE!!! E' avvenuto un errore! ");
|
||||
word_wrap_print(warningWin, 4, 3, width - 5, string);
|
||||
wwrap_print(warningWin, 4, 3, string);
|
||||
mvwprintw(warningWin, height - 1, width /2, " Premi un tasto per continuare . . . ");
|
||||
|
||||
wrefresh(warningWin);
|
||||
@@ -172,7 +175,7 @@ void statusf(const char *fmt, ...) {
|
||||
|
||||
void status(char *msg) {
|
||||
attron(COLOR_PAIR(3));
|
||||
mvprintw(LINES -2, 0, " %-*s", COLS -1, msg);
|
||||
mvprintw(LINES -2, 0, "%-*s", COLS, msg);
|
||||
attroff(COLOR_PAIR(3));
|
||||
refresh();
|
||||
}
|
||||
@@ -190,7 +193,7 @@ WINDOW *create_newwin(int height, int width, int starty, int startx)
|
||||
|
||||
void destroy_win(WINDOW *local_win)
|
||||
{
|
||||
wborder(local_win, ':', ':', '.', '.', ' ', ' ', ' ', ' ');
|
||||
wborder(local_win, ':', ':', '.', '.', '.', '.', '.', '.');
|
||||
wrefresh(local_win);
|
||||
delwin(local_win);
|
||||
}
|
||||
@@ -212,7 +215,8 @@ void print_menu(WINDOW *menu_win, int y, int x, int highlight)
|
||||
wrefresh(menu_win);
|
||||
}
|
||||
|
||||
void word_wrap_print(WINDOW *win, int start_y, int start_x, int max_width, const char *str) {
|
||||
void wwrap_print(WINDOW *win, int start_y, int start_x, const char *str) {
|
||||
int max_width = getmaxx(win) - (start_y + 1);
|
||||
int y = start_y;
|
||||
int x = start_x;
|
||||
int line_length = 0;
|
||||
|
||||
Reference in new issue
Block a user