Hello,
on a Openoffice wiki page i found some JAVA code to add a image into a
GridControl Row
what i need is how to make a "Object array" in BASIC who supports
graphics and octher data
thanks for any hint
Fernand
The main change in milestone 3 regarding DataModel is the possibility to
add not only text but also images. That's why addRow-method has as
second parameter no more string array but object array. Futher supported
types are int, double, float.
/Java/
Object dataModel= xMultiComponentFactory.createInstanceWithContext(
"com.sun.star.awt.grid.DefaultGridDataModel", m_xContext);
XGridDataModel xGridDataModel= (XGridDataModel) UnoRuntime.queryInterface(
XGridDataModel.class, dataModel);
Object oGraphicProvider=
xMultiComponentFactory.createInstanceWithContext("com.sun.star.graphic.GraphicProvider",
m_xContext);
XGraphicProvider xGraphicProvider= (XGraphicProvider)
UnoRuntime.queryInterface(XGraphicProvider.class, oGraphicProvider);
// create the graphic object
PropertyValue[] aPropertyValues= new PropertyValue[1];
PropertyValue aPropertyValue= new PropertyValue();
aPropertyValue.Name = "URL";
aPropertyValue.Value = "file:///c:/myimages/testimage.png";
aPropertyValues[0] = aPropertyValue;
XGraphic xGraphic= xGraphicProvider.queryGraphic(aPropertyValues);
xGridDataModel.addRow("1",new Object[]{xGraphic,"1,2",1.3});
//one row which contains only text
xGridDataModel.addRow("2",new Object[] {"2,1","2,2","1,3"} );
--
To unsubscribe e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted