Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bindevent on specific Grid column
Message
From
14/03/2021 12:43:40
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
14/03/2021 12:08:27
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01678862
Message ID:
01678969
Views:
48
>hello Lutz,
>
>I'm going crazy with Bindevent !!
>Switching bindevent to Header1 works :
>
>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.Header1,"DblClick", oManipulador, "OnDblClick")
>
>Define Class Manipulador As Custom
>	Procedure OnDblClick
>	Messagebox("you have dblclick on the column 13")
>	Return
>	Endproc
>Enddefine
>
>
>switching bindevent to Text1 does not work:
>
>
>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")
>
>Define Class Manipulador As Custom
>	Procedure OnDblClick
>	Messagebox("you have dblclick on the column 13")
>	Return
>	Endproc
>Enddefine
>
>
>Also i run this code to show me some information:
>
>oGrid = sbo.pageframe1.page1.cont1.grid1
>
>
>?oGrid.Column13.ControlSource = "BI.LOBS3" && Return .T.
>?oGrid.column13.name  &&Return column13
>?oGrid.column13.text1    &&Return (Object)
>?oGrid.column13.text1.value   && Return : NCREC-CL.CMP-3
>?oGrid.column13.Header1.Caption   &&Return:  QUA-NC[F0]
>?oGrid.column13.Header1  &&Return (Object)
>
>
>I can't understand why !! ??
>also i dont know to use AEVENTS() in OnDblClick.
>
>I hope you cold help me about this strange behavior.
>
>Best Regards,
>Luis

Hello Luis,

I do not really understand your code. But for testing try
-Return value of bindevent
-return of AEVENTS of both objects
-data in the array returned by AEVENTS
-raise the event
I added code into your example
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
? Bindevent(oGrid.column13.Text1,"DblClick", oManipulador, "OnDblClick")
public laSource(1,5), laTarget(1,5)
?AEVENTS(laSource,oGrid.column13.Text1)  && Return=0 no event bound. For more, see help AEVENTS() oEventObject 
?AEVENTS(laTarget,oManipulador)    && see line above
*raise event
raiseevent(oGrid.column13.Text1,"DblClick")
*call methods
oGrid.column13.Text1.DblClick
*call delegate as code
oManipulador.OnDblClick
*/added code

Define Class Manipulador As Custom
	Procedure OnDblClick
*added code
lnEvents = AEVENTS(laEve,0)  && Return=0 not called as an event bound. For more, see help AEVENTS() 0 
?'event count= ',lnevents
for lnevent = 1 to lnevents
 ?laEve(lnevent,1).name,'  ',laEve(lnevent,2),'  ',laEve(lnevent,3)
next
*/added code
		Messagebox("you have dblclick on the column 13")
		Return
	Endproc
Enddefine
For your question about AEVENTS.
AEVENTS has multiple modes to use. You see two in the code after bindevent, and in Manipulador.OnDblClick you see a different used to get the source of an event.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform