resources/RooUsage.txt
[app.Builder.js] / src / Builder4 / MainWindow.bjs
index 97abe9c..c1ec4a3 100644 (file)
     "delete_event" : "  (   event) => {\n    return false;\n} ",
     "destroy" : "() =>  {\n Xcls_MainWindow.singleton().no_windows--;\n \n Resources.singleton().disconnect(_this.statusbar.handler_id);\n \n \n if (Xcls_MainWindow.singleton().no_windows < 1) {\n\n     Gtk.main_quit();\n }\n}",
     "show" : "  ( ) => {\n    // hide the file editing..\n   \n    //this.hideViewEditing();\n    _this.statusbar.el.hide();\n     _this.statusbar_errors.el.hide();\n    _this.statusbar_warnings.el.hide();\n    _this.statusbar_depricated.el.hide();\n    \n  \n    Resources.singleton().checkResources();\n\n}",
-    "key_release_event" : " (event) => {\n    \n    if (this.search_entry.el.is_visible()) {\n\t\tif (event.keyval == Gdk.Key.f && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n\t\t    print(\"SAVE: ctrl-f  pressed\");\n\t\t\tthis.search_entry.el.grab_focus();\n\t\t    return false;\n\t\t}\n\t\t\n\t\t  if (event.keyval == Gdk.Key.g && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n\t\t    print(\"SAVE: ctrl-g  pressed\");\n\t\t\tthis.search_entry.forwardSearch();\n\t\t    return false;\n\t\t}\n\t}    \n   // print(event.key.keyval)\n    \n    return false;\n\n} \n\n"
+    "key_release_event" : " (event) => {\n    \n    if (this.search_entry.el.is_visible()) {\n\t\tif (event.keyval == Gdk.Key.f && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n\t\t    print(\"SAVE: ctrl-f  pressed\");\n\t\t\tthis.search_entry.el.grab_focus();\n\t\t    return false;\n\t\t}\n\t\t\n\t\tif (event.keyval == Gdk.Key.g && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n\t\t    print(\"SAVE: ctrl-g  pressed\");\n\t\t\tthis.search_entry.forwardSearch(true);\n\t\t    return false;\n\t\t}\n\t\t\n\t}    \n\t\n\tif (event.keyval == Gdk.Key.n && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n\t\tprint(\"SAVE: ctrl-n  pressed\");\n\t\tthis.openNewWindow();\n\t\treturn false;\n\t}\n\t\n   // print(event.key.keyval)\n    \n    return false;\n\n} \n\n"
    },
    "id" : "MainWindow",
    "default_width" : 800,
-   "* init" : " \n\t  \n    //this.el.show_all();\n    \n     ",
+   "* init" : " \n\t  \n    //this.el.show_all();\n    //try {\n         this.el.set_icon_name(\"roobuilder\");\n\t//} catch (Exception e) {\n\t//\tprint(\"no icon found\");\n//\t}",
+   "| void openNewWindow" : "() {\n\tXcls_MainWindow.singleton().no_windows++;\n        var w = new Xcls_MainWindow();\n        w.ref();\n\n        w.el.show_all();\n        w.initChildren();\n        w.windowstate.switchState(WindowState.State.FILES);\n}\n",
    "# Project.Project project" : "null",
    "# string title" : "\"Application Builder\"",
    "xtype" : "Window",
            "items" : [
             {
              "listeners" : {
-              "activate" : "  ( ) => {\n        Xcls_MainWindow.singleton().no_windows++;\n        var w = new Xcls_MainWindow();\n        w.ref();\n\n        w.el.show_all();\n        w.initChildren();\n        w.windowstate.switchState(WindowState.State.FILES);\n}"
+              "activate" : "( ) => {\n       _this.openNewWindow();\n}"
              },
+             "string label" : "Open a new Window",
              "* pack" : "append",
              "xtype" : "MenuItem",
-             "string label" : "Open a new Window",
              "$ xns" : "Gtk"
             },
             {
              "listeners" : {
               "activate" : " ( ) => {\n         Resources.singleton().fetchStart();\n}"
              },
+             "xtype" : "MenuItem",
              "string label" : "Download updated Resources",
              "* pack" : "append",
-             "xtype" : "MenuItem",
              "$ xns" : "Gtk"
             },
             {
              "listeners" : {
               "activate" : "() => {\n    About.singleton().el.show();\n    }"
              },
+             "* pack" : "append",
              "xtype" : "MenuItem",
              "string label" : "About the Builder",
-             "* pack" : "append",
              "$ xns" : "Gtk"
             }
            ]
           },
           {
+           "utf8 icon_name" : "help-about",
            "* pack" : "set_image",
            "xtype" : "Image",
-           "utf8 icon_name" : "help-about",
+           "$ xns" : "Gtk"
+          }
+         ]
+        },
+        {
+         "listeners" : {
+          "clicked" : "  ( ) => {\n   _this.windowstate.switchState(WindowState.State.FILES);\n      \n\n}"
+         },
+         "id" : "openbtn",
+         "* pack" : "add",
+         "xtype" : "Button",
+         "$ xns" : "Gtk",
+         "$ tooltop_text" : "\"Open File\"",
+         "items" : [
+          {
+           "xtype" : "Image",
+           "utf8 icon_name" : "document-open",
+           "* pack" : "set_image",
+           "$ xns" : "Gtk"
+          }
+         ]
+        },
+        {
+         "listeners" : {
+          "clicked" : "  ( ) => {\n  \n    _this.windowstate.switchState(WindowState.State.PREVIEW);\n    \n\n}"
+         },
+         "id" : "openbackbtn",
+         "utf8 tooltip_text" : "Back",
+         "xtype" : "Button",
+         "* pack" : "add",
+         "$ xns" : "Gtk",
+         "bool visible" : false,
+         "items" : [
+          {
+           "* pack" : "set_image",
+           "xtype" : "Image",
+           "utf8 icon_name" : "go-previous",
            "$ xns" : "Gtk"
           }
          ]
                  "items" : [
                   {
                    "listeners" : {
-                    "clicked" : "  ( ) => {\n  \n    _this.windowstate.switchState(WindowState.State.PREVIEW);\n    \n\n}"
+                    "clicked" : "  ( ) => {\n   if (_this.windowstate.state == WindowState.State.FILEPROJECT) {\n    \n\t     _this.windowstate.switchState(WindowState.State.FILES);\n     } else { \n\t    _this.windowstate.switchState(WindowState.State.PREVIEW);\n    }\n    \n\n}"
                    },
                    "utf8 tooltip_text" : "Back",
                    "* pack" : false,
                    "width_request" : 50,
                    "$ xns" : "Gtk",
                    "height_request" : 50,
-                   "items" : [
-                    {
-                     "utf8 icon_name" : "go-previous",
-                     "* pack" : "set_image",
-                     "xtype" : "Image",
-                     "$ xns" : "Gtk"
-                    }
-                   ]
-                  }
-                 ]
-                }
-               ]
-              },
-              {
-               "id" : "projectbutton",
-               "* init" : "this.el.set_size(50,50);",
-               "xtype" : "Actor",
-               "* pack" : "add_child",
-               "$ xns" : "Clutter",
-               "items" : [
-                {
-                 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
-                 "xtype" : "Actor",
-                 "$ xns" : "GtkClutter",
-                 "items" : [
-                  {
-                   "listeners" : {
-                    "clicked" : "  ( ) => {\n   _this.windowstate.switchState(WindowState.State.FILES);\n      \n\n}"
-                   },
-                   "* pack" : false,
-                   "xtype" : "Button",
-                   "width_request" : 50,
-                   "$ xns" : "Gtk",
-                   "height_request" : 50,
-                   "$ tooltop_text" : "\"Open File\"",
                    "items" : [
                     {
                      "xtype" : "Image",
-                     "utf8 icon_name" : "document-open",
+                     "utf8 icon_name" : "go-previous",
                      "* pack" : "set_image",
                      "$ xns" : "Gtk"
                     }
                    "height_request" : 50,
                    "items" : [
                     {
+                     "utf8 icon_name" : "document-properties",
                      "* pack" : "set_image",
                      "xtype" : "Image",
-                     "utf8 icon_name" : "document-properties",
                      "$ xns" : "Gtk"
                     }
                    ]
                  "items" : [
                   {
                    "listeners" : {
-                    "clicked" : "  ( ) => {\n     _this.windowstate.switchState(WindowState.State.PROJECT);\n   \n\n\n}"
+                    "clicked" : "  ( ) => {\n     \n     if (_this.windowstate.state == WindowState.State.FILES) {\n     \n\t     _this.windowstate.switchState(WindowState.State.FILEPROJECT);\n     } else {\n \t     _this.windowstate.switchState(WindowState.State.PROJECT);\n\t }     \n   \n\n\n}"
                    },
                    "* pack" : false,
                    "xtype" : "Button",
                    "height_request" : 50,
                    "items" : [
                     {
+                     "xtype" : "Image",
                      "utf8 icon_name" : "emblem-system",
                      "* pack" : "set_image",
-                     "xtype" : "Image",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "height_request" : 50,
                    "items" : [
                     {
+                     "* pack" : "set_image",
                      "xtype" : "Image",
                      "utf8 icon_name" : "list-add",
-                     "* pack" : "set_image",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "height_request" : 50,
                    "items" : [
                     {
+                     "utf8 icon_name" : "format-justify-left",
                      "* pack" : "set_image",
                      "xtype" : "Image",
-                     "utf8 icon_name" : "format-justify-left",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "height_request" : 50,
                    "items" : [
                     {
+                     "xtype" : "Image",
                      "utf8 icon_name" : "appointment-new",
                      "* pack" : "set_image",
-                     "xtype" : "Image",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "height_request" : 50,
                    "items" : [
                     {
+                     "utf8 icon_name" : "folder-new",
                      "* pack" : "set_image",
                      "xtype" : "Image",
-                     "utf8 icon_name" : "folder-new",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "height_request" : 50,
                    "items" : [
                     {
+                     "* pack" : "set_image",
                      "xtype" : "Image",
                      "utf8 icon_name" : "document-new",
-                     "* pack" : "set_image",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "height_request" : 50,
                    "items" : [
                     {
+                     "utf8 icon_name" : "user-trash",
                      "* pack" : "set_image",
                      "xtype" : "Image",
-                     "utf8 icon_name" : "user-trash",
                      "$ xns" : "Gtk"
                     }
                    ]
        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
        "items" : [
         {
+         "* pack" : "pack_start,true,true,0",
          "xtype" : "Label",
          "string label" : "   ",
-         "* pack" : "pack_start,true,true,0",
          "$ xns" : "Gtk"
         },
         {
         },
         {
          "listeners" : {
-          "key_press_event" : "(event) => {\n    \n \tif (event.keyval == Gdk.Key.Return) {\n\t\tthis.forwardSearch();\n\t    return true;\n\n\t}    \n   // print(event.key.keyval)\n    \n    return false;\n\n} ",
-          "changed" : "() => {\n\tif (this.el.text == \"\") {\n\t\treturn;\n\t}\n\tvar res = 0;\n\tswitch(_this.windowstate.state) {\n\t\tcase WindowState.State.CODEONLY:\n\t\tcase WindowState.State.CODE:\n\t\t\t// search the code being edited..\n\t\t\tres = _this.windowstate.code_editor.search(this.el.text);\n\t\t\t\n\t\t\tbreak;\n\t\tcase WindowState.State.PREVIEW:\n\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {\n\t\t\t\t res = _this.windowstate.window_gladeview.search(this.el.text);\n\t\t\t} else { \n\t\t\t\t res = _this.windowstate.window_rooview.search(this.el.text);\t\t\t\n\t\t\t}\n\t\t\n\t\t\n\t\t\tbreak;\n\t}\n\tif (res > 0) {\n\t\t_this.search_results.el.label = \"%d Matches\".printf(res);\n\t} else {\n\t\t_this.search_results.el.label = \"No Matches\";\n\t}\n\t\t\n\t\n\t\n}\n"
+          "key_press_event" : "(event) => {\n    \n \tif (event.keyval == Gdk.Key.Return) {\n\t\tthis.forwardSearch(false);\n\t    return true;\n\n\t}    \n   // print(event.key.keyval)\n    \n    return false;\n\n} ",
+          "changed" : "() => {\n\tif (this.el.text == \"\") {\n\t\t_this.search_results.el.hide();\n\t\treturn;\n\t}\n\tvar res = 0;\n\tswitch(_this.windowstate.state) {\n\t\tcase WindowState.State.CODEONLY:\n\t\tcase WindowState.State.CODE:\n\t\t\t// search the code being edited..\n\t\t\tres = _this.windowstate.code_editor.search(this.el.text);\n\t\t\t\n\t\t\tbreak;\n\t\tcase WindowState.State.PREVIEW:\n\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {\n\t\t\t\t res = _this.windowstate.window_gladeview.search(this.el.text);\n\t\t\t} else { \n\t\t\t\t res = _this.windowstate.window_rooview.search(this.el.text);\t\t\t\n\t\t\t}\n\t\t\n\t\t\n\t\t\tbreak;\n\t}\n\t_this.search_results.el.show();\n\tif (res > 0) {\n\t\t_this.search_results.el.label = \"%d Matches\".printf(res);\n\t} else {\n\t\t_this.search_results.el.label = \"No Matches\";\n\t}\n\t\t\n\t\n\t\n}\n"
          },
          "id" : "search_entry",
          "* init" : "var description =   Pango.FontDescription.from_string(\"monospace\");\n\tdescription.set_size(8000);\n\t this.el.override_font(description);\n\n",
          "* pack" : "pack_start,false,true,0",
-         "xtype" : "Entry",
+         "xtype" : "SearchEntry",
          "$ xns" : "Gtk",
-         "| void forwardSearch" : "() {\n\tswitch(_this.windowstate.state) {\n\t\tcase WindowState.State.CODEONLY:\n\t\tcase WindowState.State.CODE:\n\t\t\t// search the code being edited..\n\t\t\t_this.windowstate.code_editor.forwardSearch();\n\t\t\t\n\t\t\tbreak;\n\t\tcase WindowState.State.PREVIEW:\n\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {\n\t\t\t\t_this.windowstate.window_gladeview.forwardSearch();\n\t\t\t} else { \n\t\t\t\t _this.windowstate.window_rooview.forwardSearch();\n\t\t\t}\n\t\t\n\t\t\tbreak;\n\t}\n}\n"
+         "| void forwardSearch" : "(bool change_focus) {\n\tswitch(_this.windowstate.state) {\n\t\tcase WindowState.State.CODEONLY:\n\t\tcase WindowState.State.CODE:\n\t\t\t// search the code being edited..\n\t\t\t_this.windowstate.code_editor.forwardSearch(change_focus);\n\t\t\t\n\t\t\tbreak;\n\t\tcase WindowState.State.PREVIEW:\n\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {\n\t\t\t\t_this.windowstate.window_gladeview.forwardSearch(change_focus);\n\t\t\t} else { \n\t\t\t\t _this.windowstate.window_rooview.forwardSearch(change_focus);\n\t\t\t}\n\t\t\n\t\t\tbreak;\n\t}\n\t\n}\n"
         },
         {
          "* pack" : "pack_end,false,true,0",
            "$ xns" : "Gtk",
            "items" : [
             {
+             "* pack" : "set_image",
              "xtype" : "Image",
              "utf8 icon_name" : "system-search",
-             "* pack" : "set_image",
              "bool sensitive" : false,
              "$ xns" : "Gtk"
             }
            ]
           },
           {
-           "string label" : "Compile Status:",
+           "id" : "statusbar_compilestatus_label",
            "* pack" : "add",
            "xtype" : "MenuItem",
+           "string label" : "Compile Status:",
            "$ xns" : "Gtk"
           },
           {
            "$ xns" : "Gtk",
            "items" : [
             {
+             "xtype" : "Image",
              "utf8 icon_name" : "dialog-error",
              "* pack" : "set_image",
-             "xtype" : "Image",
              "$ xns" : "Gtk"
             }
            ]
            "$ xns" : "Gtk",
            "items" : [
             {
+             "* pack" : "set_image",
              "xtype" : "Image",
              "utf8 icon_name" : "dialog-warning",
-             "* pack" : "set_image",
              "$ xns" : "Gtk"
             }
            ]
            "$ xns" : "Gtk",
            "items" : [
             {
+             "utf8 icon_name" : "dialog-information",
              "* pack" : "set_image",
              "xtype" : "Image",
-             "utf8 icon_name" : "dialog-information",
              "$ xns" : "Gtk"
             }
            ]
            "$ xns" : "Gtk",
            "items" : [
             {
+             "* pack" : "set_image",
              "xtype" : "Image",
              "utf8 icon_name" : "media-playback-start",
-             "* pack" : "set_image",
              "$ xns" : "Gtk"
             }
            ]