How to Introduce a Parent Class ...
Time and again, we find the need to introduce, a class of our own which we feel should become a parent for many of the other classes.
For example, take the forms...
Some programmers who are new to VFP, create applications without subclassing the Base Classes and so each of the forms is based on the VFPs FormBase.
Then the need arises to introduce a common functionality to all the forms created.. or a group of forms.
So what we have to do is introduce a FormBaseNew Subclassed from FormBase and then make all the other related forms sub-class from this new FormBase.
The way to do is...
Open The Project
Select Classes Tab
Create a new class .. Example.. a FormBaseNew based on the FormBase class.
Then.. Choose from the VFP Menu .. Tools..
Click on Class Browser..
Click OPEN (OPEN ICON)...
SELECT THE CLASS (.vcx) file required to be modified and open it
Then.. in the result window..
SELECT any of the Forms which need to be redefined...
Then Click on REDEFINE icon on that window...
Select the FormBaseNew as the class and proceed as it guides...
You will notice that the classes are refined and the Selected form become the child of the FormBaseNew
Repeat the steps for all the forms which need to be modified so...
The same method can be used to modify the classes of other types..
Remember to backup the project before doing any of these class modifications, or else, you could end up in trouble if some wrong clickings were made by you.
Best of Luck !
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
Time and again, we find the need to introduce, a class of our own which we feel should become a parent for many of the other classes.
For example, take the forms...
Some programmers who are new to VFP, create applications without subclassing the Base Classes and so each of the forms is based on the VFPs FormBase.
Then the need arises to introduce a common functionality to all the forms created.. or a group of forms.
So what we have to do is introduce a FormBaseNew Subclassed from FormBase and then make all the other related forms sub-class from this new FormBase.
The way to do is...
Open The Project
Select Classes Tab
Create a new class .. Example.. a FormBaseNew based on the FormBase class.
Then.. Choose from the VFP Menu .. Tools..
Click on Class Browser..
Click OPEN (OPEN ICON)...
SELECT THE CLASS (.vcx) file required to be modified and open it
Then.. in the result window..
SELECT any of the Forms which need to be redefined...
Then Click on REDEFINE icon on that window...
Select the FormBaseNew as the class and proceed as it guides...
You will notice that the classes are refined and the Selected form become the child of the FormBaseNew
Repeat the steps for all the forms which need to be modified so...
The same method can be used to modify the classes of other types..
Remember to backup the project before doing any of these class modifications, or else, you could end up in trouble if some wrong clickings were made by you.
Best of Luck !
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com