Extending IDrawDecorator | developer.brewmp.com Extending IDrawDecorator | developer.brewmp.com

Developer

Extending IDrawDecorator

I am trying to extend the IDrawDecorator (I need override both the drawhandler and IntersectOpaque).

It's easy enough to create IMyExtention, however it seems that I can only inherit the VTBL, not the implementation.
I would have to reimplement ALL Widget, Decorator, DrawDecorator, etc. functions.
That seems a lot of work, especially since I only want to override the _IntersectOpaque() method.

I doubt I could simply implement them in terms of IWIDGET_XXXX calls because I don't have the original DrawDecorator struct and implementation, nor do I have access to the original DrawDecorator functions...

My best idea is to create a DrawDecorator member (aggregation, or composition, in OO speak) in my implementation, and then forward everything to it. It still a lot of work forwarding many many functions, and it is also prone to bugs.

Is there a better way? Am I not understanding the docs correctly?

You have understood the docs correctly. You have also come up with the correct solution. Create a draw decorator and forward everything to it.
-Erik

You have understood the docs correctly. You have also come up with the correct solution. Create a draw decorator and forward everything to it.
-Erik