Commit 44d2c241f0c0158679a3633eecba050b8b5f47a4

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

Implementando propriedades no widget 3270

Showing 1 changed file with 39 additions and 28 deletions   Show diff stats
@@ -55,35 +55,39 @@ @@ -55,35 +55,39 @@
55 #include "togglesc.h" 55 #include "togglesc.h"
56 #include "api.h" 56 #include "api.h"
57 57
58 -static const char *toggle_names[LIB3270_TOGGLE_COUNT] = 58 +static const struct _toggle
59 { 59 {
60 - "monocase",  
61 - "cursorblink",  
62 - "showtiming",  
63 - "cursorpos",  
64 - "dstrace",  
65 - "linewrap",  
66 - "blankfill",  
67 - "screentrace",  
68 - "eventtrace",  
69 - "marginedpaste",  
70 - "rectselect",  
71 - "crosshair",  
72 - "fullscreen",  
73 - "reconnect",  
74 - "insert",  
75 - "smartpaste",  
76 - "bold",  
77 - "keepselected",  
78 - "underline",  
79 - "autoconnect",  
80 - "kpalternative", /**< Keypad +/- move to next/previous field */  
81 - "beep", /**< Beep on errors */  
82 - "fieldattr", /**< View Field attribute */  
83 - "altscreen", /**< auto resize on altscreen */  
84 - "keepalive", /**< Enable network keep-alive with SO_KEEPALIVE */  
85 - "nettrace", /**< Enable network in/out trace */  
86 - 60 + const char *name;
  61 + const char *descr;
  62 +}
  63 +toggle_info[LIB3270_TOGGLE_COUNT] =
  64 +{
  65 + { "monocase", "" },
  66 + { "cursorblink", "" },
  67 + { "showtiming", "" },
  68 + { "cursorpos", "" },
  69 + { "dstrace", "" },
  70 + { "linewrap", "" },
  71 + { "blankfill", "" },
  72 + { "screentrace", "" },
  73 + { "eventtrace", "" },
  74 + { "marginedpaste", "" },
  75 + { "rectselect", "" },
  76 + { "crosshair", "" },
  77 + { "fullscreen", "" },
  78 + { "reconnect", "" },
  79 + { "insert", "" },
  80 + { "smartpaste", "" },
  81 + { "bold", "" },
  82 + { "keepselected", "" },
  83 + { "underline", "" },
  84 + { "autoconnect", "" },
  85 + { "kpalternative", "" }, /**< Keypad +/- move to next/previous field */
  86 + { "beep", "" }, /**< Beep on errors */
  87 + { "fieldattr", "" }, /**< View Field attribute */
  88 + { "altscreen", "" }, /**< auto resize on altscreen */
  89 + { "keepalive", "" }, /**< Enable network keep-alive with SO_KEEPALIVE */
  90 + { "nettrace", "" }, /**< Enable network in/out trace */
87 }; 91 };
88 92
89 LIB3270_EXPORT unsigned char lib3270_get_toggle(H3270 *session, LIB3270_TOGGLE ix) 93 LIB3270_EXPORT unsigned char lib3270_get_toggle(H3270 *session, LIB3270_TOGGLE ix)
@@ -237,6 +241,13 @@ void shutdown_toggles(H3270 *session) @@ -237,6 +241,13 @@ void shutdown_toggles(H3270 *session)
237 #endif 241 #endif
238 } 242 }
239 243
  244 +LIB3270_EXPORT const char * lib3270_get_toggle_description(LIB3270_TOGGLE_ID ix)
  245 +{
  246 + if(ix < N_TOGGLES)
  247 + return toggle_names[ix];
  248 + return "";
  249 +}
  250 +
240 LIB3270_EXPORT const char * lib3270_get_toggle_name(LIB3270_TOGGLE_ID ix) 251 LIB3270_EXPORT const char * lib3270_get_toggle_name(LIB3270_TOGGLE_ID ix)
241 { 252 {
242 if(ix < N_TOGGLES) 253 if(ix < N_TOGGLES)