Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Page activate firing unexpectidly
Message
De
06/01/2000 08:36:44
 
 
À
05/01/2000 19:52:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00313394
Message ID:
00313836
Vues:
46
>>>Hi All,
>>>I have two grids on a page and a button that toggles between them. The button click makes one visible and the other not. The grids are setup so that dblclick() will fire the button click to do the same toggle action.
>>>Behaviour is as expected when the button is clicked, but when double-clicking on grid1, page.active is firing. It only fires when going from grid1 to grid2.
>>>
>>>Page.activate has this code:
>>>grid1.visible=.t.
>>>grid2.visible=.f.
>>>
>>>I dbl click on Grid1, Grid2 displays briefly, then page.activate fires, and grid1 displays again.
>>>Should activate fire when clicking on a control? Help sez yes, but I don't see it fire (with wait wind nowait) when clicking on grid2.
>>>If it should, then where do I put code to run only once when activating that page? Click doesn't seem right, 'cause user could fire the click at will.
>>>What am I missing here?
>>
>>An update:
>>Page.activate fires only when dblclicking the grid that is "in front". I just moved grid1 to the back, and now page.activate fires when dblclicking grid2! This doesn't mess me up now, since page.activate redundantly displays grid1, but I still can't see why the page.activate would fire at all.
>
>I can't reproduce this. Where is your grid double-click code? In one of the controls, or in the grid itself. I created a base form with a pageframe, and two grids on the same page, and implemented code as close as I could tell you were doing, and my form worked fine.

Thanks Erik,
Each grid's textn.dblclick() method has:
This.Parent.Parent.dblclick()
Each grid's dblclick() method has:
This.Parent.btn1.click()
where the button caption displays the other state to toggle to.
.btn1.click() has this code to toggle between grids:
if .btn1.caption='Detail'
*set view parameters
*requery(viewDetail)
.grd1.visible=.f.
* show the detail grid
.grd2.visible=.t.
.btn1.caption='List'
else
*show the list grid
.grd1.visible=.t.
.grd2.visible=.f.
.btn1.caption='Detail'
endif

Grid1 and Grid2 are recordsourced to their respective views, which are in the DataEnvironment.

Page.Activate() is setup to initially show:
.grd1.visible=.t.
.grd2.visible=.f.
.button.caption='Detail'
I rechecked the grid's parent class methods and there is no code there.
The button parent class makes a check of a form level property to enable/disable the button based on form level properties, but this is disabled with a comment in the btn1.refresh() method.
I must be overlooking something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform