multigrid: add msg_scroll_start and msg_scroll_reset events

This commit is contained in:
Björn Linse 2018-10-19 10:42:34 +02:00
parent c3e2e40e02
commit f6f8f0ee76
4 changed files with 15 additions and 0 deletions

View File

@ -83,11 +83,16 @@ void grid_scroll(Integer grid, Integer top, Integer bot,
FUNC_API_SINCE(5) FUNC_API_REMOTE_IMPL; FUNC_API_SINCE(5) FUNC_API_REMOTE_IMPL;
void grid_destroy(Integer grid) void grid_destroy(Integer grid)
FUNC_API_SINCE(5) FUNC_API_REMOTE_ONLY; FUNC_API_SINCE(5) FUNC_API_REMOTE_ONLY;
void win_position(Integer win, Integer grid, Integer startrow, void win_position(Integer win, Integer grid, Integer startrow,
Integer startcol, Integer width, Integer height) Integer startcol, Integer width, Integer height)
FUNC_API_SINCE(5) FUNC_API_REMOTE_ONLY; FUNC_API_SINCE(5) FUNC_API_REMOTE_ONLY;
void win_hide(Integer win, Integer grid) void win_hide(Integer win, Integer grid)
FUNC_API_SINCE(5) FUNC_API_REMOTE_ONLY; FUNC_API_SINCE(5) FUNC_API_REMOTE_ONLY;
void win_scroll_over_start(void)
FUNC_API_SINCE(5) FUNC_API_REMOTE_ONLY;
void win_scroll_over_reset(void)
FUNC_API_SINCE(5) FUNC_API_REMOTE_ONLY;
void popupmenu_show(Array items, Integer selected, void popupmenu_show(Array items, Integer selected,
Integer row, Integer col, Integer grid) Integer row, Integer col, Integer grid)

View File

@ -1884,6 +1884,9 @@ int msg_scrollsize(void)
*/ */
static void msg_scroll_up(void) static void msg_scroll_up(void)
{ {
if (msg_scrolled == 0) {
ui_call_win_scroll_over_start();
}
if (dy_flags & DY_MSGSEP) { if (dy_flags & DY_MSGSEP) {
if (msg_scrolled == 0) { if (msg_scrolled == 0) {
grid_fill(&default_grid, Rows-p_ch-1, Rows-p_ch, 0, (int)Columns, grid_fill(&default_grid, Rows-p_ch-1, Rows-p_ch, 0, (int)Columns,

View File

@ -292,6 +292,7 @@ void update_screen(int type)
* if the screen was scrolled up when displaying a message, scroll it down * if the screen was scrolled up when displaying a message, scroll it down
*/ */
if (msg_scrolled) { if (msg_scrolled) {
ui_call_win_scroll_over_reset();
clear_cmdline = true; clear_cmdline = true;
if (dy_flags & DY_MSGSEP) { if (dy_flags & DY_MSGSEP) {
int valid = MAX(Rows - msg_scrollsize(), 0); int valid = MAX(Rows - msg_scrollsize(), 0);

View File

@ -646,6 +646,12 @@ function Screen:_handle_grid_resize(grid, width, height)
} }
end end
function Screen:_handle_msg_scroll_start()
end
function Screen:_handle_msg_scroll_reset()
end
function Screen:_handle_flush() function Screen:_handle_flush()
end end