Commit d049dc6af1562e6a32e70ddb02b9e9dc5f4c865e
1 parent
24c39ccb
Exists in
master
and in
3 other branches
Incluindo sinal para mudar o estado das opções de seleção
Showing
2 changed files
with
16 additions
and
4 deletions
Show diff stats
glue.c
... | ... | @@ -170,6 +170,11 @@ static void update_char(H3270 *session, int addr, unsigned char chr, unsigned sh |
170 | 170 | |
171 | 171 | } |
172 | 172 | |
173 | +static void nop_char(H3270 *session, unsigned char chr) | |
174 | +{ | |
175 | + | |
176 | +} | |
177 | + | |
173 | 178 | static void lib3270_session_init(H3270 *hSession, const char *model) |
174 | 179 | { |
175 | 180 | int ovc, ovr; |
... | ... | @@ -180,7 +185,8 @@ static void lib3270_session_init(H3270 *hSession, const char *model) |
180 | 185 | hSession->sz = sizeof(H3270); |
181 | 186 | |
182 | 187 | // A few dummy calls to avoid "ifs" |
183 | - hSession->update = update_char; | |
188 | + hSession->update = update_char; | |
189 | + hSession->set_selection = nop_char; | |
184 | 190 | |
185 | 191 | |
186 | 192 | hSession->sock = -1; | ... | ... |
selection.c
... | ... | @@ -175,6 +175,9 @@ LIB3270_EXPORT void lib3270_clear_selection(H3270 *session) |
175 | 175 | session->update(session,a,ea_buf[a].chr,ea_buf[a].attr,a == session->cursor_addr); |
176 | 176 | } |
177 | 177 | } |
178 | + | |
179 | + session->set_selection(session,0); | |
180 | + | |
178 | 181 | } |
179 | 182 | |
180 | 183 | |
... | ... | @@ -182,11 +185,14 @@ LIB3270_EXPORT void lib3270_select_to(H3270 *session, int baddr) |
182 | 185 | { |
183 | 186 | CHECK_SESSION_HANDLE(session); |
184 | 187 | |
185 | - if(session->selected.begin < 0) | |
186 | - session->selected.begin = session->selected.end = session->cursor_addr; | |
187 | - | |
188 | 188 | lib3270_set_cursor_address(session,session->selected.end = baddr); |
189 | 189 | |
190 | + if(session->selected.begin < 0) | |
191 | + { | |
192 | + session->selected.begin = session->cursor_addr; | |
193 | + session->set_selection(session,1); | |
194 | + } | |
195 | + | |
190 | 196 | update_selection(session); |
191 | 197 | |
192 | 198 | } | ... | ... |