Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using PageFrames
Message
 
À
16/06/1998 12:31:36
Jeroen Naus
Harte-Hanks Europe
Hasselt, Belgique
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00108408
Message ID:
00108835
Vues:
42
>This is some cool stuff you're telling me right and here and it will be useful in the future. The only problem is, that in my case a generically add pages to the pageframe and so I need to generically add code to these pages also. It would be easier to set up a proper ancestor page class for these ? And I need to do all this work to trigger a pagechange event ?
Jeroen,

No, you don't. You can define a page class in a PRG file as below;
 DEFINE CLASS MyPage AS PAGE
    PROCEDURE Activate
        * Whatever you want
    ENDPROC
 END DEFINE
Name the PRG MyPages.prg. In your code you simply do something like this;
SET LIBRARY TO MyPages.PRG ADDITIVE
WITH THISFORM.PageFrame1
   .PageCount = 0
   FOR lnCnt 1 TO 5
       lcPage = "Page"+ STR(lnCnt,1)
       .AddObject(lcPage,"MyPage")
   ENDFOR
ENDWITH
There you just removed all the default pages from the pageframe and added 5 of your own class. You could easily have a separate class for each page and do it this way;
SET LIBRARY TO MyPages.PRG ADDITIVE
WITH THISFORM.PageFrame1
   .PageCount = 0
   .AddObject("Page1","MyPage1")
   .AddObject("Page2","MyPage2")
   .AddObject("Page3","MyPage3")
   .AddObject("Page4","MyPage4")
   .AddObject("Page5","MyPage5")
ENDWITH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform