Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object Oriented Programming
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00134380
Message ID:
00138788
Views:
9
Hi Mark,

Sorry, during the Refresh my Browser got somehow confused and set the focus to the Send button.... Can I delete a message in the Browser view?

OK, forget the last part of the previous message after subclassing, here it continues.... and sorry for the bad formatting, somehow it doesn't seem to like tabs. Geez, I'm really a newbie to the UT.

Assume I want subclass the progressbar:

*=====================================================
* New progressbar control
*=====================================================
Parameter toThis, tcMethod, tuPar1, tuPar2, tuPar3,;
tuPar4, tuPar5

Private lcMethod, luReturn
lcmethod = Lower(tcmethod)
Do Case
Case lcMethod ="setvalue"
luReturn = SetValue(@toThis, tuPar1)
Otherwise
luReturn = ProgBar(@toThis, tcMethod, tuPar1, ;
tuPar2, tuPar3, tuPar4, tuPar5, tuPar6 )
Endcase

Return luReturn

*=====================================================
* Set value
*=====================================================
Procedure SetValue
Parameter toThis, tnValue

* some code before I call the default code

* DoDefault(tnValue)
=progBar(@toThis,"SetValue",tnValue)

* some code afterwards

Return

I don't have to repeat code, and still get all the behaviour defined in the parent class. That's just a simple approach which doesn't support array properties for example, but you get the idea. I've designed some more complex approaches that store classes in tables (sounds familar? *g*), support arrays and don't suffer the limitation due to the 32 available DO levels. Unfortunately, I didn't had the time to implement it.

Christof
--
Christof
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform