Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP6SP5 - Pages in a Pageframe PageOrder resets
Message
De
31/05/2003 15:56:29
Walter Meester
HoogkarspelPays-Bas
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00793853
Message ID:
00794898
Vues:
21
David,

FWIW, I find it more produvtive to change the header class in the form or class directlty. I store a custom header class in a classlibrary and just change the class and classloc fields to the this class in stead of changing it at runtime.

It saves the trouble (and performance) of redirecting the properties and methods from the standard header class to your own one.

As to the page class: One thing that justifies a page class is to avoid to have a THIS.REFRESH in about every ACTIVE event of every page I use. It has alway been a pain in the butt in the versions before VFP8 if you´d ask me...

Walter,

>Bhavbhuti,
>
>Upgrade to VFP8 and you can directly use your own Page subclasses.
>
>In earlier versions you can swap out classes. I did this in one of my Grid subclasses to swap out Header class objects.
>
>
for each loCol in this.Columns
>   with loCol
>      .Header1.Alignment = 0
>      if ( .Header1.Class == "Header" )
>         lcX = .Header1.Caption
>         .RemoveObject( "Header1" )
>         .AddObject( "Header1", "hdrSeeker", "" )
>         .Header1.Caption = lcX
>         .Header1.FontBold = .f.
>      endif
>   endwith
>endfor
>
>This let me design the grid completely visually but change it at runtime.
>
>I never really came up with a good case to need a page subclass. Swapping them out will be a little bit harder because you'll have to "move" all of the objects contained by one page to the other. But since a control can't change it's containership once instantiated you'd have to replicate the controls and that can be problematic. You are probably better off using a container of controls that won't get instantiated until your new page exists.
>
>All this it too much work and inconvience for my tastes. Using the PageRefresher class from my website on my cPageFrame class has really meant that I've never needed a Page subclass.
>
>>I guess custom properties on the pageframe are the name of the game. Incidently I had recently put up a thread asking if it is possible to switch the base class of say a page. At design time I use the default VFP page that I get. Define a programatical page class with my customizations MyPage. At run time the form switches the base class of all the pages from Page to MyPage thus take advantage of MyPage class.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform