Author: toshok
Date: 2007-06-29 16:58:39 -0400 (Fri, 29 Jun 2007)
New Revision: 81081

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/uielement.cpp
   trunk/moon/src/uielement.h
Log:
        * uielement.cpp (UIElement::OnPropertyChanged): reformat this so I
        can actually read it, and notify attachees of our property
        changes.  this makes ZIndex setting resort the parent panels list.

        * uielement.h: add an arg to UpdateBounds (a bool that defaults to
        false) to force an invalidation of the new bounds.

2007-06-29  Chris Toshok  <[EMAIL PROTECTED]>



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-06-29 20:56:26 UTC (rev 81080)
+++ trunk/moon/src/ChangeLog    2007-06-29 20:58:39 UTC (rev 81081)
@@ -1,5 +1,14 @@
 2007-06-29  Chris Toshok  <[EMAIL PROTECTED]>
 
+       * uielement.cpp (UIElement::OnPropertyChanged): reformat this so I
+       can actually read it, and notify attachees of our property
+       changes.  this makes ZIndex setting resort the parent panels list.
+
+       * uielement.h: add an arg to UpdateBounds (a bool that defaults to
+       false) to force an invalidation of the new bounds.
+
+2007-06-29  Chris Toshok  <[EMAIL PROTECTED]>
+
        * panel.h, panel.cpp: okay, i'm stupid.  it's not
        OnChildPropertyChanged either.  it's OnCollectionChanged.  we
        seriously need to clean this stuff up.

Modified: trunk/moon/src/uielement.cpp
===================================================================
--- trunk/moon/src/uielement.cpp        2007-06-29 20:56:26 UTC (rev 81080)
+++ trunk/moon/src/uielement.cpp        2007-06-29 20:58:39 UTC (rev 81081)
@@ -20,7 +20,7 @@
 #include "runtime.h"
 
 void
-UIElement::UpdateBounds ()
+UIElement::UpdateBounds (bool force_redraw_of_new_bounds)
 {
        Rect obounds = bounds;
        
@@ -39,6 +39,9 @@
                if (parent != NULL)
                        parent->UpdateBounds();
        }
+       else {
+               Invalidate (bounds);
+       }
 }
 
 void
@@ -72,16 +75,24 @@
 void
 UIElement::OnPropertyChanged (DependencyProperty *prop)
 {
+       if (prop->type != Type::UIELEMENT) {
+               Visual::OnPropertyChanged (prop);
+               return;
+       }
+         
        if (prop == UIElement::OpacityProperty ||
            prop == UIElement::ZIndexProperty) {
                Invalidate ();
-       } else if (prop == UIElement::VisibilityProperty) {
+       }
+       else if (prop == UIElement::VisibilityProperty) {
                // XXX we need a FullInvalidate if this is changing
                // from or to Collapsed, but as there's no way to tell that...
                FullInvalidate (true);
-       } else if (prop == UIElement::ClipProperty) {
+       }
+       else if (prop == UIElement::ClipProperty) {
                Invalidate ();
-       } else if (prop == UIElement::OpacityMaskProperty) {
+       }
+       else if (prop == UIElement::OpacityMaskProperty) {
                if (opacityMask != NULL) {
                        opacityMask->Detach (NULL, this);
                        opacityMask->unref ();
@@ -93,9 +104,11 @@
                }
                
                Invalidate ();
-       } else if (prop == RenderTransformProperty || prop == 
RenderTransformOriginProperty) {
+       }
+       else if (prop == RenderTransformProperty || prop == 
RenderTransformOriginProperty) {
                UpdateTransform ();
-       } else if (prop == TriggersProperty){
+       }
+       else if (prop == TriggersProperty) {
                Value *v = GetValue (prop);
                TriggerCollection *newcol = v ?  v->AsTriggerCollection() : 
NULL;
 
@@ -105,7 +118,8 @@
                                
                        newcol->closure = this;
                }
-       } else if (prop == ResourcesProperty) {
+       }
+       else if (prop == ResourcesProperty) {
                Value *v = GetValue (prop);
                ResourceCollection *newcol = v ? v->AsResourceCollection() : 
NULL;
 
@@ -115,9 +129,9 @@
                                
                        newcol->closure = this;
                }
-       } else {
-               Visual::OnPropertyChanged (prop);
        }
+
+       NotifyAttacheesOfPropertyChange (prop);
 }
 
 #if true
@@ -173,20 +187,11 @@
        if (prop == UIElement::RenderTransformProperty ||
            prop == UIElement::RenderTransformOriginProperty) {
                UpdateTransform ();
-       } else if (prop == UIElement::ClipProperty ||
-                  prop == UIElement::OpacityMaskProperty) {
+       }
+       else if (prop == UIElement::ClipProperty ||
+                prop == UIElement::OpacityMaskProperty) {
 
                Invalidate ();
-       } else if (prop == UIElement::OpacityProperty) {
-               Invalidate ();
-       } else if (prop == UIElement::VisibilityProperty) {
-               // XXX we need a FullInvalidate if this is changing
-               // from or to Collapsed, but as there's no way to tell that...
-
-         // XX do we need this here at all?
-               FullInvalidate (true);
-       } else if (Type::Find (subprop->type)->IsSubclassOf (Type::BRUSH)) {
-               Invalidate ();
        }
        
        Visual::OnSubPropertyChanged (prop, subprop);
@@ -212,8 +217,7 @@
        Invalidate ();
        if (rendertransform)
                UpdateTransform ();
-       UpdateBounds ();
-       Invalidate ();
+       UpdateBounds (true /* force an invalidate here, even if the bounds 
don't change */);
 }
 
 

Modified: trunk/moon/src/uielement.h
===================================================================
--- trunk/moon/src/uielement.h  2007-06-29 20:56:26 UTC (rev 81080)
+++ trunk/moon/src/uielement.h  2007-06-29 20:58:39 UTC (rev 81081)
@@ -75,7 +75,7 @@
        //   Updates the bounds of a item by requesting bounds update
        //   to all of its parents.
        //
-       void UpdateBounds ();
+       void UpdateBounds (bool force_redraw_of_new_bounds = false);
 
        // 
        // ComputeBounds:

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

Reply via email to