Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--activity.py63
-rw-r--r--canvas.py55
-rw-r--r--dibujo.svg125
4 files changed, 246 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..95401e0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+*.pyc
+*.pyo
+*~
diff --git a/activity.py b/activity.py
index 792d600..312ace3 100644
--- a/activity.py
+++ b/activity.py
@@ -1 +1,64 @@
+# Copyright (C) 2012 Cristhofer Travieso <cristhofert97@gmail.com>
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St,
+
+from gi.repository import Gtk
+from Canvas import canvas
+
+from sugar3.activity import activity
+from sugar3.activity.widgets import StopButton
+from sugar3.activity.widgets import ActivityToolbarButton
+from sugar3.graphics.toolbarbox import ToolbarBox
+from sugar3.graphics.toolbutton import ToolButton
+
+class BedroomActivity(activity.Activity):
+ def __init__(self, handle):
+ activity.Activity.__init__(self, handle, True)
+
+ self.max_participants = 1
+
+ # Toolbar
+ toolbarbox = ToolbarBox()
+
+ activity_button = ActivityToolbarButton(self)
+
+ toolbarbox.toolbar.insert(activity_button, 0)
+
+ up_button = ToolButton()
+ up_button.icon = 'up.svg'
+ up_button.connect('clicked', self.up_cb)
+ toolbarbox.toolbar.insert(up_button, 0)
+
+ separator = Gtk.SeparatorToolItem()
+ separator.set_expand(True)
+ separator.set_draw(False)
+ toolbarbox.toolbar.insert(separator, -1)
+
+ stopbtn = StopButton(self)
+ toolbarbox.toolbar.insert(stopbtn, -1)
+
+ self.set_toolbar_box(toolbarbox)
+
+ #Canvas
+ self.set_canvas(Canvas)
+
+ self.show_all()
+
+ def up_cb(self, widget):
+ l = canvas.entry.set_text().split('/')
+ if l[-1] == '':
+ canvas.entry.get_text(l[-2])
+ else:
+ canvas.entry.get_text(l[-1])
diff --git a/canvas.py b/canvas.py
index 792d600..aa0e19f 100644
--- a/canvas.py
+++ b/canvas.py
@@ -1 +1,56 @@
+# Copyright (C) 2013 Cristhofer Travieso <cristhofert97@gmail.com>
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St,
+
+from gi.repository import Gtk
+from gi.repository import Gdk
+
+class Canvas(Gtk.HBox):
+ def __init__(self):
+ Gtk.HBox.__init__(self)
+
+ self.presentation = []#save the presentation
+
+ #panel
+
+ scroll = Gtk.ScrolledWindow()
+ self.pack_start(scroll, True, True, 0)
+
+ liststore = Gtk.ListStore(str)
+
+ for num in range(0, len(self.presentation)):
+ liststore.append([num])
+
+ # el contenedor de las filas
+ treeview = Gtk.TreeView()
+ # moldear el contenedor
+ treeview.set_model(liststore)
+
+ # Crear la columna para la lista
+ treeview.append_column(Gtk.TreeViewColumn('Slide', Gtk.CellRendererText(), text=0))
+ scroll.add(treeview)
+
+
+ self.show_all()
+
+if __name__ == "__main__":
+ window = Gtk.Window()
+ window.connect('destroy', lambda w: Gtk.main_quit())
+ c = Canvas()
+ window.add(c)
+ window.set_title('Presentation')
+ window.maximize()
+ window.show()
+ Gtk.main()
diff --git a/dibujo.svg b/dibujo.svg
new file mode 100644
index 0000000..6121293
--- /dev/null
+++ b/dibujo.svg
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="1200"
+ height="700"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="Nuevo documento 1">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.35"
+ inkscape:cx="261.19118"
+ inkscape:cy="520"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1366"
+ inkscape:window-height="709"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Capa 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-352.36218)">
+ <rect
+ style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
+ id="rect2985"
+ width="1228.5714"
+ height="77.14286"
+ x="-8.5714283"
+ y="-5.7142859"
+ transform="translate(0,352.36218)" />
+ <text
+ xml:space="preserve"
+ style="font-size:84.53792572px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+ x="985.62292"
+ y="463.11639"
+ id="text3755"
+ sodipodi:linespacing="125%"
+ transform="scale(1.1230816,0.89040724)"><tspan
+ sodipodi:role="line"
+ id="tspan3757"
+ x="985.62292"
+ y="463.11639"
+ style="fill:#ffffff;fill-opacity:1">X</tspan></text>
+ <path
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 259.71429,409.50504 -2.85715,671.42856"
+ id="path3759"
+ inkscape:connector-curvature="0" />
+ <rect
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:1;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none"
+ id="rect3761"
+ width="751.42859"
+ height="494.28571"
+ x="354.28571"
+ y="154.28572"
+ transform="translate(0,352.36218)" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-width:2.02679491;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="rect3763"
+ width="202.83072"
+ height="93.907036"
+ x="28.584641"
+ y="476.94699" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-width:2.02679491;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="rect3763-0"
+ width="202.83072"
+ height="93.907036"
+ x="30.013023"
+ y="594.33081" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-width:2.02679491;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="rect3763-05"
+ width="202.83072"
+ height="93.907036"
+ x="27.156252"
+ y="711.7146" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-width:2.02679491;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="rect3763-7"
+ width="202.83072"
+ height="93.907036"
+ x="29.727346"
+ y="819.12079" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-width:2.02679491;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="rect3763-9"
+ width="202.83072"
+ height="93.907036"
+ x="29.441669"
+ y="923.29889" />
+ </g>
+</svg>