Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you Create a Page Class in VFP 7?
Message
De
26/11/2002 12:59:19
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00726793
Message ID:
00727140
Vues:
15
This message has been marked as a message which has helped to the initial question of the thread.
My application does exactly what you are talking about. I don't know how many pages or objects are loaded on the form until the form displays in front of me.

I use a table to contain a list of the Pages that I want added to the PageFrame. Each row in this table will contain an object and name to be defined. Programmatically when the PageFrame is added, the initialize loads the table info into a cursor, then cycles through the cursor and does a pageframe.ADDOBJECT(m.pagename, m.pageobject, parameterlist...)

Make sure you eliminate the default pages that are created for you.

m.pagename = "pgNames"
m.pageobject = "cpgfNames"

SCAN
SCATTER MEMVAR
THISFORM.pageframe.ADDOBJECT(...)
ENDSCAN

Now, where is the page defined.

Create a program called cusPages.prg
Add somewhere in main.prg a "SET PROCEDURE TO cusPages ADDITIVE" this will make it visible where ever you want.

Inside the cusPages.prg

#include ...
DEFINE CLASS cpgfNames AS PAGE
cProperty = ''
nProperty = 0

PROCEDURE init
THIS.cProperty = 'Whatever'
THIS.nProperty = 5
ENDPROC

PROCEDURE activate
ENDPROC
ENDDEFINE
Gordon de Rouyan
DC&G Consulting
Edmonton, Alberta
Email: derouyag@shaw.ca
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform