Commit 77c8ce8926fdb435cc9378be9a7b4442decc328d

Authored by perry.werneck@gmail.com
1 parent f9c1b06e

Corrigindo problema no sublinhado...

Fórum: PW3270 Suporte
Thread: Sublinhado Versão 5.0
Último Post: David Dourado
Enviados: 2013-01-09 18:35:31.386784-02

Caros,

Ao instalar a  versão 5.0 (GTK 3.6) no Windows 7 64 bits percebemos que
os inputs não tem o sublinhado.

Resolvemos instalar a versão 4.2 e percebemos que funcionou
perfeitamente. 

P.S.: Não tentamos instalar a versão 5 em outros ambientes. 

Isto é um novo comportamento padrão ou há um problema?
Showing 3 changed files with 20 additions and 50 deletions   Show diff stats
api.h
... ... @@ -291,39 +291,11 @@
291 291 #define COLOR_ATTR_NONE 0x0000
292 292 #define COLOR_ATTR_FIELD LIB3270_ATTR_FIELD
293 293 #define COLOR_ATTR_BLINK LIB3270_ATTR_BLINK
294   - #define COLOR_ATTR_UNDERLINE LIB3270_ATTR_UNDERLINE
  294 +// #define COLOR_ATTR_UNDERLINE LIB3270_ATTR_UNDERLINE
295 295 #define COLOR_ATTR_INTENSIFY LIB3270_ATTR_INTENSIFY
296 296  
297   -// #define CHAR_ATTR_CG LIB3270_ATTR_CG
298   -// #define CHAR_ATTR_MARKER LIB3270_ATTR_MARKER
299   -
300 297 #define CHAR_ATTR_UNCONVERTED LIB3270_ATTR_CG
301 298  
302   -/*
303   - struct _lib3270_option
304   - {
305   - const char *name;
306   - enum
307   - {
308   - OPT_BOOLEAN,
309   - OPT_STRING,
310   - OPT_INTEGER,
311   - OPT_XRM,
312   - OPT_SKIP2,
313   - OPT_NOP,
314   - OPT_DONE
315   - } type;
316   - unsigned char flag;
317   - const char *res_name;
318   - void *aoff;
319   - const char *description;
320   - };
321   -
322   - #define new_3270_session(m) lib3270_session_new(m)
323   -
324   - LOCAL_EXTERN const struct _lib3270_option * get_3270_option_table(int sz);
325   -*/
326   -
327 299  
328 300 /* Set/Get screen contents */
329 301 #define find_field_attribute(s,a) lib3270_field_addr(s,a)
... ...
screen.c
... ... @@ -210,16 +210,13 @@ static unsigned short calc_attrs(H3270 *session, int baddr, int fa_addr, int fa)
210 210 else
211 211 gr = 0;
212 212  
213   - if(!(gr & GR_REVERSE) && !bg)
214   - {
215   - if(gr & GR_BLINK)
216   - a |= LIB3270_ATTR_BLINK;
  213 + if(gr & GR_BLINK)
  214 + a |= LIB3270_ATTR_BLINK;
217 215  
218   - if(gr & GR_UNDERLINE)
219   - a |= LIB3270_ATTR_UNDERLINE;
220   - }
  216 + if( (gr & GR_UNDERLINE) && lib3270_get_toggle(session,LIB3270_TOGGLE_UNDERLINE))
  217 + a |= LIB3270_ATTR_UNDERLINE;
221 218  
222   - if(session->m3279 && (gr & (GR_BLINK | GR_UNDERLINE)) && !(gr & GR_REVERSE) && !bg)
  219 + if(session->m3279 && (gr & (GR_BLINK | GR_UNDERLINE)) && !(gr & GR_REVERSE))
223 220 a |= LIB3270_ATTR_BACKGROUND_INTENSITY;
224 221  
225 222 if(!session->m3279 && ((gr & GR_INTENSIFY) || FA_IS_HIGH(fa)))
... ... @@ -762,11 +759,14 @@ LIB3270_ACTION( testpattern )
762 759 { 0, text_pat },
763 760 };
764 761  
765   - int row = 0;
  762 + static const unsigned char gr[] = { 0, GR_UNDERLINE, GR_BLINK };
  763 +
  764 + int row = 0;
766 765 int max;
767   - int pos = 0;
  766 + int pos = 0;
  767 + int grpos = 0;
768 768 int f;
769   - int fg = COLOR_BLUE;
  769 + int fg = COLOR_BLUE;
770 770  
771 771 CHECK_SESSION_HANDLE(hSession);
772 772  
... ... @@ -779,7 +779,11 @@ LIB3270_ACTION( testpattern )
779 779 {
780 780 row = 0;
781 781 if(++fg > COLOR_WHITE)
  782 + {
782 783 fg = COLOR_BLUE;
  784 + if(++grpos > (sizeof(gr)/sizeof(gr[0])))
  785 + grpos = 0;
  786 + }
783 787 }
784 788 pos = 0;
785 789 }
... ... @@ -787,6 +791,7 @@ LIB3270_ACTION( testpattern )
787 791 hSession->ea_buf[f].bg = (fg == COLOR_BLACK) ? COLOR_WHITE : COLOR_BLACK;
788 792 hSession->ea_buf[f].cs = pat[row].cs;
789 793 hSession->ea_buf[f].cc = pat[row].cc[pos++];
  794 + hSession->ea_buf[f].gr = gr[grpos];
790 795 }
791 796  
792 797 hSession->display(hSession);
... ...
toggles.c
... ... @@ -149,7 +149,7 @@ static void toggle_altscreen(H3270 *session, struct lib3270_toggle *t, LIB3270_T
149 149 set_viewsize(session,t->value ? 24 : session->maxROWS,80);
150 150 }
151 151  
152   -static void toggle_monocase(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt)
  152 +static void toggle_redraw(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt)
153 153 {
154 154 session->display(session);
155 155 }
... ... @@ -172,17 +172,10 @@ void initialize_toggles(H3270 *session)
172 172 session->toggle[f].upcall = toggle_nop;
173 173  
174 174 session->toggle[LIB3270_TOGGLE_RECTANGLE_SELECT].upcall = toggle_rectselect;
175   - session->toggle[LIB3270_TOGGLE_MONOCASE].upcall = toggle_monocase;
  175 + session->toggle[LIB3270_TOGGLE_MONOCASE].upcall = toggle_redraw;
  176 + session->toggle[LIB3270_TOGGLE_UNDERLINE].upcall = toggle_redraw;
176 177 session->toggle[LIB3270_TOGGLE_ALTSCREEN].upcall = toggle_altscreen;
177 178  
178   -/*
179   -#if defined(X3270_TRACE)
180   - session->toggle[LIB3270_TOGGLE_DS_TRACE].upcall = toggle_dsTrace;
181   - session->toggle[LIB3270_TOGGLE_SCREEN_TRACE].upcall = toggle_screenTrace;
182   - session->toggle[LIB3270_TOGGLE_EVENT_TRACE].upcall = toggle_eventTrace;
183   -#endif
184   -*/
185   -
186 179 #if defined(X3270_ANSI)
187 180 session->toggle[LIB3270_TOGGLE_LINE_WRAP].upcall = toggle_lineWrap;
188 181 #endif
... ...