Skip to content

Commit

Permalink
Merged revision 3413 from trunk: corrections mainly for mouse handlin…
Browse files Browse the repository at this point in the history
…g, fixing [bugs:#608], [bugs:#700]

libcob:
* screenio.c (BUTTON3_DOUBLE_CLICKED): fix value for BUTTON3_DOUBLE_CLICKED
* screenio.c (field_accept): pass mouse position on KEY_MOUSE
* screenio.c (cob_display_formatted_text): fix early return for broken data
* common.c (set_config_val): pass COB_MOUSE_INTERVAL changes to screenio.c
  • Loading branch information
sf-mensch committed Dec 2, 2021
1 parent 526151d commit 0b48fb6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
8 changes: 4 additions & 4 deletions copy/screenio.cpy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*> Copyright (C) 2008-2012, 2015-2016,
*> 2019 Free Software Foundation, Inc.
*> Copyright (C) 2008-2012, 2015-2016, 2019, 2021
*> Free Software Foundation, Inc.
*> Written by Roger While, Simon Sobisch
*>
*> This file is part of GnuCOBOL.
Expand Down Expand Up @@ -186,8 +186,8 @@
*>78 COB-SCR-CTRL-WHEEL-RIGHT VALUE 2091. *reserved*
78 COB-SCR-ALT-WHEEL-UP VALUE 2092.
78 COB-SCR-ALT-WHEEL-DOWN VALUE 2093.
*>78 COB-SCR-ALT-WHEEL-LEFT VALUE 2082. *reserved*
*>78 COB-SCR-ALT-WHEEL-RIGHT VALUE 2083. *reserved*
*>78 COB-SCR-ALT-WHEEL-LEFT VALUE 2094. *reserved*
*>78 COB-SCR-ALT-WHEEL-RIGHT VALUE 2095. *reserved*
*> Input validation - Values 8xxx
78 COB-SCR-NO-FIELD VALUE 8000.
78 COB-SCR-TIME-OUT VALUE 8001.
Expand Down
8 changes: 8 additions & 0 deletions libcob/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,14 @@
a key that has all SUPPRESS character and skip the record.
This will handle old VBISAM which do not support key suppression.

2019-12-11 Simon Sobisch <[email protected]>

Fix Bug #608, #700
* screenio.c (BUTTON3_DOUBLE_CLICKED): fix value for BUTTON3_DOUBLE_CLICKED
* screenio.c (field_accept): pass mouse position on KEY_MOUSE
* screenio.c (cob_display_formatted_text): fix early return for broken data
* common.c (set_config_val): pass COB_MOUSE_INTERVAL changes to screenio.c

2019-11-18 Ron Norman <[email protected]>

* common.h, fileio.c (fextfh.c, fbdb.c): Updates to support
Expand Down
6 changes: 5 additions & 1 deletion libcob/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -6584,7 +6584,11 @@ set_config_val (char *value, int pos)
return 1;
}
set_value (data, data_len, numval);
if (strcmp (gc_conf[pos].env_name, "COB_MOUSE_FLAGS") == 0) {
if (strcmp (gc_conf[pos].env_name, "COB_MOUSE_FLAGS") == 0
#ifdef HAVE_MOUSEINTERVAL /* possibly add an internal option for mouse support, too */
|| strcmp (gc_conf[pos].env_name, "COB_MOUSE_INTERVAL") == 0
#endif
) {
cob_settings_screenio ();
}

Expand Down
17 changes: 15 additions & 2 deletions libcob/screenio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1431,8 +1431,8 @@ mouse_to_exception_code (mmask_t mask) {
else if (mask & BUTTON3_PRESSED) fret = 2047;
else if (mask & BUTTON3_CLICKED) fret = 2047;
else if (mask & BUTTON3_RELEASED) fret = 2048;
else if (mask & BUTTON3_DOUBLE_CLICKED) fret = 2048;
else if (mask & BUTTON3_TRIPLE_CLICKED) fret = 2048;
else if (mask & BUTTON3_DOUBLE_CLICKED) fret = 2049;
else if (mask & BUTTON3_TRIPLE_CLICKED) fret = 2049;
#if defined COB_HAS_MOUSEWHEEL
else if (mask & BUTTON4_PRESSED) fret = 2080;
else if (mask & BUTTON5_PRESSED) fret = 2081;
Expand Down Expand Up @@ -2962,6 +2962,19 @@ field_accept (cob_field *f, const int sline, const int scolumn, cob_field *fgc,
/* End key. */
fret = 2015;
goto field_return;
#ifdef NCURSES_MOUSE_VERSION
case KEY_MOUSE:
{
int mline = mevent.y;
int mcolumn = mevent.x;
mevent.bstate &= cob_mask_accept;
if (mevent.bstate != 0) {
fret = mouse_to_exception_code (mevent.bstate);
cob_move_cursor (mline, mcolumn); // move cursor to pass position
goto field_return;
}
}
#endif
default:
(void)flushinp ();
cob_beep ();
Expand Down

0 comments on commit 0b48fb6

Please sign in to comment.