Hi Frank,
Thanks. I'll test it out and look at adding a config file option for it.
Does anyone have any preferences for a key-binding?
On Wed, May 02, 2001 at 12:27:45PM +0200, Frank Richter wrote:
> As I'm a RPG programmer, I really needed the functionality of "rulers".
> But it's not possible to implement them in a curses client. So I made a
> workaround, which is a bit ugly but works for me: I patched cursesterm.c
> to show the row and column of characters, which the cursor is in, in
> bold. Maybe someone with a deeper knowledge of the source can make a
> configurable option and a key binding for this.
>
> Here it is:
>
> --- cursesterm.c.orig Wed May 2 12:16:19 2001
> +++ cursesterm.c Wed May 2 12:21:43 2001
> @@ -49,6 +49,7 @@
> #define A_5250_YELLOW ((attr_t)COLOR_PAIR(COLOR_YELLOW) | A_BOLD)
> #define A_5250_PINK ((attr_t)COLOR_PAIR(COLOR_MAGENTA))
> #define A_5250_BLUE ((attr_t)COLOR_PAIR(COLOR_CYAN) | A_BOLD)
> +#define A_5250_RULER (A_BOLD)
>
> /*@-globstate -nullpass@*/ /* lclint incorrectly assumes stdscr may be NULL */
>
> @@ -605,7 +606,20 @@
> c = tn5250_display_char_at(display, y, x);
> if ((c & 0xe0) == 0x20) { /* ATTRIBUTE */
> a = (c & 0xff);
> - addch(attribute_map[0] | ' ');
> + /* rulers */
> + if((tn5250_display_cursor_x(display)==x)&&
> + (x<(tn5250_display_width(display)-1))&&
> + (tn5250_display_cursor_y(display)!=y)) {
> + addch(attribute_map[0] | ' ' | A_5250_RULER );
> + } else {
> + if((tn5250_display_cursor_y(display)==y)&&
> + (tn5250_display_cursor_x(display)!=x)) {
> + addch(attribute_map[0] | ' ' | A_5250_RULER );
> + } else {
> + addch(attribute_map[0] | ' ');
> + }
> + }
> + /* ~rulers */
> } else { /* DATA */
> curs_attr = attribute_map[a - 0x20];
> if (curs_attr == 0x00) { /* NONDISPLAY */
> @@ -635,7 +649,20 @@
> c = '_';
> }
> }
> - addch((chtype)(c | curs_attr));
> + /* rulers */
> + if((tn5250_display_cursor_x(display)==x)&&
> + (x<(tn5250_display_width(display)-1))&&
> + (tn5250_display_cursor_y(display)!=y)) {
> + addch((chtype)(c | curs_attr | A_5250_RULER ));
> + } else {
> + if((tn5250_display_cursor_y(display)==y)&&
> + (tn5250_display_cursor_x(display)!=x)) {
> + addch((chtype)(c | curs_attr | A_5250_RULER ));
> + } else {
> + addch((chtype)(c | curs_attr));
> + }
> + }
> + /* ~rulers */
> }
> } /* if ((c & 0xe0) ... */
> } /* for (int x ... */
>
> --
> Esda Feinstrumpffabrik GmbH
> Frank Richter, Leiter EDV
> Hauptstr. 76, D-09392 Auerbach
> E-Mail: [EMAIL PROTECTED]
> +---
> | This is the LINUX5250 Mailing List!
> | To submit a new message, send your mail to [EMAIL PROTECTED]
> | To subscribe to this list send email to [EMAIL PROTECTED]
> | To unsubscribe from this list send email to [EMAIL PROTECTED]
> | Questions should be directed to the list owner/operator: [EMAIL PROTECTED]
> +---
--
Mike Madore
Software Engineer
TurboLinux, Inc.
+---
| This is the LINUX5250 Mailing List!
| To submit a new message, send your mail to [EMAIL PROTECTED]
| To subscribe to this list send email to [EMAIL PROTECTED]
| To unsubscribe from this list send email to [EMAIL PROTECTED]
| Questions should be directed to the list owner/operator: [EMAIL PROTECTED]
+---