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

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

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