Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bindevent on specific Grid column
Message
From
14/03/2021 17:27:06
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
 
 
To
14/03/2021 16:37:50
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01678862
Message ID:
01678974
Views:
42
>Hello Lutz,
>
>Many thanks for your reply and examples for using AEVENTS.
>Maybe for you understand better i attach a little word file where i explain what i want to do.
>
>Best regards,
>Luis

Hello Luis

Nice guess work what's wrong.

First, you need to understand that you bound to any Textbox of the column, not a specific row.
Second, the value of the textbox is not part of the eventbinding. It's only this object is dblclicked, call handler
Third. Let me be picky. Your grid shows two lines of the cursor (table, CA, whatever), where one column (you say: Column13) shows the values NCREC-CL.CMP-3
and NCREC-CL.CMP-4, the record with NCREC-CL.CMP-3 is where the recorpointer of the cursor points to.

The example code I've posted shows how to set the Eventbinding so, that a dblclick to any textbox (in fact, any object in the column except the Header) will call the delegate

If you dblclick a cell on the Column13, it will be on the current record
So if the handler is called, it will be for the current row in your record, you do not need what the textbox is doing - just look into the record.

But - first things first. Please run the code below - it's you example modified for some output. It creates a file Eve_Log.txt, please zip and post. By this, I can see if the what is working and what not.
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
SET alternate TO Eve_Log.txt
SET alternate on
??'----'DATETIME(),'----'
? 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

?
SET alternate off
SET alternate to
*/added code

Define Class Manipulador As Custom
	Procedure OnDblClick
*added code
?'OnDblClick'
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
*		Messagebox("you have dblclick on the column 13")
*/added code
		Return
	Endproc
Enddefine
Hello again Lutz,

Many thanks for your help

I run your code but they give me an error in Line 37, also i change this because they also return error:
??'----'DATETIME(),'----'
to
?'-----',DATETIME(),'----'


Código: 9
Linha: 37
Mensagem 1: Data type mismatch.
Mensagem 2:
Local: MANIPULADOR.ONDBLCLICK

the value on_screen are:
---- 14.03.2021 21:22:08 -----
3
2
1
OnDblClick
event count= 3
Text1 DBLCLICK 1

This information have all you need ?

Best Regards,
Luis
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform