>> Has anyone an idea how to do this without duplicating all the code >> from InsetMathHull ? >> >> I somehow want to execute a lot of functions first in some sort of >> InsetPreview. Like a virtual function with InsetPreview a child of >> InsetERT, but it can't be really a child, otherwise InsetPreview >> should be a child of InsetERT and InsetMathHull. > >Hum, InsetPreview doesn't have to be an Inset. So both InsetERT >and InsetMathHull can inherit InsetPreview in addition to >InsetText and InsetMath, without worrying about virtual >inheritance. But if you really want InsetPreview to be an >Inset, virtual inheritance will do.
Yes, I tried that, but the problem was that a lot of the functionality has to go to the beginning of the ::editXY ::edit ::metrics functions that are all inherited from Inset (?). Besides, the code in InsetPreview had to call other Inset members which wasn't possible anymore. Anyway.. Why not making a real Inset InsetPreview (:public InsetText) that previews what is inside. This can then be a mixture of ERTs, normal text and maybe graphics.. In that way, you can use it for psfrag and stuff like that: \begin InsetPreview \begin ERT \psfrag{a}{b} \end ERT \begin InsetGraphics \file a.eps \end InsetGraphics \end InsetPreview Switching between a previewed ERT and normal ERT is then moving it in or out of the InsetPreview. Vincent