Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you Create a Page Class in VFP 7?
Message
From
26/11/2002 12:59:19
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00726793
Message ID:
00727140
Views:
13
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform