Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug/Bad Behavior SubClassing, How to Corrupt a class!
Message
From
30/06/2004 13:38:34
 
 
To
30/06/2004 12:34:30
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00919001
Message ID:
00919188
Views:
12
Tracy,

>This would be a problem for me if pagenames were not modifiable. Hopefully it only has to do with subclassing perhaps? I have not experienced this error yet. I create forms that have more than 20 pages but the actual pages displayed to the user are determined on the fly - typically only 5 or so. In the init of the form I call a form method that changes the pagenames that are displayed to the user to match the current order of the pages so code in my keypress event will always run correctly. I do this so I can set focus to the correct page and control on the page when the user presses the pageup or pagedown keys, etc.

Open up the VCX of a class where you only overwrite some properties on objects aggregated in the parentclass. If you look at the properties memo field you will see some reason to be afraid of changing names afterwards <g>. It does pose some problems, if you have existing app's and try to slip pages as leaf classes "under". I sometimes succeed by hacking the ?cx files (If you do this in the IDE all your properties are GONE after fair warning <g>), but it is so much trouble I usually work around it by eventbinding or adding properties in the Init. The methods for this can be subclassed, and I am also at least a quarter OO. For new projects (if you are into pageframes) add a leaf class into your pgfbase classes. Then it is quite easy to insert new superclasses. The other ways are ... interesting <bg>.

All and all I like to be able to try out these things - you fix a lot of things by doing some dirty work. Still, it is more dangerous: backup and/or SourceSafe can be mighty useful...

rgds

thomas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform