Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Naming conventions for custom methods?
Message
From
20/11/2008 20:05:30
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01362229
Message ID:
01363396
Views:
43
>>OK, nothing so earth-shattering, but it's a nice thing that I've found quite handy in several situations. Imagine that I want to impose new behavior on several controls, few of which I can't even subclass - or there's no need to subclass them for this one time. I'll simply bindevent() their gotfocus and lostfocus, and addproperty() in the first, use it in the second. The code is in only one place, no need to visit or subclass each. The code may, for example, save a few of the old properties into .saveXXX properties and restore them on lostfocus, without writing a single byte to any of the classes - everything is in the binding object.
>
>If you're going to change code, why don't you just add the property to the class? This way still seems a little "Look, Ma, no hands" to me, i.e. silly code tricks.

Which keeps working on new objects if someone else adds them to the form, new classes which may appear etc, and you don't even have to remember to add the feature to them. It is "look, no hands", no less.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform