Author: alanmc
Date: 2007-07-11 14:53:36 -0400 (Wed, 11 Jul 2007)
New Revision: 81824

Modified:
   trunk/lunareclipse/ChangeLog
   trunk/lunareclipse/Model/SelectedBorder.cs
   trunk/lunareclipse/Properties/PropertyGroupAppearance.cs
   trunk/lunareclipse/Properties/PropertyGroupLayout.cs
Log:
* Model/SelectedBorder.cs: Resetting the rotation to be about the
  correct point in the shape after the shape is altered
* Properties/PropertyGroupLayout.cs,
  Properties/PropertyGroupAppearance.cs: Correctly setting/resetting
  values on the selected object

Modified: trunk/lunareclipse/ChangeLog
===================================================================
--- trunk/lunareclipse/ChangeLog        2007-07-11 18:48:44 UTC (rev 81823)
+++ trunk/lunareclipse/ChangeLog        2007-07-11 18:53:36 UTC (rev 81824)
@@ -1,5 +1,13 @@
 2007-07-11  Alan McGovern <[EMAIL PROTECTED]> 
 
+       * Model/SelectedBorder.cs: Resetting the rotation to be about the
+         correct point in the shape after the shape is altered
+       * Properties/PropertyGroupLayout.cs,
+         Properties/PropertyGroupAppearance.cs: Correctly setting/resetting
+         values on the selected object
+
+2007-07-11  Alan McGovern <[EMAIL PROTECTED]> 
+
        Using the correct width/height when setting the centre of rotation
 
 2007-07-11  Alan McGovern <[EMAIL PROTECTED]> 

Modified: trunk/lunareclipse/Model/SelectedBorder.cs
===================================================================
--- trunk/lunareclipse/Model/SelectedBorder.cs  2007-07-11 18:48:44 UTC (rev 
81823)
+++ trunk/lunareclipse/Model/SelectedBorder.cs  2007-07-11 18:53:36 UTC (rev 
81824)
@@ -60,7 +60,7 @@
                 
                 child = value;
                 
-                base.SetValue<int>(ZIndexProperty, 
(int)child.GetValue(ZIndexProperty) - 1);
+                base.SetValue<int>(ZIndexProperty, int.MaxValue);
                 if(!updating)
                 {
                     updating = true;
@@ -123,6 +123,8 @@
             if(current == null)
                 return;
             
+            current.CenterX = (double)Child.GetValue(WidthProperty) * 0.5;
+            current.CenterY = (double)Child.GetValue(HeightProperty) * 0.5;
             RotateTransform copy = new RotateTransform();
             copy.Angle = current.Angle;
             copy.CenterX = current.CenterX + BorderWidth;

Modified: trunk/lunareclipse/Properties/PropertyGroupAppearance.cs
===================================================================
--- trunk/lunareclipse/Properties/PropertyGroupAppearance.cs    2007-07-11 
18:48:44 UTC (rev 81823)
+++ trunk/lunareclipse/Properties/PropertyGroupAppearance.cs    2007-07-11 
18:53:36 UTC (rev 81824)
@@ -9,7 +9,7 @@
 using LunarEclipse.Model;
 using System.Windows;
 using System.Windows.Media;
-
+using LunarEclipse.Controller;
 using Gtk;
 
 namespace LunarEclipse {
@@ -122,8 +122,8 @@
                                        continue;
                                
                                string propName = info[i].Name.Substring (0, 
info[i].Name.Length - 8);
-                               DependencyProperty prop = (DependencyProperty) 
field.GetValue (item);
-                               object value = item.GetValue (prop);
+                               DependencyProperty prop = (DependencyProperty) 
field.GetValue (((SelectedBorder)item).Child);
+                               object value = ((SelectedBorder)item).GetValue 
(prop);
                                Adjustment adj;
                                
                                Widget label = new Label (propName);
@@ -237,32 +237,36 @@
                        DependencyProperty prop = (DependencyProperty) 
propTable[o];
                        ComboBox combo = (ComboBox) o;
                        
-                       item.SetValue<PenLineCap> (prop, (PenLineCap) 
combo.Active);
-               }
+                       ((SelectedBorder)item).Child.SetValue<PenLineCap> 
(prop, (PenLineCap) combo.Active);
+                   ((SelectedBorder)item).ResizeBorder();
+        }
                
                void OnStretchChanged (object o, EventArgs e)
                {
                        DependencyProperty prop = (DependencyProperty) 
propTable[o];
                        ComboBox combo = (ComboBox) o;
                        
-                       item.SetValue<Stretch> (prop, (Stretch) combo.Active);
-               }
+                       ((SelectedBorder)item).Child.SetValue<Stretch> (prop, 
(Stretch) combo.Active);
+                   ((SelectedBorder)item).ResizeBorder();
+        }
                
                void OnLineJoinChanged (object o, EventArgs e)
                {
                        DependencyProperty prop = (DependencyProperty) 
propTable[o];
                        ComboBox combo = (ComboBox) o;
                        
-                       item.SetValue<PenLineJoin> (prop, (PenLineJoin) 
combo.Active);
-               }
+                       ((SelectedBorder)item).Child.SetValue<PenLineJoin> 
(prop, (PenLineJoin) combo.Active);
+                   ((SelectedBorder)item).ResizeBorder();
+        }
                
                void OnVisibilityChanged (object o, EventArgs e)
                {
                        DependencyProperty prop = (DependencyProperty) 
propTable[o];
                        ComboBox combo = (ComboBox) o;
                        
-                       item.SetValue<Visibility> (prop, (Visibility) 
combo.Active);
-               }
+                       ((SelectedBorder)item).Child.SetValue<Visibility> 
(prop, (Visibility) combo.Active);
+                   ((SelectedBorder)item).ResizeBorder();
+        }
                
                void OnDoubleChanged (object o, EventArgs e)
                {
@@ -270,7 +274,9 @@
                        SpinButton spin = (SpinButton) o;
                        double v = spin.Value;
                        
-                       item.SetValue<double> (prop, v);
+                       ((SelectedBorder)item).Child.SetValue<double> (prop, v);
+            ((SelectedBorder)item).ResizeBorder();
+            Console.WriteLine("Changed double");
                }
                
                void OnIntegerChanged (object o, EventArgs e)
@@ -279,7 +285,9 @@
                        SpinButton spin = (SpinButton) o;
                        int v = (int) spin.Value;
                        
-                       item.SetValue<int> (prop, v);
+                       ((SelectedBorder)item).Child.SetValue<int> (prop, v);
+            ((SelectedBorder)item).ResizeBorder();
+            Console.WriteLine("Changed integer");
                }
                
                void OnDataChanged (object o, EventArgs e)
@@ -288,7 +296,8 @@
                        Entry entry = (Entry) o;
                        
                        // FIXME: is this really of type string? or is it an 
array of Points?
-                       item.SetValue<string> (prop, entry.Text);
-               }
+                       ((SelectedBorder)item).Child.SetValue<string> (prop, 
entry.Text);
+                   ((SelectedBorder)item).ResizeBorder();
+        }
        }
 }

Modified: trunk/lunareclipse/Properties/PropertyGroupLayout.cs
===================================================================
--- trunk/lunareclipse/Properties/PropertyGroupLayout.cs        2007-07-11 
18:48:44 UTC (rev 81823)
+++ trunk/lunareclipse/Properties/PropertyGroupLayout.cs        2007-07-11 
18:53:36 UTC (rev 81824)
@@ -98,17 +98,17 @@
                                
                                if (!info[i].Attached) {
                                        prop = (DependencyProperty) 
field.GetValue (item);
-                                       value = item.GetValue (prop);
+                                       value = 
((SelectedBorder)item).Child.GetValue (prop);
                                } else {
                                        // Attached properties
                                        switch (info[i].Name) {
                                        case "LeftProperty":
                                                prop = Canvas.LeftProperty;
-                                               value = item.GetValue (prop);
+                                               value = 
((SelectedBorder)item).Child.GetValue (prop);
                                                break;
                                        case "TopProperty":
                                                prop = Canvas.TopProperty;
-                                               value = item.GetValue (prop);
+                                               value = 
((SelectedBorder)item).Child.GetValue (prop);
                                                break;
                                        }
                                }
@@ -184,10 +184,12 @@
                        SpinButton spin = (SpinButton) o;
                        
                        if (((Entry) spin).Text == "Auto") {
-                               item.SetValue<double> (prop, 0.0);
+                               ((SelectedBorder)item).Child.SetValue<double> 
(prop, 0.0);
                        } else {
                                double v = spin.Value;
-                               item.SetValue<double> (prop, v);
+                               ((SelectedBorder)item).Child.SetValue<double> 
(prop, v);
+                ((SelectedBorder)item).ResizeBorder();
+                Console.WriteLine("Changed other integer: {0:0}", v);
                        }
                }
                

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

Reply via email to