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

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

index 5b5459e..22e9746 100644 (file)
                  "items" : [
                   {
                    "listeners" : {
-                    "clicked" : "  ( ) => {\n    \n    \n    \n    switch (_this.state) {\n\n \n        case \"addprop\":\n            _this.hideAddProp();\n            _this.showObject();\n            break;\n    case \"addlistener\":\n            _this.hideAddListener();\n            _this.showObject();\n            break;\n\n// show            \n        case \"edit\":\n            _this.showObject();\n            break;\n            \n// hide            \n        case \"object\":\n            _this.hideObject();\n            break;\n            break;\n                        \n        default:\n            print(\"unhandled add objects from %s\\n\",_this.state);\n            break;\n    }\n    return  ;    \n\n\n}"
+                    "clicked" : "  ( ) => {\n    \n     this.windowstate.switchState(WindowState.State.OBJECT);\n  \n\n\n}"
                    },
                    "* pack" : false,
                    "xtype" : "Button",
index 65c346a..e84f204 100644 (file)
@@ -1638,36 +1638,8 @@ public class Xcls_MainWindow : Object
             // listeners 
             this.el.clicked.connect( ( ) => {
                 
-                
-                
-                switch (_this.state) {
-            
-             
-                    case "addprop":
-                        _this.hideAddProp();
-                        _this.showObject();
-                        break;
-                case "addlistener":
-                        _this.hideAddListener();
-                        _this.showObject();
-                        break;
-            
-            // show            
-                    case "edit":
-                        _this.showObject();
-                        break;
-                        
-            // hide            
-                    case "object":
-                        _this.hideObject();
-                        break;
-                        break;
-                                    
-                    default:
-                        print("unhandled add objects from %s\n",_this.state);
-                        break;
-                }
-                return  ;    
+                 this.windowstate.switchState(WindowState.State.OBJECT);
+              
             
             
             });