<div dir="ltr"><br>
<div class="gmail_quote">
<div dir="ltr">
<div>Hi all!</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp; Long time since there&#39;s been activity on this group. I thought I will initiate something. I have&nbsp;been a wee bit busy with other things, and was not in Delhi for a while. But, I did manage to do some testing for SocialCalc. </div>

<div>&nbsp;</div>
<div>The good news is that xocom is working perfectly. Infact, I have been working on making the toolbar.py file for the release of this activity. While on it, I have made extensive use of xocom.&nbsp;I made the toolbar in Python, and used xocom to create the webview,etc. I also managed to interface the toolbar.py file with the socialcalc.py file. I have attached the relevent files with this email and also at <a href="http://wiki.laptop.org/go/Image:SocialCalc-toolbar.zip" target="_blank">http://wiki.laptop.org/go/Image:SocialCalc-toolbar.zip</a> .<br>
I had mailed earlier with some doubts, some of which actually got cleared when I studied the toolbars of other activities. I thought you might be interested to know exactly how xocom is used in the toolbar. In activities like &quot;Abiword&quot; I noticed that the web view, etc are created using hulahop and webview. As xocom has defined webviews, I have created a class SpredSheetActivityToolbar that uses xocom to create webviews. My toolbar.py file is as follows, these are some code snippets:<br>
&nbsp;<br>This is the main spreadsheet activity toolbar, It has used xocom to create the webview..<br>&nbsp;<br>class SpreadSheetActivityToolbar: <br>&nbsp;&nbsp;&nbsp; def __init__(self, activity, toolbox, self_canvas):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self._activity = activity<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.set_canvas( <font style="BACKGROUND-COLOR: #ffcc00">xocom.create_webview()</font> )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self._activity_toolbar = toolbox.get_activity_toolbar()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self._keep_palette = self._activity_toolbar.keep.get_palette()<br>
.........................<br></div>
<div>Then, I have created another class, for the edit toolbar. Its definition is as follows:<br>class SpreadsheetEditToolbar(EditToolbar):<br>&nbsp;&nbsp;&nbsp; def __init__(self, toolbox, self_canvas):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EditToolbar.__init__(self)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.set_canvas(<font style="BACKGROUND-COLOR: #ffcc00"> xocom.create_webview()</font> )<br>.........<br>This is followed by the general definition of edit toolbar, copy,paste,undo,redo, etc. There is also a viewtoolbar class, for viewing it on hulahoop. <br>
Then of course, I had to make changes in the SOcialCalc.py file in order to call this toolbar interface. Here are the details of the SocialCalc.py file:<br>To interface it with toolbar.py, I have imported the classes from this file as:<br>
&nbsp;<br>import toolbar<br>from toolbar import SpreadSheetActivityToolbar, SpreadsheetEditToolbar, ViewToolbar<br>Then, while creating the toolbar, I have called these functions as:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; toolbox = activity.ActivityToolbox(self)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.set_toolbox(toolbox)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; toolbox.show()<br>Separately calling edit toolbar:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self._edit_toolbar = SpreadsheetEditToolbar(self, self._edit_toolbar, set_canvas)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; toolbox.add_toolbar(_(&#39;Edit&#39;),self._edit_toolbar)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self._edit_toolbar.show()<br>And similarly calling the Viewtoolbar class:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; view_toolbar = ViewToolbar (self.set_canvas)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.set_canvas.show()<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>I had a lot of fun doing this integration work. I am facing a few&nbsp;problems dealing with the Javascript aspect of this whole activity, but to deal with that I am studying JS in detail. So still an advantage. I hope you all will be helping me out with the queries!</div>

<div>Apart from that, I also tested the new build for various simulated situations.&nbsp;I have taken snapshots of the same. But due to problems in my net connection, they are not getting attached. I will definitely mail them by Monday.<br>
<br>Thanks and warm regards,<br><font color="#888888">Preeti</font></div></div></div><br></div>