From 2b5846d1e550b65f4caa8edbac5a087a39454f3d Mon Sep 17 00:00:00 2001 From: james_rich Date: Thu, 24 Feb 2005 21:49:42 +0000 Subject: [PATCH] Added preliminary support for selection fields --- ChangeLog | 3 +++ src/Makefile.am | 2 ++ src/session.c | 26 +++++++++++--------------- src/tn5250-private.h | 1 + 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 64f6a04..b354790 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2005-02-24 James Rich - Added more descriptive comments to tn5250_session_query_reply(). +- Changed tn5250_terminal_enhanced() to return 0 if NULL as suggested by + Marc-Antoine Ruel. +- Added preliminary selection field support. 2005-02-23 James Rich - Applied several fixes from Marc-Antoine Ruel for multi-threading issues diff --git a/src/Makefile.am b/src/Makefile.am index 5646150..f2aa88a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,6 +15,7 @@ lib5250_la_SOURCES = buffer.c\ dbuffer.c\ display.c\ field.c\ + menu.c\ printsession.c\ record.c\ scrollbar.c\ @@ -81,6 +82,7 @@ pkginclude_HEADERS = buffer.h\ dbuffer.h\ display.h\ field.h\ + menu.h\ printsession.h\ record.h\ scrollbar.h\ diff --git a/src/session.c b/src/session.c index 1436f4a..4a55bbe 100644 --- a/src/session.c +++ b/src/session.c @@ -1050,15 +1050,6 @@ tn5250_session_write_to_display (Tn5250Session * This) tn5250_char_map_to_local (tn5250_display_char_map (This->display), cur_order), cur_order)); - if (tn5250_char_map_to_local - (tn5250_display_char_map (This->display), - cur_order) != '\n') - { - TN5250_LOG (("%c", - tn5250_char_map_to_local - (tn5250_display_char_map - (This->display), cur_order))); - } } #endif } @@ -2553,12 +2544,6 @@ tn5250_session_query_reply (Tn5250Session * This) TN5250_LOG (("Sending QueryReply.\n")); - /* FIXME: We should really be asking the terminal object if - * it supports the enhanced 5250 capbilities, and *it* - * should be checking to see if the user wants them. - * This way, the more advanced terminals (WinTerm, GTKTerm) - * additional capabilities. - */ if (tn5250_terminal_enhanced (This->display->terminal)) { @@ -2794,6 +2779,7 @@ tn5250_session_query_reply (Tn5250Session * This) static void tn5250_session_define_selection_field (Tn5250Session * This, int length) { + Tn5250Menu *menu; unsigned char flagbyte; unsigned char fieldtype; unsigned char textsize; @@ -2811,6 +2797,8 @@ tn5250_session_define_selection_field (Tn5250Session * This, int length) TN5250_LOG (("Entering tn5250_session_define_selection_field()\n")); + menu = tn5250_menu_new (); + flagbyte = tn5250_record_get_byte (This->record); /* The first two bits define mouse characteristics */ @@ -2866,32 +2854,38 @@ tn5250_session_define_selection_field (Tn5250Session * This, int length) if (flagbyte & 0x80) { TN5250_LOG (("Use scroll bar\n")); + menu->use_scrollbar = 1; usescrollbar = 1; } if (flagbyte & 0x40) { TN5250_LOG (("Add blank after numeric seperator\n")); + menu->num_sep_blank = 1; } if (flagbyte & 0x20) { TN5250_LOG (("Use * for unavailable options\n")); + menu->asterisk = 1; } if (flagbyte & 0x10) { TN5250_LOG (("Limit cursor to input capable positions\n")); + menu->inputonly = 1; } if (flagbyte & 0x08) { TN5250_LOG (("Field advance = character advance\n")); + menu->fieldadvischaradv = 1; } if (flagbyte & 0x04) { TN5250_LOG (("Cursor may not exit selection field\n")); + menu->nocursormove = 1; } @@ -2946,6 +2940,8 @@ tn5250_session_define_selection_field (Tn5250Session * This, int length) TN5250_LOG (("Invalid field selection type!!\n")); } + menu->type = fieldtype; + reserved = tn5250_record_get_byte (This->record); reserved = tn5250_record_get_byte (This->record); reserved = tn5250_record_get_byte (This->record); diff --git a/src/tn5250-private.h b/src/tn5250-private.h index c31853a..8b43dbd 100644 --- a/src/tn5250-private.h +++ b/src/tn5250-private.h @@ -83,6 +83,7 @@ #include "printsession.h" #include "display.h" #include "macro.h" +#include "menu.h" #include "debug.h" #include "wtd.h" #include "window.h"