Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP7 - Empty grids can't get focus?
Message
De
31/10/2001 12:54:56
John Deupree
Long Term Care Authority
Tulsa, Oklahoma, États-Unis
 
 
À
31/10/2001 11:58:12
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00575466
Message ID:
00575747
Vues:
23
Thanks Cetin. Actually my grid is read only (it's on a 'Find' screen), so perhaps that's why I get 'column' as the object. I was trying to set the column to 'find by' using a click on the header. I didn't want a click in the column to trigger the code in the header if there WERE records in the grid. However, when there are records, a click in the grid doesn't fire the form click method. The following code seems to work fine.
LOCAL oObj

oObj = SYS(1270)

IF UPPER(oObj.BASECLASS) = 'COLUMN'
	oObj.header1.CLICK()
ENDIF
John


>Elyse,
>If it's returning column then there is something wrong page getting click (grid enabled = .f., when returning .f. ?). Here is a more generic version that frees you from also knowing the grid name (John for header click catch I embedded GridHitTest usage in code) - directly using loObj.parent might be dangerous :
>
>
loGrid = .Null.
>loObj = Sys(1270)
>If Upper(loObj.BaseClass) # 'GRID' And Type('loObj.Parent')='O'
>  Do While Type('loObj.Parent')='O'
>    loObj = loObj.Parent
>    If Upper(loObj.BaseClass) = 'GRID'
>      loGrid = loObj
>      Exit
>    Endif
>  Enddo
>Else
>  loGrid =loObj
>Endif
>
>If !Isnull(loGrid) && Found a grid
>  Store 0 To lnWhere, lnRelRow, lnRelCol,lnPanel
>  loGrid.GridHitTest(Mcol(Wontop(),3),Mrow(Wontop(),3), ;
>        @lnWhere,@lnRelRow,@lnRelCol,@lnPanel)
>  If lnWhere = 1 && Header
>    Wait Window 'Header of relative column '+Transform(lnRelCol) TIMEOUT 2
>  Endif
>  loGrid.RightClick() && Elyse rightclick
>Endif
>
Cetin
>
>
>
>>Cetin,
>>
>>Is there anyway to trap the click event in the column header? Clicking on the header or in the column returns 'COLUMN' as the base class. I just need to trap the header click.
>>
>>TIA
>>
>>John
>>
>>>
>>>Yes Elyse,
>>>It doesn't get the focus :(
>>>You could have code in page rightclick like this :
>>>
>>>loObj = SYS(1270)
>>>IF UPPER(loObj.BaseClass) = 'GRID'
>>>	loObj.RightClick()
>>>endif
Cetin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform