Niklas Nebel wrote:
On 06/13/09 11:45, Jan Holst Jensen wrote:
I would like to be able to render cell content in an owner-draw fashion.
An intuitive way to control this for the end-user (or at least for
me) would be to add a new format to "Format Cells". I was thinking
along the lines of adding an item to "Numbers"->"Category", say "SVG
image", and cells containing SVG instructions would display the SVG
graphics instead of the SVG text. Alternatively a "Format" could be
added to the "User-defined" category ?
The actual rendering instructions that I would like to support are
not SVG but "protein rendering info" as shown at
http://www.biochemfusion.com/downloads/protein_renderer.html.
However, the two problems are equivalent and the rendering info could
easily be translated to SVG if necessary.
Can this be done as an UNO extension or would this need to added
directly into Calc as native functionality ?
PS: I've seen this implemented by a number of vendors in Excel but
trust me - you don't really want to know how they do it (seriously
fun hacking necessary) :-).
There is no such API available. But an extension could register as a
listener for value changes, and then insert shapes into the document
for the desired output. Or would that already fall into the "don't
really want to know" category?
Whether it falls into that category really depends on how it behaves
:-). Are you suggesting adding shapes on top of the cells that I want
custom rendered - and then move the shapes whenever cells change so the
shapes follow the underlying data around ? This is very much like the
"you don't want to know" solutions that I hint at. Not easy to get
working in a robust fashion - uh-oh.
But maybe that is not what you suggested - can I really embed
pictures/shapes in a cell so they are truly in-line in-the-cell ?
My experience with adding graphics to a sheet (in both Excel and Calc)
has always been that the graphics will not follow data in the cell.
Let's say you have an address book in a sheet - column A holds names and
column B holds the people's pictures (that is: pictures are put in the
document on top of column B). As soon as you e.g. change the sort order
of column A a name may then be matched with some random picture since
the pictures are not moved when cell data is shuffled around. This is
the number one problem with all solution attempts that just add standard
graphics to a sheet.
Cheers
-- Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]