Page 1 of 1

Subclassing TaharezLook widgets

Posted: Tue Mar 08, 2005 21:23
by rincewind
Hi,

I'm currently trying to subclass Widgets from the TaharezLook and put then in second dll that is added as a second WindowSet to my GUIScheme, so I can use the derived widgets together with normal TL-Widgets.
Now when I subclass widgets from TL, I have to include for example TLButton.h (and link to TaharezLook(_d).lib).

Problem is now that there is already a registerFactory in the TL-Library.

I must admit that I can't see a solution to it. Has anybody successfully managed to subclass TL-Widgets (or WindowsLook-Widgets at that)? Maybe I missed something obvious.
Of course I could just edit the TL-source directly, but then I would always have to work with a patched version of the sourcecode and repatch for every update. Also, I think the dll-system should provide exactly this.

Thanks for any pointers,

Rincewind

Re: Subclassing TaharezLook widgets

Posted: Wed Mar 09, 2005 10:47
by CrazyEddie
If I were to move the declaration of the registerFactory function into it's own header, which does not get included in any of the TL headers, I think that would solve the issue.

Let me know and I'll do that by the end of the week.

CE.

Re: Subclassing TaharezLook widgets

Posted: Wed Mar 09, 2005 11:11
by rincewind
I'm not quite sure if that would solve the problem, as when the linker tries to resolve the symbol registerFactory, it will still see the one in TaharezLook.lib and the one I put in one of my cpp files.
So I guess the only way would be to have one TaharezLook lib (and dll) that provides all the widgets and another one that only has the entry point (and loads the real dll automatically since it's linked to it's lib).

I know that this would involve quite some rearranging of the project files, etc. So if you think it's not worth the hassle, I can understand.

Maybe someone with some more knowledge about C++ linking, etc can see a simpler solution.

Greetings,

Rincewind

Re: Subclassing TaharezLook widgets

Posted: Wed Mar 09, 2005 12:10
by CrazyEddie
Yeah, I never considered the lib/linking issues, lol. Btw, that's just plain ordinary C linkage there, not C++.

I think that while the the two dlls approach would resolve the conflict, it would also overcomplicate things for more 'normal' uses.

The fact, really, is that the current look modules were not designed to have classes inherit from them, although I did not really want to give that as an answer :?

It should also be noted that the current look modules will shortly be depreciated in favour of the "Falagard" widget set. Here, "shortly" means months rather tahn weeks though.

CE.