Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem, UiEnable fire before Page.Activate
Message
De
23/10/2003 12:10:37
 
 
À
23/10/2003 11:32:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00841599
Message ID:
00841632
Vues:
20
UIEnable works as designed.
Where are you trapping the UIEnable() event? The outermost pageframe?
If so, it'll never fire. UIEnable() is designed to only fire for objects contained within a page; therefore, including UIEnable code in at the general pageframe class level is pointless.

To see how UIEnable is designed to work, put the trap in an object inside the page, not on the outermost pageframe itself.

e.g., on a form with on object hierarchy as follows:
form                      - trapped events: Init, Activate
  pageframe1                   - trapped events: Init, UIEnable
    page1                      - trapped events: Init, Activate
      text1 (textbox)          - trapped events: UIEnable
    page2                      - trapped events: Init, Activate
      pgfInside (pageframe)    - trapped events: UIEnable
        page1
        page2
you'd get the following event flow
** ox=NewObject('testform','testlib')
TESTFORM.PAGEFRAME1.PAGE1.INIT
TESTFORM.PAGEFRAME1.PAGE2.PGFINSIDE.PAGE1.INIT
TESTFORM.PAGEFRAME1.PAGE2.PGFINSIDE.PAGE2.INIT
TESTFORM.PAGEFRAME1.PAGE2.INIT
TESTFORM.PAGEFRAME1.PAGE1.TEXT1.UIENABLE .T.
TESTFORM.PAGEFRAME1.INIT
TESTFORM.INIT

** ox.Show()
TESTFORM.PAGEFRAME1.PAGE1.ACTIVATE
TESTFORM.ACTIVATE

** select outer Page2, contains Pageframe
TESTFORM.PAGEFRAME1.PAGE1.TEXT1.UIENABLE .F.
TESTFORM.PAGEFRAME1.PAGE2.ACTIVATE
TESTFORM.PAGEFRAME1.PAGE2.PGFINSIDE.UIENABLE .T.

** select outer Page1, contains Textbox
TESTFORM.PAGEFRAME1.PAGE2.PGFINSIDE.UIENABLE .F.
TESTFORM.PAGEFRAME1.PAGE1.ACTIVATE
TESTFORM.PAGEFRAME1.PAGE1.TEXT1.UIENABLE .T.
>Hi,
>
>this is a Old Bug ? I see this on VFP6/7/8.
>
>On a VCX, a pageframe initialization events is:
>
>Page1.Init
>....
>PageN.Init
>* Now ActivatePage property is read
>* On any control on ActivatePage
>Uienable(.T.)
>....
>Uienable(.T.)
>Pageframe.Init
>.....
>Form.Init
>pageframe.ActivatePage.Activate
>Form.Activate
>.....
>
>I aspected
>
>Page1.Init
>....
>PageN.Init
>* Now ActivatePage property is read, but not events fire
>Pageframe.Init
>.....
>Form.Init
>pageframe.ActivatePage.Activate
>* On any control on ActivatePage
>Uienable(.T.)
>....
>Uienable(.T.)
>Form.Activate
>.....
>
>
>On SCX UiEnabled not fire, not before, not after;
>instead fire a Deactivate of the default page.
>
>Then, is hard to build a general pageframe, good on SCX and VCX.
>
>Fabio
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform