I have a customized version of rpreview, which has a few additional buttons.
Seeing that rpreview in 7.12 is now a class, I attempt to inherit from it and place my changes in this new class. So I create a new class TPreview2, copy over method ::BuildButtonBar() and started to add in the additional buttons.
What stump me during this attempt is l2007 is declared as a static var in TPreview not as a class data. What's the correct way for me to proceed? Simply create a static l2007 var in TPreview2 or modify TPreview and change the var to a class data?
What's actually the rule of thumb when inheriting classes that make use of static vars? TPrinter is another class that comes to mind.
TIA
How to inherit from 7.12's rpreview class?
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Stefan,
A DATA belongs to an object. A CLASSDATA belongs to a Class.
For example:Imagine that you want to create a class TCar, and you want to know how many cars have been produced. Then you need a CLASSDATA nCars that will be a "shared" value from all Cars objects.
So everytime that a car is created, you do oCar:nCars++ and nCars is the same CLASSDATA shared from all Cars objects.
There are multiple cars, and just one nCars value.
A DATA belongs to an object. A CLASSDATA belongs to a Class.
For example:Imagine that you want to create a class TCar, and you want to know how many cars have been produced. Then you need a CLASSDATA nCars that will be a "shared" value from all Cars objects.
So everytime that a car is created, you do oCar:nCars++ and nCars is the same CLASSDATA shared from all Cars objects.
There are multiple cars, and just one nCars value.
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany