Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: wrong event call with a middle down click.
Message
From
17/09/2005 05:41:02
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
BUG: wrong event call with a middle down click.
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01050562
Message ID:
01050562
Views:
55
The bug is within the C++ code of the grid,
and it happen with all the objects drawn into a cell.

Repro with a TextBox:
WITH NEWOBJECT("form1")
	.grid1.column1.text1.Setfocus
	.Show
	DOEVENTS FORCE
	
	WAIT WINDOW "Waiting: now a MiddleClick happen over the grid's TextBox cell" TIMEOUT 3
	
	MOUSE CLICK AT	OBJTOCLIENT(.grid1.column1.text1,1);
		,	OBJTOCLIENT(.grid1.column1.text1,2);
		PIXELS WINDOW (.Name)  MIDDLE

ENDWITH
	
DEFINE CLASS form1 AS form

	AUTOCENTER  = .t.
	AllowOutput = .F.
	Caption = "Middle Button down fire MouseWheel into a grid cell"

	ADD OBJECT grid1 AS grid WITH ;
		ColumnCount = 1, ;
		Height = 200, ;
		Left = 30, ;
		Top = 38, ;
		Width = 320
		
		
	PROCEDURE Load
		PUBLIC oform1

		oform1= THIS

		CREATE CURSOR myTable1 ;
		(	Source	C(20)	NOT NULL DEFAULT "byby" ;
		,	Data	C(254)	NOT NULL	;
		,	Count	I		NOT NULL	;
		,	Weight	I		NOT NULL	;
		,	Created	T		NOT NULL	;
		)

		APPEND BLANK 
	ENDPROC
	
	PROCEDURE UnLoad
		RELEASE oForm1
		WAIT CLEAR
	PROCEDURE Init
		BINDEVENT(thisform.grid1.column1.text1,"MouseWheel",thisform,"MouseWheel")
		this.grid1.column1.sparse = .F.
		
	PROCEDURE MouseWheel
		LPARAMETERS nDirection, nShift, nXCoord, nYCoord
		IF AEVENTS(ax,0)#0
			? "EVENTO"
			SET TEXTMERGE TO memvar msg NOSHOW ON
			\this message doesn't have to happen
			\
			\   Object   : <<SYS(1272,AX[1])>>
			\   Event    : <<AX[2]>>
			\   Direction: <<nDirection>>
			SET TEXTMERGE TO
			WAIT WINDOW msg NOCLEAR NOWAIT
			CLEAR TYPEAHEAD
		ENDIF
	ENDPROC

ENDDEFINE
Reply
Map
View

Click here to load this message in the networking platform