Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bindevent on specific Grid column
Message
From
15/03/2021 06:22:27
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
 
 
To
15/03/2021 01:59:32
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01678862
Message ID:
01678978
Views:
42
Hi Luis.

off topic
Please consider to set Enable auto quote. This is a big help to read your messages. You found this in the settings screen, available via the hamburger menu on the top right of this screen.
/off topic

Discussion of the log file
---- 14.03.2021 21:22:08 -----

3
The line above say, you have 3 eventhandler bound to
oGrid.column13.Text1.DblClick
This might be the result of multiple calls of this code
-> The example code now resets Eventbinding first
2
Line above is odd, when BINDEVENT returns 3 for the object
1
This is even more odd
OnDblClick
event count= 3
Text1 DBLCLICK 1
ok, that's the raisevent. And the other calls? at least the
oManipulador.OnDblClick must create output?

ok. we do an other try, more output:
please post the output file again
Public oManipulador As Manipulador
* - Instancia o objeto manipulador
oManipulador = Createobject("Manipulador")


oGrid = SBO.pageframe1.page1.cont1.grid1
wait window oGrid.column13.Text1.value timeout 0.80  &&Show me the correct value : NCREC-CL.CMP-3
*           Bindevent(oGrid.column13.Text1,"DblClick", oManipulador, "OnDblClick")

*added code
*reset Eventbinding
LOCAL ARRAY laEve_Source(1),laEve_Target(1)
UNBINDEVENTS(oGrid.column13.Text1)
UNBINDEVENTS(oManipulador)
SET alternate TO Eve_Log.txt
SET alternate on
??'----',DATETIME(),'----'
?'Bindevent ', Bindevent(oGrid.column13.Text1,"DblClick", oManipulador, "OnDblClick")
public laSource(1,5), laTarget(1,5)
?'laEve_Source ', AEVENTS(laEve_Source,oGrid.column13.Text1)  && Return=0 no event bound. For more, see help AEVENTS() oEventObject 
?'laEve_Target ', AEVENTS(laEve_Target,oManipulador)    && see line above
*raise event
?'raiseevent'
raiseevent(oGrid.column13.Text1,"DblClick")
*call methods
?'Call method DblClick'
oGrid.column13.Text1.DblClick
*call delegate as code
?'Call method OnDblClick'
oManipulador.OnDblClick

?'MEMORY'
?''
SET alternate off
SET alternate to
DISPLAY MEMORY LIKE laEve* TO FILE Eve_Log.txt ADDITIVE
*/added code

Define Class Manipulador As Custom
	Procedure OnDblClick
*added code
?'OnDblClick'
LOCAL lnevents
LOCAL ARRAY laeve(1,3)
lnEvents = AEVENTS(laEve,0)  && Return=0 not called as an event bound. For more, see help AEVENTS() 0 
?'event count= ',lnevents
IF !EMPTY(lnevents)  THEN
*only 1 run possible
 ?laEve(1,1).name,'  ',laEve(1,2),'  ',laEve(1,3)
endif
*		Messagebox("you have dblclick on the column 13")
*/added code
		Return
	Endproc
Enddefine
Lutz

Aunt Edit says:
I added a bug to OnDblClick. The FOR loop was idiotic. since AEVENTS(,0) returns 0 or 3, nothing different. Code reworked

Hi Lutz,

i attach the new file that was running your code.

Thanks,
Luis
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform