lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] calculation summaries


From: Vadim Zeitlin
Subject: [lmi] calculation summaries
Date: Fri, 8 Sep 2006 01:01:18 +0200

 Hello,

 I'd like to discuss the different possibilities for (re)implementing the
calculation summaries display in LMI. First of all, after studying the
alternatives, I think there is no good reason to switch away from using
HTML. The other possibility we considered was implementing the reports
by just outputting them directly into a wxDC but while this is certainly
doable, using HTML is much more flexible and it will be easier to modify
the reports later. We also thought about using an XSLT processor for
summaries like it's already done for the illustrations printing but there
just doesn't seem to be any C++ library doing what we need which would work
under both Unix and Windows (we looked at xmlroff and mdc-xsl but they're
both Unix only). So we concluded that using HTML was the best we could do.
Please let me know if anybody disagrees with this.


 But, of course, there are further questions. The main one is whether we
want to continue using wxHTML or if we want to be able to use CSS in our
HTML. If this is the case, we can use wxActiveX class to embed Internet
Explorer into LMI under Windows and use wxMozilla
(http://wxmozilla.sourceforge.net/) to have equivalent functionality under
Unix. But doing this will require quite some work, notably on the build
system side (building wxMozilla is not for faint of heart), so I think it
would be better to continue using wxHTML unless we really, really need
something which it doesn't provide. BTW, Greg mentioned in the past that
wxHTML and Mozilla didn't render the tables in the same way, but we
couldn't reproduce it: the current HTML code seems to be rendered by
Mozilla just fine.


 Independently of the choice of the HTML engine, there is also another
choice to make: should we hard code HTML in the C++ code, as it's done now,
or extract it in a separate template file and include a "template engine"
in our C++ code which would inject the data into this HTML template. Using
an external template should give us much more flexibility and I don't see
any drawbacks in doing it, so I suppose this is what we're going to do.
Then the last question is how exactly to fill the HTML template.
Surprisingly, there are very few C++ template engine libraries, in fact we
could only find one: TEng (http://teng.sourceforge.net/). It seems to do
exactly what we need and while it does have some problems (insufficient
and not always clear documentation and rather strange and too verbose to my
taste syntax, see http://teng.sourceforge.net/?page=example), I think we
should still use it and avoid reinventing the same thing ourselves which,
while more satisfying from intellectual point of view, would almost
certainly take much more time. The main problem with TEng is that we'd need
to include yet another dependency on LMI cvs as it's certainly not wide
spread enough to rely on it being already installed. If (and only if)
adding this dependency is really undesirable, then we should look at
implementing the template engine with the functionality we need ourselves.


 To summarize, here is what I propose to do:

1. Extract HTML from the code in a separate template file
2. Use TEng to produce HTML from the template file and our data
3. Use wxHtmlWindow to display it

 Does this sound like a good plan and, if so, should we start doing it?

 Thanks in advance for any comments,
VZ





reply via email to

[Prev in Thread] Current Thread [Next in Thread]