Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bindevent on specific Grid column
Message
De
16/03/2021 14:51:55
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
16/03/2021 14:06:52
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01678862
Message ID:
01679029
Vues:
57
>Hi Luis.
>
>perfect, EVENTBINDINg is set up and working (Just compare the output with the code and use help to understand what is shown)
>
>So now comment the lines:
>
>SET alternate off
>SET alternate to
>DISPLAY MEMORY LIKE laEve* TO FILE Eve_Log.txt ADDITIVE
>
>to keep logging running
>
>dblclick your column. close logging via
>
>SET alternate off
>SET alternate to
>
>on command line
>check the file, if after the line containing MEMORY a logg of OnDblClick occurs
>This would be a mouse dblclick redirected.
>
>If you see one, it is working. Now you must create code for handling in OnDblClick
>
>If not use
>
>?AEVENTS(laEve_Source,SBO.pageframe1.page1.cont1.grid1.column13.Text1) 
>?AEVENTS(laEve_Target,oManipulador) 
>DISPLAY MEMORY LIKE laEve*
>
>on command line to check if the binding is still there. It should return values different 0 and the arrays should show where the binding goes. Check help for the fields.
>if the above errors out, the objects are probably not existing. Then there is nothing to bind to ...
>
>Lutz
>
>Hi Lutz,
>
>I try your suggestion and then show me the same result file.
>Also,in the meantime, I tried this code that solved my problem..Nei know how!?
>
>
>Public oManipulador As Manipulador
>* - Instancia o objeto manipulador
>oManipulador = Createobject("Manipulador")
>
>
>oGrid = SBO.pageframe1.page1.cont1.grid1
>
>FOR EACH loColumn IN oGrid.Columns 
>  FOR EACH loControl IN loColumn.Controls
>    IF loColumn.text1.controlsource = 'BI.LOBS3'
>       BINDEVENT( loControl, 'DblClick', oManipulador, 'OnDblClick' )
>    ENDIF 
>  ENDFOR
>ENDFOR
>
>Define Class Manipulador As Custom
>   Procedure OnDblClick
>       gorec=RECNO()
>	  lcCod = BI.LOBS3
>     *wait window lcCod timeout 0.80
>
>	Text to msel textmerge noshow pretext 7
>		Select qncstamp, cod from qnc where qnc.cod = ?lcCod
>	Endtext
>	
>	If u_sqlexec(msel,[Crs])
>		doread("QNC")
>        navega("Qnc",crs.qncstamp)
>	Endif
>
>	*Wait Window gorec timeout 0.80
>
>	Return
>	Endproc
>Enddefine
>
>
>I don't understand how writing the code in this way already works ??
>
>Many thanks for your great help, because i also learn other interesting things to debug.
>
>Best Regards,
>Luis

Hi Luis,

The simple answer is, that the Column you bound to is not Column13.
Also, if there is only one Column with that Controlsource Exit the loop:

try
FOR EACH loColumn IN oGrid.Columns 
  FOR EACH loControl IN loColumn.Controls
    IF loColumn.text1.controlsource = 'BI.LOBS3'
       BINDEVENT( loControl, 'DblClick', oManipulador, 'OnDblClick' )
*show column's name
?loColumn.NAME
*end the loop:
      EXIT
    ENDIF 
  ENDFOR
ENDFOR
Once you figured out the right column, you might use this instead of the loop
Lutz
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]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform