From d049dc6af1562e6a32e70ddb02b9e9dc5f4c865e Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Thu, 8 Mar 2012 13:48:41 +0000 Subject: [PATCH] Incluindo sinal para mudar o estado das opções de seleção --- glue.c | 8 +++++++- selection.c | 12 +++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/glue.c b/glue.c index 8f1d324..fea472b 100644 --- a/glue.c +++ b/glue.c @@ -170,6 +170,11 @@ static void update_char(H3270 *session, int addr, unsigned char chr, unsigned sh } +static void nop_char(H3270 *session, unsigned char chr) +{ + +} + static void lib3270_session_init(H3270 *hSession, const char *model) { int ovc, ovr; @@ -180,7 +185,8 @@ static void lib3270_session_init(H3270 *hSession, const char *model) hSession->sz = sizeof(H3270); // A few dummy calls to avoid "ifs" - hSession->update = update_char; + hSession->update = update_char; + hSession->set_selection = nop_char; hSession->sock = -1; diff --git a/selection.c b/selection.c index 4b78404..2ce2f31 100644 --- a/selection.c +++ b/selection.c @@ -175,6 +175,9 @@ LIB3270_EXPORT void lib3270_clear_selection(H3270 *session) session->update(session,a,ea_buf[a].chr,ea_buf[a].attr,a == session->cursor_addr); } } + + session->set_selection(session,0); + } @@ -182,11 +185,14 @@ LIB3270_EXPORT void lib3270_select_to(H3270 *session, int baddr) { CHECK_SESSION_HANDLE(session); - if(session->selected.begin < 0) - session->selected.begin = session->selected.end = session->cursor_addr; - lib3270_set_cursor_address(session,session->selected.end = baddr); + if(session->selected.begin < 0) + { + session->selected.begin = session->cursor_addr; + session->set_selection(session,1); + } + update_selection(session); } -- libgit2 0.21.2