gcompris r3730 - in branches/gcomprixogoo: . src/anim-activity src/anim-activity/resources/anim src/mosaic-activity/resources/mosaic src/redraw-activity/resources/redraw



Author: bcoudoin
Date: Fri Feb 20 00:07:47 2009
New Revision: 3730
URL: http://svn.gnome.org/viewvc/gcompris?rev=3730&view=rev

Log:
fixed anim activity


Modified:
   branches/gcomprixogoo/   (props changed)
   branches/gcomprixogoo/src/anim-activity/AnimItem.py
   branches/gcomprixogoo/src/anim-activity/Timeline.py
   branches/gcomprixogoo/src/anim-activity/anim.py
   branches/gcomprixogoo/src/anim-activity/resources/anim/color-selector.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/counter.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/down.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-circle.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-circle_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-del.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-del_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-down.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-down_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-empty.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-empty_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-fill.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-fill_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-filledcircle.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-filledcircle_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-filledrectangle.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-filledrectangle_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-flip.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-flip_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-image.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-image_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-line.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-line_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-load.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-movie.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-rectangle.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-rectangle_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-rotation-ccw.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-rotation-ccw_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-rotation-cw.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-rotation-cw_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-save.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-select.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-select_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-selector.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-text.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-text_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-up.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/tool-up_on.png   (props changed)
   branches/gcomprixogoo/src/anim-activity/resources/anim/up.png   (props changed)
   branches/gcomprixogoo/src/mosaic-activity/resources/mosaic/button_checked.png   (props changed)
   branches/gcomprixogoo/src/redraw-activity/resources/redraw/mini_bad.png   (props changed)

Modified: branches/gcomprixogoo/src/anim-activity/AnimItem.py
==============================================================================
--- branches/gcomprixogoo/src/anim-activity/AnimItem.py	(original)
+++ branches/gcomprixogoo/src/anim-activity/AnimItem.py	Fri Feb 20 00:07:47 2009
@@ -214,7 +214,6 @@
                                 "sounds/eraser2.wav")
         self.delete_at_time(self.anim.timeline.get_time())
         self.show(False)
-        print self.visible
 
     def raise_(self):
         parent = self.item.get_parent()
@@ -261,6 +260,9 @@
         self.set_visible_to_end(self.anim.timeline.get_time())
 
     def create_item_drag_event(self, item, target, event):
+        if event.type == gtk.gdk.BUTTON_RELEASE:
+            self.save_at_time(self.anim.timeline.get_time())
+
         if (event.type == gtk.gdk.MOTION_NOTIFY
             and event.state & gtk.gdk.BUTTON1_MASK):
 
@@ -585,7 +587,6 @@
         bounds = self.item.get_bounds()
         sx = (x2 - x1) / (bounds.x2 - bounds.x1)
         sy = (y2 - y1) / (bounds.y2 - bounds.y1)
-        print "sx=%f sy=%f" %(sx, sy)
         self.item.scale(sx, sy)
 
 

Modified: branches/gcomprixogoo/src/anim-activity/Timeline.py
==============================================================================
--- branches/gcomprixogoo/src/anim-activity/Timeline.py	(original)
+++ branches/gcomprixogoo/src/anim-activity/Timeline.py	Fri Feb 20 00:07:47 2009
@@ -130,7 +130,7 @@
         self.current_time = item.get_data("time")
 
         # Let anim knows there is a new time set
-        #self.anim.refresh(self.get_time())
+        self.anim.refresh(self.get_time())
 
     #
     def timeline_item_event(self, item, target, event):

Modified: branches/gcomprixogoo/src/anim-activity/anim.py
==============================================================================
--- branches/gcomprixogoo/src/anim-activity/anim.py	(original)
+++ branches/gcomprixogoo/src/anim-activity/anim.py	Fri Feb 20 00:07:47 2009
@@ -64,6 +64,9 @@
     self.gcomprisBoard = gcomprisBoard
     self.timeout = 0
 
+    # The list of all the user's objects
+    self.animlist = []
+
     # There is two board in the same code
     # here the diff in parameters
     if self.gcomprisBoard.mode == 'draw':
@@ -629,7 +632,7 @@
                                                 target)
 
           # We keep all object in a unique list
-          #self.animlist.append(self.created_object)
+          self.animlist.append(self.created_object)
 
     #
     # MOTION EVENT
@@ -667,6 +670,11 @@
 
     return False
 
+  def refresh(self, time):
+    # We keep all object in a unique list
+    # Here we order them to refresh them for the given time
+    for item in self.animlist:
+      item.display_at_time(time)
 
   def refresh_loop(self):
     self.timeline.next()
@@ -752,3 +760,5 @@
     fles.created_object.create_item_event(fles.root_drawingitem,
                                           fles.root_drawingitem)
 
+  # We keep all object in a unique list
+  fles.animlist.append(fles.created_object)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]