<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=windows-1252">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    on a Openoffice wiki page i found some JAVA code to add a image into
    a GridControl Row<br>
    what i need is how to make a "Object array" in BASIC who supports
    graphics and octher data<br>
    <br>
    thanks for any hint<br>
    <br>
    <p>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.
    </p>
    <p><i>Java</i>
    </p>
    <div dir="ltr" class="mw-geshi mw-code mw-content-ltr">
      <div class="java source-java">
        <pre class="de1"> <span class="kw3">Object</span> dataModel <span class="sy0">=</span> xMultiComponentFactory.<span class="me1">createInstanceWithContext</span><span class="br0">(</span>
                <span class="st0">"com.sun.star.awt.grid.DefaultGridDataModel"</span>, m_xContext<span class="br0">)</span><span class="sy0">;</span>
 XGridDataModel xGridDataModel <span class="sy0">=</span> <span class="br0">(</span>XGridDataModel<span class="br0">)</span> UnoRuntime.<span class="me1">queryInterface</span><span class="br0">(</span>
                XGridDataModel.<span class="kw1">class</span>, dataModel<span class="br0">)</span><span class="sy0">;</span>
 <span class="kw3">Object</span> oGraphicProvider <span class="sy0">=</span> xMultiComponentFactory.<span class="me1">createInstanceWithContext</span><span class="br0">(</span><span class="st0">"com.sun.star.graphic.GraphicProvider"</span>, m_xContext<span class="br0">)</span><span class="sy0">;</span>
 XGraphicProvider xGraphicProvider <span class="sy0">=</span> <span class="br0">(</span>XGraphicProvider<span class="br0">)</span>     UnoRuntime.<span class="me1">queryInterface</span><span class="br0">(</span>XGraphicProvider.<span class="kw1">class</span>, oGraphicProvider<span class="br0">)</span><span class="sy0">;</span>
 <span class="co1">// create the graphic object</span>
 PropertyValue<span class="br0">[</span><span class="br0">]</span> aPropertyValues <span class="sy0">=</span> <span class="kw1">new</span> PropertyValue<span class="br0">[</span><span class="nu0">1</span><span class="br0">]</span><span class="sy0">;</span>
 PropertyValue aPropertyValue <span class="sy0">=</span> <span class="kw1">new</span> PropertyValue<span class="br0">(</span><span class="br0">)</span><span class="sy0">;</span>
 aPropertyValue.<span class="kw3">Name</span> <span class="sy0">=</span> <span class="st0">"URL"</span><span class="sy0">;</span>
 aPropertyValue.<span class="me1">Value</span> <span class="sy0">=</span> <span class="st0"><a class="moz-txt-link-rfc2396E" href="file:///c:/myimages/testimage.png">"file:///c:/myimages/testimage.png"</a></span><span class="sy0">;</span>
 aPropertyValues<span class="br0">[</span><span class="nu0">0</span><span class="br0">]</span> <span class="sy0">=</span> aPropertyValue<span class="sy0">;</span>
 XGraphic xGraphic <span class="sy0">=</span> xGraphicProvider.<span class="me1">queryGraphic</span><span class="br0">(</span>aPropertyValues<span class="br0">)</span><span class="sy0">;</span>
 xGridDataModel.<span class="me1">addRow</span><span class="br0">(</span><span class="st0">"1"</span>, <span class="kw1">new</span> <span class="kw3">Object</span><span class="br0">[</span><span class="br0">]</span><span class="br0">{</span>xGraphic, <span class="st0">"1,2"</span>, <span class="nu0">1.3</span><span class="br0">}</span><span class="br0">)</span><span class="sy0">;</span>
 <span class="co1">//one row which contains only text</span>
 xGridDataModel.<span class="me1">addRow</span><span class="br0">(</span><span class="st0">"2"</span>, <span class="kw1">new</span> <span class="kw3">Object</span><span class="br0">[</span><span class="br0">]</span> <span class="br0">{</span><span class="st0">"2,1"</span>,<span class="st0">"2,2"</span>, <span class="st0">"1,3"</span><span class="br0">}</span> <span class="br0">)</span><span class="sy0">;</span></pre>
      </div>
    </div>
    <br>
  </body>
</html>