Author: lluis
Date: 2007-08-08 10:41:17 -0400 (Wed, 08 Aug 2007)
New Revision: 83670

Modified:
   trunk/stetic/ChangeLog
   trunk/stetic/libstetic/wrapper/Widget.cs
Log:
* libstetic/wrapper/Widget.cs: Added missing null check. Don't set the
  Name property to unselectable widgets.

Modified: trunk/stetic/ChangeLog
===================================================================
--- trunk/stetic/ChangeLog      2007-08-08 14:38:37 UTC (rev 83669)
+++ trunk/stetic/ChangeLog      2007-08-08 14:41:17 UTC (rev 83670)
@@ -1,3 +1,8 @@
+2007-08-08  Lluis Sanchez Gual <[EMAIL PROTECTED]> 
+
+       * libstetic/wrapper/Widget.cs: Added missing null check. Don't set the 
Name
+         property to unselectable widgets.
+
 2007-07-31  Lluis Sanchez Gual <[EMAIL PROTECTED]> 
 
        * libstetic/wrapper/Button.cs, libstetic/wrapper/ButtonBox.cs: Don't

Modified: trunk/stetic/libstetic/wrapper/Widget.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/Widget.cs    2007-08-08 14:38:37 UTC (rev 
83669)
+++ trunk/stetic/libstetic/wrapper/Widget.cs    2007-08-08 14:41:17 UTC (rev 
83670)
@@ -608,7 +608,7 @@
                        
                        // The HasDefault property can only be assigned when 
the widget is added to the window
                        prop = ClassDescriptor ["HasDefault"] as 
PropertyDescriptor;
-                       if ((bool) prop.GetValue (Wrapped)) {
+                       if (prop != null && (bool) prop.GetValue (Wrapped)) {
                                ctx.Statements.Add (
                                        new CodeAssignStatement (
                                                new 
CodePropertyReferenceExpression (
@@ -623,8 +623,15 @@
                
                protected override void GeneratePropertySet (GeneratorContext 
ctx, CodeExpression var, PropertyDescriptor prop)
                {
-                       if (prop.Name != "Visible" && prop.Name != "HasDefault")
-                               base.GeneratePropertySet (ctx, var, prop);
+                       // Those properties are handled in GeneratePostBuildCode
+                       if (prop.Name == "Visible" || prop.Name == "HasDefault")
+                               return;
+                       
+                       // Don't generate a name for unselectable widgets
+                       if (prop.Name == "Name" && Unselectable)
+                               return;
+                       
+                       base.GeneratePropertySet (ctx, var, prop);
                }
                
                protected CodeExpression GenerateUiManagerElement 
(GeneratorContext ctx, ActionTree tree)

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

Reply via email to