Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PageFrames And Pages
Message
From
17/10/2002 18:37:44
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00711806
Message ID:
00712631
Views:
16
If you want all of the Pages in the Pageframe to be of the same class, the best way is to set the Pageframes MemberClassLibrary to the VCX or PRG with the class and MemberClass to the class. You can then set PageCount to however many pages you need.

However, if you want the Pages to be from different classes, you have two ways to do this at run-time...method 1 is:
MyForm.MyPageFrame.MemberClassLibrary="mypages.vcx"
MyForm.MyPageFrame.MemberClass="pagBase"
MyForm.MyPageFrame.PageCount=MyForm.MyPageFrame.PageCount+1
* First Page added from pagBase class
MyForm.MyPageFrame.MemberClass="pagBase2"
MyForm.MyPageFrame.PageCount=MyForm.MyPageFrame.PageCount+1
* Second Page added from pagBase2 class from same classlib
MyForm.MyPageFrame.MemberClassLibrary="morepages.vcx"
MyForm.MyPageFrame.MemberClass="pagBase3"
MyForm.MyPageFrame.PageCount=MyForm.MyPageFrame.PageCount+1
* Third page added from pagBase3 class in different classlibrary.
See? When you increment Pagecount, the new page is from whatever the current member class is.

Method 2 is using AddObject, pretty much how you described:
SET CLASSLIB TO mypages.vcx
MyForm.MyPageFrame.PageCount=0   && Set to no pages
MyForm.MyPageFrame.AddObject("Page1","pagBase")   && Page Added
MyForm.MyPageFrame.AddObject("Page2","pagBase")   && Page Added
MyForm.MyPageFrame.AddObject("Page3","pagBase")   && Page Added
*** IMPORTANT DESIGN-TIME NOTE BELOW ***

Now once you start adding Pages from different classes to a VCX-based PageClass (maybe by using ASELOBJ to get an object reference to the Class Designer and pageframe class being edited) you are going to have problems re-editing that class after it's been saved because VFP will instance the edited pageframe with all of the pages set to the current memberclass. This does not occur at runtime


>I want to create predefined pages with groups of objects
>on them, then add them to the pageframe as needed.
>
>Would this best be accomplished using AddObject or
>is there a better way?
>
>I tried setting the MemberClass properties. Then in
>the Init, I tried:
>
>
>SET CLASSLIB TO MyPages.Vcx
>This.AddObject("Page1", "pagBase")
>This.AddObject("Page2", "pagBase")
>
>
>I got no result, until I went to the Property Sheet
>and set PageCount to 1. Then after running the test
>form, I have 3 pages.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform