On Tuesday 15 October 2002 1:46 pm, Andre Poenitz wrote:
> On Tue, Oct 15, 2002 at 01:34:28PM +0100, Angus Leeming wrote:
> > On Tuesday 15 October 2002 12:52 pm, Andre Poenitz wrote:
> > I've read through the xforms source a little.
> > Were I not /still/ compiling libqt, I'd try this out for
> > you.
>
> Could you please try once youve finished compiling qt?

Looks to me like John was trying to use the underlying XEvent 
but xforms wasn't playing ball (ie, not passing the right 
thing).

Try the attached patch. Gives output like:

key = 3  MB1 = 1 MB2 = 2 MB3 = 3 MB4 = 4 MB5 = 5
ev->xbutton.button = 0
xx = 0 yy = 0 ev->xbutton.x = 313 ev->xbutton.y = 280

so, I conclude that x_button_state should be modified to receive 
key rather than ev->xbutton.button.

I also conclude that ev->xbutton.[xy] contain the correct data 
but the x,y coords passed to the function are bogus. Go figure.

Nonetheless, the data is there for you to use.
Regards,
Angus



Index: src/frontends/xforms/XWorkArea.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/XWorkArea.C,v
retrieving revision 1.23
diff -u -p -r1.23 XWorkArea.C
--- src/frontends/xforms/XWorkArea.C	5 Sep 2002 15:14:23 -0000	1.23
+++ src/frontends/xforms/XWorkArea.C	15 Oct 2002 14:02:26 -0000
@@ -330,7 +330,7 @@ void XWorkArea::scroll_cb()
 
 
 int XWorkArea::work_area_handler(FL_OBJECT * ob, int event,
-				FL_Coord, FL_Coord,
+				FL_Coord xx, FL_Coord yy,
 				int key, void * xev)
 {
 	static int x_old = -1;
@@ -379,6 +379,21 @@ int XWorkArea::work_area_handler(FL_OBJE
 		    ev->xmotion.y != y_old ||
 		    fl_get_scrollbar_value(area->scrollbar) != scrollbar_value_old
 			) {
+			lyxerr << "key = " << key << ' '
+			       << " MB1 = " << FL_MBUTTON1
+			       << " MB2 = " << FL_MBUTTON2
+			       << " MB3 = " << FL_MBUTTON3
+			       << " MB4 = " << FL_MBUTTON4
+			       << " MB5 = " << FL_MBUTTON5
+			       << '\n'
+			       << "ev->xbutton.button = " << ev->xbutton.button
+			       << '\n'
+			       <<  "xx = " << xx
+			       << " yy = " << yy
+			       << " ev->xbutton.x = " << ev->xbutton.x
+			       << " ev->xbutton.y = " << ev->xbutton.y
+			       << std::endl;
+
 			x_old = ev->xmotion.x;
 			y_old = ev->xmotion.y;
 			scrollbar_value_old = fl_get_scrollbar_value(area->scrollbar);

Reply via email to