Author: alanmc
Date: 2007-08-24 17:21:42 -0400 (Fri, 24 Aug 2007)
New Revision: 84821

Modified:
   trunk/lunareclipse/ChangeLog
   trunk/lunareclipse/Controller/MoonlightController.cs
   trunk/lunareclipse/Controls/TimeLine/AnimationTimeline.cs
   trunk/lunareclipse/Model/Draw/Selector.cs
   trunk/lunareclipse/View/MainWindow.cs
Log:
* Model/Draw/Selector.cs: Using the toolbox global event so alerts are
  passed out for changing the angle
* Controller/MoonlightController.cs: Cleaning up before serializing so
  non-silverlight types don't get serialised
* Controls/TimeLine/AnimationTimeline.cs: Added ability to modify
  existing keyframe. Fixed check for duplicate keyframes
* View/MainWindow.cs: Fixed vbox packing

Modified: trunk/lunareclipse/ChangeLog
===================================================================
--- trunk/lunareclipse/ChangeLog        2007-08-24 21:20:31 UTC (rev 84820)
+++ trunk/lunareclipse/ChangeLog        2007-08-24 21:21:42 UTC (rev 84821)
@@ -1,3 +1,13 @@
+2007-08-24  Alan McGovern <[EMAIL PROTECTED]> 
+
+       * Model/Draw/Selector.cs: Using the toolbox global event so alerts are
+         passed out for changing the angle
+       * Controller/MoonlightController.cs: Cleaning up before serializing so
+         non-silverlight types don't get serialised
+       * Controls/TimeLine/AnimationTimeline.cs: Added ability to modify 
existing
+         keyframe. Fixed check for duplicate keyframes
+       * View/MainWindow.cs: Fixed vbox packing
+
 2007-08-23  Alan McGovern <[EMAIL PROTECTED]> 
 
        * View/MainWindow.cs, Properties/PropertyManager.cs: Added handling for

Modified: trunk/lunareclipse/Controller/MoonlightController.cs
===================================================================
--- trunk/lunareclipse/Controller/MoonlightController.cs        2007-08-24 
21:20:31 UTC (rev 84820)
+++ trunk/lunareclipse/Controller/MoonlightController.cs        2007-08-24 
21:21:42 UTC (rev 84821)
@@ -170,13 +170,21 @@
         }
                
                
-        public string SerializeCanvas()
+               public string SerializeCanvas()
         {
-                       ////if(Current != null)
-                       //      Current.Cleanup();
-                       
-                       return serializer.Serialize(this.moonlight.Canvas);
-        }
+                       try
+                       {
+                               if(Current != null)
+                                       Current.Cleanup();
+                               
+                               return 
serializer.Serialize(this.moonlight.Canvas);
+                       }
+                       finally
+                       {
+                               if(Current != null)
+                                       Current.Prepare();
+                       }
+               }
                
                public void Undo()
         {

Modified: trunk/lunareclipse/Controls/TimeLine/AnimationTimeline.cs
===================================================================
--- trunk/lunareclipse/Controls/TimeLine/AnimationTimeline.cs   2007-08-24 
21:20:31 UTC (rev 84820)
+++ trunk/lunareclipse/Controls/TimeLine/AnimationTimeline.cs   2007-08-24 
21:21:42 UTC (rev 84821)
@@ -211,7 +211,12 @@
                        bool moved = 
!startLocation.Equals(e.GetPosition(Canvas));
                        if(!moved)
                        {
-                               marker.Time = 
startTime.Add(TimeSpan.FromSeconds(startLocation.X / 
AnimationTimeline.PixelsPerDivision));
+                               // If we clicked on a keyframe, we set the 
current position equal to the keyframes time.
+                               // Otherwise place the position marker at the 
point of clicking
+                               if(clickedItem is KeyframeMarker)
+                                       marker.Time = clickedItem.Time;
+                               else
+                                       marker.Time = 
startTime.Add(TimeSpan.FromSeconds(startLocation.X / 
AnimationTimeline.PixelsPerDivision));
                                RaiseCurrentPositionChanged();
                                
                                PlaceMarker(marker, null);
@@ -229,9 +234,11 @@
                        // If we already have a marker at the same time for the 
same timeline, 
                        // do not add another keyframe marker
                        foreach(KeyframeMarker m in keyframeMarkers)
-                               if(timeline.Name == m.Timeline.Name && 
m.Time.Equals(marker.Time))
+                       {
+                               Console.WriteLine("timeline: {0}, Time: {1}", 
m.Timeline.Name, m.Time);
+                               if(m.Time.Equals(marker.Time))
                                        return;
-                       
+                       }
                        marker.Time = time;
                        marker.Width = 15;
                        marker.Height = 15;

Modified: trunk/lunareclipse/Model/Draw/Selector.cs
===================================================================
--- trunk/lunareclipse/Model/Draw/Selector.cs   2007-08-24 21:20:31 UTC (rev 
84820)
+++ trunk/lunareclipse/Model/Draw/Selector.cs   2007-08-24 21:21:42 UTC (rev 
84821)
@@ -300,7 +300,7 @@
                                // will give a proper angle
                                if(!double.IsNaN(difference))
                                {
-                                       border.Rotate.Angle += 
Toolbox.RadiansToDegrees(difference);
+                                       Toolbox.ChangeProperty(border.Rotate, 
RotateTransform.AngleProperty, 
(double)border.Rotate.GetValue(RotateTransform.AngleProperty) + 
Toolbox.RadiansToDegrees(difference));
                                        RaiseEvent(ChangedRotation, 
border.Rotate,
                                                           
RotateTransform.AngleProperty, 
                                                           border.Rotate.Angle, 

Modified: trunk/lunareclipse/View/MainWindow.cs
===================================================================
--- trunk/lunareclipse/View/MainWindow.cs       2007-08-24 21:20:31 UTC (rev 
84820)
+++ trunk/lunareclipse/View/MainWindow.cs       2007-08-24 21:21:42 UTC (rev 
84821)
@@ -46,9 +46,9 @@
                mainContainer = new HBox ();
                        Widget toolbox = InitialiseWidgets ();
                        toolbox.ShowAll ();
-                       mainContainer.Add (toolbox);
+                       mainContainer.PackStart (toolbox, false, false, 0);
                        animationWidgets = InitialiseAnimationWidgets();
-                       mainContainer.Add(animationWidgets);
+                       mainContainer.PackStart(animationWidgets, false, false, 
0);
                        VBox vbox = new VBox();
                        vbox.PackStart(moonlight);
                        vbox.PackEnd(timeline);
@@ -180,11 +180,20 @@
                        
                    Widget[] widgets = (Widget[])propertyPane.Children.Clone();
                        foreach(Widget widget in widgets)
-                               propertyPane.Remove(widget);
+                               widget.Destroy();
                        
                        foreach(PropertyInfo info in 
this.controller.PropertyManager.Properties)
                                
propertyPane.PackEnd(CreatePropertyWidget(controller.PropertyManager.SelectedObject.Child,
 info));
                        
+                       if(propertyPane.Children.Length == 0)
+                       {
+//                             HBox h = new HBox(true, 0);
+//                             Label l = new Label("No object selected...");
+//                             h.PackStart(l, true, true, 0);
+//                             l = new Label("...");
+//                             h.PackStart(l, true, true, 0);
+//                             propertyPane.Add(h);
+                       }
                        propertyPane.ThawChildNotify();
                        propertyPane.ShowAll();
                }
@@ -429,7 +438,7 @@
                controller.Clear();
            };
            widgets.Add(b);
-            
+                       
             return widgets;
         }
        

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to