Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bindevent and dblclick
Message
De
05/08/2008 03:52:59
Jon Neale
Bond International Software
Wootton Bassett, Royaume Uni
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01336230
Message ID:
01336493
Vues:
13
>>Hi,
>>
>>Can anyone give me an idea on why the following bindevent on the dblclick doesnt work?
>>
>>FOR lnCol = 1 TO ThisForm.Grid1.ColumnCount
>> loColumn = ThisForm.Grid1.Columns[ lnCol ]
>> FOR EACH loControl IN loColumn.Controls
>> IF PEMSTATUS( loControl, [dblClick], 5 )
>> BINDEVENT( loControl, 'dblClick', thisform, 'GridClicked') *** this doesnt work
>> ENDIF
>> *IF PEMSTATUS( loControl, [Click], 5 )
>> * BINDEVENT( loControl, 'Click', thisform, 'GridClicked') *** this works just fine
>> *ENDIF
>> ENDFOR
>>ENDFOR
Thanks to all of you for your input you gave me the kick start I needed to resolve this.

I tested Borislav's code in Fox and it worked exactly as expected, but then I tagged it into my application and it stopped working, this is what led me to find the following deep within the legacy app:
ON KEY LABEL leftmouse DO mhandler

As soon as I removed it everything works as expected, now I just need to make sure I havent destroyed the rest of the application by removing this line of code - or maybe I'll leave that up to the users :-).

Once again thanks to all as I thought I was losing my marbles yesterday.

Jon


>>
>>Looking for a little inspiration.
>>
>>Thanks
>>
>>Jon
>
>That works for me:
>
>oForm = CREATEOBJECT([form1])
>oForm.Show(1)
>
>**************************************************
>*-- Form:         form1 (d:\all_zapl\test.scx)
>*-- ParentClass:  form
>*-- BaseClass:    form
>*-- Time Stamp:   08/04/08 07:44:00 PM
>*
>DEFINE CLASS form1 AS form
>
>
>    DoCreate = .T.
>    Caption = "Form1"
>    Name = "Form1"
>
>
>    ADD OBJECT grid1 AS grid WITH ;
>        ColumnCount = 2, ;
>        Height = 200, ;
>        Left = 14, ;
>        Top = 11, ;
>        Width = 320, ;
>        Name = "Grid1", ;
>        Column1.Name = "Column1", ;
>        Column2.Name = "Column2"
>
>
>    PROCEDURE gridclicked
>        WAIT WINDOW [We are here]  NOWAIT
>    ENDPROC
>
>
>    PROCEDURE Init
>        =AFONT(laFonts)
>        lcChars = []
>        FOR lnFor = 30 TO 255
>            lcChars = lcChars + CHR(lnFor)
>        NEXT
>        FOR lnFor = 1 TO ALEN(laFonts)
>            INSERT INTO crsTest VALUES (laFonts[lnFor], lcChars)
>        NEXT
>        GO TOP
>        thisform.Grid1.Column2.DynamicFontName = [IIF(.t.,ALLTRIM(FontNames),"")]
>        FOR EACH oCol IN thisform.Grid1.Columns
>            FOR EACH oControl IN oCol.Controls
>                IF PEMSTATUS( oControl, [dblClick], 5 )
>                   BINDEVENT( oControl, 'dblClick', thisform, 'GridClicked')
>                ENDIF
>            NEXT
>        NEXT
>    ENDPROC
>
>
>    PROCEDURE Load
>        CREATE CURSOR crsTest (FontNames C(50), AllChars C(200))
>    ENDPROC
>
>
>ENDDEFINE
>*
>*-- EndDefine: form1
>**************************************************
>
>
>BTW what is the value of AllowCellSelection property of your grid?
>If it is .F. then Grid DblClick is fired not column controls one.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform