Skip to content

Commit

Permalink
Added preliminary support for selection fields
Browse files Browse the repository at this point in the history
  • Loading branch information
james_rich committed Feb 24, 2005
1 parent bc1021b commit 2b5846d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2005-02-24 James Rich <[email protected]>
- 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 <[email protected]>
- Applied several fixes from Marc-Antoine Ruel for multi-threading issues
Expand Down
2 changes: 2 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ lib5250_la_SOURCES = buffer.c\
dbuffer.c\
display.c\
field.c\
menu.c\
printsession.c\
record.c\
scrollbar.c\
Expand Down Expand Up @@ -81,6 +82,7 @@ pkginclude_HEADERS = buffer.h\
dbuffer.h\
display.h\
field.h\
menu.h\
printsession.h\
record.h\
scrollbar.h\
Expand Down
26 changes: 11 additions & 15 deletions src/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -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;
Expand All @@ -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 */
Expand Down Expand Up @@ -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;
}


Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/tn5250-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 2b5846d

Please sign in to comment.