Commit a671907ccd16cb14e1374f2fa2b18f6dddc8b4ec
1 parent
f12c8207
Exists in
master
and in
3 other branches
Implementando opção para imprimir apenas o bloco selecionado
Showing
1 changed file
with
20 additions
and
0 deletions
Show diff stats
selection.c
| @@ -360,6 +360,26 @@ LIB3270_EXPORT char * lib3270_get_selected(H3270 *hSession) | @@ -360,6 +360,26 @@ LIB3270_EXPORT char * lib3270_get_selected(H3270 *hSession) | ||
| 360 | return get_text(hSession,0); | 360 | return get_text(hSession,0); |
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | +LIB3270_EXPORT int lib3270_get_selected_addr(H3270 *hSession, int *begin, int *end) | ||
| 364 | +{ | ||
| 365 | + if(!hSession->selected || hSession->select.begin == hSession->select.end) | ||
| 366 | + return -1; | ||
| 367 | + | ||
| 368 | + if(hSession->select.end > hSession->select.begin) | ||
| 369 | + { | ||
| 370 | + *begin = hSession->select.begin; | ||
| 371 | + *end = hSession->select.end; | ||
| 372 | + } | ||
| 373 | + else | ||
| 374 | + { | ||
| 375 | + *begin = hSession->select.end; | ||
| 376 | + *end = hSession->select.begin; | ||
| 377 | + } | ||
| 378 | + | ||
| 379 | + return 0; | ||
| 380 | +} | ||
| 381 | + | ||
| 382 | + | ||
| 363 | LIB3270_EXPORT int lib3270_move_selection(H3270 *hSession, LIB3270_DIRECTION dir) | 383 | LIB3270_EXPORT int lib3270_move_selection(H3270 *hSession, LIB3270_DIRECTION dir) |
| 364 | { | 384 | { |
| 365 | if(!hSession->selected || hSession->select.begin == hSession->select.end) | 385 | if(!hSession->selected || hSession->select.begin == hSession->select.end) |