Matthias Melcher schrieb:
>
> On 11.07.2011, at 16:37, Edzard Egberts wrote:
>> I continue not to like this, to much "every" and it feels to me,
>> it's not the way "virtual" is ment for. Wrapper should be a layer,
>> overwriting virtual.
>
> I mean "virtual" functions. This is pretty much limited to
> fltk3::Widget::show, ::hide, ::draw, ::handle, and the destructor.
Is there a difference between "virtual" and virtual?
I mean something like that:
class Fl_Widget: public FL3::Fl_Widget
{
public:
Fl_Widget(int x, int y, int w, int h, const char* l= 0):
Fl3_Widget(x, y, w, h, l)
{}
protected:
virtual int handle(int event)
{
do_wrapper();
return FL3::Fl_Widget::handle(event);
}
};
Does this make sense? This would just replace some basic types, but also
could use old code and header files.
Also I know wrapper like this, only keeping the interface:
Header:
class Fl3_Widget;
class Fl_Widget
{
// Declare Methods compatible to old Fl_Widget
// add:
Fl3_Widget* pW3;
};
Code:
Fl_Widget::Fl_Widget(...): pW3(new Fl3_Widget(...)) {}
Fl_Widget::Any_Method(para P)
{
pW3->Any_Method(Do_Something_to_Wrap_To(P));
}
This way makes it necessary, to replace all old classes by interfaced
new code. But none of these make it necessary, to insert wrapper layer
into the new code, so what are you doing?
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk