Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Baseclasses not te be subclassed
Message
De
22/10/1998 09:26:46
 
 
À
22/10/1998 06:34:47
Marco Beuk
Innovero Software Solutions
The Hague, Pays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00149269
Message ID:
00149342
Vues:
17
>Columns, headers and pages cannot (visualy) be subclassed.
>Why is this and how should one deal with this?
>
>Example: when a user clicks a page in a pageframe i want its caption to turn bold so the user can see he/she has seen the page.
>I now have 'This.FontBold=.T.' in the Click() of all the applications pages (about 70 pages total). Now the user decided he/she doesn't want the page's caption to turn bold but red. Now i have to change the code at 70 places! This cannot be the goal of OOP.
>

Well... if you followed rule number one this will be easy!

You should NOT use the base classes directly. Subclass EVERY base class. Then use those classes in your ap.

So, if you did the above... you are using MyPageFrame as opposed to the pageframe base class.

In the MyPageFrame class you put your code in the click event...

thisform.FontBold = .t.

Now... that code will be in EVERY page frame you use... as long as you use MyPageFrame when you build your forms.

So, see how simple it would be to change it to...

thiform.ForeColor = rgb(255,0,0)

??????????????

BOb
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform