change property type dialog to use dropdown (has bug with popover autohide, but added...
[roobuilder] / src / JsRender / NodeProp.vala
index fed051f..edb5e17 100644 (file)
@@ -86,6 +86,43 @@ public enum JsRender.NodePropType
                }
        }
        
+       public static NodePropType[] alltypes()
+       {
+               return {
+                       PROP,
+                       USER,
+                       RAW,                    
+                       METHOD,
+                       SIGNAL,
+
+                       SPECIAL,
+                       LISTENER
+               //      CTOR,
+                       
+               };
+       }
+       public static NodePropType nameToType(string str)
+       {
+               foreach(var np in alltypes()) {
+                       if (np.to_name() == str) {
+                               return np;
+                       }
+               }
+               return NONE;
+       
+       }
+       public static string[] get_pulldown_list()
+       {
+               // eventually it needs to be smarter.... - but i did not have internet so could not use listmodels for the dropdown
+                
+               string[] ret = {};
+               foreach(var np in alltypes()) {
+                       ret += np.to_name();
+               }
+               return ret;
+       
+       }
+       
        
 }
 
@@ -94,6 +131,10 @@ public enum JsRender.NodePropType
 public class JsRender.NodeProp : Object {
 
 
+
+
+
+
        private string _name = "";
        public string name { 
                get {
@@ -217,6 +258,10 @@ public class JsRender.NodeProp : Object {
                this.childstore = new GLib.ListStore( typeof(NodeProp));
                 
        }
+       public string ptype_as_string {
+               get { return this.ptype.to_string(); }
+               private set {}
+       }
        
        
        public bool equals(NodeProp p) 
@@ -640,6 +685,7 @@ public class JsRender.NodeProp : Object {
                this.childstore.append(child);
 
        }
+        
        
        /**
        could use enums.. but basically.