mrjt Messages: 705 Registered: March 2007 Location: London
Contributor
I need to overload the Paint method of the Switch ctrl to add some extra behaviour, but this is impossible because it uses some members that are declared as 'private'.
The offending members are:
int pushindex;
[...]
Vector<int> posx;
int linecy;
int light;
I can see why these are private, but is there anything that can be done? IMO it is quite important that a Ctrl's Paint method is reproducable by sub-classes since it is quite commonly changed (at least by me ), and the only other solution is to copy the whole class.
I need to overload the Paint method of the Switch ctrl to add some extra behaviour, but this is impossible because it uses some members that are declared as 'private'.
The offending members are:
int pushindex;
[...]
Vector<int> posx;
int linecy;
int light;
I can see why these are private, but is there anything that can be done? IMO it is quite important that a Ctrl's Paint method is reproducable by sub-classes since it is quite commonly changed (at least by me ), and the only other solution is to copy the whole class.
Cheers,
James
We have discussed this some time ago... I do not think that everything should be accessible. The trouble is that these things are implementation and implementation can change, breaking (potentially) a lot of code.
Instead, if there is something missing in Switch, suggest improvements. Or maybe copy the class as you suggest and later we can merge them back.