From 40c895937c2dbbcd09ec98ae2a1cb532e0d3be38 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 08 Jul 2008 21:57:10 +0000 Subject: Added sugar menu --- diff --git a/activity.py b/activity.py index 4d3638b..11702fe 100644 --- a/activity.py +++ b/activity.py @@ -13,21 +13,69 @@ class PhysicsActivity(olpcgames.PyGameActivity): toolbar = super(PhysicsActivity, self).build_toolbar() # Add buttons - toolbar.button1 = ToolButton('minus') - toolbar.button1.set_tooltip(_('Button One')) - toolbar.button1.connect('clicked', self._button1_cb) - toolbar.insert(toolbar.button1, 2) - toolbar.button1.show() + toolbar.box = ToolButton('box') + toolbar.box.set_tooltip(_('Box')) + toolbar.box.connect('clicked', self._box_cb) + toolbar.insert(toolbar.box, 2) + toolbar.box.show() - toolbar.button2 = ToolButton('plus') - toolbar.button2.set_tooltip(_('button-2')) - toolbar.button2.connect('clicked', self._button2_cb) - toolbar.insert(toolbar.button2, 2) - toolbar.button2.show() + toolbar.circle = ToolButton('circle') + toolbar.circle.set_tooltip(_('Circle')) + toolbar.circle.connect('clicked', self._circle_cb) + toolbar.insert(toolbar.circle, 2) + toolbar.circle.show() + + toolbar.triangle = ToolButton('triangle') + toolbar.triangle.set_tooltip(_('Triangle')) + toolbar.triangle.connect('clicked', self._triangle_cb) + toolbar.insert(toolbar.triangle, 2) + toolbar.triangle.show() + + toolbar.polygon = ToolButton('polygon') + toolbar.polygon.set_tooltip(_('Polygon')) + toolbar.polygon.connect('clicked', self._polygon_cb) + toolbar.insert(toolbar.polygon, 2) + toolbar.polygon.show() + + toolbar.magicpen = ToolButton('magicpen') + toolbar.magicpen.set_tooltip(_('Magic Pen')) + toolbar.magicpen.connect('clicked', self._magicpen_cb) + toolbar.insert(toolbar.magicpen, 2) + toolbar.magicpen.show() + + toolbar.grab = ToolButton('grab') + toolbar.grab.set_tooltip(_('Grab')) + toolbar.grab.connect('clicked', self._grab_cb) + toolbar.insert(toolbar.grab, 2) + toolbar.grab.show() + + toolbar.joint = ToolButton('joint') + toolbar.joint.set_tooltip(_('Joint')) + toolbar.joint.connect('clicked', self._joint_cb) + toolbar.insert(toolbar.joint, 2) + toolbar.joint.show() + + toolbar.destroy = ToolButton('destroy') + toolbar.destroy.set_tooltip(_('Destroy')) + toolbar.destroy.connect('clicked', self._destroy_cb) + toolbar.insert(toolbar.destroy, 2) + toolbar.destroy.show() + return toolbar - def _button1_cb(self, button): - pygame.event.post(olpcgames.eventwrap.Event(pygame.USEREVENT, action='button1')) - - def _button2_cb(self, button): - pygame.event.post(olpcgames.eventwrap.Event(pygame.USEREVENT, action='button2')) + def _box_cb(self, button): + pygame.event.post(olpcgames.eventwrap.Event(pygame.USEREVENT, action='box')) + def _circle_cb(self, button): + pygame.event.post(olpcgames.eventwrap.Event(pygame.USEREVENT, action='circle')) + def _triangle_cb(self, button): + pygame.event.post(olpcgames.eventwrap.Event(pygame.USEREVENT, action='triangle')) + def _polygon_cb(self, button): + pygame.event.post(olpcgames.eventwrap.Event(pygame.USEREVENT, action='polygon')) + def _magicpen_cb(self, button): + pygame.event.post(olpcgames.eventwrap.Event(pygame.USEREVENT, action='magicpen')) + def _grab_cb(self, button): + pygame.event.post(olpcgames.eventwrap.Event(pygame.USEREVENT, action='grab')) + def _joint_cb(self, button): + pygame.event.post(olpcgames.eventwrap.Event(pygame.USEREVENT, action='joint')) + def _destroy_cb(self, button): + pygame.event.post(olpcgames.eventwrap.Event(pygame.USEREVENT, action='destroy')) diff --git a/icons/box.svg b/icons/box.svg new file mode 100755 index 0000000..d926cd1 --- /dev/null +++ b/icons/box.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/icons/circle.svg b/icons/circle.svg new file mode 100755 index 0000000..2cdb119 --- /dev/null +++ b/icons/circle.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/icons/destroy.svg b/icons/destroy.svg new file mode 100755 index 0000000..bf2a7ac --- /dev/null +++ b/icons/destroy.svg @@ -0,0 +1,6 @@ + + +]> + + \ No newline at end of file diff --git a/icons/grab.svg b/icons/grab.svg new file mode 100755 index 0000000..c620d0a --- /dev/null +++ b/icons/grab.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/icons/joint.svg b/icons/joint.svg new file mode 100755 index 0000000..f26c41f --- /dev/null +++ b/icons/joint.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/icons/magicpen.svg b/icons/magicpen.svg new file mode 100755 index 0000000..c7a1ef9 --- /dev/null +++ b/icons/magicpen.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + diff --git a/icons/minus.svg b/icons/minus.svg deleted file mode 100755 index 5b1caef..0000000 --- a/icons/minus.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - -]> - - - - - - - - diff --git a/icons/plus.svg b/icons/plus.svg deleted file mode 100755 index e1fc560..0000000 --- a/icons/plus.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - -]> - - - - - - - - - diff --git a/icons/polygon.svg b/icons/polygon.svg new file mode 100755 index 0000000..5008d4d --- /dev/null +++ b/icons/polygon.svg @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/icons/triangle.svg b/icons/triangle.svg new file mode 100755 index 0000000..0bce240 --- /dev/null +++ b/icons/triangle.svg @@ -0,0 +1,11 @@ + + + + + + + + + + -- cgit v0.9.1