[gnome-db] Formatting numbers in Form/Grid



Does libgda and/or libgnomedb somehow already support showing numbers or
dates in a different format? By looking at the docs and the code, I
could not find a way to do it. It seems that such a feature would have
to be added to GdaDataHandlerNumeric and/or a custom DataHandler.

Then, a way would be required to assign that data handler to a cell
renderer of a GnomeDbGrid. The GnomeDbDataCellRendererTextual does not
allow to change the DataHandler at runtime though. Is there a particular
reason for this or would it be possible to make a property out of the
data handler that can be changed later on? Finally, the grid and form
widgets would have to expose the cell renderers respectively entry
widgets (perhaps this is already the case via GtkTreeView API, but
adding explicit API seems cleaner).

I am however not sure how to specify other formats. The first thing that
came to my mind was a printf-like format string that could be given to
the data handler, but as one data handler handles multiple native types
(ints of different size, floats, etc.), we would have to make sure that
the format string is compatible. Perhaps it would be better to add two
or three separate data handlers for the most common types (say int, uint
and double) that allow formatting. Any suggestions?

If we agree on an API, I would come up with a patch for this.

Regards,
Armin

Attachment: signature.asc
Description: This is a digitally signed message part



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