]> O.S.I.I.S - jp/crow.git/commitdiff
divers
authorjpbruyere <jp.bruyere@hotmail.com>
Sun, 7 Aug 2016 11:36:50 +0000 (13:36 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Sun, 7 Aug 2016 11:36:50 +0000 (13:36 +0200)
Templates/Popper.goml
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/Group.cs
src/GraphicObjects/ListBox.cs
src/GraphicObjects/Popper.cs
src/GraphicObjects/TemplatedContainer.cs
src/GraphicObjects/TemplatedControl.cs
src/Interface.cs

index 731646f1213b88396b0a2410f6cd74c1d774a24e..c4093b19627ec413e0ccc410de06408bf9d8b9a2 100755 (executable)
@@ -1,7 +1,8 @@
 <?xml version="1.0"?>
 <Border Background="{./Background}" BorderWidth="1" Foreground="{./Foreground}" Height="Fit" Width="{./WidthPolicy}">
        <HorizontalStack Spacing="1" Height="-1"  Width="{./WidthPolicy}">
-               <Image Margin="2" Width="12" Height="12" Path="{./Image}" SvgSub="{./IsPopped}"/>
+               <Image Margin="2" Width="12" Height="12"
+                               Path="#Crow.Images.Icons.expandable.svg" SvgSub="{./IsPopped}"/>
                <Label Text="{./Caption}"  Width="{./WidthPolicy}"/>
        </HorizontalStack>
 </Border>
\ No newline at end of file
index 36be650df0732e8bb0916662af5b1a8a567bb0d3..8966acf6fae61605d0c80493c77f7456e01f6154 100644 (file)
@@ -1304,7 +1304,7 @@ namespace Crow
                                PropertyInfo pi = mi as PropertyInfo;
 
                                if (pi.GetSetMethod () == null) {
-                                       Debug.WriteLine ("GOML: Read only property in " + thisType.ToString() + " : " + name);
+                                       Debug.WriteLine ("XML: Read only property in " + thisType.ToString() + " : " + name);
                                        return;
                                }
 
index 4d851b1ab10a7dbdc24b2d75b10c255660266f25..a6ca5758f613e1e223c3119d873e72187d31d9f4 100644 (file)
@@ -337,7 +337,7 @@ namespace Crow
                                                }
                                        }
                                        if (t == null)
-                                               throw new Exception ("Crow." + subTree.Name + " type not found");
+                                               throw new Exception (subTree.Name + " type not found");
                     GraphicObject go = (GraphicObject)Activator.CreateInstance(t);
                     (go as IXmlSerializable).ReadXml(subTree);                    
                     AddChild(go);
index b92fe39fe16e50b76c78c31f4727b7246342d8ec..58d41e0ba177763b249ea159287a68501b900c96 100644 (file)
@@ -104,7 +104,7 @@ namespace Crow
                        SelectedItemChanged.Raise (this, new SelectionChangeEventArgs (SelectedItem));
                }
                        
-               #region implemented abstract members of TemplatedControl
+               #region TemplatedControl override
                protected override void loadTemplate (GraphicObject template = null)
                {
                        base.loadTemplate (template);
@@ -114,6 +114,7 @@ namespace Crow
                        _gsList = _list as GenericStack;
                }
                #endregion
+
                void loading(){
                        if (ItemTemplates == null)
                                ItemTemplates = new Dictionary<string, ItemTemplate> ();
index 14e7ec7ad1d7d6b774326468bb2b1870e388e0ec..0a013ae15815aec7858aa48ff3b45d5f55f4c5e2 100644 (file)
@@ -37,12 +37,54 @@ namespace Crow
 
                bool _isPopped;
                string caption;
-               string image;
+               Alignment popDirection;
                GraphicObject _content;
 
                public event EventHandler Pop;
                public event EventHandler Unpop;
 
+               #region Public Properties
+               [XmlAttributeAttribute()][DefaultValue("Popper")]
+               public string Caption {
+                       get { return caption; } 
+                       set {
+                               if (caption == value)
+                                       return;
+                               caption = value; 
+                               NotifyValueChanged ("Caption", caption);
+                       }
+               }
+               [XmlAttributeAttribute()][DefaultValue(false)]
+               public bool IsPopped
+               {
+                       get { return _isPopped; }
+                       set
+                       {
+                               if (value == _isPopped)
+                                       return;
+
+                               _isPopped = value;
+                               NotifyValueChanged ("IsPopped", _isPopped);
+
+                               if (_isPopped)
+                                       onPop (this, null);
+                               else
+                                       onUnpop (this, null);
+
+                       }
+               }
+               [XmlAttributeAttribute()][DefaultValue(Alignment.Bottom)]
+               public virtual Alignment PopDirection {
+                       get { return popDirection; }
+                       set {
+                               if (popDirection == value)
+                                       return;
+                               popDirection = value;
+                               NotifyValueChanged ("PopDirection", popDirection);
+                       }
+               }
+               #endregion
+
                public override GraphicObject Content {
                        get { return _content; }
                        set { 
@@ -109,6 +151,7 @@ namespace Crow
                        }
                }
 
+               #region GraphicObject overrides
                public override void OnLayoutChanges (LayoutingType layoutType)
                {
                        base.OnLayoutChanges (layoutType);
@@ -120,7 +163,6 @@ namespace Crow
                                _content.MinimumSize = new Size (this.Slot.Width, _content.MinimumSize.Height);                 
                }
 
-               #region GraphicObject overrides
                public override void ClearBinding ()
                {
                        //ensure popped window is cleared
@@ -156,59 +198,6 @@ namespace Crow
                        IsPopped = false;
                }
                #endregion
-
-               #region Public Properties
-               [XmlAttributeAttribute()][DefaultValue("Popper")]
-               public string Caption {
-                       get { return caption; } 
-                       set {
-                               if (caption == value)
-                                       return;
-                               caption = value; 
-                               NotifyValueChanged ("Caption", caption);
-                       }
-               }        
-               [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.expandable.svg")]
-               public string Image {
-                       get { return image; } 
-                       set {
-                               if (image == value)
-                                       return;
-                               image = value; 
-                               NotifyValueChanged ("Image", image);
-                       }
-               } 
-               [XmlAttributeAttribute()][DefaultValue(false)]
-        public bool IsPopped
-        {
-                       get { return _isPopped; }
-            set
-            {
-                               if (value == _isPopped)
-                                       return;
-                               
-                               _isPopped = value;
-                               NotifyValueChanged ("IsPopped", _isPopped);
-
-                               if (_isPopped)
-                                       onPop (this, null);
-                               else
-                                       onUnpop (this, null);
-                               
-            }
-        }
-               Alignment popDirection;
-               [XmlAttributeAttribute()][DefaultValue(Alignment.Bottom)]
-               public virtual Alignment PopDirection {
-                       get { return popDirection; }
-                       set {
-                               if (popDirection == value)
-                                       return;
-                               popDirection = value;
-                               NotifyValueChanged ("PopDirection", popDirection);
-                       }
-               }
-               #endregion
                        
                public virtual void onPop(object sender, EventArgs e)
                {
index a845722ab40d5a0b93e6da9a88a38618174361cc..18977cf9416f3a0542d1699f8c3e926eccbb21a2 100644 (file)
@@ -92,6 +92,9 @@ namespace Crow
                                                                        t = expT;
                                                        }
                                                }
+                                               if (t == null)
+                                                       throw new Exception (xr.Name + " type not found");
+                                               
                                                GraphicObject go = (GraphicObject)Activator.CreateInstance (t);                                
 
                                                (go as IXmlSerializable).ReadXml (xr);
index 9040ddeb18238e0171dc592e7218adc7e3ce390b..b325a0d28e676ae5a0c0204ad1491dbb2469fbaa 100644 (file)
@@ -27,6 +27,7 @@ using System.Diagnostics;
 using System.Linq;
 using System.Collections.Generic;
 using System.Text;
+using System.Reflection;
 
 namespace Crow
 {
@@ -174,6 +175,13 @@ namespace Crow
                                                                xr.Read ();
 
                                                                Type t = Type.GetType ("Crow." + xr.Name);
+                                                               if (t == null) {
+                                                                       Assembly a = Assembly.GetEntryAssembly ();
+                                                                       foreach (Type expT in a.GetExportedTypes ()) {
+                                                                               if (expT.Name == xr.Name)
+                                                                                       t = expT;
+                                                                       }
+                                                               }
                                                                GraphicObject go = (GraphicObject)Activator.CreateInstance (t);
                                                                (go as IXmlSerializable).ReadXml (xr);
 
index df59527566b1c6587bed04dc9d2bcac50b322ac4..7b324de74070da3bb851b22adbc11c8c7fd769ec 100644 (file)
@@ -108,7 +108,7 @@ namespace Crow
                        }
                }
 
-               #region default values and style loading
+               #region Default values and Style loading
                /// Default values of properties from GraphicObjects are retrieve from XML Attributes.
                /// The reflexion process used to retrieve those values being very slow, it is compiled in MSIL
                /// and injected as a dynamic method referenced in the DefaultValuesLoader Dictionnary.