Re: mouse click offset in help



Hello,

On Thu, 11 Nov 2004, Egmont Koblinger wrote:

> Hi,
>
> In the help screen (F1) the rectangular area which accepts mouse click for a
> link is shiftedtwo characters to the left. This means that the last two
> letters of a link don't accept mouse click, however, two characters left
> from the link do.

The help dialog has a box drawn in it - thus the offset of 2. It is not
only the column number that is affected by this, but also the line
number. This is how a dialog with a box looks like:

  0123456789
 0
 1 +------+
 2 |      |
 3 |      |
 4 |  x   |
 5 |  +------ Data area
 6 |      |
 7 |      |
 8 +------+
 9

The data is output in the area starting a (2,2) and ending
at (7,7).

>
> Attached patch fixes both for 4.6.0 and 2004-11-04-15 snapshot.

I don't think that the attached patch is the best possible solution.
Please, consider the attached one-liner.
Index: help.c
===================================================================
RCS file: /cvsroot/mc/mc/src/help.c,v
retrieving revision 1.49
diff -u -p -r1.49 help.c
--- help.c	18 Sep 2004 14:30:58 -0000	1.49
+++ help.c	19 Nov 2004 17:48:45 -0000
@@ -479,6 +479,7 @@ static int help_event (Gpm_Event *event,
 	return 0;
 
     /* The event is relative to the dialog window, adjust it: */
+    event->x -= 2;
     event->y -= 2;
     
     if (event->buttons & GPM_B_RIGHT){


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]