Basic resize of bars
This commit is contained in:
41
input_win.c
41
input_win.c
@@ -87,29 +87,34 @@ void inp_get_char(int *ch, char *input, int *size)
|
|||||||
noecho();
|
noecho();
|
||||||
*ch = wgetch(inp_win);
|
*ch = wgetch(inp_win);
|
||||||
|
|
||||||
// if it wasn't an arrow key etc
|
if (*ch == KEY_RESIZE) {
|
||||||
if (!_handle_edit(*ch, input, size)) {
|
cons_show("REZISE SIGNAL");
|
||||||
if (_printable(*ch)) {
|
win_resize();
|
||||||
getyx(inp_win, inp_y, inp_x);
|
} else {
|
||||||
|
// if it wasn't an arrow key etc
|
||||||
|
if (!_handle_edit(*ch, input, size)) {
|
||||||
|
if (_printable(*ch)) {
|
||||||
|
getyx(inp_win, inp_y, inp_x);
|
||||||
|
|
||||||
// handle insert if not at end of input
|
// handle insert if not at end of input
|
||||||
if (inp_x <= *size) {
|
if (inp_x <= *size) {
|
||||||
winsch(inp_win, *ch);
|
winsch(inp_win, *ch);
|
||||||
wmove(inp_win, inp_y, inp_x+1);
|
wmove(inp_win, inp_y, inp_x+1);
|
||||||
|
|
||||||
for (i = *size; i > inp_x -1; i--)
|
for (i = *size; i > inp_x -1; i--)
|
||||||
input[i] = input[i-1];
|
input[i] = input[i-1];
|
||||||
input[inp_x -1] = *ch;
|
input[inp_x -1] = *ch;
|
||||||
|
|
||||||
(*size)++;
|
(*size)++;
|
||||||
|
|
||||||
// otherwise just append
|
// otherwise just append
|
||||||
} else {
|
} else {
|
||||||
waddch(inp_win, *ch);
|
waddch(inp_win, *ch);
|
||||||
input[(*size)++] = *ch;
|
input[(*size)++] = *ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
reset_search_attempts();
|
||||||
}
|
}
|
||||||
|
|
||||||
reset_search_attempts();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,14 @@ void gui_init(void)
|
|||||||
dirty = TRUE;
|
dirty = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void win_resize(void)
|
||||||
|
{
|
||||||
|
create_title_bar();
|
||||||
|
create_status_bar();
|
||||||
|
create_input_window();
|
||||||
|
dirty = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
void gui_refresh(void)
|
void gui_refresh(void)
|
||||||
{
|
{
|
||||||
title_bar_refresh();
|
title_bar_refresh();
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ struct prof_win {
|
|||||||
void gui_init(void);
|
void gui_init(void);
|
||||||
void gui_refresh(void);
|
void gui_refresh(void);
|
||||||
void gui_close(void);
|
void gui_close(void);
|
||||||
|
void win_resize(void);
|
||||||
|
|
||||||
// create windows
|
// create windows
|
||||||
void create_title_bar(void);
|
void create_title_bar(void);
|
||||||
|
|||||||
Reference in New Issue
Block a user