Commit 2f31b6cee0fc316300faa9a82d95fd668f0de7c2
1 parent
d63525e8
Exists in
master
and in
5 other branches
Incluindo opcao para preservar o numero de linhas da tela definido pelo usuario …
…quando o host muda para 80x25
Showing
5 changed files
with
26 additions
and
16 deletions
Show diff stats
src/include/lib3270.h
| ... | ... | @@ -110,6 +110,7 @@ |
| 110 | 110 | LIB3270_TOGGLE_KP_ALTERNATIVE, /**< Keypad +/- move to next/previous field */ |
| 111 | 111 | LIB3270_TOGGLE_BEEP, /**< Beep on errors */ |
| 112 | 112 | LIB3270_TOGGLE_VIEW_FIELD, /**< View Field attribute */ |
| 113 | + LIB3270_TOGGLE_ALTSCREEN, /**< auto resize on altscreen */ | |
| 113 | 114 | |
| 114 | 115 | // LIB3270_TOGGLE_ALT_CURSOR, |
| 115 | 116 | // LIB3270_TOGGLE_AID_WAIT, | ... | ... |
src/lib3270/ctlr.c
| ... | ... | @@ -129,9 +129,6 @@ void ctlr_init(H3270 *session, unsigned cmask unused) |
| 129 | 129 | */ |
| 130 | 130 | void ctlr_reinit(H3270 *session, unsigned cmask) |
| 131 | 131 | { |
| 132 | -// static struct ea *real_ea_buf = NULL; | |
| 133 | -// static struct ea *real_aea_buf = NULL; | |
| 134 | - | |
| 135 | 132 | if (cmask & MODEL_CHANGE) |
| 136 | 133 | { |
| 137 | 134 | /* Allocate buffers */ |
| ... | ... | @@ -177,7 +174,7 @@ int lib3270_set_model(H3270 *hSession, int model) |
| 177 | 174 | |
| 178 | 175 | ctlr_set_rows_cols(hSession,model,hSession->ov_cols,hSession->ov_rows); |
| 179 | 176 | ctlr_reinit(hSession,MODEL_CHANGE); |
| 180 | - | |
| 177 | + screen_update(hSession,0,hSession->rows*hSession->cols); | |
| 181 | 178 | return 0; |
| 182 | 179 | } |
| 183 | 180 | |
| ... | ... | @@ -402,9 +399,9 @@ LIB3270_EXPORT int lib3270_get_next_unprotected(H3270 *hSession, int baddr0) |
| 402 | 399 | return 0; |
| 403 | 400 | } |
| 404 | 401 | |
| 405 | -/* | |
| 406 | - * Perform an erase command, which may include changing the (virtual) screen | |
| 407 | - * size. | |
| 402 | +/** | |
| 403 | + * Perform an erase command, which may include changing the (virtual) screen size. | |
| 404 | + * | |
| 408 | 405 | */ |
| 409 | 406 | void ctlr_erase(H3270 *session, int alt) |
| 410 | 407 | { |
| ... | ... | @@ -421,6 +418,7 @@ void ctlr_erase(H3270 *session, int alt) |
| 421 | 418 | { |
| 422 | 419 | /* Going from 24x80 to maximum. */ |
| 423 | 420 | session->display(session); |
| 421 | + | |
| 424 | 422 | set_viewsize(session,session->maxROWS,session->maxCOLS); |
| 425 | 423 | } |
| 426 | 424 | else |
| ... | ... | @@ -433,7 +431,11 @@ void ctlr_erase(H3270 *session, int alt) |
| 433 | 431 | ctlr_blanks(session); |
| 434 | 432 | session->display(session); |
| 435 | 433 | } |
| 436 | - set_viewsize(session,24,80); | |
| 434 | + | |
| 435 | + if(lib3270_get_toggle(session,LIB3270_TOGGLE_ALTSCREEN)) | |
| 436 | + set_viewsize(session,24,80); | |
| 437 | + else | |
| 438 | + set_viewsize(session,session->maxROWS,80); | |
| 437 | 439 | } |
| 438 | 440 | } |
| 439 | 441 | |
| ... | ... | @@ -441,7 +443,6 @@ void ctlr_erase(H3270 *session, int alt) |
| 441 | 443 | |
| 442 | 444 | } |
| 443 | 445 | |
| 444 | - | |
| 445 | 446 | /* |
| 446 | 447 | * Interpret an incoming 3270 command. |
| 447 | 448 | */ |
| ... | ... | @@ -466,7 +467,7 @@ enum pds process_ds(H3270 *hSession, unsigned char *buf, int buflen) |
| 466 | 467 | case CMD_EWA: /* erase/write alternate */ |
| 467 | 468 | case SNA_CMD_EWA: |
| 468 | 469 | trace_ds(hSession,"EraseWriteAlternate"); |
| 469 | - ctlr_erase(hSession,True); | |
| 470 | + ctlr_erase(hSession,1); | |
| 470 | 471 | if ((rv = ctlr_write(hSession,buf, buflen, True)) < 0) |
| 471 | 472 | return rv; |
| 472 | 473 | return PDS_OKAY_NO_OUTPUT; |
| ... | ... | @@ -475,7 +476,7 @@ enum pds process_ds(H3270 *hSession, unsigned char *buf, int buflen) |
| 475 | 476 | case CMD_EW: /* erase/write */ |
| 476 | 477 | case SNA_CMD_EW: |
| 477 | 478 | trace_ds(hSession,"EraseWrite"); |
| 478 | - ctlr_erase(hSession,False); | |
| 479 | + ctlr_erase(hSession,0); | |
| 479 | 480 | if ((rv = ctlr_write(hSession,buf, buflen, True)) < 0) |
| 480 | 481 | return rv; |
| 481 | 482 | return PDS_OKAY_NO_OUTPUT; | ... | ... |
src/lib3270/sf.c
| ... | ... | @@ -403,12 +403,12 @@ static enum pds sf_erase_reset(H3270 *hSession, unsigned char buf[], int buflen) |
| 403 | 403 | { |
| 404 | 404 | case SF_ER_DEFAULT: |
| 405 | 405 | trace_ds(hSession," Default\n"); |
| 406 | - ctlr_erase(hSession,False); | |
| 406 | + ctlr_erase(hSession,0); | |
| 407 | 407 | break; |
| 408 | 408 | |
| 409 | 409 | case SF_ER_ALT: |
| 410 | 410 | trace_ds(hSession," Alternate\n"); |
| 411 | - ctlr_erase(hSession,True); | |
| 411 | + ctlr_erase(hSession,1); | |
| 412 | 412 | break; |
| 413 | 413 | |
| 414 | 414 | default: | ... | ... |
src/lib3270/toggles.c
| ... | ... | @@ -78,6 +78,8 @@ static const char *toggle_names[LIB3270_TOGGLE_COUNT] = |
| 78 | 78 | "kpalternative", /**< Keypad +/- move to next/previous field */ |
| 79 | 79 | "beep", /**< Beep on errors */ |
| 80 | 80 | "fieldattr", /**< View Field attribute */ |
| 81 | + "altscreen", /**< auto resize on altscreen */ | |
| 82 | + | |
| 81 | 83 | |
| 82 | 84 | }; |
| 83 | 85 | |
| ... | ... | @@ -141,6 +143,12 @@ LIB3270_EXPORT int lib3270_toggle(H3270 *session, LIB3270_TOGGLE ix) |
| 141 | 143 | return (int) t->value; |
| 142 | 144 | } |
| 143 | 145 | |
| 146 | +static void toggle_altscreen(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt) | |
| 147 | +{ | |
| 148 | + if(!session->screen_alt) | |
| 149 | + set_viewsize(session,t->value ? 24 : session->maxROWS,80); | |
| 150 | +} | |
| 151 | + | |
| 144 | 152 | static void toggle_monocase(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt) |
| 145 | 153 | { |
| 146 | 154 | session->display(session); |
| ... | ... | @@ -165,6 +173,7 @@ void initialize_toggles(H3270 *session) |
| 165 | 173 | |
| 166 | 174 | session->toggle[LIB3270_TOGGLE_RECTANGLE_SELECT].upcall = toggle_rectselect; |
| 167 | 175 | session->toggle[LIB3270_TOGGLE_MONOCASE].upcall = toggle_monocase; |
| 176 | + session->toggle[LIB3270_TOGGLE_ALTSCREEN].upcall = toggle_altscreen; | |
| 168 | 177 | |
| 169 | 178 | /* |
| 170 | 179 | #if defined(X3270_TRACE) |
| ... | ... | @@ -183,13 +192,11 @@ void initialize_toggles(H3270 *session) |
| 183 | 192 | LIB3270_TOGGLE_CURSOR_BLINK, |
| 184 | 193 | LIB3270_TOGGLE_CURSOR_POS, |
| 185 | 194 | LIB3270_TOGGLE_BEEP, |
| 195 | + LIB3270_TOGGLE_ALTSCREEN, | |
| 186 | 196 | }; |
| 187 | 197 | |
| 188 | 198 | for(f=0;f< (sizeof(active_by_default)/sizeof(active_by_default[0])); f++) |
| 189 | - { | |
| 190 | 199 | session->toggle[active_by_default[f]].value = True; |
| 191 | - } | |
| 192 | - | |
| 193 | 200 | |
| 194 | 201 | for(f=0;f<LIB3270_TOGGLE_COUNT;f++) |
| 195 | 202 | { | ... | ... |
ui/00default.xml
| ... | ... | @@ -120,6 +120,7 @@ |
| 120 | 120 | <menuitem action='toggle' id='Monocase' label='Monocase' /> |
| 121 | 121 | <menuitem action='toggle' id='CursorPos' label='Track Cursor' /> |
| 122 | 122 | <menuitem action='toggle' id='FullScreen' key='<alt>Home' label='Full Screen' /> |
| 123 | + <menuitem action='toggle' id='AltScreen' label='Resize on alternate screen' /> | |
| 123 | 124 | <menuitem action='toggle' id='MarginedPaste' label='Paste with left margin' /> |
| 124 | 125 | <menuitem action='toggle' id='CrossHair' key='<alt>x' label='Cross Hair Cursor' /> |
| 125 | 126 | <menuitem action='toggle' id='BlankFill' label='Blank Fill' /> | ... | ... |