src/Builder4/MainWindow.bjs
authorAlan Knowles <alan@roojs.com>
Fri, 27 Feb 2015 01:03:15 +0000 (09:03 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 27 Feb 2015 01:03:15 +0000 (09:03 +0800)
src/Builder4/MainWindow.vala

src/Builder4/MainWindow.bjs
src/Builder4/MainWindow.vala

index 22e9746..855cb30 100644 (file)
                  "items" : [
                   {
                    "listeners" : {
-                    "clicked" : "  ( ) => {\n    \n    \n    \n    switch (_this.state) {\n        case \"edit\":\n            _this.showAddProp();\n            break;\n            \n        case \"object\":\n            _this.hideObject();\n            _this.showAddProp();\n            break;\n       \n        case \"addlistener\":\n            _this.hideAddListener();\n            _this.showAddProp();            \n            break;\n            \n            \n        case \"addprop\":\n            _this.hideAddProp();\n            break;\n            \n        default:\n            print(\"unhandled add property from %s\\n\",_this.state);\n            break;\n            \n    }\n    return  ;    \n\n\n}"
+                    "clicked" : "  ( ) => {\n    \n     this.windowstate.switchState(WindowState.State.PROP);\n \n\n}"
                    },
                    "* pack" : false,
                    "xtype" : "Button",
index e84f204..d55a0fc 100644 (file)
@@ -1750,35 +1750,8 @@ public class Xcls_MainWindow : Object
             // listeners 
             this.el.clicked.connect( ( ) => {
                 
-                
-                
-                switch (_this.state) {
-                    case "edit":
-                        _this.showAddProp();
-                        break;
-                        
-                    case "object":
-                        _this.hideObject();
-                        _this.showAddProp();
-                        break;
-                   
-                    case "addlistener":
-                        _this.hideAddListener();
-                        _this.showAddProp();            
-                        break;
-                        
-                        
-                    case "addprop":
-                        _this.hideAddProp();
-                        break;
-                        
-                    default:
-                        print("unhandled add property from %s\n",_this.state);
-                        break;
-                        
-                }
-                return  ;    
-            
+                 this.windowstate.switchState(WindowState.State.PROP);
+             
             
             });
         }