Author: jackson
Date: 2007-06-06 19:36:15 -0400 (Wed, 06 Jun 2007)
New Revision: 78796
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/xaml.cpp
Log:
* xaml.cpp: Set brush attributes.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-06-06 23:31:29 UTC (rev 78795)
+++ trunk/moon/src/ChangeLog 2007-06-06 23:36:15 UTC (rev 78796)
@@ -1,5 +1,9 @@
2007-06-06 Jackson Harper <[EMAIL PROTECTED]>
+ * xaml.cpp: Set brush attributes.
+
+2007-06-06 Jackson Harper <[EMAIL PROTECTED]>
+
* runtime.h:
* transform.h: Need to register this base DependencyObject for the
xaml parser.
Modified: trunk/moon/src/xaml.cpp
===================================================================
--- trunk/moon/src/xaml.cpp 2007-06-06 23:31:29 UTC (rev 78795)
+++ trunk/moon/src/xaml.cpp 2007-06-06 23:36:15 UTC (rev 78796)
@@ -355,7 +355,8 @@
return inst;
}
-
+
+
///
/// Add Child funcs
///
@@ -399,12 +400,6 @@
g_strfreev (prop_name);
}
-void
-solid_color_brush_set_property (XamlParserInfo *p, XamlElementInstance *item,
XamlElementInstance *property, XamlElementInstance *value)
-{
-
-}
-
///
/// set attributes funcs
///
@@ -420,7 +415,9 @@
{
DependencyObject *dep = (DependencyObject *) item->item;
- for (int i = 0; attr [i]; i++) {
+
+
+ for (int i = 0; attr [i]; i += 2) {
DependencyProperty *prop = NULL;
XamlElementInfo *walk = item->info;
while (walk) {
@@ -433,6 +430,7 @@
if (prop) {
/// This should be replaced soon, just stuck it in here
for debugging
Value v;
+
switch (prop->value_type) {
case Value::BOOL:
v = Value ((bool) !g_strcasecmp ("true", attr
[i + 1]));
@@ -449,10 +447,18 @@
case Value::STRING:
v = Value (attr [i + 1]);
break;
- default:
- continue;
+ case Value::BRUSH:
+ case Value::SOLIDCOLORBRUSH:
+ // Only solid color brushes can be specified
using attribute syntax
+ SolidColorBrush *scb = solid_color_brush_new ();
+ solid_color_brush_set_color (scb,
color_from_str (attr [i + 1]));
+ v = Value (scb);
+ break;
}
+
dep->SetValue (prop, v);
+ } else {
+ printf ("can not find property: %s %s\n", attr [i],
attr [i + 1]);
}
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches