"response" : " (self, response_id) => { \n \n\tif (response_id < 1) { // cancel!\n this.el.hide();\n return;\n }\n\n if (_this.name.el.get_text().length < 1) {\n StandardErrorDialog.show(\n this.el,\n \"You have to set Component name \"\n );\n \n return;\n }\n // what does this do?\n \n var isNew = _this.file.name.length > 0 ? false : true;\n \n if (!isNew && this.file.name != _this.name.el.get_text()) {\n Xcls_StandardErrorDialog.singleton().show(\n this.el,\n \"Sorry changing names does not work yet. \"\n );\n \n return;\n }\n \n \n \n \n // FIXME - this may be more complicated...\n //for (var i in this.def) {\n // this.file[i] = this.get(i).el.get_text();\n //}\n\n if (!isNew) {\n this.updateFileFromEntry();\n \n \n _this.file.save();\n this.el.hide();\n return;\n }\n var fn = this.name.el.get_text();\n var dir = _this.project.firstPath();\n \n if (GLib.FileUtils.test(dir + \"/\" + fn + \".bjs\", GLib.FileTest.EXISTS)) {\n Xcls_StandardErrorDialog.singleton().show(\n this.el,\n \"That file already exists\"\n ); \n return;\n }\n \n var f = JsRender.JsRender.factory(\n _this.file.project.xtype, \n _this.file.project, \n dir + \"/\" + fn + \".bjs\");\n\n _this.file = f;\n \n\n \n this.updateFileFromEntry();\n _this.file.save();\n _this.file.project.addFile(_this.file);\n \n\t \n // what about .js ?\n \n this.el.hide();\n \n \n //var tmpl = this.project.loadFileOnly(DialogNewComponent.get('template').getValue());\n \n //var nf = _this.project.create(dir + \"/\" + _this.file.name + \".bjs\");\n //for (var i in this.file) {\n // nf[i] = this.file[i];\n //}\n _this.success(_this.project, _this.file);\n /*\n\n -- fixme -- needs to be a signal..\n if (DialogNewComponent.success != null) {\n DialogNewComponent.success(_this.project, nf);\n }\n */\n}",
"show" : "(self) => {\n this.el.show_all();\n //test\n}"
},
- "| void show" : "(JsRender.JsRender c) \n{\n this.project = c.project;\n \n //if (!this.el) {\n //this.init();\n //}\n \n _this.name.el.set_text(c.name);\n _this.title.el.set_text(c.title);\n _this.parent.el.set_text(c.parent); \n _this.region.el.set_text(c.region);\n _this.modOrder.el.set_text(c.modOrder);\n _this.permname.el.set_text(c.permname);\n \n if (c.path.length > 0) {\n this.el.set_title(\"Edit File Details - \" + c.name);\n } else {\n this.el.set_title(\"Create New File\");\n }\n \n _this.file = c;\n //console.log('show all');\n this.el.show_all();\n \n //this.success = c.success;\n \n \n}",
- "id" : "DialogNewComponent",
+ "| void updateFileFromEntry" : "() {\n\n _this.file.title = _this.title.el.get_text();\n _this.file.region = _this.region.el.get_text(); \n _this.file.parent = _this.parent.el.get_text(); \n _this.file.permname = _this.permname.el.get_text(); \n _this.file.modOrder = _this.modOrder.el.get_text(); \n} ",
"@ void success" : "(Project.Project pr, JsRender.JsRender file)",
+ "id" : "DialogNewComponent",
"default_width" : 500,
"$ deletable" : true,
- "| void updateFileFromEntry" : "() {\n\n _this.file.title = _this.title.el.get_text();\n _this.file.region = _this.region.el.get_text(); \n _this.file.parent = _this.parent.el.get_text(); \n _this.file.permname = _this.permname.el.get_text(); \n _this.file.modOrder = _this.modOrder.el.get_text(); \n} ",
"# Project.Project project" : "",
"title" : "New Component",
"xtype" : "Dialog",
+ "| void show" : "(JsRender.JsRender c) \n{\n this.project = c.project;\n \n //if (!this.el) {\n //this.init();\n //}\n \n _this.name.el.set_text(c.name);\n _this.title.el.set_text(c.title);\n _this.parent.el.set_text(c.parent); \n _this.region.el.set_text(c.region);\n _this.modOrder.el.set_text(c.modOrder);\n _this.permname.el.set_text(c.permname);\n \n if (c.path.length > 0) {\n this.el.set_title(\"Edit File Details - \" + c.name);\n } else {\n this.el.set_title(\"Create New File\");\n }\n \n _this.file = c;\n //console.log('show all');\n this.el.show_all();\n \n //this.success = c.success;\n \n \n}",
"# JsRender.JsRender file" : "null",
"default_height" : 200,
"$ modal" : true,
},
{
"label" : "Region",
- "$ visible" : true,
"tooltip_text" : "center, north, south, east, west",
+ "$ visible" : true,
"xalign" : 0.90000000000000002,
"* pack" : "attach_defaults,0,1,2,3",
"xtype" : "Label",
},
{
"label" : "Cancel",
- "xtype" : "Button",
"* pack" : "add_action_widget,0",
+ "xtype" : "Button",
"$ xns" : "Gtk"
},
{
"label" : "OK",
- "xtype" : "Button",
"* pack" : "add_action_widget,1",
+ "xtype" : "Button",
"$ xns" : "Gtk"
}
]
console = imports.console;
XObject = imports.XObject.XObject;
DialogNewComponent=new XObject({
+ updateFileFromEntry : () {
+
+ _this.file.title = _this.title.el.get_text();
+ _this.file.region = _this.region.el.get_text();
+ _this.file.parent = _this.parent.el.get_text();
+ _this.file.permname = _this.permname.el.get_text();
+ _this.file.modOrder = _this.modOrder.el.get_text();
+ },
+ success : "(Project.Project pr, JsRender.JsRender file)",
+ id : "DialogNewComponent",
+ default_width : 500,
+ deletable : TRUE,
+ project : "",
+ title : "New Component",
+ xtype : "Dialog",
show : (JsRender.JsRender c)
{
this.project = c.project;
},
- id : "DialogNewComponent",
- success : "(Project.Project pr, JsRender.JsRender file)",
- default_width : 500,
- deletable : FALSE,
- updateFileFromEntry : () {
-
- _this.file.title = _this.title.el.get_text();
- _this.file.region = _this.region.el.get_text();
- _this.file.parent = _this.parent.el.get_text();
- _this.file.permname = _this.permname.el.get_text();
- _this.file.modOrder = _this.modOrder.el.get_text();
- },
- project : "",
- title : "New Component",
- xtype : "Dialog",
file : "null",
default_height : 200,
modal : TRUE,
},
{
label : "Region",
- visible : TRUE,
tooltip_text : "center, north, south, east, west",
+ visible : TRUE,
xalign : 0.900000,
xtype : "Label",
justify : Gtk.Justification.RIGHT,
this.el.title = "New Component";
this.el.default_height = 200;
this.el.default_width = 500;
- this.el.deletable = false;
+ this.el.deletable = true;
this.el.modal = true;
var child_0 = new Xcls_VBox2( _this );
child_0.ref();
}
// user defined functions
- public void show (JsRender.JsRender c)
+ public void updateFileFromEntry () {
+
+ _this.file.title = _this.title.el.get_text();
+ _this.file.region = _this.region.el.get_text();
+ _this.file.parent = _this.parent.el.get_text();
+ _this.file.permname = _this.permname.el.get_text();
+ _this.file.modOrder = _this.modOrder.el.get_text();
+ }
+ public void show (JsRender.JsRender c)
{
this.project = c.project;
//this.success = c.success;
- }
- public void updateFileFromEntry () {
-
- _this.file.title = _this.title.el.get_text();
- _this.file.region = _this.region.el.get_text();
- _this.file.parent = _this.parent.el.get_text();
- _this.file.permname = _this.permname.el.get_text();
- _this.file.modOrder = _this.modOrder.el.get_text();
}
public class Xcls_VBox2 : Object
{
"items" : [
{
"listeners" : {
- "delete_event" : " (self, event) => {\n this.el.response(Gtk.ResponseType.CANCEL);\n return true;\n //test\n}"
+ "delete_event" : " (self, event) => {\n this.el.response(Gtk.ResponseType.CANCEL);\n return true;\n}"
},
"default_width" : 400,
+ "| string show" : " (Gtk.Window parent, Project.Project project, JsRender.Node data) {\n \n \n this.el.set_transient_for(parent);\n this.el.modal = true;\n \n this.data = data;\n this.project = project;\n this.name.el.set_text(\"\");\n this.el.show_all();\n var name = \"\";\n while (true) {\n var response_id = this.el.run();\n if (response_id < 1) {\n this.el.hide();\n return \"\";\n }\n \n name = _this.name.el.get_text();\n if (name.length < 1) {\n StandardErrorDialog.singleton().show(\n (Gtk.Window) _this.el,\n \"You must give the template a name. \"\n );\n continue;\n }\n if (!Regex.match_simple (\"^[A-Za-z.]+$\", name) || \n !Regex.match_simple (\"^[A-Za-z.]+$\", name) )\n {\n StandardErrorDialog.show(\n (Gtk.Window) _this.el,\n\n \"Template Nane must contain only letters dots\"\n );\n continue;\n }\n break;\n }\n var f = project.newFile(name);\n f.tree = _this.data.deepClone();\n f.save();\n \n // now we save it..\n this.el.hide();\n \n return name;\n \n \n \n}\n",
"# Project.Project project" : "",
"xtype" : "Dialog",
- "| string show" : " (Gtk.Window parent, Project.Project project, JsRender.Node data) {\n \n \n this.el.set_transient_for(parent);\n this.el.modal = true;\n \n this.data = data;\n this.project = project;\n this.name.el.set_text(\"\");\n this.el.show_all();\n var name = \"\";\n while (true) {\n var response_id = this.el.run();\n if (response_id < 1) {\n this.el.hide();\n return \"\";\n }\n \n name = _this.name.el.get_text();\n if (name.length < 1) {\n StandardErrorDialog.singleton().show(\n (Gtk.Window) _this.el,\n \"You must give the template a name. \"\n );\n continue;\n }\n if (!Regex.match_simple (\"^[A-Za-z.]+$\", name) || \n !Regex.match_simple (\"^[A-Za-z.]+$\", name) )\n {\n StandardErrorDialog.show(\n (Gtk.Window) _this.el,\n\n \"Template Nane must contain only letters dots\"\n );\n continue;\n }\n break;\n }\n var f = project.newFile(name);\n f.tree = _this.data.deepClone();\n f.save();\n \n // now we save it..\n this.el.hide();\n \n return name;\n \n \n \n}\n",
"default_height" : 200,
"$ modal" : true,
"# JsRender.Node data" : "",
"items" : [
{
"label" : "Name",
- "xtype" : "Label",
"* pack" : "add",
+ "xtype" : "Label",
"$ xns" : "Gtk"
},
{
"id" : "name",
- "xtype" : "Entry",
"* pack" : "add",
+ "xtype" : "Entry",
"$ xns" : "Gtk"
}
]
},
{
"label" : "Cancel",
- "xtype" : "Button",
"* pack" : "add_action_widget,0",
+ "xtype" : "Button",
"$ xns" : "Gtk"
},
{
"label" : "OK",
- "xtype" : "Button",
"* pack" : "add_action_widget,1",
+ "xtype" : "Button",
"$ xns" : "Gtk"
}
]
XObject = imports.XObject.XObject;
DialogSaveModule=new XObject({
default_width : 400,
- project : "",
- xtype : "Dialog",
show : (Gtk.Window parent, Project.Project project, JsRender.Node data) {
},
+ project : "",
+ xtype : "Dialog",
default_height : 200,
- modal : true,
+ modal : TRUE,
data : "",
xns : Gtk,
listeners : {
delete_event : (self, event) => {
this.el.response(Gtk.ResponseType.CANCEL);
return true;
- //test
}
},
items : [
-static Xcls_DialogSaveModule _DialogSaveModule;
+static DialogSaveModule _DialogSaveModule;
-public class Xcls_DialogSaveModule : Object
+public class DialogSaveModule : Object
{
public Gtk.Dialog el;
- private Xcls_DialogSaveModule _this;
+ private DialogSaveModule _this;
- public static Xcls_DialogSaveModule singleton()
+ public static DialogSaveModule singleton()
{
if (_DialogSaveModule == null) {
- _DialogSaveModule= new Xcls_DialogSaveModule();
+ _DialogSaveModule= new DialogSaveModule();
}
return _DialogSaveModule;
}
public JsRender.Node data;
// ctor
- public Xcls_DialogSaveModule()
+ public DialogSaveModule()
{
_this = this;
this.el = new Gtk.Dialog();
this.el.delete_event.connect( (self, event) => {
this.el.response(Gtk.ResponseType.CANCEL);
return true;
- //test
});
}
// user defined functions
- public string show (Gtk.Window parent, Project.Project project, JsRender.Node data) {
+ public string show (Gtk.Window parent, Project.Project project, JsRender.Node data) {
this.el.set_transient_for(parent);
public class Xcls_HBox2 : Object
{
public Gtk.HBox el;
- private Xcls_DialogSaveModule _this;
+ private DialogSaveModule _this;
// my vars (def)
// ctor
- public Xcls_HBox2(Xcls_DialogSaveModule _owner )
+ public Xcls_HBox2(DialogSaveModule _owner )
{
_this = _owner;
this.el = new Gtk.HBox( true, 0 );
public class Xcls_Label3 : Object
{
public Gtk.Label el;
- private Xcls_DialogSaveModule _this;
+ private DialogSaveModule _this;
// my vars (def)
// ctor
- public Xcls_Label3(Xcls_DialogSaveModule _owner )
+ public Xcls_Label3(DialogSaveModule _owner )
{
_this = _owner;
this.el = new Gtk.Label( "Name" );
public class Xcls_name : Object
{
public Gtk.Entry el;
- private Xcls_DialogSaveModule _this;
+ private DialogSaveModule _this;
// my vars (def)
// ctor
- public Xcls_name(Xcls_DialogSaveModule _owner )
+ public Xcls_name(DialogSaveModule _owner )
{
_this = _owner;
_this.name = this;
public class Xcls_Button5 : Object
{
public Gtk.Button el;
- private Xcls_DialogSaveModule _this;
+ private DialogSaveModule _this;
// my vars (def)
// ctor
- public Xcls_Button5(Xcls_DialogSaveModule _owner )
+ public Xcls_Button5(DialogSaveModule _owner )
{
_this = _owner;
this.el = new Gtk.Button();
public class Xcls_Button6 : Object
{
public Gtk.Button el;
- private Xcls_DialogSaveModule _this;
+ private DialogSaveModule _this;
// my vars (def)
// ctor
- public Xcls_Button6(Xcls_DialogSaveModule _owner )
+ public Xcls_Button6(DialogSaveModule _owner )
{
_this = _owner;
this.el = new Gtk.Button();
{
- "id": "file-gtk-11",
- "name": "MainWindow",
- "parent": "",
- "title": false,
- "path": "/home/alan/gitlive/app.Builder.js/Builder4/MainWindow.bjs",
- "items": [
+ "name" : "MainWindow",
+ "parent" : "",
+ "title" : "",
+ "path" : "/home/alan/gitlive/app.Builder.js/Builder4/MainWindow.bjs",
+ "permname" : "",
+ "modOrder" : "",
+ "items" : [
{
- "listeners": {
- "show": " ( ) => {\n // hide the file editing..\n \n //this.hideViewEditing();\n}",
- "delete_event": " ( event) => {\n return false;\n}",
- "destroy": "() => {\n Gtk.main_quit();\n}"
+ "listeners" : {
+ "delete_event" : " ( event) => {\n return false;\n}",
+ "destroy" : "() => {\n Gtk.main_quit();\n}",
+ "show" : " ( ) => {\n // hide the file editing..\n \n //this.hideViewEditing();\n}"
},
- ".Project.Project:project": "null",
- ".Xcls_ClutterFiles:clutterfiles": "null",
- ".Xcls_DialogNewComponent:new_file_dialog": "null",
- ".Xcls_Editor:code_editor": "null",
- ".Xcls_GladeView:window_gladeview": "null",
- ".Xcls_LeftProps:left_props": "null",
- ".Xcls_ProjectSettings:projectsettings": "null",
- ".Xcls_RightPalete:rightpalete": "null",
- ".Xcls_WindowAddProp:add_props": "null",
- ".Xcls_WindowLeftProjects:left_projects": "null",
- ".Xcls_WindowLeftTree:left_tree": "null",
- ".Xcls_WindowRooView:window_rooview": "null",
- ".bool:children_loaded": "false",
- ".string:state": "",
- ".string:title": "\"Application Builder\"",
- "border_width": 0,
- "default_height": 500,
- "default_width": 800,
- "id": "MainWindow",
- "xtype": "Window",
- "|init": " this.state = \"files\";\n\t \n //this.el.show_all();\n \n ",
- "|type": "Gtk.WindowType.TOPLEVEL",
- "|void:hideAddListener": "() {\n _this.backbutton.el.hide();\n _this.projectbutton.el.show(); \n _this.projecteditbutton.el.show();\n _this.editfilebutton.el.show(); \n _this.addpropsview.el.save_easing_state();\n var el = _this.rooview.el;\n el.save_easing_state();\n\n \n el.set_scale(1.0f,1.0f);\n _this.addpropsview.el.set_scale(0.0f,0.0f);\n _this.state = \"edit\";\n\n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.addpropsview.el.restore_easing_state(); \n }",
- "|void:hideAddProp": "() {\n _this.backbutton.el.hide();\n _this.projectbutton.el.show(); \n _this.projecteditbutton.el.show();\n _this.editfilebutton.el.show(); \n _this.addpropsview.el.save_easing_state();\n \n var el = _this.rooview.el;\n el.save_easing_state();\n\n \n el.set_scale(1.0f,1.0f);\n _this.addpropsview.el.set_scale(0.0f,0.0f);\n _this.state = \"edit\";\n\n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.addpropsview.el.restore_easing_state(); \n }",
- "|void:hideCodeEdit": "() {\n //this.code_editor.saveContents();\n _this.backbutton.el.hide();\n _this.projectbutton.el.show(); \n _this.projecteditbutton.el.show();\n _this.editfilebutton.el.show(); \n _this.codeeditview.el.save_easing_state();\n var el = _this.rooview.el;\n el.save_easing_state();\n\n \n el.set_scale(1.0f,1.0f);\n _this.codeeditview.el.set_scale(0.0f,0.0f);\n _this.state = \"edit\";\n\n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.codeeditview.el.restore_easing_state(); \n }",
- "|void:hideObject": "() {\n // return to editing state..\n \n _this.projecteditbutton.el.show();\n _this.backbutton.el.hide();\n _this.projectbutton.el.show(); \n _this.editfilebutton.el.show(); \n _this.objectview.el.save_easing_state();\n var el = _this.rooview.el;\n el.save_easing_state();\n\n \n el.set_scale(1.0f,1.0f);\n _this.objectview.el.set_scale(0.0f,0.0f);\n _this.state = \"edit\";\n\n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.objectview.el.restore_easing_state(); \n \n\n}",
- "|void:hideProjectEdit": " () {\n // return to editing state..\n \n _this.projectbutton.el.show();\n _this.projecteditbutton.el.show();\n _this.backbutton.el.hide();\n _this.editfilebutton.el.show(); \n \n //this.rooview.el.hide();\n //this.edit_project.el.show();\n _this.projecteditview.el.save_easing_state();\n var el = _this.rooview.el;\n el.save_easing_state();\n\n \n el.set_scale(1.0f,1.0f);\n _this.projecteditview.el.set_scale(1.0f,0.0f);\n _this.state = \"edit\";\n\n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.projecteditview.el.restore_easing_state(); \n \n}\n",
- "|void:hideViewEditing": " ( ) {\n\n// show the file navigation...\n \n if (this.left_tree.getActiveFile() != null) {\n if (this.left_tree.getActiveFile().xtype == \"Roo\" ) {\n this.window_rooview.createThumb();\n } else {\n this.window_gladeview.createThumb();\n }\n }\n \n _this.addprojectbutton.el.show(); \n _this.addfilebutton.el.show(); \n _this.backbutton.el.show();\n _this.delprojectbutton.el.show();\n \n _this.editfilebutton.el.hide(); \n _this.projectbutton.el.hide(); \n _this.projecteditbutton.el.hide();\n _this.objectshowbutton.el.hide();\n _this.addpropbutton.el.hide(); \n _this.addlistenerbutton.el.hide(); \n\n\n\n\n \n // show the add file button..\n \n \n \n this.editpane.el.hide();\n //this.rooview.el.hide();\n this.left_projects.el.show();\n \n var el = _this.rooview.el;\n el.save_easing_state();\n el.set_easing_duration(1000);\n // show project / file view..\n //_this.mainpane.lastWidth = _this.leftpane.el.get_position();\n //_this.mainpane.el.set_position(0);\n // rotate y 180..\n el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 360.0f);\n el.set_scale(0.0f,0.0f);\n \n _this.state = \"files\";\n if (_this.project != null) {\n _this.left_projects.selectProject(_this.project);\n }\n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n \n print(\"show view browsing\");\n}",
- "|void:initChildren": " () {\n // this needs putting in a better place..\n \n print(\"init children\");\n this.left_tree = new Xcls_WindowLeftTree();\n this.left_tree.ref();\n this.tree.el.pack_start(this.left_tree.el,true, true,0);\n this.left_tree.el.show_all();\n \n this.left_tree.before_node_change.connect(() => {\n if (this.state != \"codeedit\") {\n this.left_props.finish_editing();\n return true;\n }\n if (!this.code_editor.saveContents()) {\n return false;\n }\n return false;\n \n });\n \n this.left_tree.node_selected.connect((sel) => {\n \n print(\"node_selected called %s\\n\", (sel == null) ? \"NULL\" : \"a value\");\n \n if (sel == null) {\n this.left_props.el.hide();\n } \n this.left_props.el.show();\n this.left_props.load(this.left_tree.getActiveFile(), sel);\n switch (this.state) {\n case \"object\": \n \n if (sel == null) {\n this.rightpalete.clear();\n break;\n }\n this.rightpalete.load(_this.left_tree.getActiveFile().palete(), sel.fqn());\n break;\n \n \n case \"addprop\":\n if (sel == null) {\n this.add_props.clear();\n break;\n }\n this.add_props.show(_this.left_tree.getActiveFile().palete(), \"props\", sel.fqn());\n break;\n \n case \"addlistener\":\n if (sel == null) {\n this.add_props.clear();\n break;\n }\n this.add_props.show(_this.left_tree.getActiveFile().palete(), \"signals\", sel.fqn());\n break;\n\n case \"codeedit\":\n \n this.hideCodeEdit();\n break;\n \n \n }\n return ;\n \n });\n \n this.left_tree.changed.connect(() => {\n this.window_rooview.requestRedraw();\n this.left_tree.model.file.save();\n });\n \n \n\n // left properties\n\n this.left_props =new Xcls_LeftProps();\n this.left_props.ref();\n this.props.el.pack_start(this.left_props.el,true, true,0);\n this.left_props.el.show_all();\n \n this.left_props.show_editor.connect( (file, node, type, key) => {\n this.showCodeEdit(node, type, key);\n });\n this.left_props.stop_editor.connect( () => {\n if (this.state != \"codeedit\") {\n return true;\n }\n \n var ret = this.code_editor.saveContents();\n if (!ret) {\n return false;\n }\n this.hideCodeEdit();\n return ret;\n });\n this.left_props.changed.connect(() => {\n if (this.left_tree.getActiveFile().xtype == \"Roo\" ) {\n this.window_rooview.requestRedraw();\n \n } else {\n this.window_gladeview.loadFile(this.left_tree.getActiveFile());\n }\n this.left_tree.model.file.save();\n });\n \n\n\n\n // left projects..\n this.left_projects = new Xcls_WindowLeftProjects();\n this.left_projects.ref();\n this.leftpane.el.pack_start(this.left_projects.el,true, true,0);\n this.left_projects.el.show_all();\n this.left_projects.project_selected.connect((proj) => {\n proj.scanDirs();\n _this.clutterfiles.loadProject(proj);\n \n });\n \n \n // project edit..\n this.projectsettings =new Xcls_ProjectSettings();\n this.projectsettings.ref(); /// really?\n ((Gtk.Container)(this.projecteditview.el.get_widget())).add(this.projectsettings.el);\n //this.projectsettings.el.show_all();\n\n var stage = _this.projecteditview.el.get_stage();\n stage.set_background_color( Clutter.Color.from_string(\"#000\"));\n \n this.projectsettings.buttonPressed.connect((btn) => {\n if (this.left_tree.getActiveFile().xtype == \"Roo\" ) {\n \n if (btn == \"save\") {\n _this.window_rooview.view.renderJS(true);\n }\n if (btn == \"apply\") {\n _this.window_rooview.view.renderJS(true);\n return;\n }\n } else {\n // do nothing for gtk..\n }\n if (btn == \"save\" || btn == \"apply\") {\n _this.project.save();\n \n }\n \n this.hideProjectEdit();\n \n });\n \n \n // objects (palate..)\n this.rightpalete = new Xcls_RightPalete();\n this.rightpalete.ref(); /// really?\n ((Gtk.Container)(this.objectview.el.get_widget())).add(this.rightpalete.el);\n //this.projectsettings.el.show_all();\n\n stage = _this.objectview.el.get_stage();\n stage.set_background_color( Clutter.Color.from_string(\"#000\"));\n \n /*this.projectsettings.buttonPressed.connect((btn) => {\n if (btn == \"save\") {\n _this.window_rooview.view.renderJS(true);\n }\n if (btn == \"apply\") {\n _this.window_rooview.view.renderJS(true);\n return;\n }\n this.hideProjectEdit();\n \n });\n */\n \n \n \n // Add properties\n this.add_props = new Xcls_WindowAddProp();\n this.add_props.ref(); /// really?\n ((Gtk.Container)(this.addpropsview.el.get_widget())).add(this.add_props.el);\n //this.projectsettings.el.show_all();\n\n stage = _this.addpropsview.el.get_stage();\n stage.set_background_color( Clutter.Color.from_string(\"#000\"));\n \n \n _this.add_props.select.connect( (key,type,skel, etype) => {\n this.left_props.addProp(etype, key, skel, type);\n });\n \n // editor\n \n \n this.code_editor = new Xcls_Editor();\n this.code_editor.ref(); /// really?\n ((Gtk.Container)(this.codeeditview.el.get_widget())).add(this.code_editor.el);\n //this.projectsettings.el.show_all();\n\n stage = _this.codeeditview.el.get_stage();\n stage.set_background_color( Clutter.Color.from_string(\"#000\"));\n // editor.save...\n\n _this.code_editor.save.connect( () => {\n this.left_tree.model.file.save();\n });\n \n \n \n \n // roo view\n \n this.window_rooview =new Xcls_WindowRooView();\n this.window_rooview.ref();\n ((Gtk.Container)(this.rooview.el.get_widget())).add(this.window_rooview.el);\n this.window_rooview.el.show_all();\n\n stage = _this.rooview.el.get_stage();\n stage.set_background_color( Clutter.Color.from_string(\"#000\"));\n \n \n // glade view\n \n this.window_gladeview =new Xcls_GladeView();\n this.window_gladeview.ref();\n\n //((Gtk.Container)(this.rooview.el.get_widget())).add(this.window_gladeview.el);\n ///this.window_gladeview.el.hide();\n\n \n \n // clutter files\n \n \n this.clutterfiles = new Xcls_ClutterFiles();\n this.clutterfiles.ref();\n stage.add_child(this.clutterfiles.el);\n this.clutterfiles.el.show_all();\n\n\n this.clutterfiles.open.connect((file) => { \n _this.project = file.project;\n _this.showViewEditing();\n this.left_tree.model.loadFile(file);\n var ctr= ((Gtk.Container)(this.rooview.el.get_widget()));\n if (file.xtype == \"Roo\" ) { \n ctr.foreach( (w) => { ctr.remove(w); });\n ctr.add(this.window_rooview.el);\n this.window_rooview.loadFile(file);\n \n this.window_rooview.el.show_all();\n } else {\n ctr.foreach( (w) => { ctr.remove(w); });\n ctr.add(this.window_gladeview.el);\n this.window_gladeview.loadFile(file);\n this.window_gladeview.el.show_all();\n }\n print(\"OPEN : \" + file.name);\n\n });\n\n // new file dialog\n this.new_file_dialog = new Xcls_DialogNewComponent();\n // force it modal to the main window..\n this.new_file_dialog.el.set_transient_for(this.el);\n this.new_file_dialog.el.set_modal(true);\n \n this.new_file_dialog.success.connect((project,file) =>\n {\n _this.project = project;\n _this.showViewEditing();\n this.left_tree.model.loadFile(file);\n var ctr= ((Gtk.Container)(this.rooview.el.get_widget()));\n if (file.xtype == \"Roo\" ) { \n ctr.foreach( (w) => { ctr.remove(w); });\n ctr.add(this.window_rooview.el);\n this.window_rooview.loadFile(file);\n \n this.window_rooview.el.show_all();\n } else {\n ctr.foreach( (w) => { ctr.remove(w); });\n ctr.add(this.window_gladeview.el);\n this.window_gladeview.loadFile(file);\n this.window_gladeview.el.show_all();\n }\n \n });\n \n \n\n //w.el.show_all();\n var tl = new Clutter.Timeline(6000);\n tl.set_repeat_count(-1);\n tl.start();\n tl.ref();\n\n this.children_loaded = true;\n\n\n\n\n}\n",
- "|void:setTitle": " (string str) {\n this.el.set_title(this.title + \" - \" + str);\n}\n",
- "|void:show": "() {\n this.left_tree =new Xcls_WindowLeftTree();\n _this.vbox.el.pack_start(this.left_tree.el,true, true,0);\n this.el.show_all();\n\n}",
- "|void:showAddListener": "() {\n\n \n \n var ae = this.left_tree.getActiveElement();\n if (ae == null) {\n return;\n }\n \n _this.backbutton.el.show();\n _this.projectbutton.el.hide();\n _this.editfilebutton.el.hide();\n _this.projecteditbutton.el.hide(); \n \n \n //this.rooview.el.hide();\n this.add_props.el.show_all();\n this.add_props.show(\n Palete.factory(this.project.xtype), \n \"signals\",\n ae.fqn()\n );\n //this.rightpalete.show(this.project);\n\n _this.addpropsview.el.save_easing_state();\n \n var el = _this.rooview.el;\n el.save_easing_state();\n \n \n el.set_scale(0.5f,0.5f);\n\n _this.addpropsview.el.set_scale(1.0f,1.0f);\n \n \n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.addpropsview.el.restore_easing_state();\n this.state = \"addlistener\";\n}",
- "|void:showAddProp": "() {\n\n \n var ae = this.left_tree.getActiveElement();\n if (ae == null) {\n return;\n }\n _this.backbutton.el.show();\n _this.projectbutton.el.hide();\n _this.editfilebutton.el.hide();\n _this.projecteditbutton.el.hide(); \n \n \n \n //this.rooview.el.hide();\n this.add_props.el.show_all();\n this.add_props.show(\n Palete.factory(this.project.xtype), \n \"props\",\n ae.fqn()\n );\n\n _this.addpropsview.el.save_easing_state();\n \n var el = _this.rooview.el;\n el.save_easing_state();\n \n \n el.set_scale(0.5f,0.5f);\n\n _this.addpropsview.el.set_scale(1.0f,1.0f);\n \n \n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.addpropsview.el.restore_easing_state();\n this.state = \"addprop\";\n}",
- "|void:showCodeEdit": "(JsRender.Node node, string ptype, string key)\n{\n // this is a bit different,\n // it's not called via a button - but triggered by the prop edit class signal.\n // so it has to hide any other state..\n \n switch(this.state) {\n case \"object\":\n this.hideObject();\n break;\n case \"addprop\":\n this.hideAddProp();\n break;\n case \"addlistener\":\n this.hideAddListener();\n break;\n }\n \n _this.backbutton.el.show();\n \n _this.projectbutton.el.hide();\n _this.editfilebutton.el.hide();\n _this.projecteditbutton.el.hide(); \n // more?? \n \n //this.rooview.el.hide();\n this.code_editor.el.show_all();\n this.code_editor.show(\n node,\n ptype,\n key\n );\n\n _this.codeeditview.el.save_easing_state();\n \n var el = _this.rooview.el;\n el.save_easing_state();\n \n \n el.set_scale(0.5f,0.5f);\n\n _this.codeeditview.el.set_scale(1.0f,1.0f);\n \n \n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.codeeditview.el.restore_easing_state();\n this.state = \"codeedit\";\n}\n",
- "|void:showObject": "() {\n\n \n // what's the active node on the left hand side..\n \n var n = _this.left_tree.getActiveElement();\n\n if (_this.left_tree.model.file == null) {\n return;\n }\n \n if (n == null && _this.left_tree.model.file.tree != null) {\n return;\n }\n \n _this.backbutton.el.show();\n _this.projectbutton.el.hide();\n _this.editfilebutton.el.hide();\n _this.projecteditbutton.el.hide(); \n \n \n //this.rooview.el.hide();\n this.rightpalete.el.show_all();\n this.rightpalete.load(_this.left_tree.getActiveFile().palete(), n == null ? \"*top\" : n.fqn());\n\n \n //this.rightpalete.show(this.project);\n\n _this.objectview.el.save_easing_state();\n \n var el = _this.rooview.el;\n el.save_easing_state();\n \n \n el.set_scale(0.5f,0.5f);\n\n _this.objectview.el.set_scale(1.0f,1.0f);\n \n \n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.objectview.el.restore_easing_state();\n this.state = \"object\";\n}",
- "|void:showProjectEdit": " () {\n // make the browser smaller, and show the edit dialog\n \n \n _this.projectbutton.el.hide();\n _this.projecteditbutton.el.hide();\n \n _this.editfilebutton.el.hide();\n \n \n \n \n _this.backbutton.el.show();\n \n //this.rooview.el.hide();\n this.projectsettings.el.show_all();\n this.projectsettings.show(this.project);\n _this.projecteditview.el.save_easing_state();\n \n var el = _this.rooview.el;\n el.save_easing_state();\n \n \n el.set_scale(0.5f,0.5f);\n\n _this.projecteditview.el.set_scale(1.0f,1.0f);\n \n _this.state = \"projectedit\";\n \n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.projecteditview.el.restore_easing_state();\n // print(\"show view browsing\");\n \n}\n",
- "|void:showViewEditing": " ( ) {\n this.editpane.el.show();\n // this.rooview.el.show();\n this.left_projects.el.hide();\n \n _this.addprojectbutton.el.hide(); \n _this.delprojectbutton.el.hide();\n _this.addfilebutton.el.hide(); \n _this.backbutton.el.hide();\n \n _this.projectbutton.el.show(); \n _this.editfilebutton.el.show(); \n _this.projecteditbutton.el.show();\n _this.objectshowbutton.el.show();\n _this.addpropbutton.el.show(); \n _this.addlistenerbutton.el.show(); \n \n \n var el = _this.rooview.el;\n el.save_easing_state();\n \n \n el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);\n el.set_scale(1.0f,1.0f);\n _this.state = \"edit\";\n // _this.mainpane.el.set_position(_this.leftpane.lastWidth);\n _this.clutterfiles.el.hide();\n \n el.restore_easing_state();\n \n print(\"show view editing\");\n}",
- "|xns": "Gtk",
- "items": [
+ "| void hideObject" : "() {\n // return to editing state..\n \n _this.projecteditbutton.el.show();\n _this.backbutton.el.hide();\n _this.projectbutton.el.show(); \n _this.editfilebutton.el.show(); \n _this.objectview.el.save_easing_state();\n var el = _this.rooview.el;\n el.save_easing_state();\n\n \n el.set_scale(1.0f,1.0f);\n _this.objectview.el.set_scale(0.0f,0.0f);\n _this.state = \"edit\";\n\n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.objectview.el.restore_easing_state(); \n \n\n}",
+ "| void show" : "() {\n this.left_tree =new Xcls_WindowLeftTree();\n _this.vbox.el.pack_start(this.left_tree.el,true, true,0);\n this.el.show_all();\n\n}",
+ "| void showAddProp" : "() {\n\n \n var ae = this.left_tree.getActiveElement();\n if (ae == null) {\n return;\n }\n _this.backbutton.el.show();\n _this.projectbutton.el.hide();\n _this.editfilebutton.el.hide();\n _this.projecteditbutton.el.hide(); \n \n \n \n //this.rooview.el.hide();\n this.add_props.el.show_all();\n this.add_props.show(\n Palete.factory(this.project.xtype), \n \"props\",\n ae.fqn()\n );\n\n _this.addpropsview.el.save_easing_state();\n \n var el = _this.rooview.el;\n el.save_easing_state();\n _this.clutterembed.setSizesAlloc(\"addprop\");\n \n \n\n _this.addpropsview.el.set_scale(1.0f,1.0f);\n \n \n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.addpropsview.el.restore_easing_state();\n this.state = \"addprop\";\n}",
+ "# Project.Project project" : "null",
+ "| void showProjectEdit" : " () {\n // make the browser smaller, and show the edit dialog\n \n \n _this.projectbutton.el.hide();\n _this.projecteditbutton.el.hide();\n \n _this.editfilebutton.el.hide();\n \n \n \n \n _this.backbutton.el.show();\n \n //this.rooview.el.hide();\n this.projectsettings.el.show_all();\n this.projectsettings.show(this.project);\n _this.projecteditview.el.save_easing_state();\n \n var el = _this.rooview.el;\n el.save_easing_state();\n \n \n el.set_scale(0.5f,0.5f);\n\n _this.projecteditview.el.set_scale(1.0f,1.0f);\n \n _this.state = \"projectedit\";\n \n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.projecteditview.el.restore_easing_state();\n // print(\"show view browsing\");\n \n}\n",
+ "| void showAddListener" : "() {\n\n \n \n var ae = this.left_tree.getActiveElement();\n if (ae == null) {\n return;\n }\n \n _this.backbutton.el.show();\n _this.projectbutton.el.hide();\n _this.editfilebutton.el.hide();\n _this.projecteditbutton.el.hide(); \n \n \n //this.rooview.el.hide();\n this.add_props.el.show_all();\n this.add_props.show(\n Palete.factory(this.project.xtype), \n \"signals\",\n ae.fqn()\n );\n //this.rightpalete.show(this.project);\n\n _this.addpropsview.el.save_easing_state();\n \n var el = _this.rooview.el;\n el.save_easing_state();\n \n _this.clutterembed.setSizesAlloc(\"addlistener\");\n\n \n \n\n _this.addpropsview.el.set_scale(1.0f,1.0f);\n \n \n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.addpropsview.el.restore_easing_state();\n this.state = \"addlistener\";\n}",
+ "# bool children_loaded" : false,
+ "| void setTitle" : " (string str) {\n this.el.set_title(this.title + \" - \" + str);\n}\n",
+ "| void initChildren" : " () {\n // this needs putting in a better place..\n \n print(\"init children\");\n this.left_tree = new Xcls_WindowLeftTree();\n this.left_tree.ref();\n this.tree.el.pack_start(this.left_tree.el,true, true,0);\n this.left_tree.el.show_all();\n \n this.left_tree.before_node_change.connect(() => {\n if (this.state != \"codeedit\") {\n this.left_props.finish_editing();\n return true;\n }\n if (!this.code_editor.saveContents()) {\n return false;\n }\n return false;\n \n });\n \n this.left_tree.node_selected.connect((sel) => {\n \n print(\"node_selected called %s\\n\", (sel == null) ? \"NULL\" : \"a value\");\n \n if (sel == null) {\n this.left_props.el.hide();\n } \n this.left_props.el.show();\n this.left_props.load(this.left_tree.getActiveFile(), sel);\n switch (this.state) {\n case \"object\": \n \n if (sel == null) {\n this.rightpalete.clear();\n break;\n }\n this.rightpalete.load(_this.left_tree.getActiveFile().palete(), sel.fqn());\n break;\n \n \n case \"addprop\":\n if (sel == null) {\n this.add_props.clear();\n break;\n }\n this.add_props.show(_this.left_tree.getActiveFile().palete(), \"props\", sel.fqn());\n break;\n \n case \"addlistener\":\n if (sel == null) {\n this.add_props.clear();\n break;\n }\n this.add_props.show(_this.left_tree.getActiveFile().palete(), \"signals\", sel.fqn());\n break;\n\n case \"codeedit\":\n \n this.hideCodeEdit();\n break;\n \n \n }\n return ;\n \n });\n \n this.left_tree.changed.connect(() => {\n this.window_rooview.requestRedraw();\n this.left_tree.model.file.save();\n });\n \n \n\n // left properties\n\n this.left_props =new Xcls_LeftProps();\n this.left_props.ref();\n this.props.el.pack_start(this.left_props.el,true, true,0);\n this.left_props.el.show_all();\n \n this.left_props.show_editor.connect( (file, node, type, key) => {\n this.showCodeEdit(node, type, key);\n });\n this.left_props.stop_editor.connect( () => {\n if (this.state != \"codeedit\") {\n return true;\n }\n \n var ret = this.code_editor.saveContents();\n if (!ret) {\n return false;\n }\n this.hideCodeEdit();\n return ret;\n });\n this.left_props.changed.connect(() => {\n if (this.left_tree.getActiveFile().xtype == \"Roo\" ) {\n this.window_rooview.requestRedraw();\n \n } else {\n this.window_gladeview.loadFile(this.left_tree.getActiveFile());\n }\n this.left_tree.model.file.save();\n });\n \n\n\n\n // left projects..\n this.left_projects = new Xcls_WindowLeftProjects();\n this.left_projects.ref();\n this.leftpane.el.pack_start(this.left_projects.el,true, true,0);\n this.left_projects.el.show_all();\n this.left_projects.project_selected.connect((proj) => {\n proj.scanDirs();\n _this.clutterfiles.loadProject(proj);\n \n });\n \n \n // project edit..\n this.projectsettings =new Xcls_ProjectSettings();\n this.projectsettings.ref(); /// really?\n ((Gtk.Container)(this.projecteditview.el.get_widget())).add(this.projectsettings.el);\n //this.projectsettings.el.show_all();\n\n var stage = _this.projecteditview.el.get_stage();\n stage.set_background_color( Clutter.Color.from_string(\"#000\"));\n \n this.projectsettings.buttonPressed.connect((btn) => {\n if (this.left_tree.getActiveFile().xtype == \"Roo\" ) {\n \n if (btn == \"save\") {\n _this.window_rooview.view.renderJS(true);\n }\n if (btn == \"apply\") {\n _this.window_rooview.view.renderJS(true);\n return;\n }\n } else {\n // do nothing for gtk..\n }\n if (btn == \"save\" || btn == \"apply\") {\n _this.project.save();\n \n }\n \n this.hideProjectEdit();\n \n });\n \n \n // objects (palate..)\n this.rightpalete = new Xcls_RightPalete();\n this.rightpalete.ref(); /// really?\n ((Gtk.Container)(this.objectview.el.get_widget())).add(this.rightpalete.el);\n //this.projectsettings.el.show_all();\n\n stage = _this.objectview.el.get_stage();\n stage.set_background_color( Clutter.Color.from_string(\"#000\"));\n \n /*this.projectsettings.buttonPressed.connect((btn) => {\n if (btn == \"save\") {\n _this.window_rooview.view.renderJS(true);\n }\n if (btn == \"apply\") {\n _this.window_rooview.view.renderJS(true);\n return;\n }\n this.hideProjectEdit();\n \n });\n */\n \n \n \n // Add properties\n this.add_props = new Xcls_WindowAddProp();\n this.add_props.ref(); /// really?\n ((Gtk.Container)(this.addpropsview.el.get_widget())).add(this.add_props.el);\n //this.projectsettings.el.show_all();\n\n stage = _this.addpropsview.el.get_stage();\n stage.set_background_color( Clutter.Color.from_string(\"#000\"));\n \n \n _this.add_props.select.connect( (key,type,skel, etype) => {\n this.left_props.addProp(etype, key, skel, type);\n });\n \n // editor\n \n \n this.code_editor = new Xcls_Editor();\n this.code_editor.ref(); /// really?\n ((Gtk.Container)(this.codeeditview.el.get_widget())).add(this.code_editor.el);\n //this.projectsettings.el.show_all();\n\n stage = _this.codeeditview.el.get_stage();\n stage.set_background_color( Clutter.Color.from_string(\"#000\"));\n // editor.save...\n\n _this.code_editor.save.connect( () => {\n this.left_tree.model.file.save();\n });\n \n \n \n \n // roo view\n \n this.window_rooview =new Xcls_WindowRooView();\n this.window_rooview.ref();\n ((Gtk.Container)(this.rooview.el.get_widget())).add(this.window_rooview.el);\n this.window_rooview.el.show_all();\n\n stage = _this.rooview.el.get_stage();\n stage.set_background_color( Clutter.Color.from_string(\"#000\"));\n \n \n // glade view\n \n this.window_gladeview =new Xcls_GladeView();\n this.window_gladeview.ref();\n\n //((Gtk.Container)(this.rooview.el.get_widget())).add(this.window_gladeview.el);\n ///this.window_gladeview.el.hide();\n\n \n \n // clutter files\n \n \n this.clutterfiles = new Xcls_ClutterFiles();\n this.clutterfiles.ref();\n stage.add_child(this.clutterfiles.el);\n this.clutterfiles.el.show_all();\n\n\n this.clutterfiles.open.connect((file) => { \n _this.project = file.project;\n _this.showViewEditing();\n this.left_tree.model.loadFile(file);\n var ctr= ((Gtk.Container)(this.rooview.el.get_widget()));\n if (file.xtype == \"Roo\" ) { \n ctr.foreach( (w) => { ctr.remove(w); });\n ctr.add(this.window_rooview.el);\n this.window_rooview.loadFile(file);\n \n this.window_rooview.el.show_all();\n } else {\n ctr.foreach( (w) => { ctr.remove(w); });\n ctr.add(this.window_gladeview.el);\n this.window_gladeview.loadFile(file);\n this.window_gladeview.el.show_all();\n }\n print(\"OPEN : \" + file.name);\n\n });\n\n // new file dialog\n this.new_file_dialog = new Xcls_DialogNewComponent();\n // force it modal to the main window..\n this.new_file_dialog.el.set_transient_for(this.el);\n this.new_file_dialog.el.set_modal(true);\n \n this.new_file_dialog.success.connect((project,file) =>\n {\n _this.project = project;\n _this.showViewEditing();\n this.left_tree.model.loadFile(file);\n var ctr= ((Gtk.Container)(this.rooview.el.get_widget()));\n if (file.xtype == \"Roo\" ) { \n ctr.foreach( (w) => { ctr.remove(w); });\n ctr.add(this.window_rooview.el);\n this.window_rooview.loadFile(file);\n \n this.window_rooview.el.show_all();\n } else {\n ctr.foreach( (w) => { ctr.remove(w); });\n ctr.add(this.window_gladeview.el);\n this.window_gladeview.loadFile(file);\n this.window_gladeview.el.show_all();\n }\n \n });\n \n \n\n //w.el.show_all();\n var tl = new Clutter.Timeline(6000);\n tl.set_repeat_count(-1);\n tl.start();\n tl.ref();\n\n this.children_loaded = true;\n\n\n\n\n}\n",
+ "border_width" : 0,
+ "default_height" : 500,
+ "# Xcls_WindowLeftProjects left_projects" : "null",
+ "id" : "MainWindow",
+ "# Xcls_WindowRooView window_rooview" : "null",
+ "default_width" : 800,
+ "# Xcls_Editor code_editor" : "null",
+ "| void hideAddProp" : "() {\n _this.backbutton.el.hide();\n _this.projectbutton.el.show(); \n _this.projecteditbutton.el.show();\n _this.editfilebutton.el.show(); \n _this.addpropsview.el.save_easing_state();\n \n var el = _this.rooview.el;\n el.save_easing_state();\n\n \n el.set_scale(1.0f,1.0f);\n _this.addpropsview.el.set_scale(0.0f,0.0f);\n _this.state = \"edit\";\n\n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.addpropsview.el.restore_easing_state(); \n }",
+ "xtype" : "Window",
+ "| void hideCodeEdit" : "() {\n //this.code_editor.saveContents();\n _this.backbutton.el.hide();\n _this.projectbutton.el.show(); \n _this.projecteditbutton.el.show();\n _this.editfilebutton.el.show(); \n _this.codeeditview.el.save_easing_state();\n var el = _this.rooview.el;\n el.save_easing_state();\n\n \n el.set_scale(1.0f,1.0f);\n _this.codeeditview.el.set_scale(0.0f,0.0f);\n _this.state = \"edit\";\n\n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.codeeditview.el.restore_easing_state(); \n }",
+ "$ type" : "Gtk.WindowType.TOPLEVEL",
+ "# Xcls_WindowLeftTree left_tree" : "null",
+ "# Xcls_DialogNewComponent new_file_dialog" : "null",
+ "| void hideViewEditing" : " ( ) {\n\n// show the file navigation...\n \n if (this.left_tree.getActiveFile() != null) {\n if (this.left_tree.getActiveFile().xtype == \"Roo\" ) {\n this.window_rooview.createThumb();\n } else {\n this.window_gladeview.createThumb();\n }\n }\n \n _this.addprojectbutton.el.show(); \n _this.addfilebutton.el.show(); \n _this.backbutton.el.show();\n _this.delprojectbutton.el.show();\n \n _this.editfilebutton.el.hide(); \n _this.projectbutton.el.hide(); \n _this.projecteditbutton.el.hide();\n _this.objectshowbutton.el.hide();\n _this.addpropbutton.el.hide(); \n _this.addlistenerbutton.el.hide(); \n\n\n\n\n \n // show the add file button..\n \n \n \n this.editpane.el.hide();\n //this.rooview.el.hide();\n this.left_projects.el.show();\n \n var el = _this.rooview.el;\n el.save_easing_state();\n el.set_easing_duration(1000);\n // show project / file view..\n //_this.mainpane.lastWidth = _this.leftpane.el.get_position();\n //_this.mainpane.el.set_position(0);\n // rotate y 180..\n el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 360.0f);\n el.set_scale(0.0f,0.0f);\n \n _this.state = \"files\";\n if (_this.project != null) {\n _this.left_projects.selectProject(_this.project);\n }\n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n \n print(\"show view browsing\");\n}",
+ "# Xcls_ProjectSettings projectsettings" : "null",
+ "$ xns" : "Gtk",
+ "# Xcls_ClutterFiles clutterfiles" : "null",
+ "| void hideAddListener" : "() {\n _this.backbutton.el.hide();\n _this.projectbutton.el.show(); \n _this.projecteditbutton.el.show();\n _this.editfilebutton.el.show(); \n _this.addpropsview.el.save_easing_state();\n var el = _this.rooview.el;\n el.save_easing_state();\n\n \n el.set_scale(1.0f,1.0f);\n _this.addpropsview.el.set_scale(0.0f,0.0f);\n _this.state = \"edit\";\n\n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.addpropsview.el.restore_easing_state(); \n }",
+ "# Xcls_LeftProps left_props" : "null",
+ "# string state" : "",
+ "# Xcls_RightPalete rightpalete" : "null",
+ "# string title" : "\"Application Builder\"",
+ "# Xcls_WindowAddProp add_props" : "null",
+ "* init" : " this.state = \"files\";\n\t \n //this.el.show_all();\n \n ",
+ "| void showViewEditing" : " ( ) {\n this.editpane.el.show();\n // this.rooview.el.show();\n this.left_projects.el.hide();\n \n _this.addprojectbutton.el.hide(); \n _this.delprojectbutton.el.hide();\n _this.addfilebutton.el.hide(); \n _this.backbutton.el.hide();\n \n _this.projectbutton.el.show(); \n _this.editfilebutton.el.show(); \n _this.projecteditbutton.el.show();\n _this.objectshowbutton.el.show();\n _this.addpropbutton.el.show(); \n _this.addlistenerbutton.el.show(); \n \n \n var el = _this.rooview.el;\n el.save_easing_state();\n \n \n el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);\n el.set_scale(1.0f,1.0f);\n _this.state = \"edit\";\n // _this.mainpane.el.set_position(_this.leftpane.lastWidth);\n _this.clutterfiles.el.hide();\n \n el.restore_easing_state();\n \n print(\"show view editing\");\n}",
+ "| void showObject" : "() {\n\n \n // what's the active node on the left hand side..\n \n var n = _this.left_tree.getActiveElement();\n\n if (_this.left_tree.model.file == null) {\n return;\n }\n \n if (n == null && _this.left_tree.model.file.tree != null) {\n return;\n }\n \n _this.backbutton.el.show();\n _this.projectbutton.el.hide();\n _this.editfilebutton.el.hide();\n _this.projecteditbutton.el.hide(); \n \n \n //this.rooview.el.hide();\n this.rightpalete.el.show_all();\n this.rightpalete.load(_this.left_tree.getActiveFile().palete(), n == null ? \"*top\" : n.fqn());\n\n \n //this.rightpalete.show(this.project);\n\n _this.objectview.el.save_easing_state();\n \n var el = _this.rooview.el;\n el.save_easing_state();\n \n _this.clutterembed.setSizesAlloc(\"object\");\n \n\n _this.objectview.el.set_scale(1.0f,1.0f);\n \n \n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.objectview.el.restore_easing_state();\n this.state = \"object\";\n}",
+ "# Xcls_GladeView window_gladeview" : "null",
+ "| void showCodeEdit" : "(JsRender.Node node, string ptype, string key)\n{\n // this is a bit different,\n // it's not called via a button - but triggered by the prop edit class signal.\n // so it has to hide any other state..\n \n switch(this.state) {\n case \"object\":\n this.hideObject();\n break;\n case \"addprop\":\n this.hideAddProp();\n break;\n case \"addlistener\":\n this.hideAddListener();\n break;\n }\n \n _this.backbutton.el.show();\n \n _this.projectbutton.el.hide();\n _this.editfilebutton.el.hide();\n _this.projecteditbutton.el.hide(); \n // more?? \n \n //this.rooview.el.hide();\n this.code_editor.el.show_all();\n this.code_editor.show(\n node,\n ptype,\n key\n );\n\n _this.codeeditview.el.save_easing_state();\n \n var el = _this.rooview.el;\n el.save_easing_state();\n _this.clutterembed.setSizesAlloc(\"codedit\");\n \n _this.codeeditview.el.set_scale(1.0f,1.0f);\n \n \n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.codeeditview.el.restore_easing_state();\n this.state = \"codeedit\";\n}\n",
+ "| void hideProjectEdit" : " () {\n // return to editing state..\n \n _this.projectbutton.el.show();\n _this.projecteditbutton.el.show();\n _this.backbutton.el.hide();\n _this.editfilebutton.el.show(); \n \n //this.rooview.el.hide();\n //this.edit_project.el.show();\n _this.projecteditview.el.save_easing_state();\n var el = _this.rooview.el;\n el.save_easing_state();\n\n \n el.set_scale(1.0f,1.0f);\n _this.projecteditview.el.set_scale(1.0f,0.0f);\n _this.state = \"edit\";\n\n \n //_this.clutterfiles.loadProject(_this.project);\n\n el.restore_easing_state();\n _this.projecteditview.el.restore_easing_state(); \n \n}\n",
+ "items" : [
{
- "|homogeneous": "false",
- "id": "vbox",
- "pack": "add",
- "xtype": "VBox",
- "|xns": "Gtk",
- "items": [
+ "id" : "vbox",
+ "* pack" : "add",
+ "xtype" : "VBox",
+ "$ xns" : "Gtk",
+ "$ homogeneous" : false,
+ "items" : [
{
- "|homogeneous": "true",
- "id": "topbar",
- "pack": "pack_start,false,true,0",
- "xtype": "HBox",
- "|height_request": 20,
- "|vexpand": "false ",
- "|xns": "Gtk"
+ "$ vexpand" : "false ",
+ "id" : "topbar",
+ "* pack" : "pack_start,false,true,0",
+ "xtype" : "HBox",
+ "$ height_request" : 20,
+ "$ xns" : "Gtk",
+ "$ homogeneous" : true
},
{
- ".int:lastWidth": 0,
- "id": "mainpane",
- "pack": "pack_end,true,true,0",
- "position": 400,
- "xtype": "HPaned",
- "|xns": "Gtk",
- "items": [
+ "id" : "mainpane",
+ "position" : 400,
+ "* pack" : "pack_end,true,true,0",
+ "# int lastWidth" : 0,
+ "xtype" : "HPaned",
+ "$ xns" : "Gtk",
+ "items" : [
{
- "id": "leftpane",
- "pack": "add1",
- "xtype": "VBox",
- "|xns": "Gtk",
- "items": [
+ "id" : "leftpane",
+ "xtype" : "VBox",
+ "* pack" : "add1",
+ "$ xns" : "Gtk",
+ "items" : [
{
- "id": "editpane",
- "pack": "pack_start,false,true,0",
- "xtype": "VPaned",
- "|xns": "Gtk",
- "items": [
+ "id" : "editpane",
+ "xtype" : "VPaned",
+ "* pack" : "pack_start,false,true,0",
+ "$ xns" : "Gtk",
+ "items" : [
{
- "id": "tree",
- "pack": "add1",
- "xtype": "VBox",
- "|xns": "Gtk"
+ "id" : "tree",
+ "xtype" : "VBox",
+ "* pack" : "add1",
+ "$ xns" : "Gtk"
},
{
- "id": "props",
- "pack": "add2",
- "xtype": "VBox",
- "|xns": "Gtk"
+ "id" : "props",
+ "xtype" : "VBox",
+ "* pack" : "add2",
+ "$ xns" : "Gtk"
}
]
}
]
},
{
- "pack": "add2",
- "xtype": "VBox",
- "|xns": "Gtk",
- "items": [
+ "* pack" : "add2",
+ "xtype" : "VBox",
+ "$ xns" : "Gtk",
+ "items" : [
{
- "listeners": {
- "size_allocate": " ( alloc) => {\n if (!_this.children_loaded) { return; }\n //print(\"size_allocation %d,%d\\n\".printf(alloc.width, alloc.height));\n\n/* _this.rooview.el.set_size(this.el.get_stage().width-50,\n this.el.get_stage().height);\n _this.clutterfiles.set_size(this.el.get_stage().width-50,\n this.el.get_stage().height);\n*/\n // this.el.set_size_request(alloc.width,alloc.height);\n // this.el.get_stage().set_size(alloc.width,alloc.height);\n _this.rooview.el.set_size(alloc.width-50,\n alloc.height);\n \n \n \n _this.clutterfiles.set_size(alloc.width-50,\n alloc.height);\n _this.projecteditview.el.set_size(alloc.width-50,\n alloc.height / 2.0f);\n \n _this.objectview.el.set_size((alloc.width -50)/2.0f,\n alloc.height);\n \n _this.addpropsview.el.set_size((alloc.width -50)/2.0f,\n alloc.height);\n \n _this.codeeditview.el.set_size((alloc.width -50)/2.0f,\n alloc.height);\n}"
+ "listeners" : {
+ "size_allocate" : " ( alloc) => {\n this.setSizes(alloc, _this.state); \n \n}"
},
- "id": "clutterembed",
- "pack": "pack_start,true,true,0",
- "xtype": "Embed",
- "|init": " var stage = this.el.get_stage();\n stage.set_background_color( Clutter.Color.from_string(\"#000\"));\n \n \n",
- "|xns": "GtkClutter",
- "items": [
+ "id" : "clutterembed",
+ "* init" : " var stage = this.el.get_stage();\n stage.set_background_color( Clutter.Color.from_string(\"#000\"));\n \n \n",
+ "xtype" : "Embed",
+ "* pack" : "pack_start,true,true,0",
+ "| void setSizes" : " ( Gtk.Allocation alloc, string state) {\n if (!_this.children_loaded) { return; }\n \n _this.clutterfiles.set_size(alloc.width-50, alloc.height);\n \n // project view appears at top...\n \n _this.projecteditview.el.set_size(alloc.width-50, alloc.height / 2.0f);\n \n \n \n var avail = alloc.width < 50.0f ? 0 : alloc.width - 50.0f;\n \n \n var palsize = avail < 300.0f ? avail : 300.0f;\n print(\"set palsize size %f\\n\", palsize);\n // palate / props : fixed 300 pix\n \n _this.objectview.el.set_size(palsize, alloc.height); \n _this.addpropsview.el.set_size(palsize, alloc.height);\n \n \n \n // code edit min 600\n \n var codesize = avail < 600.0f ? avail : 600.0f;\n print(\"set code size %f\\n\", codesize);\n\n _this.codeeditview.el.set_size(codesize, alloc.height);\n _this.rooview.el.set_size(alloc.width-50, alloc.height); \n \n switch ( state) {\n case \"codeedit\": \n\n\tvar scale = avail > 0.0f ? (avail - codesize -10 ) / avail : 0.0f;\n\t\n\t\n _this.rooview.el.set_scale(scale,scale);\n break;\n case \"addprop\":\n case \"addlistener\": \n case \"object\": \n\tvar scale = avail > 0.0f ? (avail - palsize -10 ) / avail : 0.0f;\n _this.rooview.el.set_scale(scale,scale);\n break;\n }\n \n}",
+ "$ xns" : "GtkClutter",
+ "| void setSizesAlloc" : "(string state) {\n\n Gtk.Allocation alloc;\n this.el.get_allocation(out alloc);\n this.setSizes(alloc, state);\n}\n",
+ "items" : [
{
- "id": "rooview",
- "pack": "get_stage().add_child",
- "xtype": "Actor",
- "|init": "{\n \n \n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 1.0f\n )\n );\n \n //this.el.set_position(100,100);\n this.el.set_pivot_point(1.0f,1.0f);\n \n this.el.set_size(_this.clutterembed.el.get_stage().width-50,\n _this.clutterembed.el.get_stage().height);\n \n}",
- "|xns": "GtkClutter"
+ "id" : "rooview",
+ "* init" : "{\n \n \n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 1.0f\n )\n );\n \n //this.el.set_position(100,100);\n this.el.set_pivot_point(1.0f,1.0f);\n \n this.el.set_size(_this.clutterembed.el.get_stage().width-50,\n _this.clutterembed.el.get_stage().height);\n \n}",
+ "xtype" : "Actor",
+ "* pack" : "get_stage().add_child",
+ "$ xns" : "GtkClutter"
},
{
- "id": "objectview",
- "pack": "get_stage().add_child",
- "xtype": "Actor",
- "|init": "{\n \n /*\n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 0.0f\n )\n );\n */\n this.el.fixed_x = 50.0f;\n this.el.fixed_y = 0.0f;\n //this.el.set_position(100,100);\n this.el.set_pivot_point(0.0f,0.0f);\n this.el.set_scale(0.0f,1.0f);\n this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n _this.clutterembed.el.get_stage().height);\n \n}",
- "|xns": "GtkClutter"
+ "id" : "objectview",
+ "* init" : "{\n \n /*\n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 0.0f\n )\n );\n */\n this.el.fixed_x = 50.0f;\n this.el.fixed_y = 0.0f;\n //this.el.set_position(100,100);\n this.el.set_pivot_point(0.0f,0.0f);\n this.el.set_scale(0.0f,1.0f);\n this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n _this.clutterembed.el.get_stage().height);\n \n}",
+ "xtype" : "Actor",
+ "* pack" : "get_stage().add_child",
+ "$ xns" : "GtkClutter"
},
{
- "id": "codeeditview",
- "pack": "get_stage().add_child",
- "xtype": "Actor",
- "|init": "{\n \n /*\n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 0.0f\n )\n );\n */\n this.el.fixed_x = 50.0f;\n this.el.fixed_y = 0.0f;\n //this.el.set_position(100,100);\n this.el.set_pivot_point(0.0f,0.0f);\n this.el.set_scale(0.0f,1.0f);\n this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n _this.clutterembed.el.get_stage().height);\n \n}",
- "|xns": "GtkClutter"
+ "id" : "codeeditview",
+ "* init" : "{\n \n /*\n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 0.0f\n )\n );\n */\n this.el.fixed_x = 50.0f;\n this.el.fixed_y = 0.0f;\n //this.el.set_position(100,100);\n this.el.set_pivot_point(0.0f,0.0f);\n this.el.set_scale(0.0f,1.0f);\n this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n _this.clutterembed.el.get_stage().height);\n \n}",
+ "xtype" : "Actor",
+ "* pack" : "get_stage().add_child",
+ "$ xns" : "GtkClutter"
},
{
- "id": "addpropsview",
- "pack": "get_stage().add_child",
- "xtype": "Actor",
- "|init": "{\n \n /*\n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 0.0f\n )\n );\n */\n this.el.fixed_x = 50.0f;\n this.el.fixed_y = 0.0f;\n //this.el.set_position(100,100);\n this.el.set_pivot_point(0.0f,0.0f);\n this.el.set_scale(0.0f,1.0f);\n this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n _this.clutterembed.el.get_stage().height);\n \n}",
- "|xns": "GtkClutter"
+ "id" : "addpropsview",
+ "* init" : "{\n \n /*\n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 0.0f\n )\n );\n */\n this.el.fixed_x = 50.0f;\n this.el.fixed_y = 0.0f;\n //this.el.set_position(100,100);\n this.el.set_pivot_point(0.0f,0.0f);\n this.el.set_scale(0.0f,1.0f);\n this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n _this.clutterembed.el.get_stage().height);\n \n}",
+ "xtype" : "Actor",
+ "* pack" : "get_stage().add_child",
+ "$ xns" : "GtkClutter"
},
{
- "id": "projecteditview",
- "pack": "get_stage().add_child",
- "xtype": "Actor",
- "|init": "{\n \n \n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 1.0f\n )\n );\n \n //this.el.set_position(100,100);\n this.el.set_pivot_point(0.0f,0.0f);\n this.el.set_scale(1.0f,0.0f);\n this.el.set_size(_this.clutterembed.el.get_stage().width-50,\n _this.clutterembed.el.get_stage().height /2);\n \n}",
- "|xns": "GtkClutter"
+ "id" : "projecteditview",
+ "* init" : "{\n \n \n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 1.0f\n )\n );\n \n //this.el.set_position(100,100);\n this.el.set_pivot_point(0.0f,0.0f);\n this.el.set_scale(1.0f,0.0f);\n this.el.set_size(_this.clutterembed.el.get_stage().width-50,\n _this.clutterembed.el.get_stage().height /2);\n \n}",
+ "xtype" : "Actor",
+ "* pack" : "get_stage().add_child",
+ "$ xns" : "GtkClutter"
},
{
- "id": "buttonlayout",
- "pack": "get_stage().add_child",
- "xtype": "Actor",
- "|init": "{\n \n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 0.0f\n )\n );\n \n \n //this.el.set_position(100,100);\n this.el.set_pivot_point(0.5f,0.5f);\n this.el.set_size(50,\n _this.clutterembed.el.get_stage().height);\n \n}",
- "|xns": "Clutter",
- "items": [
+ "id" : "buttonlayout",
+ "* init" : "{\n \n this.el.add_constraint(\n new Clutter.AlignConstraint(\n _this.clutterembed.el.get_stage(), \n Clutter.AlignAxis.X_AXIS,\n 0.0f\n )\n );\n \n \n //this.el.set_position(100,100);\n this.el.set_pivot_point(0.5f,0.5f);\n this.el.set_size(50,\n _this.clutterembed.el.get_stage().height);\n \n}",
+ "xtype" : "Actor",
+ "* pack" : "get_stage().add_child",
+ "$ xns" : "Clutter",
+ "items" : [
{
- "|orientation": "Clutter.Orientation.VERTICAL",
- "*prop": "layout_manager",
- "xtype": "BoxLayout",
- "|xns": "Clutter"
+ "$ orientation" : "Clutter.Orientation.VERTICAL",
+ "xtype" : "BoxLayout",
+ "$ xns" : "Clutter",
+ "* prop" : "layout_manager"
},
{
- "id": "backbutton",
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "this.el.set_size(50,50);",
- "|xns": "Clutter",
- "items": [
+ "id" : "backbutton",
+ "* init" : "this.el.set_size(50,50);",
+ "xtype" : "Actor",
+ "* pack" : "add_child",
+ "$ xns" : "Clutter",
+ "items" : [
{
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
- "|xns": "GtkClutter",
- "items": [
+ "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
+ "* pack" : "add_child",
+ "xtype" : "Actor",
+ "$ xns" : "GtkClutter",
+ "items" : [
{
- "listeners": {
- "clicked": " ( ) => {\n switch (_this.state) {\n case \"edit\":\n \n _this.hideViewEditing();\n break; \n case \"files\":\n // should only occur if there is an active file..\n _this.showViewEditing();\n break; \n \n case \"addprop\":\n _this.hideAddProp();\n\n break;\n case \"addlistener\":\n _this.hideAddListener();\n\n break;\n \n case \"object\":\n _this.hideObject();\n break; \n \n case \"codeedit\":\n \n _this.hideCodeEdit(); \n break;\n \n case \"projectedit\":\n // save?\n _this.hideProjectEdit();\n break;\n \n default:\n break;\n }\n return ; \n\n}"
+ "listeners" : {
+ "clicked" : " ( ) => {\n switch (_this.state) {\n case \"edit\":\n \n _this.hideViewEditing();\n break; \n case \"files\":\n // should only occur if there is an active file..\n _this.showViewEditing();\n break; \n \n case \"addprop\":\n _this.hideAddProp();\n\n break;\n case \"addlistener\":\n _this.hideAddListener();\n\n break;\n \n case \"object\":\n _this.hideObject();\n break; \n \n case \"codeedit\":\n \n _this.hideCodeEdit(); \n break;\n \n case \"projectedit\":\n // save?\n _this.hideProjectEdit();\n break;\n \n default:\n break;\n }\n return ; \n\n}"
},
- "height_request": 50,
- "pack": "false",
- "width_request": 50,
- "xtype": "Button",
- "|label": "\"<<\"",
- "|xns": "Gtk"
+ "* pack" : false,
+ "xtype" : "Button",
+ "width_request" : 50,
+ "$ label" : "\"<<\"",
+ "$ xns" : "Gtk",
+ "height_request" : 50
}
]
}
]
},
{
- "id": "projectbutton",
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "this.el.set_size(50,50);",
- "|xns": "Clutter",
- "items": [
+ "id" : "projectbutton",
+ "* init" : "this.el.set_size(50,50);",
+ "xtype" : "Actor",
+ "* pack" : "add_child",
+ "$ xns" : "Clutter",
+ "items" : [
{
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
- "|xns": "GtkClutter",
- "items": [
+ "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
+ "* pack" : "add_child",
+ "xtype" : "Actor",
+ "$ xns" : "GtkClutter",
+ "items" : [
{
- "listeners": {
- "clicked": " ( ) => {\n switch (_this.state) {\n case \"edit\":\n \n _this.hideViewEditing();\n break; \n case \"files\":\n _this.showViewEditing();\n break; \n \n case \"addprop\":\n _this.hideAddProp();\n _this.hideViewEditing();\n break;\n case \"addlistener\":\n _this.hideAddListener();\n _this.hideViewEditing();\n break;\n \n case \"object\":\n _this.hideObject();\n _this.hideViewEditing();\n break; \n \n default:\n break;\n }\n return ; \n\n}"
+ "listeners" : {
+ "clicked" : " ( ) => {\n switch (_this.state) {\n case \"edit\":\n \n _this.hideViewEditing();\n break; \n case \"files\":\n _this.showViewEditing();\n break; \n \n case \"addprop\":\n _this.hideAddProp();\n _this.hideViewEditing();\n break;\n case \"addlistener\":\n _this.hideAddListener();\n _this.hideViewEditing();\n break;\n \n case \"object\":\n _this.hideObject();\n _this.hideViewEditing();\n break; \n \n default:\n break;\n }\n return ; \n\n}"
},
- "height_request": 50,
- "pack": "false",
- "width_request": 50,
- "xtype": "Button",
- "|label": "\"Open\\nFiles\"",
- "|xns": "Gtk"
+ "* pack" : false,
+ "xtype" : "Button",
+ "width_request" : 50,
+ "$ label" : "\"Open\\nFiles\"",
+ "$ xns" : "Gtk",
+ "height_request" : 50
}
]
}
]
},
{
- "id": "editfilebutton",
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "this.el.set_size(50.0f,50.0f);",
- "|xns": "Clutter",
- "items": [
+ "id" : "editfilebutton",
+ "* init" : "this.el.set_size(50.0f,50.0f);",
+ "xtype" : "Actor",
+ "* pack" : "add_child",
+ "$ xns" : "Clutter",
+ "items" : [
{
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
- "|xns": "GtkClutter",
- "items": [
+ "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
+ "* pack" : "add_child",
+ "xtype" : "Actor",
+ "$ xns" : "GtkClutter",
+ "items" : [
{
- "listeners": {
- "clicked": " ( ) => {\n \n // create a new file in project..\n if (_this.project == null || _this.left_tree.model.file == null) {\n return ;\n }\n \n _this.new_file_dialog.show(_this.left_tree.model.file);\n \n return ; \n\n\n}"
+ "listeners" : {
+ "clicked" : " ( ) => {\n \n // create a new file in project..\n if (_this.project == null || _this.left_tree.model.file == null) {\n return ;\n }\n \n _this.new_file_dialog.show(_this.left_tree.model.file);\n \n return ; \n\n\n}"
},
- "height_request": 50,
- "pack": "false",
- "width_request": 50,
- "xtype": "Button",
- "|label": "\"File\\nDetails\"",
- "|xns": "Gtk"
+ "* pack" : false,
+ "xtype" : "Button",
+ "width_request" : 50,
+ "$ label" : "\"File\\nDetails\"",
+ "$ xns" : "Gtk",
+ "height_request" : 50
}
]
}
]
},
{
- "id": "projecteditbutton",
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "this.el.set_size(50,50);",
- "|xns": "Clutter",
- "items": [
+ "id" : "projecteditbutton",
+ "* init" : "this.el.set_size(50,50);",
+ "xtype" : "Actor",
+ "* pack" : "add_child",
+ "$ xns" : "Clutter",
+ "items" : [
{
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
- "|xns": "GtkClutter",
- "items": [
+ "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
+ "* pack" : "add_child",
+ "xtype" : "Actor",
+ "$ xns" : "GtkClutter",
+ "items" : [
{
- "listeners": {
- "clicked": " ( ) => {\n switch (_this.state) {\n case \"edit\":\n _this.showProjectEdit();\n break; \n case \"files\":\n // _this.showViewEditing();\n break; \n case \"projectedit\":\n _this.hideProjectEdit();\n break;\n \n \n \n case \"addprop\":\n _this.hideAddProp();\n _this.showProjectEdit();\n break;\n case \"addlistener\":\n _this.hideAddListener();\n _this.showProjectEdit();\n break;\n \n case \"object\":\n _this.hideObject();\n _this.showProjectEdit(); \n break;\n default:\n break;\n }\n return ; \n\n\n}"
+ "listeners" : {
+ "clicked" : " ( ) => {\n switch (_this.state) {\n case \"edit\":\n _this.showProjectEdit();\n break; \n case \"files\":\n // _this.showViewEditing();\n break; \n case \"projectedit\":\n _this.hideProjectEdit();\n break;\n \n \n \n case \"addprop\":\n _this.hideAddProp();\n _this.showProjectEdit();\n break;\n case \"addlistener\":\n _this.hideAddListener();\n _this.showProjectEdit();\n break;\n \n case \"object\":\n _this.hideObject();\n _this.showProjectEdit(); \n break;\n default:\n break;\n }\n return ; \n\n\n}"
},
- "height_request": 50,
- "pack": "false",
- "width_request": 50,
- "xtype": "Button",
- "|label": "\"Project\\nDetails\"",
- "|xns": "Gtk"
+ "* pack" : false,
+ "xtype" : "Button",
+ "width_request" : 50,
+ "$ label" : "\"Project\\nDetails\"",
+ "$ xns" : "Gtk",
+ "height_request" : 50
}
]
}
]
},
{
- "listeners": {
- "enter_event": "( event) => {\n this.el.background_color = new Clutter.Color.from_string(\"#333\");\n return false;\n}",
- "leave_event": "( event) => {\n this.el.background_color = new Clutter.Color.from_string(\"#000\");\n return false;\n}",
- "button_press_event": " ( ) => {\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 false; \n\n\n}"
+ "listeners" : {
+ "button_press_event" : " ( ) => {\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 false; \n\n\n}",
+ "enter_event" : "( event) => {\n this.el.background_color = new Clutter.Color.from_string(\"#333\");\n return false;\n}",
+ "leave_event" : "( event) => {\n this.el.background_color = new Clutter.Color.from_string(\"#000\");\n return false;\n}"
},
- "id": "objectshowbutton",
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "this.el.set_size(50,50);",
- "|xns": "Clutter",
- "items": [
+ "id" : "objectshowbutton",
+ "* init" : "this.el.set_size(50,50);",
+ "xtype" : "Actor",
+ "* pack" : "add_child",
+ "$ xns" : "Clutter",
+ "items" : [
{
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
- "|xns": "GtkClutter",
- "items": [
+ "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
+ "* pack" : "add_child",
+ "xtype" : "Actor",
+ "$ xns" : "GtkClutter",
+ "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}"
+ "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}"
},
- "height_request": 50,
- "pack": "false",
- "width_request": 50,
- "xtype": "Button",
- "|label": "\"Show\\nPalete\"",
- "|xns": "Gtk"
+ "* pack" : false,
+ "xtype" : "Button",
+ "width_request" : 50,
+ "$ label" : "\"Show\\nPalete\"",
+ "$ xns" : "Gtk",
+ "height_request" : 50
}
]
}
]
},
{
- "id": "addpropbutton",
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "this.el.set_size(50,50);",
- "|xns": "Clutter",
- "items": [
+ "id" : "addpropbutton",
+ "* init" : "this.el.set_size(50,50);",
+ "xtype" : "Actor",
+ "* pack" : "add_child",
+ "$ xns" : "Clutter",
+ "items" : [
{
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
- "|xns": "GtkClutter",
- "items": [
+ "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
+ "* pack" : "add_child",
+ "xtype" : "Actor",
+ "$ xns" : "GtkClutter",
+ "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}"
+ "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}"
},
- "height_request": 50,
- "pack": "false",
- "width_request": 50,
- "xtype": "Button",
- "|label": "\"Add\\nProp\"",
- "|xns": "Gtk"
+ "* pack" : false,
+ "xtype" : "Button",
+ "width_request" : 50,
+ "$ label" : "\"Add\\nProp\"",
+ "$ xns" : "Gtk",
+ "height_request" : 50
}
]
}
]
},
{
- "id": "addlistenerbutton",
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "this.el.set_size(50,50);",
- "|xns": "Clutter",
- "items": [
+ "id" : "addlistenerbutton",
+ "* init" : "this.el.set_size(50,50);",
+ "xtype" : "Actor",
+ "* pack" : "add_child",
+ "$ xns" : "Clutter",
+ "items" : [
{
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
- "|xns": "GtkClutter",
- "items": [
+ "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
+ "* pack" : "add_child",
+ "xtype" : "Actor",
+ "$ xns" : "GtkClutter",
+ "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}"
+ "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}"
},
- "height_request": 50,
- "pack": "false",
- "width_request": 50,
- "xtype": "Button",
- "|label": "\"Add\\nEvent\\nCode\"",
- "|xns": "Gtk"
+ "* pack" : false,
+ "xtype" : "Button",
+ "width_request" : 50,
+ "$ label" : "\"Add\\nEvent\\nCode\"",
+ "$ xns" : "Gtk",
+ "height_request" : 50
}
]
}
]
},
{
- "id": "addprojectbutton",
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "this.el.set_size(50.0f,50.0f);",
- "|xns": "Clutter",
- "items": [
+ "id" : "addprojectbutton",
+ "* init" : "this.el.set_size(50.0f,50.0f);",
+ "xtype" : "Actor",
+ "* pack" : "add_child",
+ "$ xns" : "Clutter",
+ "items" : [
{
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
- "|xns": "GtkClutter",
- "items": [
+ "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
+ "* pack" : "add_child",
+ "xtype" : "Actor",
+ "$ xns" : "GtkClutter",
+ "items" : [
{
- "listeners": {
- "clicked": " ( ) => {\n \n // create a new file in project..\n //Xcls_DialogNewComponent.singleton().show(\n var pe = Xcls_EditProject.singleton();\n pe.el.set_transient_for(_this.el);\n pe.el.set_modal(true); \n \n var p = pe.show();\n\n if (p == null) {\n return;\n }\n _this.left_projects.is_loaded = false; \n _this.left_projects.load();\n _this.left_projects.selectProject(p);\n return ; \n\n\n}"
+ "listeners" : {
+ "clicked" : " ( ) => {\n \n // create a new file in project..\n //Xcls_DialogNewComponent.singleton().show(\n var pe = Xcls_EditProject.singleton();\n pe.el.set_transient_for(_this.el);\n pe.el.set_modal(true); \n \n var p = pe.show();\n\n if (p == null) {\n return;\n }\n _this.left_projects.is_loaded = false; \n _this.left_projects.load();\n _this.left_projects.selectProject(p);\n return ; \n\n\n}"
},
- "height_request": 50,
- "pack": "false",
- "width_request": 50,
- "xtype": "Button",
- "|label": "\"New\\nProj.\"",
- "|xns": "Gtk"
+ "* pack" : false,
+ "xtype" : "Button",
+ "width_request" : 50,
+ "$ label" : "\"New\\nProj.\"",
+ "$ xns" : "Gtk",
+ "height_request" : 50
}
]
}
]
},
{
- "id": "addfilebutton",
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "this.el.set_size(50.0f,50.0f);",
- "|xns": "Clutter",
- "items": [
+ "id" : "addfilebutton",
+ "* init" : "this.el.set_size(50.0f,50.0f);",
+ "xtype" : "Actor",
+ "* pack" : "add_child",
+ "$ xns" : "Clutter",
+ "items" : [
{
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
- "|xns": "GtkClutter",
- "items": [
+ "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
+ "* pack" : "add_child",
+ "xtype" : "Actor",
+ "$ xns" : "GtkClutter",
+ "items" : [
{
- "listeners": {
- "clicked": " () => {\n // create a new file in project..\n if (_this.project == null) {\n return ;\n }\n \n var f = JsRender.JsRender.factory(_this.project.xtype, _this.project, \"\");\n _this.new_file_dialog.show(f);\n \n return ; \n}"
+ "listeners" : {
+ "clicked" : " () => {\n // create a new file in project..\n if (_this.project == null) {\n return ;\n }\n \n var f = JsRender.JsRender.factory(_this.project.xtype, _this.project, \"\");\n _this.new_file_dialog.show(f);\n \n return ; \n}"
},
- "height_request": 50,
- "pack": "false",
- "width_request": 50,
- "xtype": "Button",
- "|label": "\"Add\\nFile\"",
- "|xns": "Gtk"
+ "* pack" : false,
+ "xtype" : "Button",
+ "width_request" : 50,
+ "$ label" : "\"Add\\nFile\"",
+ "$ xns" : "Gtk",
+ "height_request" : 50
}
]
}
]
},
{
- "id": "delprojectbutton",
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "this.el.set_size(50,50);",
- "|xns": "Clutter",
- "items": [
+ "id" : "delprojectbutton",
+ "* init" : "this.el.set_size(50,50);",
+ "xtype" : "Actor",
+ "* pack" : "add_child",
+ "$ xns" : "Clutter",
+ "items" : [
{
- "pack": "add_child",
- "xtype": "Actor",
- "|init": "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
- "|xns": "GtkClutter",
- "items": [
+ "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
+ "* pack" : "add_child",
+ "xtype" : "Actor",
+ "$ xns" : "GtkClutter",
+ "items" : [
{
- "listeners": {
- "clicked": " ( ) => {\n \n var cd = Xcls_DialogConfirm.singleton();\n cd.el.set_transient_for(_this.el);\n cd.el.set_modal(true);\n\n var project = _this.left_projects.getSelectedProject();\n if (project == null) {\n print(\"SKIP - no project\\n\");\n return;\n }\n \n \n if (Gtk.ResponseType.YES != cd.show(\"Confirm\", \n \"Are you sure you want to delete project %s\".printf(project.name))) {\n return;\n }\n \n\n // confirm?\n Project.Project.remove(project);\n _this.project = null;\n \n _this.left_projects.is_loaded = false;\n _this.left_projects.load();\n _this.clutterfiles.clearFiles();\n\n}"
+ "listeners" : {
+ "clicked" : " ( ) => {\n \n var cd = DialogConfirm.singleton();\n cd.el.set_transient_for(_this.el);\n cd.el.set_modal(true);\n\n var project = _this.left_projects.getSelectedProject();\n if (project == null) {\n print(\"SKIP - no project\\n\");\n return;\n }\n \n \n if (Gtk.ResponseType.YES != cd.show(\"Confirm\", \n \"Are you sure you want to delete project %s\".printf(project.name))) {\n return;\n }\n \n\n // confirm?\n Project.Project.remove(project);\n _this.project = null;\n \n _this.left_projects.is_loaded = false;\n _this.left_projects.load();\n _this.clutterfiles.clearFiles();\n\n}"
},
- "height_request": 50,
- "pack": "false",
- "width_request": 50,
- "xtype": "Button",
- "|label": "\"Del\\nProp\"",
- "|xns": "Gtk"
+ "* pack" : false,
+ "xtype" : "Button",
+ "width_request" : 50,
+ "$ label" : "\"Del\\nProp\"",
+ "$ xns" : "Gtk",
+ "height_request" : 50
}
]
}
}
]
}
- ],
- "permname": "",
- "modOrder": ""
+ ]
}
\ No newline at end of file
console = imports.console;
XObject = imports.XObject.XObject;
MainWindow=new XObject({
- xtype: Gtk.Window,
- listeners : {
- show : ( ) => {
- // hide the file editing..
+ hideObject : () {
+ // return to editing state..
- //this.hideViewEditing();
- },
- delete_event : ( event) => {
- return false;
- },
- destroy : () => {
- Gtk.main_quit();
- }
- },
- border_width : 0,
- default_height : 500,
- default_width : 800,
- id : "MainWindow",
- init : this.state = "files";
-
- //this.el.show_all();,
- type : Gtk.WindowType.TOPLEVEL,
- 'void:hideAddListener' : () {
+ _this.projecteditbutton.el.show();
_this.backbutton.el.hide();
_this.projectbutton.el.show();
- _this.projecteditbutton.el.show();
_this.editfilebutton.el.show();
- _this.addpropsview.el.save_easing_state();
+ _this.objectview.el.save_easing_state();
var el = _this.rooview.el;
el.save_easing_state();
el.set_scale(1.0f,1.0f);
- _this.addpropsview.el.set_scale(0.0f,0.0f);
+ _this.objectview.el.set_scale(0.0f,0.0f);
_this.state = "edit";
//_this.clutterfiles.loadProject(_this.project);
el.restore_easing_state();
- _this.addpropsview.el.restore_easing_state();
- },
- 'void:hideAddProp' : () {
- _this.backbutton.el.hide();
- _this.projectbutton.el.show();
- _this.projecteditbutton.el.show();
- _this.editfilebutton.el.show();
- _this.addpropsview.el.save_easing_state();
-
- var el = _this.rooview.el;
- el.save_easing_state();
-
-
- el.set_scale(1.0f,1.0f);
- _this.addpropsview.el.set_scale(0.0f,0.0f);
- _this.state = "edit";
-
+ _this.objectview.el.restore_easing_state();
- //_this.clutterfiles.loadProject(_this.project);
- el.restore_easing_state();
- _this.addpropsview.el.restore_easing_state();
- },
- 'void:hideCodeEdit' : () {
- //this.code_editor.saveContents();
- _this.backbutton.el.hide();
- _this.projectbutton.el.show();
- _this.projecteditbutton.el.show();
- _this.editfilebutton.el.show();
- _this.codeeditview.el.save_easing_state();
- var el = _this.rooview.el;
- el.save_easing_state();
+ },
+ show : () {
+ this.left_tree =new Xcls_WindowLeftTree();
+ _this.vbox.el.pack_start(this.left_tree.el,true, true,0);
+ this.el.show_all();
-
- el.set_scale(1.0f,1.0f);
- _this.codeeditview.el.set_scale(0.0f,0.0f);
- _this.state = "edit";
+ },
+ showAddProp : () {
-
- //_this.clutterfiles.loadProject(_this.project);
+
+ var ae = this.left_tree.getActiveElement();
+ if (ae == null) {
+ return;
+ }
+ _this.backbutton.el.show();
+ _this.projectbutton.el.hide();
+ _this.editfilebutton.el.hide();
+ _this.projecteditbutton.el.hide();
+
+
+
+ //this.rooview.el.hide();
+ this.add_props.el.show_all();
+ this.add_props.show(
+ Palete.factory(this.project.xtype),
+ "props",
+ ae.fqn()
+ );
- el.restore_easing_state();
- _this.codeeditview.el.restore_easing_state();
- },
- 'void:hideObject' : () {
- // return to editing state..
-
- _this.projecteditbutton.el.show();
- _this.backbutton.el.hide();
- _this.projectbutton.el.show();
- _this.editfilebutton.el.show();
- _this.objectview.el.save_easing_state();
+ _this.addpropsview.el.save_easing_state();
+
var el = _this.rooview.el;
el.save_easing_state();
+ _this.clutterembed.setSizesAlloc("addprop");
+
+
-
- el.set_scale(1.0f,1.0f);
- _this.objectview.el.set_scale(0.0f,0.0f);
- _this.state = "edit";
-
+ _this.addpropsview.el.set_scale(1.0f,1.0f);
+
+
//_this.clutterfiles.loadProject(_this.project);
el.restore_easing_state();
- _this.objectview.el.restore_easing_state();
-
-
+ _this.addpropsview.el.restore_easing_state();
+ this.state = "addprop";
},
- 'void:hideProjectEdit' : () {
- // return to editing state..
-
- _this.projectbutton.el.show();
- _this.projecteditbutton.el.show();
- _this.backbutton.el.hide();
- _this.editfilebutton.el.show();
+ project : "null",
+ showProjectEdit : () {
+ // make the browser smaller, and show the edit dialog
+
+
+ _this.projectbutton.el.hide();
+ _this.projecteditbutton.el.hide();
+
+ _this.editfilebutton.el.hide();
+
+
+
+
+ _this.backbutton.el.show();
//this.rooview.el.hide();
- //this.edit_project.el.show();
- _this.projecteditview.el.save_easing_state();
+ this.projectsettings.el.show_all();
+ this.projectsettings.show(this.project);
+ _this.projecteditview.el.save_easing_state();
+
var el = _this.rooview.el;
el.save_easing_state();
-
+
- el.set_scale(1.0f,1.0f);
- _this.projecteditview.el.set_scale(1.0f,0.0f);
- _this.state = "edit";
+ el.set_scale(0.5f,0.5f);
+ _this.projecteditview.el.set_scale(1.0f,1.0f);
+
+ _this.state = "projectedit";
+
//_this.clutterfiles.loadProject(_this.project);
el.restore_easing_state();
- _this.projecteditview.el.restore_easing_state();
-
+ _this.projecteditview.el.restore_easing_state();
+ // print("show view browsing");
+
},
- 'void:hideViewEditing' : ( ) {
+ showAddListener : () {
- // show the file navigation...
-
- if (this.left_tree.getActiveFile() != null) {
- if (this.left_tree.getActiveFile().xtype == "Roo" ) {
- this.window_rooview.createThumb();
- } else {
- this.window_gladeview.createThumb();
- }
- }
-
- _this.addprojectbutton.el.show();
- _this.addfilebutton.el.show();
- _this.backbutton.el.show();
- _this.delprojectbutton.el.show();
+
+
+ var ae = this.left_tree.getActiveElement();
+ if (ae == null) {
+ return;
+ }
+
+ _this.backbutton.el.show();
+ _this.projectbutton.el.hide();
+ _this.editfilebutton.el.hide();
+ _this.projecteditbutton.el.hide();
- _this.editfilebutton.el.hide();
- _this.projectbutton.el.hide();
- _this.projecteditbutton.el.hide();
- _this.objectshowbutton.el.hide();
- _this.addpropbutton.el.hide();
- _this.addlistenerbutton.el.hide();
-
-
-
-
-
- // show the add file button..
-
-
- this.editpane.el.hide();
//this.rooview.el.hide();
- this.left_projects.el.show();
-
+ this.add_props.el.show_all();
+ this.add_props.show(
+ Palete.factory(this.project.xtype),
+ "signals",
+ ae.fqn()
+ );
+ //this.rightpalete.show(this.project);
+
+ _this.addpropsview.el.save_easing_state();
+
var el = _this.rooview.el;
el.save_easing_state();
- el.set_easing_duration(1000);
- // show project / file view..
- //_this.mainpane.lastWidth = _this.leftpane.el.get_position();
- //_this.mainpane.el.set_position(0);
- // rotate y 180..
- el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 360.0f);
- el.set_scale(0.0f,0.0f);
- _this.state = "files";
- if (_this.project != null) {
- _this.left_projects.selectProject(_this.project);
- }
+ _this.clutterembed.setSizesAlloc("addlistener");
+
+
+
+
+ _this.addpropsview.el.set_scale(1.0f,1.0f);
+
+
+
//_this.clutterfiles.loadProject(_this.project);
el.restore_easing_state();
-
- print("show view browsing");
+ _this.addpropsview.el.restore_easing_state();
+ this.state = "addlistener";
},
- 'void:initChildren' : () {
+ children_loaded : false,
+ setTitle : (string str) {
+ this.el.set_title(this.title + " - " + str);
+ },
+ initChildren : () {
// this needs putting in a better place..
print("init children");
},
- 'void:setTitle' : (string str) {
- this.el.set_title(this.title + " - " + str);
- },
- 'void:show' : () {
- this.left_tree =new Xcls_WindowLeftTree();
- _this.vbox.el.pack_start(this.left_tree.el,true, true,0);
- this.el.show_all();
-
- },
- 'void:showAddListener' : () {
-
-
-
- var ae = this.left_tree.getActiveElement();
- if (ae == null) {
- return;
- }
+ border_width : 0,
+ default_height : 500,
+ left_projects : "null",
+ id : "MainWindow",
+ window_rooview : "null",
+ default_width : 800,
+ code_editor : "null",
+ hideAddProp : () {
+ _this.backbutton.el.hide();
+ _this.projectbutton.el.show();
+ _this.projecteditbutton.el.show();
+ _this.editfilebutton.el.show();
+ _this.addpropsview.el.save_easing_state();
- _this.backbutton.el.show();
- _this.projectbutton.el.hide();
- _this.editfilebutton.el.hide();
- _this.projecteditbutton.el.hide();
-
+ var el = _this.rooview.el;
+ el.save_easing_state();
+
- //this.rooview.el.hide();
- this.add_props.el.show_all();
- this.add_props.show(
- Palete.factory(this.project.xtype),
- "signals",
- ae.fqn()
- );
- //this.rightpalete.show(this.project);
+ el.set_scale(1.0f,1.0f);
+ _this.addpropsview.el.set_scale(0.0f,0.0f);
+ _this.state = "edit";
- _this.addpropsview.el.save_easing_state();
-
+
+ //_this.clutterfiles.loadProject(_this.project);
+
+ el.restore_easing_state();
+ _this.addpropsview.el.restore_easing_state();
+ },
+ xtype : "Window",
+ hideCodeEdit : () {
+ //this.code_editor.saveContents();
+ _this.backbutton.el.hide();
+ _this.projectbutton.el.show();
+ _this.projecteditbutton.el.show();
+ _this.editfilebutton.el.show();
+ _this.codeeditview.el.save_easing_state();
var el = _this.rooview.el;
el.save_easing_state();
-
+
- el.set_scale(0.5f,0.5f);
+ el.set_scale(1.0f,1.0f);
+ _this.codeeditview.el.set_scale(0.0f,0.0f);
+ _this.state = "edit";
- _this.addpropsview.el.set_scale(1.0f,1.0f);
-
+
+ //_this.clutterfiles.loadProject(_this.project);
+
+ el.restore_easing_state();
+ _this.codeeditview.el.restore_easing_state();
+ },
+ type : Gtk.WindowType.TOPLEVEL,
+ left_tree : "null",
+ new_file_dialog : "null",
+ hideViewEditing : ( ) {
+
+ // show the file navigation...
+
+ if (this.left_tree.getActiveFile() != null) {
+ if (this.left_tree.getActiveFile().xtype == "Roo" ) {
+ this.window_rooview.createThumb();
+ } else {
+ this.window_gladeview.createThumb();
+ }
+ }
+
+ _this.addprojectbutton.el.show();
+ _this.addfilebutton.el.show();
+ _this.backbutton.el.show();
+ _this.delprojectbutton.el.show();
+
+ _this.editfilebutton.el.hide();
+ _this.projectbutton.el.hide();
+ _this.projecteditbutton.el.hide();
+ _this.objectshowbutton.el.hide();
+ _this.addpropbutton.el.hide();
+ _this.addlistenerbutton.el.hide();
+
+
+
+
+
+ // show the add file button..
+
+
+
+ this.editpane.el.hide();
+ //this.rooview.el.hide();
+ this.left_projects.el.show();
+
+ var el = _this.rooview.el;
+ el.save_easing_state();
+ el.set_easing_duration(1000);
+ // show project / file view..
+ //_this.mainpane.lastWidth = _this.leftpane.el.get_position();
+ //_this.mainpane.el.set_position(0);
+ // rotate y 180..
+ el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 360.0f);
+ el.set_scale(0.0f,0.0f);
+ _this.state = "files";
+ if (_this.project != null) {
+ _this.left_projects.selectProject(_this.project);
+ }
+ //_this.clutterfiles.loadProject(_this.project);
+
+ el.restore_easing_state();
+
+ print("show view browsing");
+ },
+ projectsettings : "null",
+ xns : Gtk,
+ clutterfiles : "null",
+ hideAddListener : () {
+ _this.backbutton.el.hide();
+ _this.projectbutton.el.show();
+ _this.projecteditbutton.el.show();
+ _this.editfilebutton.el.show();
+ _this.addpropsview.el.save_easing_state();
+ var el = _this.rooview.el;
+ el.save_easing_state();
+
+
+ el.set_scale(1.0f,1.0f);
+ _this.addpropsview.el.set_scale(0.0f,0.0f);
+ _this.state = "edit";
+
//_this.clutterfiles.loadProject(_this.project);
el.restore_easing_state();
- _this.addpropsview.el.restore_easing_state();
- this.state = "addlistener";
+ _this.addpropsview.el.restore_easing_state();
+ },
+ left_props : "null",
+ state : "",
+ rightpalete : "null",
+ title : "\"Application Builder\"",
+ add_props : "null",
+ showViewEditing : ( ) {
+ this.editpane.el.show();
+ // this.rooview.el.show();
+ this.left_projects.el.hide();
+
+ _this.addprojectbutton.el.hide();
+ _this.delprojectbutton.el.hide();
+ _this.addfilebutton.el.hide();
+ _this.backbutton.el.hide();
+
+ _this.projectbutton.el.show();
+ _this.editfilebutton.el.show();
+ _this.projecteditbutton.el.show();
+ _this.objectshowbutton.el.show();
+ _this.addpropbutton.el.show();
+ _this.addlistenerbutton.el.show();
+
+
+ var el = _this.rooview.el;
+ el.save_easing_state();
+
+
+ el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
+ el.set_scale(1.0f,1.0f);
+ _this.state = "edit";
+ // _this.mainpane.el.set_position(_this.leftpane.lastWidth);
+ _this.clutterfiles.el.hide();
+
+ el.restore_easing_state();
+
+ print("show view editing");
},
- 'void:showAddProp' : () {
+ showObject : () {
- var ae = this.left_tree.getActiveElement();
- if (ae == null) {
+ // what's the active node on the left hand side..
+
+ var n = _this.left_tree.getActiveElement();
+
+ if (_this.left_tree.model.file == null) {
+ return;
+ }
+
+ if (n == null && _this.left_tree.model.file.tree != null) {
return;
}
+
_this.backbutton.el.show();
_this.projectbutton.el.hide();
_this.editfilebutton.el.hide();
_this.projecteditbutton.el.hide();
-
//this.rooview.el.hide();
- this.add_props.el.show_all();
- this.add_props.show(
- Palete.factory(this.project.xtype),
- "props",
- ae.fqn()
- );
+ this.rightpalete.el.show_all();
+ this.rightpalete.load(_this.left_tree.getActiveFile().palete(), n == null ? "*top" : n.fqn());
- _this.addpropsview.el.save_easing_state();
+
+ //this.rightpalete.show(this.project);
+
+ _this.objectview.el.save_easing_state();
var el = _this.rooview.el;
el.save_easing_state();
+ _this.clutterembed.setSizesAlloc("object");
- el.set_scale(0.5f,0.5f);
- _this.addpropsview.el.set_scale(1.0f,1.0f);
+ _this.objectview.el.set_scale(1.0f,1.0f);
//_this.clutterfiles.loadProject(_this.project);
el.restore_easing_state();
- _this.addpropsview.el.restore_easing_state();
- this.state = "addprop";
+ _this.objectview.el.restore_easing_state();
+ this.state = "object";
},
- 'void:showCodeEdit' : (JsRender.Node node, string ptype, string key)
+ window_gladeview : "null",
+ showCodeEdit : (JsRender.Node node, string ptype, string key)
{
// this is a bit different,
// it's not called via a button - but triggered by the prop edit class signal.
var el = _this.rooview.el;
el.save_easing_state();
+ _this.clutterembed.setSizesAlloc("codedit");
-
- el.set_scale(0.5f,0.5f);
-
_this.codeeditview.el.set_scale(1.0f,1.0f);
_this.codeeditview.el.restore_easing_state();
this.state = "codeedit";
},
- 'void:showObject' : () {
-
-
- // what's the active node on the left hand side..
-
- var n = _this.left_tree.getActiveElement();
-
- if (_this.left_tree.model.file == null) {
- return;
- }
-
- if (n == null && _this.left_tree.model.file.tree != null) {
- return;
- }
-
- _this.backbutton.el.show();
- _this.projectbutton.el.hide();
- _this.editfilebutton.el.hide();
- _this.projecteditbutton.el.hide();
-
+ hideProjectEdit : () {
+ // return to editing state..
+
+ _this.projectbutton.el.show();
+ _this.projecteditbutton.el.show();
+ _this.backbutton.el.hide();
+ _this.editfilebutton.el.show();
//this.rooview.el.hide();
- this.rightpalete.el.show_all();
- this.rightpalete.load(_this.left_tree.getActiveFile().palete(), n == null ? "*top" : n.fqn());
-
-
- //this.rightpalete.show(this.project);
-
- _this.objectview.el.save_easing_state();
-
+ //this.edit_project.el.show();
+ _this.projecteditview.el.save_easing_state();
var el = _this.rooview.el;
el.save_easing_state();
-
-
- el.set_scale(0.5f,0.5f);
- _this.objectview.el.set_scale(1.0f,1.0f);
-
-
-
- //_this.clutterfiles.loadProject(_this.project);
-
- el.restore_easing_state();
- _this.objectview.el.restore_easing_state();
- this.state = "object";
- },
- 'void:showProjectEdit' : () {
- // make the browser smaller, and show the edit dialog
-
-
- _this.projectbutton.el.hide();
- _this.projecteditbutton.el.hide();
-
- _this.editfilebutton.el.hide();
-
-
-
- _this.backbutton.el.show();
-
- //this.rooview.el.hide();
- this.projectsettings.el.show_all();
- this.projectsettings.show(this.project);
- _this.projecteditview.el.save_easing_state();
-
- var el = _this.rooview.el;
- el.save_easing_state();
-
-
- el.set_scale(0.5f,0.5f);
+ el.set_scale(1.0f,1.0f);
+ _this.projecteditview.el.set_scale(1.0f,0.0f);
+ _this.state = "edit";
- _this.projecteditview.el.set_scale(1.0f,1.0f);
-
- _this.state = "projectedit";
-
//_this.clutterfiles.loadProject(_this.project);
el.restore_easing_state();
- _this.projecteditview.el.restore_easing_state();
- // print("show view browsing");
-
- },
- 'void:showViewEditing' : ( ) {
- this.editpane.el.show();
- // this.rooview.el.show();
- this.left_projects.el.hide();
-
- _this.addprojectbutton.el.hide();
- _this.delprojectbutton.el.hide();
- _this.addfilebutton.el.hide();
- _this.backbutton.el.hide();
-
- _this.projectbutton.el.show();
- _this.editfilebutton.el.show();
- _this.projecteditbutton.el.show();
- _this.objectshowbutton.el.show();
- _this.addpropbutton.el.show();
- _this.addlistenerbutton.el.show();
-
-
- var el = _this.rooview.el;
- el.save_easing_state();
+ _this.projecteditview.el.restore_easing_state();
-
- el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
- el.set_scale(1.0f,1.0f);
- _this.state = "edit";
- // _this.mainpane.el.set_position(_this.leftpane.lastWidth);
- _this.clutterfiles.el.hide();
-
- el.restore_easing_state();
-
- print("show view editing");
+ },
+ listeners : {
+ delete_event : ( event) => {
+ return false;
+ },
+ destroy : () => {
+ Gtk.main_quit();
+ },
+ show : ( ) => {
+ // hide the file editing..
+
+ //this.hideViewEditing();
+ }
},
items : [
- {
- xtype: Gtk.VBox,
- homogeneous : false,
+ {
id : "vbox",
- pack : "add",
+ xtype : "VBox",
+ xns : Gtk,
+ homogeneous : FALSE,
items : [
- {
- xtype: Gtk.HBox,
- homogeneous : true,
+ {
+ vexpand : false,
id : "topbar",
- pack : "pack_start,false,true,0",
+ xtype : "HBox",
height_request : 20,
- vexpand : false
+ xns : Gtk,
+ homogeneous : TRUE
},
- {
- xtype: Gtk.HPaned,
+ {
id : "mainpane",
- pack : "pack_end,true,true,0",
position : 400,
+ lastWidth : 0,
+ xtype : "HPaned",
+ xns : Gtk,
items : [
- {
- xtype: Gtk.VBox,
+ {
id : "leftpane",
- pack : "add1",
+ xtype : "VBox",
+ xns : Gtk,
items : [
- {
- xtype: Gtk.VPaned,
+ {
id : "editpane",
- pack : "pack_start,false,true,0",
+ xtype : "VPaned",
+ xns : Gtk,
items : [
- {
- xtype: Gtk.VBox,
+ {
id : "tree",
- pack : "add1"
+ xtype : "VBox",
+ xns : Gtk
},
- {
- xtype: Gtk.VBox,
+ {
id : "props",
- pack : "add2"
+ xtype : "VBox",
+ xns : Gtk
}
]
+
}
]
+
},
- {
- xtype: Gtk.VBox,
- pack : "add2",
+ {
+ xtype : "VBox",
+ xns : Gtk,
items : [
- {
- xtype: GtkClutter.Embed,
- listeners : {
- size_allocate : ( alloc) => {
- if (!_this.children_loaded) { return; }
- //print("size_allocation %d,%d\n".printf(alloc.width, alloc.height));
+ {
+ id : "clutterembed",
+ xtype : "Embed",
+ setSizes : ( Gtk.Allocation alloc, string state) {
+ if (!_this.children_loaded) { return; }
+
+ _this.clutterfiles.set_size(alloc.width-50, alloc.height);
- /* _this.rooview.el.set_size(this.el.get_stage().width-50,
- this.el.get_stage().height);
- _this.clutterfiles.set_size(this.el.get_stage().width-50,
- this.el.get_stage().height);
- */
- // this.el.set_size_request(alloc.width,alloc.height);
- // this.el.get_stage().set_size(alloc.width,alloc.height);
- _this.rooview.el.set_size(alloc.width-50,
- alloc.height);
-
-
-
- _this.clutterfiles.set_size(alloc.width-50,
- alloc.height);
- _this.projecteditview.el.set_size(alloc.width-50,
- alloc.height / 2.0f);
-
- _this.objectview.el.set_size((alloc.width -50)/2.0f,
- alloc.height);
-
- _this.addpropsview.el.set_size((alloc.width -50)/2.0f,
- alloc.height);
-
- _this.codeeditview.el.set_size((alloc.width -50)/2.0f,
- alloc.height);
+ // project view appears at top...
+
+ _this.projecteditview.el.set_size(alloc.width-50, alloc.height / 2.0f);
+
+
+
+ var avail = alloc.width < 50.0f ? 0 : alloc.width - 50.0f;
+
+
+ var palsize = avail < 300.0f ? avail : 300.0f;
+ print("set palsize size %f\n", palsize);
+ // palate / props : fixed 300 pix
+
+ _this.objectview.el.set_size(palsize, alloc.height);
+ _this.addpropsview.el.set_size(palsize, alloc.height);
+
+
+
+ // code edit min 600
+
+ var codesize = avail < 600.0f ? avail : 600.0f;
+ print("set code size %f\n", codesize);
+
+ _this.codeeditview.el.set_size(codesize, alloc.height);
+ _this.rooview.el.set_size(alloc.width-50, alloc.height);
+
+ switch ( state) {
+ case "codeedit":
+
+ var scale = avail > 0.0f ? (avail - codesize -10 ) / avail : 0.0f;
+
+
+ _this.rooview.el.set_scale(scale,scale);
+ break;
+ case "addprop":
+ case "addlistener":
+ case "object":
+ var scale = avail > 0.0f ? (avail - palsize -10 ) / avail : 0.0f;
+ _this.rooview.el.set_scale(scale,scale);
+ break;
}
+
+ },
+ xns : GtkClutter,
+ setSizesAlloc : (string state) {
+
+ Gtk.Allocation alloc;
+ this.el.get_allocation(out alloc);
+ this.setSizes(alloc, state);
+ },
+ listeners : {
+ size_allocate : ( alloc) => {
+ this.setSizes(alloc, _this.state);
+
+ }
},
- id : "clutterembed",
- pack : "pack_start,true,true,0",
- init : var stage = this.el.get_stage();
- stage.set_background_color( Clutter.Color.from_string("#000"));,
items : [
- {
- xtype: GtkClutter.Actor,
+ {
id : "rooview",
- pack : "get_stage().add_child",
- init : {
-
-
- this.el.add_constraint(
- new Clutter.AlignConstraint(
- _this.clutterembed.el.get_stage(),
- Clutter.AlignAxis.X_AXIS,
- 1.0f
- )
- );
-
- //this.el.set_position(100,100);
- this.el.set_pivot_point(1.0f,1.0f);
-
- this.el.set_size(_this.clutterembed.el.get_stage().width-50,
- _this.clutterembed.el.get_stage().height);
-
- }
+ xtype : "Actor",
+ xns : GtkClutter
},
- {
- xtype: GtkClutter.Actor,
+ {
id : "objectview",
- pack : "get_stage().add_child",
- init : {
-
- /*
- this.el.add_constraint(
- new Clutter.AlignConstraint(
- _this.clutterembed.el.get_stage(),
- Clutter.AlignAxis.X_AXIS,
- 0.0f
- )
- );
- */
- this.el.fixed_x = 50.0f;
- this.el.fixed_y = 0.0f;
- //this.el.set_position(100,100);
- this.el.set_pivot_point(0.0f,0.0f);
- this.el.set_scale(0.0f,1.0f);
- this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,
- _this.clutterembed.el.get_stage().height);
-
- }
+ xtype : "Actor",
+ xns : GtkClutter
},
- {
- xtype: GtkClutter.Actor,
+ {
id : "codeeditview",
- pack : "get_stage().add_child",
- init : {
-
- /*
- this.el.add_constraint(
- new Clutter.AlignConstraint(
- _this.clutterembed.el.get_stage(),
- Clutter.AlignAxis.X_AXIS,
- 0.0f
- )
- );
- */
- this.el.fixed_x = 50.0f;
- this.el.fixed_y = 0.0f;
- //this.el.set_position(100,100);
- this.el.set_pivot_point(0.0f,0.0f);
- this.el.set_scale(0.0f,1.0f);
- this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,
- _this.clutterembed.el.get_stage().height);
-
- }
+ xtype : "Actor",
+ xns : GtkClutter
},
- {
- xtype: GtkClutter.Actor,
+ {
id : "addpropsview",
- pack : "get_stage().add_child",
- init : {
-
- /*
- this.el.add_constraint(
- new Clutter.AlignConstraint(
- _this.clutterembed.el.get_stage(),
- Clutter.AlignAxis.X_AXIS,
- 0.0f
- )
- );
- */
- this.el.fixed_x = 50.0f;
- this.el.fixed_y = 0.0f;
- //this.el.set_position(100,100);
- this.el.set_pivot_point(0.0f,0.0f);
- this.el.set_scale(0.0f,1.0f);
- this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,
- _this.clutterembed.el.get_stage().height);
-
- }
+ xtype : "Actor",
+ xns : GtkClutter
},
- {
- xtype: GtkClutter.Actor,
+ {
id : "projecteditview",
- pack : "get_stage().add_child",
- init : {
-
-
- this.el.add_constraint(
- new Clutter.AlignConstraint(
- _this.clutterembed.el.get_stage(),
- Clutter.AlignAxis.X_AXIS,
- 1.0f
- )
- );
-
- //this.el.set_position(100,100);
- this.el.set_pivot_point(0.0f,0.0f);
- this.el.set_scale(1.0f,0.0f);
- this.el.set_size(_this.clutterembed.el.get_stage().width-50,
- _this.clutterembed.el.get_stage().height /2);
-
- }
+ xtype : "Actor",
+ xns : GtkClutter
},
- {
- xtype: Clutter.Actor,
- id : "buttonlayout",
- pack : "get_stage().add_child",
- init : {
-
- this.el.add_constraint(
- new Clutter.AlignConstraint(
- _this.clutterembed.el.get_stage(),
- Clutter.AlignAxis.X_AXIS,
- 0.0f
- )
- );
-
-
- //this.el.set_position(100,100);
- this.el.set_pivot_point(0.5f,0.5f);
- this.el.set_size(50,
- _this.clutterembed.el.get_stage().height);
-
+ {
+ layout_manager : {
+ orientation : Clutter.Orientation.VERTICAL,
+ xtype : "BoxLayout",
+ xns : Clutter
},
+ id : "buttonlayout",
+ xtype : "Actor",
+ xns : Clutter,
items : [
- {
- xtype: Clutter.Actor,
+ {
id : "backbutton",
- pack : "add_child",
- init : this.el.set_size(50,50);,
+ xtype : "Actor",
+ xns : Clutter,
items : [
- {
- xtype: GtkClutter.Actor,
- pack : "add_child",
- init : ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);,
+ {
+ xtype : "Actor",
+ xns : GtkClutter,
items : [
- {
- xtype: Gtk.Button,
- listeners : {
- clicked : ( ) => {
- switch (_this.state) {
- case "edit":
-
- _this.hideViewEditing();
- break;
- case "files":
- // should only occur if there is an active file..
- _this.showViewEditing();
- break;
-
- case "addprop":
- _this.hideAddProp();
-
- break;
- case "addlistener":
- _this.hideAddListener();
-
- break;
-
- case "object":
- _this.hideObject();
- break;
-
- case "codeedit":
-
- _this.hideCodeEdit();
- break;
-
- case "projectedit":
- // save?
- _this.hideProjectEdit();
- break;
-
- default:
- break;
- }
- return ;
-
- }
- },
- height_request : 50,
- pack : "false",
+ {
+ xtype : "Button",
width_request : 50,
- label : "<<"
+ label : "<<",
+ xns : Gtk,
+ height_request : 50,
+ listeners : {
+ clicked : ( ) => {
+ switch (_this.state) {
+ case "edit":
+
+ _this.hideViewEditing();
+ break;
+ case "files":
+ // should only occur if there is an active file..
+ _this.showViewEditing();
+ break;
+
+ case "addprop":
+ _this.hideAddProp();
+
+ break;
+ case "addlistener":
+ _this.hideAddListener();
+
+ break;
+
+ case "object":
+ _this.hideObject();
+ break;
+
+ case "codeedit":
+
+ _this.hideCodeEdit();
+ break;
+
+ case "projectedit":
+ // save?
+ _this.hideProjectEdit();
+ break;
+
+ default:
+ break;
+ }
+ return ;
+
+ }
+ }
}
]
+
}
]
+
},
- {
- xtype: Clutter.Actor,
+ {
id : "projectbutton",
- pack : "add_child",
- init : this.el.set_size(50,50);,
+ xtype : "Actor",
+ xns : Clutter,
items : [
- {
- xtype: GtkClutter.Actor,
- pack : "add_child",
- init : ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);,
+ {
+ xtype : "Actor",
+ xns : GtkClutter,
items : [
- {
- xtype: Gtk.Button,
- listeners : {
- clicked : ( ) => {
- switch (_this.state) {
- case "edit":
-
- _this.hideViewEditing();
- break;
- case "files":
- _this.showViewEditing();
- break;
-
- case "addprop":
- _this.hideAddProp();
- _this.hideViewEditing();
- break;
- case "addlistener":
- _this.hideAddListener();
- _this.hideViewEditing();
- break;
-
- case "object":
- _this.hideObject();
- _this.hideViewEditing();
- break;
-
- default:
- break;
- }
- return ;
-
- }
- },
- height_request : 50,
- pack : "false",
+ {
+ xtype : "Button",
width_request : 50,
- label : "Open\nFiles"
+ label : "Open\nFiles",
+ xns : Gtk,
+ height_request : 50,
+ listeners : {
+ clicked : ( ) => {
+ switch (_this.state) {
+ case "edit":
+
+ _this.hideViewEditing();
+ break;
+ case "files":
+ _this.showViewEditing();
+ break;
+
+ case "addprop":
+ _this.hideAddProp();
+ _this.hideViewEditing();
+ break;
+ case "addlistener":
+ _this.hideAddListener();
+ _this.hideViewEditing();
+ break;
+
+ case "object":
+ _this.hideObject();
+ _this.hideViewEditing();
+ break;
+
+ default:
+ break;
+ }
+ return ;
+
+ }
+ }
}
]
+
}
]
+
},
- {
- xtype: Clutter.Actor,
+ {
id : "editfilebutton",
- pack : "add_child",
- init : this.el.set_size(50.0f,50.0f);,
+ xtype : "Actor",
+ xns : Clutter,
items : [
- {
- xtype: GtkClutter.Actor,
- pack : "add_child",
- init : ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);,
+ {
+ xtype : "Actor",
+ xns : GtkClutter,
items : [
- {
- xtype: Gtk.Button,
- listeners : {
- clicked : ( ) => {
-
- // create a new file in project..
- if (_this.project == null || _this.left_tree.model.file == null) {
- return ;
- }
-
- _this.new_file_dialog.show(_this.left_tree.model.file);
-
- return ;
-
-
- }
- },
- height_request : 50,
- pack : "false",
+ {
+ xtype : "Button",
width_request : 50,
- label : "File\nDetails"
+ label : "File\nDetails",
+ xns : Gtk,
+ height_request : 50,
+ listeners : {
+ clicked : ( ) => {
+
+ // create a new file in project..
+ if (_this.project == null || _this.left_tree.model.file == null) {
+ return ;
+ }
+
+ _this.new_file_dialog.show(_this.left_tree.model.file);
+
+ return ;
+
+
+ }
+ }
}
]
+
}
]
+
},
- {
- xtype: Clutter.Actor,
+ {
id : "projecteditbutton",
- pack : "add_child",
- init : this.el.set_size(50,50);,
+ xtype : "Actor",
+ xns : Clutter,
items : [
- {
- xtype: GtkClutter.Actor,
- pack : "add_child",
- init : ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);,
+ {
+ xtype : "Actor",
+ xns : GtkClutter,
items : [
- {
- xtype: Gtk.Button,
- listeners : {
- clicked : ( ) => {
- switch (_this.state) {
- case "edit":
- _this.showProjectEdit();
- break;
- case "files":
- // _this.showViewEditing();
- break;
- case "projectedit":
- _this.hideProjectEdit();
- break;
-
-
-
- case "addprop":
- _this.hideAddProp();
- _this.showProjectEdit();
- break;
- case "addlistener":
- _this.hideAddListener();
- _this.showProjectEdit();
- break;
-
- case "object":
- _this.hideObject();
- _this.showProjectEdit();
- break;
- default:
- break;
- }
- return ;
-
-
- }
- },
- height_request : 50,
- pack : "false",
+ {
+ xtype : "Button",
width_request : 50,
- label : "Project\nDetails"
+ label : "Project\nDetails",
+ xns : Gtk,
+ height_request : 50,
+ listeners : {
+ clicked : ( ) => {
+ switch (_this.state) {
+ case "edit":
+ _this.showProjectEdit();
+ break;
+ case "files":
+ // _this.showViewEditing();
+ break;
+ case "projectedit":
+ _this.hideProjectEdit();
+ break;
+
+
+
+ case "addprop":
+ _this.hideAddProp();
+ _this.showProjectEdit();
+ break;
+ case "addlistener":
+ _this.hideAddListener();
+ _this.showProjectEdit();
+ break;
+
+ case "object":
+ _this.hideObject();
+ _this.showProjectEdit();
+ break;
+ default:
+ break;
+ }
+ return ;
+
+
+ }
+ }
}
]
+
}
]
+
},
- {
- xtype: Clutter.Actor,
+ {
+ id : "objectshowbutton",
+ xtype : "Actor",
+ xns : Clutter,
listeners : {
- enter_event : ( event) => {
- this.el.background_color = new Clutter.Color.from_string("#333");
- return false;
- },
- leave_event : ( event) => {
- this.el.background_color = new Clutter.Color.from_string("#000");
- return false;
- },
- button_press_event : ( ) => {
-
-
-
- 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 false;
-
-
- }
+ button_press_event : ( ) => {
+
+
+
+ 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 false;
+
+
+ },
+ enter_event : ( event) => {
+ this.el.background_color = new Clutter.Color.from_string("#333");
+ return false;
+ },
+ leave_event : ( event) => {
+ this.el.background_color = new Clutter.Color.from_string("#000");
+ return false;
+ }
},
- id : "objectshowbutton",
- pack : "add_child",
- init : this.el.set_size(50,50);,
items : [
- {
- xtype: GtkClutter.Actor,
- pack : "add_child",
- init : ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);,
+ {
+ xtype : "Actor",
+ xns : GtkClutter,
items : [
- {
- xtype: Gtk.Button,
- listeners : {
- clicked : ( ) => {
-
-
-
- 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 ;
-
-
- }
- },
- height_request : 50,
- pack : "false",
+ {
+ xtype : "Button",
width_request : 50,
- label : "Show\nPalete"
+ label : "Show\nPalete",
+ xns : Gtk,
+ height_request : 50,
+ listeners : {
+ clicked : ( ) => {
+
+
+
+ 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 ;
+
+
+ }
+ }
}
]
+
}
]
+
},
- {
- xtype: Clutter.Actor,
+ {
id : "addpropbutton",
- pack : "add_child",
- init : this.el.set_size(50,50);,
+ xtype : "Actor",
+ xns : Clutter,
items : [
- {
- xtype: GtkClutter.Actor,
- pack : "add_child",
- init : ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);,
+ {
+ xtype : "Actor",
+ xns : GtkClutter,
items : [
- {
- xtype: Gtk.Button,
- listeners : {
- clicked : ( ) => {
-
-
-
- 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 ;
-
-
- }
- },
- height_request : 50,
- pack : "false",
+ {
+ xtype : "Button",
width_request : 50,
- label : "Add\nProp"
+ label : "Add\nProp",
+ xns : Gtk,
+ height_request : 50,
+ listeners : {
+ clicked : ( ) => {
+
+
+
+ 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 ;
+
+
+ }
+ }
}
]
+
}
]
+
},
- {
- xtype: Clutter.Actor,
+ {
id : "addlistenerbutton",
- pack : "add_child",
- init : this.el.set_size(50,50);,
+ xtype : "Actor",
+ xns : Clutter,
items : [
- {
- xtype: GtkClutter.Actor,
- pack : "add_child",
- init : ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);,
+ {
+ xtype : "Actor",
+ xns : GtkClutter,
items : [
- {
- xtype: Gtk.Button,
- listeners : {
- clicked : ( ) => {
-
-
-
- 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 ;
-
-
- }
- },
- height_request : 50,
- pack : "false",
+ {
+ xtype : "Button",
width_request : 50,
- label : "Add\nEvent\nCode"
+ label : "Add\nEvent\nCode",
+ xns : Gtk,
+ height_request : 50,
+ listeners : {
+ clicked : ( ) => {
+
+
+
+ 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 ;
+
+
+ }
+ }
}
]
+
}
]
+
},
- {
- xtype: Clutter.Actor,
+ {
id : "addprojectbutton",
- pack : "add_child",
- init : this.el.set_size(50.0f,50.0f);,
+ xtype : "Actor",
+ xns : Clutter,
items : [
- {
- xtype: GtkClutter.Actor,
- pack : "add_child",
- init : ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);,
+ {
+ xtype : "Actor",
+ xns : GtkClutter,
items : [
- {
- xtype: Gtk.Button,
- listeners : {
- clicked : ( ) => {
-
- // create a new file in project..
- //Xcls_DialogNewComponent.singleton().show(
- var pe = Xcls_EditProject.singleton();
- pe.el.set_transient_for(_this.el);
- pe.el.set_modal(true);
-
- var p = pe.show();
-
- if (p == null) {
- return;
- }
- _this.left_projects.is_loaded = false;
- _this.left_projects.load();
- _this.left_projects.selectProject(p);
- return ;
-
-
- }
- },
- height_request : 50,
- pack : "false",
+ {
+ xtype : "Button",
width_request : 50,
- label : "New\nProj."
+ label : "New\nProj.",
+ xns : Gtk,
+ height_request : 50,
+ listeners : {
+ clicked : ( ) => {
+
+ // create a new file in project..
+ //Xcls_DialogNewComponent.singleton().show(
+ var pe = Xcls_EditProject.singleton();
+ pe.el.set_transient_for(_this.el);
+ pe.el.set_modal(true);
+
+ var p = pe.show();
+
+ if (p == null) {
+ return;
+ }
+ _this.left_projects.is_loaded = false;
+ _this.left_projects.load();
+ _this.left_projects.selectProject(p);
+ return ;
+
+
+ }
+ }
}
]
+
}
]
+
},
- {
- xtype: Clutter.Actor,
+ {
id : "addfilebutton",
- pack : "add_child",
- init : this.el.set_size(50.0f,50.0f);,
+ xtype : "Actor",
+ xns : Clutter,
items : [
- {
- xtype: GtkClutter.Actor,
- pack : "add_child",
- init : ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);,
+ {
+ xtype : "Actor",
+ xns : GtkClutter,
items : [
- {
- xtype: Gtk.Button,
- listeners : {
- clicked : () => {
- // create a new file in project..
- if (_this.project == null) {
- return ;
- }
-
- var f = JsRender.JsRender.factory(_this.project.xtype, _this.project, "");
- _this.new_file_dialog.show(f);
-
- return ;
- }
- },
- height_request : 50,
- pack : "false",
+ {
+ xtype : "Button",
width_request : 50,
- label : "Add\nFile"
+ label : "Add\nFile",
+ xns : Gtk,
+ height_request : 50,
+ listeners : {
+ clicked : () => {
+ // create a new file in project..
+ if (_this.project == null) {
+ return ;
+ }
+
+ var f = JsRender.JsRender.factory(_this.project.xtype, _this.project, "");
+ _this.new_file_dialog.show(f);
+
+ return ;
+ }
+ }
}
]
+
}
]
+
},
- {
- xtype: Clutter.Actor,
+ {
id : "delprojectbutton",
- pack : "add_child",
- init : this.el.set_size(50,50);,
+ xtype : "Actor",
+ xns : Clutter,
items : [
- {
- xtype: GtkClutter.Actor,
- pack : "add_child",
- init : ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);,
+ {
+ xtype : "Actor",
+ xns : GtkClutter,
items : [
- {
- xtype: Gtk.Button,
- listeners : {
- clicked : ( ) => {
-
- var cd = Xcls_DialogConfirm.singleton();
- cd.el.set_transient_for(_this.el);
- cd.el.set_modal(true);
-
- var project = _this.left_projects.getSelectedProject();
- if (project == null) {
- print("SKIP - no project\n");
- return;
- }
-
-
- if (Gtk.ResponseType.YES != cd.show("Confirm",
- "Are you sure you want to delete project %s".printf(project.name))) {
- return;
- }
-
-
- // confirm?
- Project.Project.remove(project);
- _this.project = null;
-
- _this.left_projects.is_loaded = false;
- _this.left_projects.load();
- _this.clutterfiles.clearFiles();
-
- }
- },
- height_request : 50,
- pack : "false",
+ {
+ xtype : "Button",
width_request : 50,
- label : "Del\nProp"
+ label : "Del\nProp",
+ xns : Gtk,
+ height_request : 50,
+ listeners : {
+ clicked : ( ) => {
+
+ var cd = DialogConfirm.singleton();
+ cd.el.set_transient_for(_this.el);
+ cd.el.set_modal(true);
+
+ var project = _this.left_projects.getSelectedProject();
+ if (project == null) {
+ print("SKIP - no project\n");
+ return;
+ }
+
+
+ if (Gtk.ResponseType.YES != cd.show("Confirm",
+ "Are you sure you want to delete project %s".printf(project.name))) {
+ return;
+ }
+
+
+ // confirm?
+ Project.Project.remove(project);
+ _this.project = null;
+
+ _this.left_projects.is_loaded = false;
+ _this.left_projects.load();
+ _this.clutterfiles.clearFiles();
+
+ }
+ }
}
]
+
}
]
+
}
- ],
- layout_manager : {
- xtype: Clutter.BoxLayout,
- orientation : Clutter.Orientation.VERTICAL
- }
+ ]
+
}
]
+
}
]
+
}
]
+
}
]
+
}
]
+
});
MainWindow.init();
XObject.cache['/MainWindow'] = MainWindow;
-/* -- to compile
-valac --pkg gio-2.0 --pkg posix --pkg gtk+-3.0 --pkg libnotify --pkg gtksourceview-3.0 --pkg libwnck-3.0 \
- /tmp/MainWindow.vala -o /tmp/MainWindow
-*/
-
-
-/* -- to test class
-static int main (string[] args) {
- Gtk.init (ref args);
- new Xcls_MainWindow();
- MainWindow.show_all();
- Gtk.main ();
- return 0;
-}
-*/
-
-
-public static Xcls_MainWindow MainWindow;
+static Xcls_MainWindow _MainWindow;
public class Xcls_MainWindow : Object
{
public static Xcls_MainWindow singleton()
{
- if (MainWindow == null) {
- MainWindow= new Xcls_MainWindow();
+ if (_MainWindow == null) {
+ _MainWindow= new Xcls_MainWindow();
}
- return MainWindow;
+ return _MainWindow;
}
public Xcls_vbox vbox;
public Xcls_topbar topbar;
public Xcls_addfilebutton addfilebutton;
public Xcls_delprojectbutton delprojectbutton;
- // my vars
+ // my vars (def)
public Project.Project project;
- public Xcls_ClutterFiles clutterfiles;
- public Xcls_DialogNewComponent new_file_dialog;
- public Xcls_Editor code_editor;
- public Xcls_GladeView window_gladeview;
- public Xcls_LeftProps left_props;
- public Xcls_ProjectSettings projectsettings;
- public Xcls_RightPalete rightpalete;
- public Xcls_WindowAddProp add_props;
+ public bool children_loaded;
public Xcls_WindowLeftProjects left_projects;
- public Xcls_WindowLeftTree left_tree;
public Xcls_WindowRooView window_rooview;
- public bool children_loaded;
+ public Xcls_Editor code_editor;
+ public Xcls_WindowLeftTree left_tree;
+ public Xcls_DialogNewComponent new_file_dialog;
+ public Xcls_ProjectSettings projectsettings;
+ public Xcls_ClutterFiles clutterfiles;
+ public Xcls_LeftProps left_props;
public string state;
+ public Xcls_RightPalete rightpalete;
public string title;
+ public Xcls_WindowAddProp add_props;
+ public Xcls_GladeView window_gladeview;
- // ctor
+ // ctor
public Xcls_MainWindow()
{
_this = this;
this.el = new Gtk.Window( Gtk.WindowType.TOPLEVEL );
- // my vars
+ // my vars (dec)
this.project = null;
- this.clutterfiles = null;
- this.new_file_dialog = null;
+ this.children_loaded = false;
+ this.left_projects = null;
+ this.window_rooview = null;
this.code_editor = null;
- this.window_gladeview = null;
- this.left_props = null;
+ this.left_tree = null;
+ this.new_file_dialog = null;
this.projectsettings = null;
+ this.clutterfiles = null;
+ this.left_props = null;
this.rightpalete = null;
- this.add_props = null;
- this.left_projects = null;
- this.left_tree = null;
- this.window_rooview = null;
- this.children_loaded = false;
this.title = "Application Builder";
+ this.add_props = null;
+ this.window_gladeview = null;
// set gobject values
this.el.border_width = 0;
this.el.add ( child_0.el );
// init method
- this.state = "files";
+
+ this.state = "files";
//this.el.show_all();
-
-
-
// listeners
- this.el.show.connect( ( ) => {
- // hide the file editing..
-
- //this.hideViewEditing();
- } );
- this.el.delete_event.connect( ( event) => {
+ this.el.delete_event.connect( ( event) => {
return false;
- } );
+ });
this.el.destroy.connect( () => {
Gtk.main_quit();
- } );
+ });
+ this.el.show.connect( ( ) => {
+ // hide the file editing..
+
+ //this.hideViewEditing();
+ });
}
- // userdefined functions
- public void hideAddListener() {
- _this.backbutton.el.hide();
- _this.projectbutton.el.show();
- _this.projecteditbutton.el.show();
- _this.editfilebutton.el.show();
- _this.addpropsview.el.save_easing_state();
- var el = _this.rooview.el;
- el.save_easing_state();
-
-
- el.set_scale(1.0f,1.0f);
- _this.addpropsview.el.set_scale(0.0f,0.0f);
- _this.state = "edit";
-
+ // user defined functions
+ public void hideObject () {
+ // return to editing state..
+
+ _this.projecteditbutton.el.show();
+ _this.backbutton.el.hide();
+ _this.projectbutton.el.show();
+ _this.editfilebutton.el.show();
+ _this.objectview.el.save_easing_state();
+ var el = _this.rooview.el;
+ el.save_easing_state();
+
+
+ el.set_scale(1.0f,1.0f);
+ _this.objectview.el.set_scale(0.0f,0.0f);
+ _this.state = "edit";
+
+
+ //_this.clutterfiles.loadProject(_this.project);
+
+ el.restore_easing_state();
+ _this.objectview.el.restore_easing_state();
+
+
+ }
+ public void show () {
+ this.left_tree =new Xcls_WindowLeftTree();
+ _this.vbox.el.pack_start(this.left_tree.el,true, true,0);
+ this.el.show_all();
+
+ }
+ public void showAddProp () {
+
- //_this.clutterfiles.loadProject(_this.project);
-
- el.restore_easing_state();
- _this.addpropsview.el.restore_easing_state();
- }
- public void hideAddProp() {
- _this.backbutton.el.hide();
- _this.projectbutton.el.show();
- _this.projecteditbutton.el.show();
- _this.editfilebutton.el.show();
- _this.addpropsview.el.save_easing_state();
-
- var el = _this.rooview.el;
- el.save_easing_state();
-
-
- el.set_scale(1.0f,1.0f);
- _this.addpropsview.el.set_scale(0.0f,0.0f);
- _this.state = "edit";
+ var ae = this.left_tree.getActiveElement();
+ if (ae == null) {
+ return;
+ }
+ _this.backbutton.el.show();
+ _this.projectbutton.el.hide();
+ _this.editfilebutton.el.hide();
+ _this.projecteditbutton.el.hide();
- //_this.clutterfiles.loadProject(_this.project);
-
- el.restore_easing_state();
- _this.addpropsview.el.restore_easing_state();
- }
- public void hideCodeEdit() {
- //this.code_editor.saveContents();
- _this.backbutton.el.hide();
- _this.projectbutton.el.show();
- _this.projecteditbutton.el.show();
- _this.editfilebutton.el.show();
- _this.codeeditview.el.save_easing_state();
- var el = _this.rooview.el;
- el.save_easing_state();
-
-
- el.set_scale(1.0f,1.0f);
- _this.codeeditview.el.set_scale(0.0f,0.0f);
- _this.state = "edit";
-
- //_this.clutterfiles.loadProject(_this.project);
-
- el.restore_easing_state();
- _this.codeeditview.el.restore_easing_state();
- }
- public void hideObject() {
- // return to editing state..
-
- _this.projecteditbutton.el.show();
- _this.backbutton.el.hide();
- _this.projectbutton.el.show();
- _this.editfilebutton.el.show();
- _this.objectview.el.save_easing_state();
- var el = _this.rooview.el;
- el.save_easing_state();
-
-
- el.set_scale(1.0f,1.0f);
- _this.objectview.el.set_scale(0.0f,0.0f);
- _this.state = "edit";
-
+ //this.rooview.el.hide();
+ this.add_props.el.show_all();
+ this.add_props.show(
+ Palete.factory(this.project.xtype),
+ "props",
+ ae.fqn()
+ );
+
+ _this.addpropsview.el.save_easing_state();
+
+ var el = _this.rooview.el;
+ el.save_easing_state();
+ _this.clutterembed.setSizesAlloc("addprop");
- //_this.clutterfiles.loadProject(_this.project);
-
- el.restore_easing_state();
- _this.objectview.el.restore_easing_state();
+
+ _this.addpropsview.el.set_scale(1.0f,1.0f);
+
+
+
+ //_this.clutterfiles.loadProject(_this.project);
+
+ el.restore_easing_state();
+ _this.addpropsview.el.restore_easing_state();
+ this.state = "addprop";
+ }
+ public void showProjectEdit () {
+ // make the browser smaller, and show the edit dialog
- }
- public void hideProjectEdit () {
- // return to editing state..
-
- _this.projectbutton.el.show();
- _this.projecteditbutton.el.show();
- _this.backbutton.el.hide();
- _this.editfilebutton.el.show();
-
- //this.rooview.el.hide();
- //this.edit_project.el.show();
- _this.projecteditview.el.save_easing_state();
- var el = _this.rooview.el;
- el.save_easing_state();
-
-
- el.set_scale(1.0f,1.0f);
- _this.projecteditview.el.set_scale(1.0f,0.0f);
- _this.state = "edit";
+ _this.projectbutton.el.hide();
+ _this.projecteditbutton.el.hide();
+
+ _this.editfilebutton.el.hide();
- //_this.clutterfiles.loadProject(_this.project);
-
- el.restore_easing_state();
- _this.projecteditview.el.restore_easing_state();
-
- }
- public void hideViewEditing ( ) {
-
- // show the file navigation...
-
- if (this.left_tree.getActiveFile() != null) {
- if (this.left_tree.getActiveFile().xtype == "Roo" ) {
- this.window_rooview.createThumb();
- } else {
- this.window_gladeview.createThumb();
- }
- }
-
- _this.addprojectbutton.el.show();
- _this.addfilebutton.el.show();
- _this.backbutton.el.show();
- _this.delprojectbutton.el.show();
-
- _this.editfilebutton.el.hide();
- _this.projectbutton.el.hide();
- _this.projecteditbutton.el.hide();
- _this.objectshowbutton.el.hide();
- _this.addpropbutton.el.hide();
- _this.addlistenerbutton.el.hide();
-
-
-
-
- // show the add file button..
-
-
-
- this.editpane.el.hide();
- //this.rooview.el.hide();
- this.left_projects.el.show();
-
- var el = _this.rooview.el;
- el.save_easing_state();
- el.set_easing_duration(1000);
- // show project / file view..
- //_this.mainpane.lastWidth = _this.leftpane.el.get_position();
- //_this.mainpane.el.set_position(0);
- // rotate y 180..
- el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 360.0f);
- el.set_scale(0.0f,0.0f);
-
- _this.state = "files";
- if (_this.project != null) {
- _this.left_projects.selectProject(_this.project);
- }
- //_this.clutterfiles.loadProject(_this.project);
+
+
+ _this.backbutton.el.show();
+
+ //this.rooview.el.hide();
+ this.projectsettings.el.show_all();
+ this.projectsettings.show(this.project);
+ _this.projecteditview.el.save_easing_state();
+
+ var el = _this.rooview.el;
+ el.save_easing_state();
+
+
+ el.set_scale(0.5f,0.5f);
+
+ _this.projecteditview.el.set_scale(1.0f,1.0f);
+
+ _this.state = "projectedit";
+
+
+ //_this.clutterfiles.loadProject(_this.project);
+
+ el.restore_easing_state();
+ _this.projecteditview.el.restore_easing_state();
+ // print("show view browsing");
- el.restore_easing_state();
-
- print("show view browsing");
+ }
+ public void showAddListener () {
+
+
+
+ var ae = this.left_tree.getActiveElement();
+ if (ae == null) {
+ return;
}
- public void initChildren () {
- // this needs putting in a better place..
-
- print("init children");
- this.left_tree = new Xcls_WindowLeftTree();
- this.left_tree.ref();
- this.tree.el.pack_start(this.left_tree.el,true, true,0);
- this.left_tree.el.show_all();
-
- this.left_tree.before_node_change.connect(() => {
- if (this.state != "codeedit") {
- this.left_props.finish_editing();
- return true;
- }
- if (!this.code_editor.saveContents()) {
- return false;
- }
+
+ _this.backbutton.el.show();
+ _this.projectbutton.el.hide();
+ _this.editfilebutton.el.hide();
+ _this.projecteditbutton.el.hide();
+
+
+ //this.rooview.el.hide();
+ this.add_props.el.show_all();
+ this.add_props.show(
+ Palete.factory(this.project.xtype),
+ "signals",
+ ae.fqn()
+ );
+ //this.rightpalete.show(this.project);
+
+ _this.addpropsview.el.save_easing_state();
+
+ var el = _this.rooview.el;
+ el.save_easing_state();
+
+ _this.clutterembed.setSizesAlloc("addlistener");
+
+
+
+
+ _this.addpropsview.el.set_scale(1.0f,1.0f);
+
+
+
+ //_this.clutterfiles.loadProject(_this.project);
+
+ el.restore_easing_state();
+ _this.addpropsview.el.restore_easing_state();
+ this.state = "addlistener";
+ }
+ public void setTitle (string str) {
+ this.el.set_title(this.title + " - " + str);
+ }
+ public void initChildren () {
+ // this needs putting in a better place..
+
+ print("init children");
+ this.left_tree = new Xcls_WindowLeftTree();
+ this.left_tree.ref();
+ this.tree.el.pack_start(this.left_tree.el,true, true,0);
+ this.left_tree.el.show_all();
+
+ this.left_tree.before_node_change.connect(() => {
+ if (this.state != "codeedit") {
+ this.left_props.finish_editing();
+ return true;
+ }
+ if (!this.code_editor.saveContents()) {
return false;
-
- });
-
- this.left_tree.node_selected.connect((sel) => {
-
- print("node_selected called %s\n", (sel == null) ? "NULL" : "a value");
-
- if (sel == null) {
- this.left_props.el.hide();
- }
- this.left_props.el.show();
- this.left_props.load(this.left_tree.getActiveFile(), sel);
- switch (this.state) {
- case "object":
-
- if (sel == null) {
- this.rightpalete.clear();
- break;
- }
- this.rightpalete.load(_this.left_tree.getActiveFile().palete(), sel.fqn());
- break;
-
-
- case "addprop":
- if (sel == null) {
- this.add_props.clear();
- break;
- }
- this.add_props.show(_this.left_tree.getActiveFile().palete(), "props", sel.fqn());
- break;
-
- case "addlistener":
- if (sel == null) {
- this.add_props.clear();
- break;
- }
- this.add_props.show(_this.left_tree.getActiveFile().palete(), "signals", sel.fqn());
- break;
-
- case "codeedit":
-
- this.hideCodeEdit();
- break;
-
-
- }
- return ;
-
- });
-
- this.left_tree.changed.connect(() => {
- this.window_rooview.requestRedraw();
- this.left_tree.model.file.save();
- });
-
-
-
- // left properties
-
- this.left_props =new Xcls_LeftProps();
- this.left_props.ref();
- this.props.el.pack_start(this.left_props.el,true, true,0);
- this.left_props.el.show_all();
-
- this.left_props.show_editor.connect( (file, node, type, key) => {
- this.showCodeEdit(node, type, key);
- });
- this.left_props.stop_editor.connect( () => {
- if (this.state != "codeedit") {
- return true;
- }
-
- var ret = this.code_editor.saveContents();
- if (!ret) {
- return false;
- }
- this.hideCodeEdit();
- return ret;
- });
- this.left_props.changed.connect(() => {
- if (this.left_tree.getActiveFile().xtype == "Roo" ) {
- this.window_rooview.requestRedraw();
-
- } else {
- this.window_gladeview.loadFile(this.left_tree.getActiveFile());
- }
- this.left_tree.model.file.save();
- });
-
-
+ }
+ return false;
+ });
- // left projects..
- this.left_projects = new Xcls_WindowLeftProjects();
- this.left_projects.ref();
- this.leftpane.el.pack_start(this.left_projects.el,true, true,0);
- this.left_projects.el.show_all();
- this.left_projects.project_selected.connect((proj) => {
- proj.scanDirs();
- _this.clutterfiles.loadProject(proj);
-
- });
+ this.left_tree.node_selected.connect((sel) => {
-
- // project edit..
- this.projectsettings =new Xcls_ProjectSettings();
- this.projectsettings.ref(); /// really?
- ((Gtk.Container)(this.projecteditview.el.get_widget())).add(this.projectsettings.el);
- //this.projectsettings.el.show_all();
-
- var stage = _this.projecteditview.el.get_stage();
- stage.set_background_color( Clutter.Color.from_string("#000"));
+ print("node_selected called %s\n", (sel == null) ? "NULL" : "a value");
- this.projectsettings.buttonPressed.connect((btn) => {
- if (this.left_tree.getActiveFile().xtype == "Roo" ) {
-
- if (btn == "save") {
- _this.window_rooview.view.renderJS(true);
- }
- if (btn == "apply") {
- _this.window_rooview.view.renderJS(true);
- return;
+ if (sel == null) {
+ this.left_props.el.hide();
+ }
+ this.left_props.el.show();
+ this.left_props.load(this.left_tree.getActiveFile(), sel);
+ switch (this.state) {
+ case "object":
+
+ if (sel == null) {
+ this.rightpalete.clear();
+ break;
}
- } else {
- // do nothing for gtk..
- }
- if (btn == "save" || btn == "apply") {
- _this.project.save();
-
- }
-
- this.hideProjectEdit();
-
- });
-
-
- // objects (palate..)
- this.rightpalete = new Xcls_RightPalete();
- this.rightpalete.ref(); /// really?
- ((Gtk.Container)(this.objectview.el.get_widget())).add(this.rightpalete.el);
- //this.projectsettings.el.show_all();
-
- stage = _this.objectview.el.get_stage();
- stage.set_background_color( Clutter.Color.from_string("#000"));
-
- /*this.projectsettings.buttonPressed.connect((btn) => {
- if (btn == "save") {
- _this.window_rooview.view.renderJS(true);
- }
- if (btn == "apply") {
- _this.window_rooview.view.renderJS(true);
- return;
- }
- this.hideProjectEdit();
-
- });
- */
-
-
-
- // Add properties
- this.add_props = new Xcls_WindowAddProp();
- this.add_props.ref(); /// really?
- ((Gtk.Container)(this.addpropsview.el.get_widget())).add(this.add_props.el);
- //this.projectsettings.el.show_all();
-
- stage = _this.addpropsview.el.get_stage();
- stage.set_background_color( Clutter.Color.from_string("#000"));
-
-
- _this.add_props.select.connect( (key,type,skel, etype) => {
- this.left_props.addProp(etype, key, skel, type);
- });
-
- // editor
-
-
- this.code_editor = new Xcls_Editor();
- this.code_editor.ref(); /// really?
- ((Gtk.Container)(this.codeeditview.el.get_widget())).add(this.code_editor.el);
- //this.projectsettings.el.show_all();
-
- stage = _this.codeeditview.el.get_stage();
- stage.set_background_color( Clutter.Color.from_string("#000"));
- // editor.save...
-
- _this.code_editor.save.connect( () => {
- this.left_tree.model.file.save();
- });
-
-
-
-
- // roo view
-
- this.window_rooview =new Xcls_WindowRooView();
- this.window_rooview.ref();
- ((Gtk.Container)(this.rooview.el.get_widget())).add(this.window_rooview.el);
- this.window_rooview.el.show_all();
-
- stage = _this.rooview.el.get_stage();
- stage.set_background_color( Clutter.Color.from_string("#000"));
-
-
- // glade view
-
- this.window_gladeview =new Xcls_GladeView();
- this.window_gladeview.ref();
-
- //((Gtk.Container)(this.rooview.el.get_widget())).add(this.window_gladeview.el);
- ///this.window_gladeview.el.hide();
-
-
-
- // clutter files
-
-
- this.clutterfiles = new Xcls_ClutterFiles();
- this.clutterfiles.ref();
- stage.add_child(this.clutterfiles.el);
- this.clutterfiles.el.show_all();
-
-
- this.clutterfiles.open.connect((file) => {
- _this.project = file.project;
- _this.showViewEditing();
- this.left_tree.model.loadFile(file);
- var ctr= ((Gtk.Container)(this.rooview.el.get_widget()));
- if (file.xtype == "Roo" ) {
- ctr.foreach( (w) => { ctr.remove(w); });
- ctr.add(this.window_rooview.el);
- this.window_rooview.loadFile(file);
-
- this.window_rooview.el.show_all();
- } else {
- ctr.foreach( (w) => { ctr.remove(w); });
- ctr.add(this.window_gladeview.el);
- this.window_gladeview.loadFile(file);
- this.window_gladeview.el.show_all();
- }
- print("OPEN : " + file.name);
-
- });
-
- // new file dialog
- this.new_file_dialog = new Xcls_DialogNewComponent();
- // force it modal to the main window..
- this.new_file_dialog.el.set_transient_for(this.el);
- this.new_file_dialog.el.set_modal(true);
-
- this.new_file_dialog.success.connect((project,file) =>
- {
- _this.project = project;
- _this.showViewEditing();
- this.left_tree.model.loadFile(file);
- var ctr= ((Gtk.Container)(this.rooview.el.get_widget()));
- if (file.xtype == "Roo" ) {
- ctr.foreach( (w) => { ctr.remove(w); });
- ctr.add(this.window_rooview.el);
- this.window_rooview.loadFile(file);
+ this.rightpalete.load(_this.left_tree.getActiveFile().palete(), sel.fqn());
+ break;
+
- this.window_rooview.el.show_all();
- } else {
- ctr.foreach( (w) => { ctr.remove(w); });
- ctr.add(this.window_gladeview.el);
- this.window_gladeview.loadFile(file);
- this.window_gladeview.el.show_all();
- }
-
- });
-
-
-
- //w.el.show_all();
- var tl = new Clutter.Timeline(6000);
- tl.set_repeat_count(-1);
- tl.start();
- tl.ref();
-
- this.children_loaded = true;
-
-
-
-
- }
- public void setTitle (string str) {
- this.el.set_title(this.title + " - " + str);
- }
- public void show() {
- this.left_tree =new Xcls_WindowLeftTree();
- _this.vbox.el.pack_start(this.left_tree.el,true, true,0);
- this.el.show_all();
-
- }
- public void showAddListener() {
-
-
-
- var ae = this.left_tree.getActiveElement();
- if (ae == null) {
- return;
- }
-
- _this.backbutton.el.show();
- _this.projectbutton.el.hide();
- _this.editfilebutton.el.hide();
- _this.projecteditbutton.el.hide();
-
-
- //this.rooview.el.hide();
- this.add_props.el.show_all();
- this.add_props.show(
- Palete.factory(this.project.xtype),
- "signals",
- ae.fqn()
- );
- //this.rightpalete.show(this.project);
-
- _this.addpropsview.el.save_easing_state();
-
- var el = _this.rooview.el;
- el.save_easing_state();
-
-
- el.set_scale(0.5f,0.5f);
-
- _this.addpropsview.el.set_scale(1.0f,1.0f);
-
-
-
- //_this.clutterfiles.loadProject(_this.project);
-
- el.restore_easing_state();
- _this.addpropsview.el.restore_easing_state();
- this.state = "addlistener";
- }
- public void showAddProp() {
-
-
- var ae = this.left_tree.getActiveElement();
- if (ae == null) {
- return;
- }
- _this.backbutton.el.show();
- _this.projectbutton.el.hide();
- _this.editfilebutton.el.hide();
- _this.projecteditbutton.el.hide();
-
-
-
- //this.rooview.el.hide();
- this.add_props.el.show_all();
- this.add_props.show(
- Palete.factory(this.project.xtype),
- "props",
- ae.fqn()
- );
-
- _this.addpropsview.el.save_easing_state();
-
- var el = _this.rooview.el;
- el.save_easing_state();
-
-
- el.set_scale(0.5f,0.5f);
-
- _this.addpropsview.el.set_scale(1.0f,1.0f);
-
-
-
- //_this.clutterfiles.loadProject(_this.project);
-
- el.restore_easing_state();
- _this.addpropsview.el.restore_easing_state();
- this.state = "addprop";
- }
- public void showCodeEdit(JsRender.Node node, string ptype, string key)
- {
- // this is a bit different,
- // it's not called via a button - but triggered by the prop edit class signal.
- // so it has to hide any other state..
-
- switch(this.state) {
- case "object":
- this.hideObject();
+ case "addprop":
+ if (sel == null) {
+ this.add_props.clear();
+ break;
+ }
+ this.add_props.show(_this.left_tree.getActiveFile().palete(), "props", sel.fqn());
break;
- case "addprop":
- this.hideAddProp();
+
+ case "addlistener":
+ if (sel == null) {
+ this.add_props.clear();
+ break;
+ }
+ this.add_props.show(_this.left_tree.getActiveFile().palete(), "signals", sel.fqn());
break;
- case "addlistener":
- this.hideAddListener();
+
+ case "codeedit":
+
+ this.hideCodeEdit();
break;
+
+
}
-
- _this.backbutton.el.show();
-
- _this.projectbutton.el.hide();
- _this.editfilebutton.el.hide();
- _this.projecteditbutton.el.hide();
- // more??
-
- //this.rooview.el.hide();
- this.code_editor.el.show_all();
- this.code_editor.show(
- node,
- ptype,
- key
- );
-
- _this.codeeditview.el.save_easing_state();
-
- var el = _this.rooview.el;
- el.save_easing_state();
-
-
- el.set_scale(0.5f,0.5f);
+ return ;
+
+ });
- _this.codeeditview.el.set_scale(1.0f,1.0f);
-
-
+ this.left_tree.changed.connect(() => {
+ this.window_rooview.requestRedraw();
+ this.left_tree.model.file.save();
+ });
- //_this.clutterfiles.loadProject(_this.project);
-
- el.restore_easing_state();
- _this.codeeditview.el.restore_easing_state();
- this.state = "codeedit";
- }
- public void showObject() {
-
-
- // what's the active node on the left hand side..
-
- var n = _this.left_tree.getActiveElement();
- if (_this.left_tree.model.file == null) {
- return;
- }
-
- if (n == null && _this.left_tree.model.file.tree != null) {
- return;
+
+ // left properties
+
+ this.left_props =new Xcls_LeftProps();
+ this.left_props.ref();
+ this.props.el.pack_start(this.left_props.el,true, true,0);
+ this.left_props.el.show_all();
+
+ this.left_props.show_editor.connect( (file, node, type, key) => {
+ this.showCodeEdit(node, type, key);
+ });
+ this.left_props.stop_editor.connect( () => {
+ if (this.state != "codeedit") {
+ return true;
}
-
- _this.backbutton.el.show();
- _this.projectbutton.el.hide();
- _this.editfilebutton.el.hide();
- _this.projecteditbutton.el.hide();
-
-
- //this.rooview.el.hide();
- this.rightpalete.el.show_all();
- this.rightpalete.load(_this.left_tree.getActiveFile().palete(), n == null ? "*top" : n.fqn());
-
-
- //this.rightpalete.show(this.project);
- _this.objectview.el.save_easing_state();
-
- var el = _this.rooview.el;
- el.save_easing_state();
-
-
- el.set_scale(0.5f,0.5f);
-
- _this.objectview.el.set_scale(1.0f,1.0f);
-
-
-
- //_this.clutterfiles.loadProject(_this.project);
-
- el.restore_easing_state();
- _this.objectview.el.restore_easing_state();
- this.state = "object";
- }
- public void showProjectEdit () {
- // make the browser smaller, and show the edit dialog
-
-
- _this.projectbutton.el.hide();
- _this.projecteditbutton.el.hide();
-
- _this.editfilebutton.el.hide();
-
-
-
-
- _this.backbutton.el.show();
+ var ret = this.code_editor.saveContents();
+ if (!ret) {
+ return false;
+ }
+ this.hideCodeEdit();
+ return ret;
+ });
+ this.left_props.changed.connect(() => {
+ if (this.left_tree.getActiveFile().xtype == "Roo" ) {
+ this.window_rooview.requestRedraw();
+
+ } else {
+ this.window_gladeview.loadFile(this.left_tree.getActiveFile());
+ }
+ this.left_tree.model.file.save();
+ });
+
+
+
+
+ // left projects..
+ this.left_projects = new Xcls_WindowLeftProjects();
+ this.left_projects.ref();
+ this.leftpane.el.pack_start(this.left_projects.el,true, true,0);
+ this.left_projects.el.show_all();
+ this.left_projects.project_selected.connect((proj) => {
+ proj.scanDirs();
+ _this.clutterfiles.loadProject(proj);
+
+ });
+
+
+ // project edit..
+ this.projectsettings =new Xcls_ProjectSettings();
+ this.projectsettings.ref(); /// really?
+ ((Gtk.Container)(this.projecteditview.el.get_widget())).add(this.projectsettings.el);
+ //this.projectsettings.el.show_all();
+
+ var stage = _this.projecteditview.el.get_stage();
+ stage.set_background_color( Clutter.Color.from_string("#000"));
+
+ this.projectsettings.buttonPressed.connect((btn) => {
+ if (this.left_tree.getActiveFile().xtype == "Roo" ) {
- //this.rooview.el.hide();
- this.projectsettings.el.show_all();
- this.projectsettings.show(this.project);
- _this.projecteditview.el.save_easing_state();
-
- var el = _this.rooview.el;
- el.save_easing_state();
-
+ if (btn == "save") {
+ _this.window_rooview.view.renderJS(true);
+ }
+ if (btn == "apply") {
+ _this.window_rooview.view.renderJS(true);
+ return;
+ }
+ } else {
+ // do nothing for gtk..
+ }
+ if (btn == "save" || btn == "apply") {
+ _this.project.save();
+
+ }
- el.set_scale(0.5f,0.5f);
+ this.hideProjectEdit();
+
+ });
- _this.projecteditview.el.set_scale(1.0f,1.0f);
-
- _this.state = "projectedit";
+
+ // objects (palate..)
+ this.rightpalete = new Xcls_RightPalete();
+ this.rightpalete.ref(); /// really?
+ ((Gtk.Container)(this.objectview.el.get_widget())).add(this.rightpalete.el);
+ //this.projectsettings.el.show_all();
+
+ stage = _this.objectview.el.get_stage();
+ stage.set_background_color( Clutter.Color.from_string("#000"));
+
+ /*this.projectsettings.buttonPressed.connect((btn) => {
+ if (btn == "save") {
+ _this.window_rooview.view.renderJS(true);
+ }
+ if (btn == "apply") {
+ _this.window_rooview.view.renderJS(true);
+ return;
+ }
+ this.hideProjectEdit();
+ });
+ */
+
+
+
+ // Add properties
+ this.add_props = new Xcls_WindowAddProp();
+ this.add_props.ref(); /// really?
+ ((Gtk.Container)(this.addpropsview.el.get_widget())).add(this.add_props.el);
+ //this.projectsettings.el.show_all();
+
+ stage = _this.addpropsview.el.get_stage();
+ stage.set_background_color( Clutter.Color.from_string("#000"));
+
+
+ _this.add_props.select.connect( (key,type,skel, etype) => {
+ this.left_props.addProp(etype, key, skel, type);
+ });
+
+ // editor
+
+
+ this.code_editor = new Xcls_Editor();
+ this.code_editor.ref(); /// really?
+ ((Gtk.Container)(this.codeeditview.el.get_widget())).add(this.code_editor.el);
+ //this.projectsettings.el.show_all();
+
+ stage = _this.codeeditview.el.get_stage();
+ stage.set_background_color( Clutter.Color.from_string("#000"));
+ // editor.save...
+
+ _this.code_editor.save.connect( () => {
+ this.left_tree.model.file.save();
+ });
+
- //_this.clutterfiles.loadProject(_this.project);
- el.restore_easing_state();
- _this.projecteditview.el.restore_easing_state();
- // print("show view browsing");
-
- }
- public void showViewEditing ( ) {
- this.editpane.el.show();
- // this.rooview.el.show();
- this.left_projects.el.hide();
-
- _this.addprojectbutton.el.hide();
- _this.delprojectbutton.el.hide();
- _this.addfilebutton.el.hide();
- _this.backbutton.el.hide();
-
- _this.projectbutton.el.show();
- _this.editfilebutton.el.show();
+
+ // roo view
+
+ this.window_rooview =new Xcls_WindowRooView();
+ this.window_rooview.ref();
+ ((Gtk.Container)(this.rooview.el.get_widget())).add(this.window_rooview.el);
+ this.window_rooview.el.show_all();
+
+ stage = _this.rooview.el.get_stage();
+ stage.set_background_color( Clutter.Color.from_string("#000"));
+
+
+ // glade view
+
+ this.window_gladeview =new Xcls_GladeView();
+ this.window_gladeview.ref();
+
+ //((Gtk.Container)(this.rooview.el.get_widget())).add(this.window_gladeview.el);
+ ///this.window_gladeview.el.hide();
+
+
+
+ // clutter files
+
+
+ this.clutterfiles = new Xcls_ClutterFiles();
+ this.clutterfiles.ref();
+ stage.add_child(this.clutterfiles.el);
+ this.clutterfiles.el.show_all();
+
+
+ this.clutterfiles.open.connect((file) => {
+ _this.project = file.project;
+ _this.showViewEditing();
+ this.left_tree.model.loadFile(file);
+ var ctr= ((Gtk.Container)(this.rooview.el.get_widget()));
+ if (file.xtype == "Roo" ) {
+ ctr.foreach( (w) => { ctr.remove(w); });
+ ctr.add(this.window_rooview.el);
+ this.window_rooview.loadFile(file);
+
+ this.window_rooview.el.show_all();
+ } else {
+ ctr.foreach( (w) => { ctr.remove(w); });
+ ctr.add(this.window_gladeview.el);
+ this.window_gladeview.loadFile(file);
+ this.window_gladeview.el.show_all();
+ }
+ print("OPEN : " + file.name);
+
+ });
+
+ // new file dialog
+ this.new_file_dialog = new Xcls_DialogNewComponent();
+ // force it modal to the main window..
+ this.new_file_dialog.el.set_transient_for(this.el);
+ this.new_file_dialog.el.set_modal(true);
+
+ this.new_file_dialog.success.connect((project,file) =>
+ {
+ _this.project = project;
+ _this.showViewEditing();
+ this.left_tree.model.loadFile(file);
+ var ctr= ((Gtk.Container)(this.rooview.el.get_widget()));
+ if (file.xtype == "Roo" ) {
+ ctr.foreach( (w) => { ctr.remove(w); });
+ ctr.add(this.window_rooview.el);
+ this.window_rooview.loadFile(file);
+
+ this.window_rooview.el.show_all();
+ } else {
+ ctr.foreach( (w) => { ctr.remove(w); });
+ ctr.add(this.window_gladeview.el);
+ this.window_gladeview.loadFile(file);
+ this.window_gladeview.el.show_all();
+ }
+
+ });
+
+
+
+ //w.el.show_all();
+ var tl = new Clutter.Timeline(6000);
+ tl.set_repeat_count(-1);
+ tl.start();
+ tl.ref();
+
+ this.children_loaded = true;
+
+
+
+
+ }
+ public void hideAddProp () {
+ _this.backbutton.el.hide();
+ _this.projectbutton.el.show();
+ _this.projecteditbutton.el.show();
+ _this.editfilebutton.el.show();
+ _this.addpropsview.el.save_easing_state();
+
+ var el = _this.rooview.el;
+ el.save_easing_state();
+
+
+ el.set_scale(1.0f,1.0f);
+ _this.addpropsview.el.set_scale(0.0f,0.0f);
+ _this.state = "edit";
+
+
+ //_this.clutterfiles.loadProject(_this.project);
+
+ el.restore_easing_state();
+ _this.addpropsview.el.restore_easing_state();
+ }
+ public void hideCodeEdit () {
+ //this.code_editor.saveContents();
+ _this.backbutton.el.hide();
+ _this.projectbutton.el.show();
_this.projecteditbutton.el.show();
- _this.objectshowbutton.el.show();
- _this.addpropbutton.el.show();
- _this.addlistenerbutton.el.show();
+ _this.editfilebutton.el.show();
+ _this.codeeditview.el.save_easing_state();
+ var el = _this.rooview.el;
+ el.save_easing_state();
+
+
+ el.set_scale(1.0f,1.0f);
+ _this.codeeditview.el.set_scale(0.0f,0.0f);
+ _this.state = "edit";
+
+
+ //_this.clutterfiles.loadProject(_this.project);
+
+ el.restore_easing_state();
+ _this.codeeditview.el.restore_easing_state();
+ }
+ public void hideViewEditing ( ) {
+
+ // show the file navigation...
+
+ if (this.left_tree.getActiveFile() != null) {
+ if (this.left_tree.getActiveFile().xtype == "Roo" ) {
+ this.window_rooview.createThumb();
+ } else {
+ this.window_gladeview.createThumb();
+ }
+ }
+ _this.addprojectbutton.el.show();
+ _this.addfilebutton.el.show();
+ _this.backbutton.el.show();
+ _this.delprojectbutton.el.show();
+
+ _this.editfilebutton.el.hide();
+ _this.projectbutton.el.hide();
+ _this.projecteditbutton.el.hide();
+ _this.objectshowbutton.el.hide();
+ _this.addpropbutton.el.hide();
+ _this.addlistenerbutton.el.hide();
+
+
+
+
+
+ // show the add file button..
+
- var el = _this.rooview.el;
- el.save_easing_state();
+ this.editpane.el.hide();
+ //this.rooview.el.hide();
+ this.left_projects.el.show();
+
+ var el = _this.rooview.el;
+ el.save_easing_state();
+ el.set_easing_duration(1000);
+ // show project / file view..
+ //_this.mainpane.lastWidth = _this.leftpane.el.get_position();
+ //_this.mainpane.el.set_position(0);
+ // rotate y 180..
+ el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 360.0f);
+ el.set_scale(0.0f,0.0f);
+
+ _this.state = "files";
+ if (_this.project != null) {
+ _this.left_projects.selectProject(_this.project);
+ }
+ //_this.clutterfiles.loadProject(_this.project);
+
+ el.restore_easing_state();
- el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
- el.set_scale(1.0f,1.0f);
- _this.state = "edit";
- // _this.mainpane.el.set_position(_this.leftpane.lastWidth);
- _this.clutterfiles.el.hide();
+ print("show view browsing");
+ }
+ public void hideAddListener () {
+ _this.backbutton.el.hide();
+ _this.projectbutton.el.show();
+ _this.projecteditbutton.el.show();
+ _this.editfilebutton.el.show();
+ _this.addpropsview.el.save_easing_state();
+ var el = _this.rooview.el;
+ el.save_easing_state();
+
+
+ el.set_scale(1.0f,1.0f);
+ _this.addpropsview.el.set_scale(0.0f,0.0f);
+ _this.state = "edit";
+
+
+ //_this.clutterfiles.loadProject(_this.project);
+
+ el.restore_easing_state();
+ _this.addpropsview.el.restore_easing_state();
+ }
+ public void showViewEditing ( ) {
+ this.editpane.el.show();
+ // this.rooview.el.show();
+ this.left_projects.el.hide();
+
+ _this.addprojectbutton.el.hide();
+ _this.delprojectbutton.el.hide();
+ _this.addfilebutton.el.hide();
+ _this.backbutton.el.hide();
+
+ _this.projectbutton.el.show();
+ _this.editfilebutton.el.show();
+ _this.projecteditbutton.el.show();
+ _this.objectshowbutton.el.show();
+ _this.addpropbutton.el.show();
+ _this.addlistenerbutton.el.show();
+
+
+ var el = _this.rooview.el;
+ el.save_easing_state();
+
+
+ el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
+ el.set_scale(1.0f,1.0f);
+ _this.state = "edit";
+ // _this.mainpane.el.set_position(_this.leftpane.lastWidth);
+ _this.clutterfiles.el.hide();
+
+ el.restore_easing_state();
- el.restore_easing_state();
-
- print("show view editing");
+ print("show view editing");
+ }
+ public void showObject () {
+
+
+ // what's the active node on the left hand side..
+
+ var n = _this.left_tree.getActiveElement();
+
+ if (_this.left_tree.model.file == null) {
+ return;
}
-
- // skip |xns - no return type
+
+ if (n == null && _this.left_tree.model.file.tree != null) {
+ return;
+ }
+
+ _this.backbutton.el.show();
+ _this.projectbutton.el.hide();
+ _this.editfilebutton.el.hide();
+ _this.projecteditbutton.el.hide();
+
+
+ //this.rooview.el.hide();
+ this.rightpalete.el.show_all();
+ this.rightpalete.load(_this.left_tree.getActiveFile().palete(), n == null ? "*top" : n.fqn());
+
+
+ //this.rightpalete.show(this.project);
+
+ _this.objectview.el.save_easing_state();
+
+ var el = _this.rooview.el;
+ el.save_easing_state();
+
+ _this.clutterembed.setSizesAlloc("object");
+
+
+ _this.objectview.el.set_scale(1.0f,1.0f);
+
+
+
+ //_this.clutterfiles.loadProject(_this.project);
+
+ el.restore_easing_state();
+ _this.objectview.el.restore_easing_state();
+ this.state = "object";
+ }
+ public void showCodeEdit (JsRender.Node node, string ptype, string key)
+ {
+ // this is a bit different,
+ // it's not called via a button - but triggered by the prop edit class signal.
+ // so it has to hide any other state..
+
+ switch(this.state) {
+ case "object":
+ this.hideObject();
+ break;
+ case "addprop":
+ this.hideAddProp();
+ break;
+ case "addlistener":
+ this.hideAddListener();
+ break;
+ }
+
+ _this.backbutton.el.show();
+
+ _this.projectbutton.el.hide();
+ _this.editfilebutton.el.hide();
+ _this.projecteditbutton.el.hide();
+ // more??
+
+ //this.rooview.el.hide();
+ this.code_editor.el.show_all();
+ this.code_editor.show(
+ node,
+ ptype,
+ key
+ );
+
+ _this.codeeditview.el.save_easing_state();
+
+ var el = _this.rooview.el;
+ el.save_easing_state();
+ _this.clutterembed.setSizesAlloc("codedit");
+
+ _this.codeeditview.el.set_scale(1.0f,1.0f);
+
+
+
+ //_this.clutterfiles.loadProject(_this.project);
+
+ el.restore_easing_state();
+ _this.codeeditview.el.restore_easing_state();
+ this.state = "codeedit";
+ }
+ public void hideProjectEdit () {
+ // return to editing state..
+
+ _this.projectbutton.el.show();
+ _this.projecteditbutton.el.show();
+ _this.backbutton.el.hide();
+ _this.editfilebutton.el.show();
+
+ //this.rooview.el.hide();
+ //this.edit_project.el.show();
+ _this.projecteditview.el.save_easing_state();
+ var el = _this.rooview.el;
+ el.save_easing_state();
+
+
+ el.set_scale(1.0f,1.0f);
+ _this.projecteditview.el.set_scale(1.0f,0.0f);
+ _this.state = "edit";
+
+
+ //_this.clutterfiles.loadProject(_this.project);
+
+ el.restore_easing_state();
+ _this.projecteditview.el.restore_easing_state();
+
+ }
public class Xcls_vbox : Object
{
public Gtk.VBox el;
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_vbox(Xcls_MainWindow _owner )
{
_this = _owner;
_this.vbox = this;
this.el = new Gtk.VBox( false, 0 );
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_topbar( _this );
this.el.pack_end ( child_1.el , true,true,0 );
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_topbar : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_topbar(Xcls_MainWindow _owner )
{
_this = _owner;
_this.topbar = this;
this.el = new Gtk.HBox( true, 0 );
- // my vars
+ // my vars (dec)
// set gobject values
this.el.height_request = 20;
this.el.vexpand = false ;
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_mainpane : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
public int lastWidth;
- // ctor
+ // ctor
public Xcls_mainpane(Xcls_MainWindow _owner )
{
_this = _owner;
_this.mainpane = this;
this.el = new Gtk.HPaned();
- // my vars
+ // my vars (dec)
this.lastWidth = 0;
// set gobject values
this.el.add2 ( child_1.el );
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_leftpane : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_leftpane(Xcls_MainWindow _owner )
{
_this = _owner;
_this.leftpane = this;
this.el = new Gtk.VBox( true, 0 );
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_editpane( _this );
this.el.pack_start ( child_0.el , false,true,0 );
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_editpane : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_editpane(Xcls_MainWindow _owner )
{
_this = _owner;
_this.editpane = this;
this.el = new Gtk.VPaned();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_tree( _this );
this.el.add2 ( child_1.el );
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_tree : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_tree(Xcls_MainWindow _owner )
{
_this = _owner;
_this.tree = this;
this.el = new Gtk.VBox( true, 0 );
- // my vars
+ // my vars (dec)
// set gobject values
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_props : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_props(Xcls_MainWindow _owner )
{
_this = _owner;
_this.props = this;
this.el = new Gtk.VBox( true, 0 );
- // my vars
+ // my vars (dec)
// set gobject values
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_VBox9 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_VBox9(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.VBox( true, 0 );
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_clutterembed( _this );
this.el.pack_start ( child_0.el , true,true,0 );
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_clutterembed : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_clutterembed(Xcls_MainWindow _owner )
{
_this = _owner;
_this.clutterembed = this;
this.el = new GtkClutter.Embed();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_rooview( _this );
this.el.get_stage().add_child ( child_5.el );
// init method
- var stage = this.el.get_stage();
- stage.set_background_color( Clutter.Color.from_string("#000"));
-
-
+ var stage = this.el.get_stage();
+ stage.set_background_color( Clutter.Color.from_string("#000"));
// listeners
- this.el.size_allocate.connect( ( alloc) => {
- if (!_this.children_loaded) { return; }
- //print("size_allocation %d,%d\n".printf(alloc.width, alloc.height));
+ this.el.size_allocate.connect( ( alloc) => {
+ this.setSizes(alloc, _this.state);
+
+ });
+ }
+
+ // user defined functions
+ public void setSizes ( Gtk.Allocation alloc, string state) {
+ if (!_this.children_loaded) { return; }
+
+ _this.clutterfiles.set_size(alloc.width-50, alloc.height);
- /* _this.rooview.el.set_size(this.el.get_stage().width-50,
- this.el.get_stage().height);
- _this.clutterfiles.set_size(this.el.get_stage().width-50,
- this.el.get_stage().height);
- */
- // this.el.set_size_request(alloc.width,alloc.height);
- // this.el.get_stage().set_size(alloc.width,alloc.height);
- _this.rooview.el.set_size(alloc.width-50,
- alloc.height);
-
-
-
- _this.clutterfiles.set_size(alloc.width-50,
- alloc.height);
- _this.projecteditview.el.set_size(alloc.width-50,
- alloc.height / 2.0f);
-
- _this.objectview.el.set_size((alloc.width -50)/2.0f,
- alloc.height);
-
- _this.addpropsview.el.set_size((alloc.width -50)/2.0f,
- alloc.height);
+ // project view appears at top...
+
+ _this.projecteditview.el.set_size(alloc.width-50, alloc.height / 2.0f);
+
+
+
+ var avail = alloc.width < 50.0f ? 0 : alloc.width - 50.0f;
+
+
+ var palsize = avail < 300.0f ? avail : 300.0f;
+ print("set palsize size %f\n", palsize);
+ // palate / props : fixed 300 pix
+
+ _this.objectview.el.set_size(palsize, alloc.height);
+ _this.addpropsview.el.set_size(palsize, alloc.height);
+
+
+
+ // code edit min 600
+
+ var codesize = avail < 600.0f ? avail : 600.0f;
+ print("set code size %f\n", codesize);
+
+ _this.codeeditview.el.set_size(codesize, alloc.height);
+ _this.rooview.el.set_size(alloc.width-50, alloc.height);
+
+ switch ( state) {
+ case "codeedit":
+
+ var scale = avail > 0.0f ? (avail - codesize -10 ) / avail : 0.0f;
+
+
+ _this.rooview.el.set_scale(scale,scale);
+ break;
+ case "addprop":
+ case "addlistener":
+ case "object":
+ var scale = avail > 0.0f ? (avail - palsize -10 ) / avail : 0.0f;
+ _this.rooview.el.set_scale(scale,scale);
+ break;
+ }
- _this.codeeditview.el.set_size((alloc.width -50)/2.0f,
- alloc.height);
- } );
}
-
- // userdefined functions
-
- // skip |xns - no return type
+ public void setSizesAlloc (string state) {
+
+ Gtk.Allocation alloc;
+ this.el.get_allocation(out alloc);
+ this.setSizes(alloc, state);
+ }
}
public class Xcls_rooview : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_rooview(Xcls_MainWindow _owner )
{
_this = _owner;
_this.rooview = this;
this.el = new GtkClutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
// init method
+
{
this.el.set_size(_this.clutterembed.el.get_stage().width-50,
_this.clutterembed.el.get_stage().height);
- }
- }
-
- // userdefined functions
+ } }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_objectview : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_objectview(Xcls_MainWindow _owner )
{
_this = _owner;
_this.objectview = this;
this.el = new GtkClutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
// init method
+
{
/*
this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,
_this.clutterembed.el.get_stage().height);
- }
- }
+ } }
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_codeeditview : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_codeeditview(Xcls_MainWindow _owner )
{
_this = _owner;
_this.codeeditview = this;
this.el = new GtkClutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
// init method
+
{
/*
this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,
_this.clutterembed.el.get_stage().height);
- }
- }
-
- // userdefined functions
+ } }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_addpropsview : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_addpropsview(Xcls_MainWindow _owner )
{
_this = _owner;
_this.addpropsview = this;
this.el = new GtkClutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
// init method
+
{
/*
this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,
_this.clutterembed.el.get_stage().height);
- }
- }
+ } }
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_projecteditview : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_projecteditview(Xcls_MainWindow _owner )
{
_this = _owner;
_this.projecteditview = this;
this.el = new GtkClutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
// init method
+
{
this.el.set_size(_this.clutterembed.el.get_stage().width-50,
_this.clutterembed.el.get_stage().height /2);
- }
- }
-
- // userdefined functions
+ } }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_buttonlayout : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_buttonlayout(Xcls_MainWindow _owner )
{
_this = _owner;
_this.buttonlayout = this;
this.el = new Clutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_BoxLayout17( _this );
this.el.add_child ( child_10.el );
// init method
+
{
this.el.add_constraint(
this.el.set_size(50,
_this.clutterembed.el.get_stage().height);
- }
- }
+ } }
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_BoxLayout17 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_BoxLayout17(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Clutter.BoxLayout();
- // my vars
+ // my vars (dec)
// set gobject values
this.el.orientation = Clutter.Orientation.VERTICAL;
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_backbutton : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_backbutton(Xcls_MainWindow _owner )
{
_this = _owner;
_this.backbutton = this;
this.el = new Clutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Actor19( _this );
this.el.add_child ( child_0.el );
// init method
- this.el.set_size(50,50);
- }
- // userdefined functions
+ this.el.set_size(50,50); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Actor19 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Actor19(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new GtkClutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Button20( _this );
child_0.ref();
// init method
- ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
- }
- // userdefined functions
+ ((Gtk.Container)(this.el.get_widget())).add ( child_0.el); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Button20 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Button20(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Button();
- // my vars
+ // my vars (dec)
// set gobject values
+ this.el.width_request = 50;
this.el.height_request = 50;
this.el.label = "<<";
- this.el.width_request = 50;
// listeners
- this.el.clicked.connect( ( ) => {
+ this.el.clicked.connect( ( ) => {
switch (_this.state) {
case "edit":
}
return ;
- } );
+ });
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_projectbutton : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_projectbutton(Xcls_MainWindow _owner )
{
_this = _owner;
_this.projectbutton = this;
this.el = new Clutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Actor22( _this );
this.el.add_child ( child_0.el );
// init method
- this.el.set_size(50,50);
- }
- // userdefined functions
+ this.el.set_size(50,50); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Actor22 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Actor22(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new GtkClutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Button23( _this );
child_0.ref();
// init method
- ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
- }
- // userdefined functions
+ ((Gtk.Container)(this.el.get_widget())).add ( child_0.el); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Button23 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Button23(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Button();
- // my vars
+ // my vars (dec)
// set gobject values
+ this.el.width_request = 50;
this.el.height_request = 50;
this.el.label = "Open\nFiles";
- this.el.width_request = 50;
// listeners
- this.el.clicked.connect( ( ) => {
+ this.el.clicked.connect( ( ) => {
switch (_this.state) {
case "edit":
}
return ;
- } );
+ });
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_editfilebutton : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_editfilebutton(Xcls_MainWindow _owner )
{
_this = _owner;
_this.editfilebutton = this;
this.el = new Clutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Actor25( _this );
this.el.add_child ( child_0.el );
// init method
- this.el.set_size(50.0f,50.0f);
- }
- // userdefined functions
+ this.el.set_size(50.0f,50.0f); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Actor25 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Actor25(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new GtkClutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Button26( _this );
child_0.ref();
// init method
- ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
- }
- // userdefined functions
+ ((Gtk.Container)(this.el.get_widget())).add ( child_0.el); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Button26 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Button26(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Button();
- // my vars
+ // my vars (dec)
// set gobject values
+ this.el.width_request = 50;
this.el.height_request = 50;
this.el.label = "File\nDetails";
- this.el.width_request = 50;
// listeners
- this.el.clicked.connect( ( ) => {
+ this.el.clicked.connect( ( ) => {
// create a new file in project..
if (_this.project == null || _this.left_tree.model.file == null) {
return ;
- } );
+ });
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_projecteditbutton : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_projecteditbutton(Xcls_MainWindow _owner )
{
_this = _owner;
_this.projecteditbutton = this;
this.el = new Clutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Actor28( _this );
this.el.add_child ( child_0.el );
// init method
- this.el.set_size(50,50);
- }
- // userdefined functions
+ this.el.set_size(50,50); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Actor28 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Actor28(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new GtkClutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Button29( _this );
child_0.ref();
// init method
- ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
- }
- // userdefined functions
+ ((Gtk.Container)(this.el.get_widget())).add ( child_0.el); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Button29 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Button29(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Button();
- // my vars
+ // my vars (dec)
// set gobject values
+ this.el.width_request = 50;
this.el.height_request = 50;
this.el.label = "Project\nDetails";
- this.el.width_request = 50;
// listeners
- this.el.clicked.connect( ( ) => {
+ this.el.clicked.connect( ( ) => {
switch (_this.state) {
case "edit":
_this.showProjectEdit();
return ;
- } );
+ });
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_objectshowbutton : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_objectshowbutton(Xcls_MainWindow _owner )
{
_this = _owner;
_this.objectshowbutton = this;
this.el = new Clutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Actor31( _this );
this.el.add_child ( child_0.el );
// init method
- this.el.set_size(50,50);
+ this.el.set_size(50,50);
// listeners
- this.el.enter_event.connect( ( event) => {
- this.el.background_color = new Clutter.Color.from_string("#333");
- return false;
- } );
- this.el.leave_event.connect( ( event) => {
- this.el.background_color = new Clutter.Color.from_string("#000");
- return false;
- } );
- this.el.button_press_event.connect( ( ) => {
+ this.el.button_press_event.connect( ( ) => {
return false;
- } );
+ });
+ this.el.enter_event.connect( ( event) => {
+ this.el.background_color = new Clutter.Color.from_string("#333");
+ return false;
+ });
+ this.el.leave_event.connect( ( event) => {
+ this.el.background_color = new Clutter.Color.from_string("#000");
+ return false;
+ });
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Actor31 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Actor31(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new GtkClutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Button32( _this );
child_0.ref();
// init method
- ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
- }
- // userdefined functions
+ ((Gtk.Container)(this.el.get_widget())).add ( child_0.el); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Button32 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Button32(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Button();
- // my vars
+ // my vars (dec)
// set gobject values
+ this.el.width_request = 50;
this.el.height_request = 50;
this.el.label = "Show\nPalete";
- this.el.width_request = 50;
// listeners
- this.el.clicked.connect( ( ) => {
+ this.el.clicked.connect( ( ) => {
return ;
- } );
+ });
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_addpropbutton : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_addpropbutton(Xcls_MainWindow _owner )
{
_this = _owner;
_this.addpropbutton = this;
this.el = new Clutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Actor34( _this );
this.el.add_child ( child_0.el );
// init method
- this.el.set_size(50,50);
- }
- // userdefined functions
+ this.el.set_size(50,50); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Actor34 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Actor34(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new GtkClutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Button35( _this );
child_0.ref();
// init method
- ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
- }
- // userdefined functions
+ ((Gtk.Container)(this.el.get_widget())).add ( child_0.el); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Button35 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Button35(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Button();
- // my vars
+ // my vars (dec)
// set gobject values
+ this.el.width_request = 50;
this.el.height_request = 50;
this.el.label = "Add\nProp";
- this.el.width_request = 50;
// listeners
- this.el.clicked.connect( ( ) => {
+ this.el.clicked.connect( ( ) => {
return ;
- } );
+ });
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_addlistenerbutton : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_addlistenerbutton(Xcls_MainWindow _owner )
{
_this = _owner;
_this.addlistenerbutton = this;
this.el = new Clutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Actor37( _this );
this.el.add_child ( child_0.el );
// init method
- this.el.set_size(50,50);
- }
- // userdefined functions
+ this.el.set_size(50,50); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Actor37 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Actor37(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new GtkClutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Button38( _this );
child_0.ref();
// init method
- ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
- }
- // userdefined functions
+ ((Gtk.Container)(this.el.get_widget())).add ( child_0.el); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Button38 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Button38(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Button();
- // my vars
+ // my vars (dec)
// set gobject values
+ this.el.width_request = 50;
this.el.height_request = 50;
this.el.label = "Add\nEvent\nCode";
- this.el.width_request = 50;
// listeners
- this.el.clicked.connect( ( ) => {
+ this.el.clicked.connect( ( ) => {
return ;
- } );
+ });
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_addprojectbutton : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_addprojectbutton(Xcls_MainWindow _owner )
{
_this = _owner;
_this.addprojectbutton = this;
this.el = new Clutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Actor40( _this );
this.el.add_child ( child_0.el );
// init method
- this.el.set_size(50.0f,50.0f);
- }
- // userdefined functions
+ this.el.set_size(50.0f,50.0f); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Actor40 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Actor40(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new GtkClutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Button41( _this );
child_0.ref();
// init method
- ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
- }
- // userdefined functions
+ ((Gtk.Container)(this.el.get_widget())).add ( child_0.el); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Button41 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Button41(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Button();
- // my vars
+ // my vars (dec)
// set gobject values
+ this.el.width_request = 50;
this.el.height_request = 50;
this.el.label = "New\nProj.";
- this.el.width_request = 50;
// listeners
- this.el.clicked.connect( ( ) => {
+ this.el.clicked.connect( ( ) => {
// create a new file in project..
//Xcls_DialogNewComponent.singleton().show(
return ;
- } );
+ });
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_addfilebutton : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_addfilebutton(Xcls_MainWindow _owner )
{
_this = _owner;
_this.addfilebutton = this;
this.el = new Clutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Actor43( _this );
this.el.add_child ( child_0.el );
// init method
- this.el.set_size(50.0f,50.0f);
- }
- // userdefined functions
+ this.el.set_size(50.0f,50.0f); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Actor43 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Actor43(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new GtkClutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Button44( _this );
child_0.ref();
// init method
- ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
- }
- // userdefined functions
+ ((Gtk.Container)(this.el.get_widget())).add ( child_0.el); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Button44 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Button44(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Button();
- // my vars
+ // my vars (dec)
// set gobject values
+ this.el.width_request = 50;
this.el.height_request = 50;
this.el.label = "Add\nFile";
- this.el.width_request = 50;
// listeners
- this.el.clicked.connect( () => {
+ this.el.clicked.connect( () => {
// create a new file in project..
if (_this.project == null) {
return ;
_this.new_file_dialog.show(f);
return ;
- } );
+ });
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_delprojectbutton : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_delprojectbutton(Xcls_MainWindow _owner )
{
_this = _owner;
_this.delprojectbutton = this;
this.el = new Clutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Actor46( _this );
this.el.add_child ( child_0.el );
// init method
- this.el.set_size(50,50);
- }
- // userdefined functions
+ this.el.set_size(50,50); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Actor46 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Actor46(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new GtkClutter.Actor();
- // my vars
+ // my vars (dec)
// set gobject values
var child_0 = new Xcls_Button47( _this );
child_0.ref();
// init method
- ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
- }
- // userdefined functions
+ ((Gtk.Container)(this.el.get_widget())).add ( child_0.el); }
- // skip |xns - no return type
+ // user defined functions
}
public class Xcls_Button47 : Object
{
private Xcls_MainWindow _this;
- // my vars
+ // my vars (def)
- // ctor
+ // ctor
public Xcls_Button47(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Button();
- // my vars
+ // my vars (dec)
// set gobject values
+ this.el.width_request = 50;
this.el.height_request = 50;
this.el.label = "Del\nProp";
- this.el.width_request = 50;
// listeners
- this.el.clicked.connect( ( ) => {
+ this.el.clicked.connect( ( ) => {
- var cd = Xcls_DialogConfirm.singleton();
+ var cd = DialogConfirm.singleton();
cd.el.set_transient_for(_this.el);
cd.el.set_modal(true);
_this.left_projects.load();
_this.clutterfiles.clearFiles();
- } );
+ });
}
- // userdefined functions
-
- // skip |xns - no return type
+ // user defined functions
}
}
{
- "id": "file-gtk-17",
- "name": "WindowLeftProps",
- "parent": "",
- "title": false,
- "path": "/home/alan/gitlive/app.Builder.js/Builder4/WindowLeftProps.bjs",
- "items": [
+ "name" : "WindowLeftProps",
+ "parent" : "",
+ "title" : "",
+ "path" : "/home/alan/gitlive/app.Builder.js/Builder4/WindowLeftProps.bjs",
+ "permname" : "",
+ "modOrder" : "",
+ "items" : [
{
- ".JsRender.JsRender:file": "",
- ".JsRender.Node:node": "",
- ".bool:allow_edit": false,
- ".signal:bool:stop_editor": "()",
- ".signal:void:changed": "()",
- ".signal:void:show_add_props": "(string type)",
- ".signal:void:show_editor": "(JsRender.JsRender file, JsRender.Node node, string type, string key)",
- "id": "LeftProps",
- "xtype": "VBox",
- "|bool:startEditingValue": "( Gtk.TreePath path) {\n\n // ONLY return true if editing is allowed - eg. combo..\n \n print(\"start editing?\\n\");\n if (!this.stop_editor()) {\n print(\"stop editor failed\\n\");\n return false;\n }\n \n Gtk.TreeIter iter;\n\n var mod = this.model.el;\n mod.get_iter (out iter, path);\n \n /*\n m.set(iter, \n 0, \"listener\",\n 1, miter.get_key(),\n 2, \"<b>\" + miter.get_key() + \"</b>\",\n 3, miter.get_value()\n ); \n \n */\n GLib.Value gval;\n mod.get_value(iter, 3 , out gval);\n var val = (string)gval;\n \n mod.get_value(iter, 1 , out gval);\n var key = (string)gval;\n var type_ar = key.split(\" \");\n \n \n \n mod.get_value(iter, 0 , out gval);\n var type = (string)gval;\n \n \n \n var use_textarea = false;\n \n if (type == \"listener\") {\n use_textarea = true;\n }\n if (key.length > 0 && key[0] == '$') {\n use_textarea = true;\n }\n if (use_textarea) {\n print(\"Call show editor\\n\");\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n this.view.el.get_selection().select_path(path);\n \n this.show_editor(file, node, type, key);\n \n return false;\n });\n \n \n return false;\n }\n // others... - fill in options for true/false?\n print(\"turn on editing %s \\n\" , mod.get_path(iter).to_string());\n \n print (type_ar[0].up());\n if (type_ar.length > 1 && (\n type_ar[0].up() == \"BOOLEAN\"\n ||\n type_ar[0].up() == \"BOOL\" \n )) {\n print(\"start editing try/false)???\");\n this.valrender.el.has_entry = false;\n string[] opts = { \"true\", \"false\" };\n this.valrender.setOptions(opts);\n \n this.valrender.el.has_entry = false;\n this.valrender.el.editable = true;\n this.allow_edit = true;\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {\n this.view.el.set_cursor_on_cell(\n path,\n this.valcol.el,\n this.valrender.el,\n true\n );\n return false;\n });\n return true;\n }\n \n \n \n string[] opts = { };\n this.valrender.setOptions(opts);\n \n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n \n // at this point - work out the type...\n // if its' a combo... then show the options..\n this.valrender.el.has_entry = true;\n \n this.valrender.el.editable = true; \n \n \n this.allow_edit = true;\n \n \n \n \n\n this.view.el.set_cursor_on_cell(\n path,\n this.valcol.el,\n this.valrender.el,\n true\n );\n return false;\n });\n return false;\n }\n",
- "|homogeneous": "false ",
- "|string:keyFormat": "(string val, string type) {\n \n // Glib.markup_escape_text(val);\n\n if (type == \"listener\") {\n return \"<span font_weight=\\\"bold\\\" color=\\\"#660000\\\">\" + \n GLib.Markup.escape_text(val) +\n \"</span>\";\n }\n // property..\n if (val.length < 1) {\n return \"<span color=\\\"#FF0000\\\">--empty--</span>\";\n }\n \n //@ = signal\n //$ = property with \n //# - object properties\n //* = special\n // all of these... - display value is last element..\n var ar = val.strip().split(\" \");\n \n \n var dval = GLib.Markup.escape_text(ar[ar.length-1]);\n \n \n \n \n switch(val[0]) {\n case '@': // signal // just bold balck?\n if (dval[0] == '@') {\n dval = dval.substring(1);\n }\n \n return @\"<span font_weight=\\\"bold\\\">@ $dval</span>\"; \n case '#': // object properties?\n if (dval[0] == '#') {\n dval = dval.substring(1);\n }\n return @\"<span font_weight=\\\"bold\\\">$dval</span>\";\n case '*': // special\n if (dval[0] == '*') {\n dval = dval.substring(1);\n }\n return @\"<span color=\\\"#0000CC\\\" font_weight=\\\"bold\\\">$dval</span>\"; \n case '$':\n if (dval[0] == '$') {\n dval = dval.substring(1);\n }\n return @\"<span style=\\\"italic\\\">$dval</span>\";\n case '|': // user defined methods\n if (dval[0] == '|') {\n dval = dval.substring(1);\n }\n return @\"<span color=\\\"#008000\\\" font_weight=\\\"bold\\\">$dval</span>\";\n \n \n \n default:\n return dval;\n }\n \n \n\n}",
- "|string:keySortFormat": "(string key) {\n // listeners first - with 0\n // specials\n if (key[0] == '*') {\n return \"1 \" + key;\n }\n // functions\n \n var bits = key.split(\" \");\n \n if (key[0] == '|') {\n return \"2 \" + bits[bits.length -1];\n }\n // signals\n if (key[0] == '@') {\n return \"3 \" + bits[bits.length -1];\n }\n \n // props\n if (key[0] == '#') {\n return \"4 \" + bits[bits.length -1];\n }\n // the rest..\n return \"5 \" + bits[bits.length -1]; \n\n\n\n}",
- "|void:addProp": " (string in_type, string key, string value, string value_type) {\n // info includes key, val, skel, etype..\n //console.dump(info);\n //type = info.type.toLowerCase();\n //var data = this.toJS();\n \n var type = in_type == \"signals\" ? \"listener\" : in_type;\n \n var fkey = (value_type.length > 0 ? value_type + \" \" : \"\") + key;\n \n if (type == \"listener\") {\n if (this.node.listeners.has_key(key)) {\n return;\n }\n this.node.listeners.set(key,value);\n } else {\n \n if (this.node.props.has_key(fkey)) {\n return;\n }\n this.node.props.set(fkey,value);\n }\n \n \n // add a row???\n this.load(this.file, this.node);\n \n \n \n /// need to find the row which I've just added..\n \n \n var s = this.view.el.get_selection();\n s.unselect_all();\n \n print(\"trying to find new iter\");\n \n this.model.el.foreach((model, path, iter) => {\n GLib.Value gval;\n \n this.model.el.get_value(iter, 0 , out gval);\n if ((string)gval != type) {\n print(\"not type: %s = %s\\n\", (string)gval , type);\n return false;\n }\n this.model.el.get_value(iter, 1 , out gval);\n if ((string)gval != fkey) {\n print(\"not key: %s = %s\\n\", (string)gval , fkey);\n return false;\n }\n // delay this?\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,40 , () => {\n \n this.startEditingValue(this.model.el.get_path(iter));\n return false;\n });\n //s.select_iter(iter);\n return true; \n });\n \n \n \n \n}\n",
- "|void:before_edit": "()\n{\n\n print(\"before edit - stop editing\\n\");\n \n // these do not appear to trigger save...\n _this.keyrender.el.stop_editing(false);\n _this.keyrender.el.editable =false;\n\n _this.valrender.el.stop_editing(false);\n _this.valrender.el.editable =false; \n \n \n// technicall stop the popup editor..\n\n}\n",
- "|void:deleteSelected": " () {\n \n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n \n var s = this.view.el.get_selection();\n s.get_selected(out mod, out iter);\n \n \n GLib.Value gval;\n mod.get_value(iter, 0 , out gval);\n var type = (string)gval;\n \n mod.get_value(iter, 1 , out gval);\n var key = (string)gval;\n \n switch(type) {\n case \"listener\":\n this.node.listeners.remove(key);\n break;\n \n case \"props\":\n this.node.props.remove(key);\n break;\n }\n this.load(this.file, this.node);\n \n _this.changed();\n}",
- "|void:finish_editing": "() {\n // \n this.before_edit();\n}",
- "|void:load": "(JsRender.JsRender file, JsRender.Node? node) \n{\n print(\"load leftprops\\n\");\n this.before_edit();\n this.node = node;\n this.file = file;\n \n \n this.model.el.clear();\n \n //this.get('/RightEditor').el.hide();\n if (node ==null) {\n return ;\n }\n \n \n\n //var provider = this.get('/LeftTree').getPaleteProvider();\n Gtk.TreeIter iter;\n \n //typeof(string), // 0 key type\n //typeof(string), // 1 key\n //typeof(string), // 2 key (display)\n //typeof(string), // 3 value\n //typeof(string), // 4 value (display)\n //typeof(string), // 5 both (tooltip)\n \n \n \n \n // really need a way to sort the hashmap...\n var m = this.model.el;\n \n var miter = node.listeners.map_iterator();\n \n while(miter.next()) {\n m.append(out iter,null);\n \n this.updateIter(iter, \"listener\", miter.get_key(), miter.get_value());\n \n \n }\n \n \n miter = node.props.map_iterator();\n \n \n while(miter.next()) {\n m.append(out iter,null);\n this.updateIter(iter, \"prop\", miter.get_key(), miter.get_value());\n \n }\n print(\"clear selection\\n\");\n // clear selection?\n this.model.el.set_sort_column_id(6,Gtk.SortType.ASCENDING); // sort by real key..\n \n this.view.el.get_selection().unselect_all();\n \n \n \n}\n",
- "|void:startEditingKey": "( Gtk.TreePath path) {\n \n if (!this.stop_editor()) {\n return;\n }\n \n // others... - fill in options for true/false?\n \n \n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n this.allow_edit = true;\n this.keyrender.el.editable = true;\n \n this.view.el.set_cursor_on_cell(\n path,\n this.keycol.el,\n this.keyrender.el,\n true\n );\n \n return false;\n });\n \n \n}\n",
- "|void:updateIter": "(Gtk.TreeIter iter, string type, string key, string value) {\n\n print(\"update Iter %s, %s\\n\", key,value);\n //typeof(string), // 0 key type\n //typeof(string), // 1 key\n //typeof(string), // 2 key (display)\n //typeof(string), // 3 value\n //typeof(string), // 4 value (display)\n //typeof(string), // 5 both (tooltip)\n //typeof(string), // 6 key (sort)\n \n var dl = value.strip().split(\"\\n\");\n\n var dis_val = dl.length > 1 ? (dl[0].strip()+ \"...\") : dl[0];\n \n if (type == \"listener\") {\n \n \n \n this.model.el.set(iter, \n 0, type,\n 1, key,\n 2, this.keyFormat(key ,type),\n 3, value,\n 4, dis_val,\n 5, \"<tt>\" + GLib.Markup.escape_text(key + \" \" +value) + \"</tt>\",\n 6, \"0 \" + key\n ); \n return;\n }\n \n\n\n this.model.el.set(iter, \n 0, \"props\",\n 1, key,\n 2, this.keyFormat(key , \"prop\"),\n 3, value,\n 4, dis_val,\n 5, \"<tt>\" + GLib.Markup.escape_text(key + \" \" + value) + \"</tt>\",\n 6, this.keySortFormat(key)\n ); \n}",
- "|xns": "Gtk",
- "items": [
+ "# bool allow_edit" : false,
+ "| void startEditingKey" : "( Gtk.TreePath path) {\n \n if (!this.stop_editor()) {\n return;\n }\n \n // others... - fill in options for true/false?\n \n \n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n this.allow_edit = true;\n this.keyrender.el.editable = true;\n \n this.view.el.set_cursor_on_cell(\n path,\n this.keycol.el,\n this.keyrender.el,\n true\n );\n \n return false;\n });\n \n \n}\n",
+ "| void updateIter" : "(Gtk.TreeIter iter, string type, string key, string value) {\n\n print(\"update Iter %s, %s\\n\", key,value);\n //typeof(string), // 0 key type\n //typeof(string), // 1 key\n //typeof(string), // 2 key (display)\n //typeof(string), // 3 value\n //typeof(string), // 4 value (display)\n //typeof(string), // 5 both (tooltip)\n //typeof(string), // 6 key (sort)\n \n var dl = value.strip().split(\"\\n\");\n\n var dis_val = dl.length > 1 ? (dl[0].strip()+ \"...\") : dl[0];\n \n if (type == \"listener\") {\n \n \n \n this.model.el.set(iter, \n 0, type,\n 1, key,\n 2, this.keyFormat(key ,type),\n 3, value,\n 4, dis_val,\n 5, \"<tt>\" + GLib.Markup.escape_text(key + \" \" +value) + \"</tt>\",\n 6, \"0 \" + key\n ); \n return;\n }\n \n\n\n this.model.el.set(iter, \n 0, \"props\",\n 1, key,\n 2, this.keyFormat(key , \"prop\"),\n 3, value,\n 4, dis_val,\n 5, \"<tt>\" + GLib.Markup.escape_text(key + \" \" + value) + \"</tt>\",\n 6, this.keySortFormat(key)\n ); \n}",
+ "id" : "LeftProps",
+ "| string keyFormat" : "(string val, string type) {\n \n // Glib.markup_escape_text(val);\n\n if (type == \"listener\") {\n return \"<span font_weight=\\\"bold\\\" color=\\\"#660000\\\">\" + \n GLib.Markup.escape_text(val) +\n \"</span>\";\n }\n // property..\n if (val.length < 1) {\n return \"<span color=\\\"#FF0000\\\">--empty--</span>\";\n }\n \n //@ = signal\n //$ = property with \n //# - object properties\n //* = special\n // all of these... - display value is last element..\n var ar = val.strip().split(\" \");\n \n \n var dval = GLib.Markup.escape_text(ar[ar.length-1]);\n \n \n \n \n switch(val[0]) {\n case '@': // signal // just bold balck?\n if (dval[0] == '@') {\n dval = dval.substring(1);\n }\n \n return @\"<span font_weight=\\\"bold\\\">@ $dval</span>\"; \n case '#': // object properties?\n if (dval[0] == '#') {\n dval = dval.substring(1);\n }\n return @\"<span font_weight=\\\"bold\\\">$dval</span>\";\n case '*': // special\n if (dval[0] == '*') {\n dval = dval.substring(1);\n }\n return @\"<span color=\\\"#0000CC\\\" font_weight=\\\"bold\\\">$dval</span>\"; \n case '$':\n if (dval[0] == '$') {\n dval = dval.substring(1);\n }\n return @\"<span style=\\\"italic\\\">$dval</span>\";\n case '|': // user defined methods\n if (dval[0] == '|') {\n dval = dval.substring(1);\n }\n return @\"<span color=\\\"#008000\\\" font_weight=\\\"bold\\\">$dval</span>\";\n \n \n \n default:\n return dval;\n }\n \n \n\n}",
+ "| bool startEditingValue" : "( Gtk.TreePath path) {\n\n // ONLY return true if editing is allowed - eg. combo..\n \n print(\"start editing?\\n\");\n if (!this.stop_editor()) {\n print(\"stop editor failed\\n\");\n return false;\n }\n \n Gtk.TreeIter iter;\n\n var mod = this.model.el;\n mod.get_iter (out iter, path);\n \n /*\n m.set(iter, \n 0, \"listener\",\n 1, miter.get_key(),\n 2, \"<b>\" + miter.get_key() + \"</b>\",\n 3, miter.get_value()\n ); \n \n */\n GLib.Value gval;\n mod.get_value(iter, 3 , out gval);\n var val = (string)gval;\n \n mod.get_value(iter, 1 , out gval);\n var key = (string)gval;\n var type_ar = key.split(\" \");\n \n \n \n mod.get_value(iter, 0 , out gval);\n var type = (string)gval;\n \n \n \n var use_textarea = false;\n\n //------------ things that require the text editor...\n \n if (type == \"listener\") {\n use_textarea = true;\n }\n\n if (key.length > 0 && key[0] == '$') {\n use_textarea = true;\n }\n if (key.length > 0 && key == \"* init\") {\n use_textarea = true;\n }\n if (val.length > 40) { // long value...\n use_textarea = true;\n }\n \n \n \n if (use_textarea) {\n print(\"Call show editor\\n\");\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n this.view.el.get_selection().select_path(path);\n \n this.show_editor(file, node, type, key);\n \n return false;\n });\n \n \n return false;\n }\n // others... - fill in options for true/false?\n print(\"turn on editing %s \\n\" , mod.get_path(iter).to_string());\n \n print (type_ar[0].up());\n if (type_ar.length > 1 && (\n type_ar[0].up() == \"BOOLEAN\"\n ||\n type_ar[0].up() == \"BOOL\" \n )) {\n print(\"start editing try/false)???\");\n this.valrender.el.has_entry = false;\n string[] opts = { \"true\", \"false\" };\n this.valrender.setOptions(opts);\n \n this.valrender.el.has_entry = false;\n this.valrender.el.editable = true;\n this.allow_edit = true;\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {\n this.view.el.set_cursor_on_cell(\n path,\n this.valcol.el,\n this.valrender.el,\n true\n );\n return false;\n });\n return true;\n }\n \n \n \n string[] opts = { };\n this.valrender.setOptions(opts);\n \n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n \n // at this point - work out the type...\n // if its' a combo... then show the options..\n this.valrender.el.has_entry = true;\n \n this.valrender.el.editable = true; \n \n \n this.allow_edit = true;\n \n \n \n \n\n this.view.el.set_cursor_on_cell(\n path,\n this.valcol.el,\n this.valrender.el,\n true\n );\n return false;\n });\n return false;\n }\n",
+ "xtype" : "VBox",
+ "# JsRender.JsRender file" : "",
+ "@ bool stop_editor" : "()",
+ "@ void show_editor" : "(JsRender.JsRender file, JsRender.Node node, string type, string key)",
+ "| void deleteSelected" : " () {\n \n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n \n var s = this.view.el.get_selection();\n s.get_selected(out mod, out iter);\n \n \n GLib.Value gval;\n mod.get_value(iter, 0 , out gval);\n var type = (string)gval;\n \n mod.get_value(iter, 1 , out gval);\n var key = (string)gval;\n \n switch(type) {\n case \"listener\":\n this.node.listeners.remove(key);\n break;\n \n case \"props\":\n this.node.props.remove(key);\n break;\n }\n this.load(this.file, this.node);\n \n _this.changed();\n}",
+ "| void load" : "(JsRender.JsRender file, JsRender.Node? node) \n{\n print(\"load leftprops\\n\");\n this.before_edit();\n this.node = node;\n this.file = file;\n \n \n this.model.el.clear();\n \n //this.get('/RightEditor').el.hide();\n if (node ==null) {\n return ;\n }\n \n \n\n //var provider = this.get('/LeftTree').getPaleteProvider();\n Gtk.TreeIter iter;\n \n //typeof(string), // 0 key type\n //typeof(string), // 1 key\n //typeof(string), // 2 key (display)\n //typeof(string), // 3 value\n //typeof(string), // 4 value (display)\n //typeof(string), // 5 both (tooltip)\n \n \n \n \n // really need a way to sort the hashmap...\n var m = this.model.el;\n \n var miter = node.listeners.map_iterator();\n \n while(miter.next()) {\n m.append(out iter,null);\n \n this.updateIter(iter, \"listener\", miter.get_key(), miter.get_value());\n \n \n }\n \n \n miter = node.props.map_iterator();\n \n \n while(miter.next()) {\n m.append(out iter,null);\n this.updateIter(iter, \"prop\", miter.get_key(), miter.get_value());\n \n }\n print(\"clear selection\\n\");\n // clear selection?\n this.model.el.set_sort_column_id(6,Gtk.SortType.ASCENDING); // sort by real key..\n \n this.view.el.get_selection().unselect_all();\n \n \n \n}\n",
+ "@ void changed" : "()",
+ "| string keySortFormat" : "(string key) {\n // listeners first - with 0\n // specials\n if (key[0] == '*') {\n return \"1 \" + key;\n }\n // functions\n \n var bits = key.split(\" \");\n \n if (key[0] == '|') {\n return \"2 \" + bits[bits.length -1];\n }\n // signals\n if (key[0] == '@') {\n return \"3 \" + bits[bits.length -1];\n }\n \n // props\n if (key[0] == '#') {\n return \"4 \" + bits[bits.length -1];\n }\n // the rest..\n return \"5 \" + bits[bits.length -1]; \n\n\n\n}",
+ "| void finish_editing" : "() {\n // \n this.before_edit();\n}",
+ "$ xns" : "Gtk",
+ "@ void show_add_props" : "(string type)",
+ "| void addProp" : " (string in_type, string key, string value, string value_type) {\n // info includes key, val, skel, etype..\n //console.dump(info);\n //type = info.type.toLowerCase();\n //var data = this.toJS();\n \n var type = in_type == \"signals\" ? \"listener\" : in_type;\n \n var fkey = (value_type.length > 0 ? value_type + \" \" : \"\") + key;\n \n if (type == \"listener\") {\n if (this.node.listeners.has_key(key)) {\n return;\n }\n this.node.listeners.set(key,value);\n } else {\n \n if (this.node.props.has_key(fkey)) {\n return;\n }\n this.node.props.set(fkey,value);\n }\n \n \n // add a row???\n this.load(this.file, this.node);\n \n \n \n /// need to find the row which I've just added..\n \n \n var s = this.view.el.get_selection();\n s.unselect_all();\n \n print(\"trying to find new iter\");\n \n this.model.el.foreach((model, path, iter) => {\n GLib.Value gval;\n \n this.model.el.get_value(iter, 0 , out gval);\n if ((string)gval != type) {\n print(\"not type: %s = %s\\n\", (string)gval , type);\n return false;\n }\n this.model.el.get_value(iter, 1 , out gval);\n if ((string)gval != fkey) {\n print(\"not key: %s = %s\\n\", (string)gval , fkey);\n return false;\n }\n // delay this?\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,40 , () => {\n \n this.startEditingValue(this.model.el.get_path(iter));\n return false;\n });\n //s.select_iter(iter);\n return true; \n });\n \n \n \n \n}\n",
+ "| void before_edit" : "()\n{\n\n print(\"before edit - stop editing\\n\");\n \n // these do not appear to trigger save...\n _this.keyrender.el.stop_editing(false);\n _this.keyrender.el.editable =false;\n\n _this.valrender.el.stop_editing(false);\n _this.valrender.el.editable =false; \n \n \n// technicall stop the popup editor..\n\n}\n",
+ "$ homogeneous" : "false ",
+ "# JsRender.Node node" : "",
+ "items" : [
{
- "pack": "pack_start,false,true,0",
- "xtype": "HBox",
- "|xns": "Gtk",
- "items": [
+ "* pack" : "pack_start,false,true,0",
+ "xtype" : "HBox",
+ "$ xns" : "Gtk",
+ "items" : [
{
- "listeners": {
- "button_press_event": " (self, ev) => {\n _this.before_edit();\n \n \n var p = _this.AddPropertyPopup;\n p.el.set_screen(Gdk.Screen.get_default());\n p.el.show_all();\n p.el.popup(null, null, null, ev.button, ev.time);\n return true;\n}"
+ "listeners" : {
+ "button_press_event" : " (self, ev) => {\n _this.before_edit();\n \n \n var p = _this.AddPropertyPopup;\n p.el.set_screen(Gdk.Screen.get_default());\n p.el.show_all();\n p.el.popup(null, null, null, ev.button, ev.time);\n return true;\n}"
},
- "pack": "add",
- "xtype": "Button",
- "|xns": "Gtk",
- "items": [
+ "* pack" : "add",
+ "xtype" : "Button",
+ "$ xns" : "Gtk",
+ "items" : [
{
- "|xns": "Gtk",
- "xtype": "HBox",
- "pack": "add",
- "items": [
+ "* pack" : "add",
+ "xtype" : "HBox",
+ "$ xns" : "Gtk",
+ "items" : [
{
- "|xns": "Gtk",
- "xtype": "Image",
- "pack": "add",
- "|stock": "Gtk.STOCK_ADD",
- "|icon_size": "Gtk.IconSize.MENU"
+ "* pack" : "add",
+ "xtype" : "Image",
+ "$ stock" : "Gtk.STOCK_ADD",
+ "$ xns" : "Gtk",
+ "$ icon_size" : "Gtk.IconSize.MENU"
},
{
- "|xns": "Gtk",
- "xtype": "Label",
- "pack": "add",
- "label": "Other"
+ "label" : "Other",
+ "* pack" : "add",
+ "xtype" : "Label",
+ "$ xns" : "Gtk"
}
]
},
{
- "|xns": "Gtk",
- "xtype": "Menu",
- "pack": false,
- "id": "AddPropertyPopup",
- "items": [
+ "id" : "AddPropertyPopup",
+ "* pack" : false,
+ "xtype" : "Menu",
+ "$ xns" : "Gtk",
+ "items" : [
{
- "listeners": {
- "activate": " () => {\n _this.addProp( \"prop\", \"id\", \"\", \"string\");\n}"
+ "listeners" : {
+ "activate" : " () => {\n _this.addProp( \"prop\", \"id\", \"\", \"string\");\n}"
},
- "label": "ID",
- "pack": "append",
- "tooltip_markup": "Using this.get('*someid') will find any id in an application.",
- "xtype": "MenuItem",
- "|xns": "Gtk"
+ "label" : "ID",
+ "* pack" : "append",
+ "xtype" : "MenuItem",
+ "tooltip_markup" : "Using this.get('*someid') will find any id in an application.",
+ "$ xns" : "Gtk"
},
{
- "listeners": {
- "activate": " ( ) => {\n\n _this.addProp( \"prop\", \"pack\",\"add\", \"*\");\n}"
+ "listeners" : {
+ "activate" : " ( ) => {\n\n _this.addProp( \"prop\", \"pack\",\"add\", \"*\");\n}"
},
- "label": "PACK",
- "pack": "append",
- "tooltip_markup": "Add what type of packing is to be used",
- "xtype": "MenuItem",
- "|xns": "Gtk"
+ "label" : "PACK",
+ "* pack" : "append",
+ "xtype" : "MenuItem",
+ "tooltip_markup" : "Add what type of packing is to be used",
+ "$ xns" : "Gtk"
},
{
- "listeners": {
- "activate": " ( ) => {\n\n _this.addProp( \"prop\", \"init\", \"{\\n\\n}\\n\", \"*\" );\n}"
+ "listeners" : {
+ "activate" : " ( ) => {\n\n _this.addProp( \"prop\", \"init\", \"{\\n\\n}\\n\", \"*\" );\n}"
},
- "label": "INIT",
- "pack": "append",
- "tooltip_markup": "Override the init method",
- "xtype": "MenuItem",
- "|xns": "Gtk"
+ "label" : "INIT",
+ "* pack" : "append",
+ "xtype" : "MenuItem",
+ "tooltip_markup" : "Override the init method",
+ "$ xns" : "Gtk"
},
{
- "|xns": "Gtk",
- "xtype": "SeparatorMenuItem",
- "pack": "add"
+ "* pack" : "add",
+ "xtype" : "SeparatorMenuItem",
+ "$ xns" : "Gtk"
},
{
- "listeners": {
- "activate": " (self) => {\n\n _this.addProp( \"prop\", \"XXXX\", \"\",\"string\");\n\n}"
+ "listeners" : {
+ "activate" : " (self) => {\n\n _this.addProp( \"prop\", \"XXXX\", \"\",\"string\");\n\n}"
},
- "label": "String",
- "pack": "append",
- "tooltip_markup": "Add a user defined string property",
- "xtype": "MenuItem",
- "|xns": "Gtk"
+ "label" : "String",
+ "* pack" : "append",
+ "xtype" : "MenuItem",
+ "tooltip_markup" : "Add a user defined string property",
+ "$ xns" : "Gtk"
},
{
- "listeners": {
- "activate": " ( ) =>{\n\n _this.addProp(\"prop\", \"XXX\", \"0\", \"int\");\n}"
+ "listeners" : {
+ "activate" : " ( ) =>{\n\n _this.addProp(\"prop\", \"XXX\", \"0\", \"int\");\n}"
},
- "label": "Number",
- "pack": "append",
- "tooltip_markup": "Add a user defined number property",
- "xtype": "MenuItem",
- "|xns": "Gtk"
+ "label" : "Number",
+ "* pack" : "append",
+ "xtype" : "MenuItem",
+ "tooltip_markup" : "Add a user defined number property",
+ "$ xns" : "Gtk"
},
{
- "listeners": {
- "activate": " ( ) =>{\n\n _this.addProp( \"prop\", \"XXX\", \"true\", \"bool\");\n}"
+ "listeners" : {
+ "activate" : " ( ) =>{\n\n _this.addProp( \"prop\", \"XXX\", \"true\", \"bool\");\n}"
},
- "label": "Boolean",
- "pack": "append",
- "tooltip_markup": "Add a user defined boolean property",
- "xtype": "MenuItem",
- "|xns": "Gtk"
+ "label" : "Boolean",
+ "* pack" : "append",
+ "xtype" : "MenuItem",
+ "tooltip_markup" : "Add a user defined boolean property",
+ "$ xns" : "Gtk"
},
{
- "|xns": "Gtk",
- "xtype": "SeparatorMenuItem",
- "pack": "add"
+ "* pack" : "add",
+ "xtype" : "SeparatorMenuItem",
+ "$ xns" : "Gtk"
},
{
- "listeners": {
- "activate": " ( ) =>{\n\n _this.addProp(\"prop\", \"XXXX\", \"function() { }\", \"| function\");\n}"
+ "listeners" : {
+ "activate" : " ( ) =>{\n\n _this.addProp(\"prop\", \"XXXX\", \"function() { }\", \"| function\");\n}"
},
- "label": "Javascript Function",
- "pack": "append",
- "tooltip_markup": "Add a user function boolean property",
- "xtype": "MenuItem",
- "|xns": "Gtk"
+ "label" : "Javascript Function",
+ "* pack" : "append",
+ "xtype" : "MenuItem",
+ "tooltip_markup" : "Add a user function boolean property",
+ "$ xns" : "Gtk"
},
{
- "listeners": {
- "activate": " ( ) =>{\n\n _this.addProp( \"prop\", \"XXXX\", \"() {\\n\\n}\\n\", \"| return_type\");\n}"
+ "listeners" : {
+ "activate" : " ( ) =>{\n\n _this.addProp( \"prop\", \"XXXX\", \"() {\\n\\n}\\n\", \"| return_type\");\n}"
},
- "label": "Vala Method",
- "pack": "append",
- "tooltip_markup": "Add a user function boolean property",
- "xtype": "MenuItem",
- "|xns": "Gtk"
+ "label" : "Vala Method",
+ "* pack" : "append",
+ "xtype" : "MenuItem",
+ "tooltip_markup" : "Add a user function boolean property",
+ "$ xns" : "Gtk"
}
]
}
]
},
{
- ".bool:editing": false,
- "id": "EditProps",
- "pack": "pack_end,true,true,0",
- "xtype": "ScrolledWindow",
- "|init": " {\n \n this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n}\n",
- "|shadow_type": "Gtk.ShadowType.IN",
- "|xns": "Gtk",
- "items": [
+ "# bool editing" : false,
+ "id" : "EditProps",
+ "* init" : " {\n \n this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n}\n",
+ "$ shadow_type" : "Gtk.ShadowType.IN",
+ "* pack" : "pack_end,true,true,0",
+ "xtype" : "ScrolledWindow",
+ "$ xns" : "Gtk",
+ "items" : [
{
- "listeners": {
- "button_press_event": " ( ev) => {\n\n \n \n \n Gtk.TreeViewColumn col;\n int cell_x;\n int cell_y;\n Gtk.TreePath path;\n if (!this.el.get_path_at_pos((int)ev.x, (int) ev.y, out path, out col, out cell_x, out cell_y )) {\n print(\"nothing selected on click\");\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n this.el.get_selection().unselect_all();\n\n return false;\n });\n _this.before_edit();\n return false; //not on a element.\n }\n \n // right click.\n if (ev.type == Gdk.EventType.BUTTON_PRESS && ev.button == 3) { \n // show popup!. \n if (col.title == \"Value\") {\n _this.before_edit();\n return false;\n }\n\n var p = _this.ContextMenu;\n\n p.el.set_screen(Gdk.Screen.get_default());\n p.el.show_all();\n p.el.popup(null, null, null, ev.button, ev.time);\n //Seed.print(\"click:\" + res.column.title);\n // select the \n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n \n this.el.get_selection().select_path(path);\n return false;\n });\n _this.before_edit();\n return false;\n }\n \n \n if (col.title != \"Value\") {\n print(\"col title != Value\");\n \n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n this.el.get_selection().select_path(path);\n return false;\n });\n \n _this.before_edit();\n // XObject.error(\"column is not value?\");\n return false; // ignore.. - key click.. ??? should we do this??\n }\n \n \n // if the cell can be edited with a pulldown\n // then we should return true... - and let the start_editing handle it?\n \n \n \n \n \n \n \n // currently editing???\n// if ( this.activePath) {\n \n // this.activePath = false;\n // stop editing!!!!\n /*\n if (this.get('/Editor').dirty) {\n //if (!this.get('/Editor.buffer').checkSyntax()) {\n // this.get('/StandardErrorDialog').show(\"Fix errors in code and save..\"); \n // return true;\n // // error Dialog\n //}\n if (!this.get('/Editor.view').save()) {\n return true;\n }\n } \n */\n \n //this.EditProps.editableColumn.items[0].el.stop_editing();\n //this.EditProps.editing = false;\n \n // XObject.error(\"Currently editing?\");\n // return false;\n // }\n \n // var renderer = this.valrender.el; // set has_entry..\n \n //var type = this.get('/LeftPanel.model').getType(res.path.to_string());\n \n // get options for this type -- this is to support option lists etc..\n //var provider = this.get('/LeftTree').getPaleteProvider();\n //var opts = provider.findOptions(type);\n \n// if (opts === false) {\n // it's text etnry\n// this.get('/LeftPanel').editableColumn.setOptions([]);\n// renderer.has_entry = true;\n// } else {\n// this.get('/LeftPanel').editableColumn.setOptions(opts);\n// renderer.has_entry = false;\n// }\n\n // we need to set the selected row..\n \n //Gtk.TreePath path;\n\n ;\n // _this.before_edit(); <<< we really need to stop the other editor..\n _this.keyrender.el.stop_editing(false);\n _this.keyrender.el.editable =false;\n \n \n return _this.startEditingValue(path); // assumes selected row..\n \n \n\n \n \n}"
+ "listeners" : {
+ "button_press_event" : " ( ev) => {\n\n \n \n \n Gtk.TreeViewColumn col;\n int cell_x;\n int cell_y;\n Gtk.TreePath path;\n if (!this.el.get_path_at_pos((int)ev.x, (int) ev.y, out path, out col, out cell_x, out cell_y )) {\n print(\"nothing selected on click\");\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n this.el.get_selection().unselect_all();\n\n return false;\n });\n _this.before_edit();\n return false; //not on a element.\n }\n \n // right click.\n if (ev.type == Gdk.EventType.BUTTON_PRESS && ev.button == 3) { \n // show popup!. \n if (col.title == \"Value\") {\n _this.before_edit();\n return false;\n }\n\n var p = _this.ContextMenu;\n\n p.el.set_screen(Gdk.Screen.get_default());\n p.el.show_all();\n p.el.popup(null, null, null, ev.button, ev.time);\n //Seed.print(\"click:\" + res.column.title);\n // select the \n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n \n this.el.get_selection().select_path(path);\n return false;\n });\n _this.before_edit();\n return false;\n }\n \n \n if (col.title != \"Value\") {\n print(\"col title != Value\");\n \n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n this.el.get_selection().select_path(path);\n return false;\n });\n \n _this.before_edit();\n // XObject.error(\"column is not value?\");\n return false; // ignore.. - key click.. ??? should we do this??\n }\n \n \n // if the cell can be edited with a pulldown\n // then we should return true... - and let the start_editing handle it?\n \n \n \n \n \n \n \n // currently editing???\n// if ( this.activePath) {\n \n // this.activePath = false;\n // stop editing!!!!\n /*\n if (this.get('/Editor').dirty) {\n //if (!this.get('/Editor.buffer').checkSyntax()) {\n // this.get('/StandardErrorDialog').show(\"Fix errors in code and save..\"); \n // return true;\n // // error Dialog\n //}\n if (!this.get('/Editor.view').save()) {\n return true;\n }\n } \n */\n \n //this.EditProps.editableColumn.items[0].el.stop_editing();\n //this.EditProps.editing = false;\n \n // XObject.error(\"Currently editing?\");\n // return false;\n // }\n \n // var renderer = this.valrender.el; // set has_entry..\n \n //var type = this.get('/LeftPanel.model').getType(res.path.to_string());\n \n // get options for this type -- this is to support option lists etc..\n //var provider = this.get('/LeftTree').getPaleteProvider();\n //var opts = provider.findOptions(type);\n \n// if (opts === false) {\n // it's text etnry\n// this.get('/LeftPanel').editableColumn.setOptions([]);\n// renderer.has_entry = true;\n// } else {\n// this.get('/LeftPanel').editableColumn.setOptions(opts);\n// renderer.has_entry = false;\n// }\n\n // we need to set the selected row..\n \n //Gtk.TreePath path;\n\n ;\n // _this.before_edit(); <<< we really need to stop the other editor..\n _this.keyrender.el.stop_editing(false);\n _this.keyrender.el.editable =false;\n \n \n return _this.startEditingValue(path); // assumes selected row..\n \n \n\n \n \n}"
},
- "id": "view",
- "tooltip_column": 5,
- "xtype": "TreeView",
- "|enable_tree_lines": "true",
- "|headers_visible": "true",
- "|init": "{\n var selection = this.el.get_selection();\n selection.set_mode( Gtk.SelectionMode.SINGLE);\n\n\n var description = new Pango.FontDescription();\n description.set_size(8000);\n this.el.modify_font(description);\n}\n",
- "|xns": "Gtk",
- "items": [
+ "id" : "view",
+ "* init" : "{\n var selection = this.el.get_selection();\n selection.set_mode( Gtk.SelectionMode.SINGLE);\n\n\n var description = new Pango.FontDescription();\n description.set_size(8000);\n this.el.modify_font(description);\n}\n",
+ "tooltip_column" : 5,
+ "xtype" : "TreeView",
+ "$ enable_tree_lines" : true,
+ "$ headers_visible" : true,
+ "$ xns" : "Gtk",
+ "items" : [
{
- "id": "model",
- "n_columns": 7,
- "pack": "set_model",
- "xtype": "TreeStore",
- "|changed": "function(str, doRefresh) {\n if (!this.activePath) {\n return;\n }\n var iter = new Gtk.TreeIter();\n this.el.get_iter(iter, new Gtk.TreePath.from_string(this.activePath));\n \n this.el.set_value(iter, 1, '' +str);\n this.el.set_value(iter, 3, '' + this.toShort(str));\n var type = this.getIterValue(iter, 4);\n\n this.el.set_value(iter, 5, type + ' : ' + str);\n // update the tree... \n\n this.get('/LeftTree.model').changed(this.toJS(), doRefresh); \n}\n",
- "|columns": " typeof(string), // 0 key type\n typeof(string), // 1 key\n typeof(string), // 2 key (display)\n typeof(string), // 3 value\n typeof(string), // 4 value (display)\n typeof(string), // 5 both (tooltip) \n typeof(string) // 6 key (for sorting)\n",
- "|toShort": "function(str) {\n var a = typeof(str) == 'string' ? str.split(\"\\n\") : [];\n return a.length > 1 ? a[0] + '....' : '' + str;\n}\n",
- "|xns": "Gtk"
+ "id" : "model",
+ "$ changed" : "function(str, doRefresh) {\n if (!this.activePath) {\n return;\n }\n var iter = new Gtk.TreeIter();\n this.el.get_iter(iter, new Gtk.TreePath.from_string(this.activePath));\n \n this.el.set_value(iter, 1, '' +str);\n this.el.set_value(iter, 3, '' + this.toShort(str));\n var type = this.getIterValue(iter, 4);\n\n this.el.set_value(iter, 5, type + ' : ' + str);\n // update the tree... \n\n this.get('/LeftTree.model').changed(this.toJS(), doRefresh); \n}\n",
+ "* pack" : "set_model",
+ "xtype" : "TreeStore",
+ "$ columns" : " typeof(string), // 0 key type\n typeof(string), // 1 key\n typeof(string), // 2 key (display)\n typeof(string), // 3 value\n typeof(string), // 4 value (display)\n typeof(string), // 5 both (tooltip) \n typeof(string) // 6 key (for sorting)\n",
+ "n_columns" : 7,
+ "$ xns" : "Gtk",
+ "$ toShort" : "function(str) {\n var a = typeof(str) == 'string' ? str.split(\"\\n\") : [];\n return a.length > 1 ? a[0] + '....' : '' + str;\n}\n"
},
{
- "id": "keycol",
- "pack": "append_column",
- "title": "Name",
- "xtype": "TreeViewColumn",
- "|init": " this.el.add_attribute(_this.keyrender.el , \"markup\", 2 );\n this.el.add_attribute(_this.keyrender.el , \"text\", 1 );\n ",
- "|resizable": "true",
- "|xns": "Gtk",
- "items": [
+ "id" : "keycol",
+ "* init" : " this.el.add_attribute(_this.keyrender.el , \"markup\", 2 );\n this.el.add_attribute(_this.keyrender.el , \"text\", 1 );\n ",
+ "title" : "Name",
+ "* pack" : "append_column",
+ "xtype" : "TreeViewColumn",
+ "$ resizable" : true,
+ "$ xns" : "Gtk",
+ "items" : [
{
- "listeners": {
- "editing_started": "( editable, path) => {\n\n Gtk.TreeIter iter;\n _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));\n GLib.Value gval;\n \n\n\n // this.get('/LeftPanel.model').activePath = path;\n _this.model.el.get_value(iter,1, out gval);\n var val = (string)gval;\n \n ((Gtk.Entry)editable).set_text(val); \n}",
- "edited": " (path, newtext) => {\n print(\"Keyrender - signal:edited\\n\");\n \n this.el.editable = false;\n \n \n\n Gtk.TreeIter iter;\n _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));\n GLib.Value gval;\n \n _this.model.el.get_value(iter,1, out gval);\n var oldval = (string)gval;\n \n _this.model.el.get_value(iter,0, out gval);\n var ktype = (string)gval;\n \n _this.model.el.set_value(iter, 1, newtext);\n \n print(\"ktype: %s\\n\",ktype);\n switch(ktype) {\n case \"listener\":\n var ov = _this.node.listeners.get(oldval);\n _this.node.listeners.set(newtext, ov);\n _this.node.listeners.remove(oldval);\n \n _this.updateIter(iter, ktype, newtext, ov);\n \n break;\n case \"props\":\n var ov = _this.node.props.get(oldval);\n _this.node.props.set(newtext, ov);\n _this.node.props.remove(oldval);\n _this.updateIter(iter, ktype, newtext, ov);\n break;\n }\n _this.changed();\n \n}"
+ "listeners" : {
+ "editing_started" : "( editable, path) => {\n\n Gtk.TreeIter iter;\n _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));\n GLib.Value gval;\n \n\n\n // this.get('/LeftPanel.model').activePath = path;\n _this.model.el.get_value(iter,1, out gval);\n var val = (string)gval;\n \n ((Gtk.Entry)editable).set_text(val); \n}",
+ "edited" : " (path, newtext) => {\n print(\"Keyrender - signal:edited\\n\");\n \n this.el.editable = false;\n \n \n\n Gtk.TreeIter iter;\n _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));\n GLib.Value gval;\n \n _this.model.el.get_value(iter,1, out gval);\n var oldval = (string)gval;\n \n _this.model.el.get_value(iter,0, out gval);\n var ktype = (string)gval;\n \n _this.model.el.set_value(iter, 1, newtext);\n \n print(\"ktype: %s\\n\",ktype);\n switch(ktype) {\n case \"listener\":\n var ov = _this.node.listeners.get(oldval);\n _this.node.listeners.set(newtext, ov);\n _this.node.listeners.remove(oldval);\n \n _this.updateIter(iter, ktype, newtext, ov);\n \n break;\n case \"props\":\n var ov = _this.node.props.get(oldval);\n _this.node.props.set(newtext, ov);\n _this.node.props.remove(oldval);\n _this.updateIter(iter, ktype, newtext, ov);\n break;\n }\n _this.changed();\n \n}"
},
- "id": "keyrender",
- "pack": "pack_start,false",
- "xtype": "CellRendererText",
- "|xns": "Gtk"
+ "id" : "keyrender",
+ "xtype" : "CellRendererText",
+ "* pack" : "pack_start,false",
+ "$ xns" : "Gtk"
}
]
},
{
- "id": "valcol",
- "pack": "append_column",
- "|resizable": "true",
- "title": "Value",
- "xtype": "TreeViewColumn",
- "|init": "{\n\t\n\t// typeof(string), // 0 key type\n // typeof(string), // 1 key\n // typeof(string), // 2 key (display)\n // typeof(string), // 3 value\n // typeof(string) // 4 value (display)\n\n\t\n\tthis.el.add_attribute(_this.valrender.el , \"text\", 4 );\n\t//this.el.add_attribute(_this.valrender.el , \"sensitive\", 4 );\n\t//this.el.add_attribute(this.items[0].el , 'editable', 3 );\n // this.el.set_cell_data_func(cell, age_cell_data_func, NULL, NULL);\n\n //\tthis.get('/LeftPanel').editableColumn= this;\n}\n",
- "|xns": "Gtk",
- "items": [
+ "id" : "valcol",
+ "* init" : "{\n\t\n\t// typeof(string), // 0 key type\n // typeof(string), // 1 key\n // typeof(string), // 2 key (display)\n // typeof(string), // 3 value\n // typeof(string) // 4 value (display)\n\n\t\n\tthis.el.add_attribute(_this.valrender.el , \"text\", 4 );\n\t//this.el.add_attribute(_this.valrender.el , \"sensitive\", 4 );\n\t//this.el.add_attribute(this.items[0].el , 'editable', 3 );\n // this.el.set_cell_data_func(cell, age_cell_data_func, NULL, NULL);\n\n //\tthis.get('/LeftPanel').editableColumn= this;\n}\n",
+ "* pack" : "append_column",
+ "title" : "Value",
+ "xtype" : "TreeViewColumn",
+ "$ resizable" : true,
+ "$ xns" : "Gtk",
+ "items" : [
{
- "listeners": {
- "edited": " (path, newtext) => {\n print(\"Valrender - signal:edited\\n\");\n \n this.el.editable = false;\n/* \n m.set(iter, \n 0, \"listener\",\n 1, miter.get_key(),\n 2, \"<b>\" + miter.get_key() + \"</b>\",\n 3, miter.get_value(),\n 4, display_value(short);\n ); \n\n */ \n\n Gtk.TreeIter iter;\n _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));\n GLib.Value gval;\n \n _this.model.el.get_value(iter,0, out gval);\n var ktype = (string)gval;\n \n \n _this.model.el.get_value(iter,3, out gval);\n var oldval = (string)gval;\n \n _this.model.el.get_value(iter,1, out gval);\n var key = (string)gval;\n \n \n \n switch(ktype) {\n case \"listener\":\n _this.node.listeners.set(key, newtext);\n _this.updateIter(iter,ktype,key,newtext);\n break;\n case \"props\":\n _this.node.props.set(key,newtext);\n _this.updateIter(iter,ktype, key,newtext); \n break;\n }\n// _this.load(_this.file,_this.node);\n _this.changed();\n \n}",
- "editing_started": "( editable, path) => {\n //_this.editing = true;\n print(\"editing started called\\n\");\n if (!_this.allow_edit) {\n \n print(\"val - editing_Started\\n\");\n this.el.editable = false; // make sure it's not editor...\n \n \n return;\n }\n _this.allow_edit =false;\n \n \n if ( this.el.has_entry ) {\n \n Gtk.TreeIter iter;\n _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));\n GLib.Value gval;\n \n\n \n // this.get('/LeftPanel.model').activePath = path;\n _this.model.el.get_value(iter,3, out gval);\n \n\n var val = (string)gval;\n var combo = (Gtk.ComboBox)editable;\n\n var entry = (Gtk.Entry) combo.get_child(); \n entry.set_text(val);\n }\n \n}"
+ "listeners" : {
+ "editing_started" : "( editable, path) => {\n //_this.editing = true;\n print(\"editing started called\\n\");\n if (!_this.allow_edit) {\n \n print(\"val - editing_Started\\n\");\n this.el.editable = false; // make sure it's not editor...\n \n \n return;\n }\n _this.allow_edit =false;\n \n \n if ( this.el.has_entry ) {\n \n Gtk.TreeIter iter;\n _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));\n GLib.Value gval;\n \n\n \n // this.get('/LeftPanel.model').activePath = path;\n _this.model.el.get_value(iter,3, out gval);\n \n\n var val = (string)gval;\n var combo = (Gtk.ComboBox)editable;\n\n var entry = (Gtk.Entry) combo.get_child(); \n entry.set_text(val);\n }\n \n}",
+ "edited" : " (path, newtext) => {\n print(\"Valrender - signal:edited\\n\");\n \n this.el.editable = false;\n/* \n m.set(iter, \n 0, \"listener\",\n 1, miter.get_key(),\n 2, \"<b>\" + miter.get_key() + \"</b>\",\n 3, miter.get_value(),\n 4, display_value(short);\n ); \n\n */ \n\n Gtk.TreeIter iter;\n _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));\n GLib.Value gval;\n \n _this.model.el.get_value(iter,0, out gval);\n var ktype = (string)gval;\n \n \n _this.model.el.get_value(iter,3, out gval);\n var oldval = (string)gval;\n \n _this.model.el.get_value(iter,1, out gval);\n var key = (string)gval;\n \n \n \n switch(ktype) {\n case \"listener\":\n _this.node.listeners.set(key, newtext);\n _this.updateIter(iter,ktype,key,newtext);\n break;\n case \"props\":\n _this.node.props.set(key,newtext);\n _this.updateIter(iter,ktype, key,newtext); \n break;\n }\n// _this.load(_this.file,_this.node);\n _this.changed();\n \n}"
},
- "id": "valrender",
- "pack": "pack_start,true",
- "text_column": 0,
- "xtype": "CellRendererCombo",
- "|editable": "false",
- "|has_entry": "true",
- "|void:setOptions": "(string[] ar) {\n var m = _this.valrendermodel.el;\n m.clear();\n Gtk.TreeIter iret;\n for (var i =0; i < ar.length; i++) {\n m.append(out iret);\n m.set_value(iret, 0, ar[i]);\n }\n\n}",
- "|xns": "Gtk",
- "items": [
+ "id" : "valrender",
+ "* pack" : "pack_start,true",
+ "xtype" : "CellRendererCombo",
+ "$ editable" : false,
+ "$ has_entry" : true,
+ "$ xns" : "Gtk",
+ "text_column" : 0,
+ "| void setOptions" : "(string[] ar) {\n var m = _this.valrendermodel.el;\n m.clear();\n Gtk.TreeIter iret;\n for (var i =0; i < ar.length; i++) {\n m.append(out iret);\n m.set_value(iret, 0, ar[i]);\n }\n\n}",
+ "items" : [
{
- "id": "valrendermodel",
- "*prop": "model",
- "n_columns": 1,
- "pack": false,
- "xtype": "ListStore",
- "|columns": "typeof(string)",
- "|xns": "Gtk"
+ "id" : "valrendermodel",
+ "* pack" : false,
+ "xtype" : "ListStore",
+ "$ columns" : "typeof(string)",
+ "n_columns" : 1,
+ "$ xns" : "Gtk",
+ "* prop" : "model"
}
]
}
]
},
{
- "id": "ContextMenu",
- "pack": false,
- "xtype": "Menu",
- "|xns": "Gtk",
- "items": [
+ "id" : "ContextMenu",
+ "xtype" : "Menu",
+ "* pack" : false,
+ "$ xns" : "Gtk",
+ "items" : [
{
- "listeners": {
- "activate": " ( ) =>{\n \n var s = _this.view.el.get_selection();\n Gtk.TreeIter iter;\n Gtk.TreeModel model;\n s.get_selected (out model, out iter);\n _this.startEditingKey(model.get_path(iter));\n}"
+ "listeners" : {
+ "activate" : " ( ) =>{\n \n var s = _this.view.el.get_selection();\n Gtk.TreeIter iter;\n Gtk.TreeModel model;\n s.get_selected (out model, out iter);\n _this.startEditingKey(model.get_path(iter));\n}"
},
- "label": "Edit",
- "pack": "append",
- "xtype": "MenuItem",
- "|xns": "Gtk"
+ "label" : "Edit",
+ "xtype" : "MenuItem",
+ "* pack" : "append",
+ "$ xns" : "Gtk"
},
{
- "pack": "append",
- "xtype": "SeparatorMenuItem",
- "|xns": "Gtk"
+ "* pack" : "append",
+ "xtype" : "SeparatorMenuItem",
+ "$ xns" : "Gtk"
},
{
- "listeners": {
- "activate": " ( ) =>{\n\t_this.deleteSelected();\n}"
+ "listeners" : {
+ "activate" : " ( ) =>{\n\t_this.deleteSelected();\n}"
},
- "label": "Delete",
- "pack": "append",
- "xtype": "MenuItem",
- "|xns": "Gtk"
+ "label" : "Delete",
+ "xtype" : "MenuItem",
+ "* pack" : "append",
+ "$ xns" : "Gtk"
}
]
}
}
]
}
- ],
- "permname": "",
- "modOrder": ""
+ ]
}
\ No newline at end of file
},
- id : "LeftProps",
updateIter : (Gtk.TreeIter iter, string type, string key, string value) {
print("update Iter %s, %s\n", key,value);
6, this.keySortFormat(key)
);
},
- keySortFormat : (string key) {
- // listeners first - with 0
- // specials
- if (key[0] == '*') {
- return "1 " + key;
- }
- // functions
-
- var bits = key.split(" ");
-
- if (key[0] == '|') {
- return "2 " + bits[bits.length -1];
- }
- // signals
- if (key[0] == '@') {
- return "3 " + bits[bits.length -1];
- }
-
- // props
- if (key[0] == '#') {
- return "4 " + bits[bits.length -1];
- }
- // the rest..
- return "5 " + bits[bits.length -1];
-
-
-
- },
- load : (JsRender.JsRender file, JsRender.Node? node)
- {
- print("load leftprops\n");
- this.before_edit();
- this.node = node;
- this.file = file;
-
-
- this.model.el.clear();
-
- //this.get('/RightEditor').el.hide();
- if (node ==null) {
- return ;
- }
-
-
-
- //var provider = this.get('/LeftTree').getPaleteProvider();
- Gtk.TreeIter iter;
-
- //typeof(string), // 0 key type
- //typeof(string), // 1 key
- //typeof(string), // 2 key (display)
- //typeof(string), // 3 value
- //typeof(string), // 4 value (display)
- //typeof(string), // 5 both (tooltip)
-
-
-
-
- // really need a way to sort the hashmap...
- var m = this.model.el;
-
- var miter = node.listeners.map_iterator();
-
- while(miter.next()) {
- m.append(out iter,null);
-
- this.updateIter(iter, "listener", miter.get_key(), miter.get_value());
-
-
- }
-
-
- miter = node.props.map_iterator();
-
-
- while(miter.next()) {
- m.append(out iter,null);
- this.updateIter(iter, "prop", miter.get_key(), miter.get_value());
-
- }
- print("clear selection\n");
- // clear selection?
- this.model.el.set_sort_column_id(6,Gtk.SortType.ASCENDING); // sort by real key..
-
- this.view.el.get_selection().unselect_all();
-
-
-
- },
- before_edit : ()
- {
-
- print("before edit - stop editing\n");
-
- // these do not appear to trigger save...
- _this.keyrender.el.stop_editing(false);
- _this.keyrender.el.editable =false;
-
- _this.valrender.el.stop_editing(false);
- _this.valrender.el.editable =false;
-
-
- // technicall stop the popup editor..
-
- },
- xtype : "VBox",
- finish_editing : () {
- //
- this.before_edit();
- },
- file : "",
- stop_editor : "()",
- show_editor : "(JsRender.JsRender file, JsRender.Node node, string type, string key)",
- changed : "()",
+ id : "LeftProps",
keyFormat : (string val, string type) {
// Glib.markup_escape_text(val);
},
- xns : Gtk,
- show_add_props : "(string type)",
startEditingValue : ( Gtk.TreePath path) {
// ONLY return true if editing is allowed - eg. combo..
var use_textarea = false;
+
+ //------------ things that require the text editor...
if (type == "listener") {
use_textarea = true;
}
- if (key.length > 0 && (key[0] == '$' || key[0] == '|') ) {
+
+ if (key.length > 0 && key[0] == '$') {
+ use_textarea = true;
+ }
+ if (key.length > 0 && key == "* init") {
+ use_textarea = true;
+ }
+ if (val.length > 40) { // long value...
use_textarea = true;
}
+
+
+
if (use_textarea) {
print("Call show editor\n");
GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {
});
return false;
},
+ xtype : "VBox",
+ file : "",
+ stop_editor : "()",
+ show_editor : "(JsRender.JsRender file, JsRender.Node node, string type, string key)",
deleteSelected : () {
Gtk.TreeIter iter;
_this.changed();
},
- homogeneous : false,
+ load : (JsRender.JsRender file, JsRender.Node? node)
+ {
+ print("load leftprops\n");
+ this.before_edit();
+ this.node = node;
+ this.file = file;
+
+
+ this.model.el.clear();
+
+ //this.get('/RightEditor').el.hide();
+ if (node ==null) {
+ return ;
+ }
+
+
+
+ //var provider = this.get('/LeftTree').getPaleteProvider();
+ Gtk.TreeIter iter;
+
+ //typeof(string), // 0 key type
+ //typeof(string), // 1 key
+ //typeof(string), // 2 key (display)
+ //typeof(string), // 3 value
+ //typeof(string), // 4 value (display)
+ //typeof(string), // 5 both (tooltip)
+
+
+
+
+ // really need a way to sort the hashmap...
+ var m = this.model.el;
+
+ var miter = node.listeners.map_iterator();
+
+ while(miter.next()) {
+ m.append(out iter,null);
+
+ this.updateIter(iter, "listener", miter.get_key(), miter.get_value());
+
+
+ }
+
+
+ miter = node.props.map_iterator();
+
+
+ while(miter.next()) {
+ m.append(out iter,null);
+ this.updateIter(iter, "prop", miter.get_key(), miter.get_value());
+
+ }
+ print("clear selection\n");
+ // clear selection?
+ this.model.el.set_sort_column_id(6,Gtk.SortType.ASCENDING); // sort by real key..
+
+ this.view.el.get_selection().unselect_all();
+
+
+
+ },
+ changed : "()",
+ keySortFormat : (string key) {
+ // listeners first - with 0
+ // specials
+ if (key[0] == '*') {
+ return "1 " + key;
+ }
+ // functions
+
+ var bits = key.split(" ");
+
+ if (key[0] == '|') {
+ return "2 " + bits[bits.length -1];
+ }
+ // signals
+ if (key[0] == '@') {
+ return "3 " + bits[bits.length -1];
+ }
+
+ // props
+ if (key[0] == '#') {
+ return "4 " + bits[bits.length -1];
+ }
+ // the rest..
+ return "5 " + bits[bits.length -1];
+
+
+
+ },
+ finish_editing : () {
+ //
+ this.before_edit();
+ },
+ xns : Gtk,
+ show_add_props : "(string type)",
addProp : (string in_type, string key, string value, string value_type) {
// info includes key, val, skel, etype..
//console.dump(info);
},
+ before_edit : ()
+ {
+
+ print("before edit - stop editing\n");
+
+ // these do not appear to trigger save...
+ _this.keyrender.el.stop_editing(false);
+ _this.keyrender.el.editable =false;
+
+ _this.valrender.el.stop_editing(false);
+ _this.valrender.el.editable =false;
+
+
+ // technicall stop the popup editor..
+
+ },
+ homogeneous : false,
node : "",
items : [
{
xns : Gtk,
items : [
{
- stock : Gtk.STOCK_ADD,
xtype : "Image",
+ stock : Gtk.STOCK_ADD,
xns : Gtk,
icon_size : Gtk.IconSize.MENU
},
id : "view",
tooltip_column : 5,
xtype : "TreeView",
- enable_tree_lines : TRUE,
- headers_visible : TRUE,
+ enable_tree_lines : true,
+ headers_visible : true,
xns : Gtk,
listeners : {
button_press_event : ( ev) => {
+ // currently editing???
+ // if ( this.activePath) {
+
+ // this.activePath = false;
+ // stop editing!!!!
+ /*
+ if (this.get('/Editor').dirty) {
+ //if (!this.get('/Editor.buffer').checkSyntax()) {
+ // this.get('/StandardErrorDialog').show("Fix errors in code and save..");
+ // return true;
+ // // error Dialog
+ //}
+ if (!this.get('/Editor.view').save()) {
+ return true;
+ }
+ }
+ */
+
+ //this.EditProps.editableColumn.items[0].el.stop_editing();
+ //this.EditProps.editing = false;
+
+ // XObject.error("Currently editing?");
+ // return false;
+ // }
+
+ // var renderer = this.valrender.el; // set has_entry..
+
+ //var type = this.get('/LeftPanel.model').getType(res.path.to_string());
+
+ // get options for this type -- this is to support option lists etc..
+ //var provider = this.get('/LeftTree').getPaleteProvider();
+ //var opts = provider.findOptions(type);
+
+ // if (opts === false) {
+ // it's text etnry
+ // this.get('/LeftPanel').editableColumn.setOptions([]);
+ // renderer.has_entry = true;
+ // } else {
+ // this.get('/LeftPanel').editableColumn.setOptions(opts);
+ // renderer.has_entry = false;
+ // }
+
+ // we need to set the selected row..
+
+ //Gtk.TreePath path;
+
+ ;
// _this.before_edit(); <<< we really need to stop the other editor..
_this.keyrender.el.stop_editing(false);
_this.keyrender.el.editable =false;
id : "keycol",
title : "Name",
xtype : "TreeViewColumn",
- resizable : TRUE,
+ resizable : true,
xns : Gtk,
items : [
{
id : "valcol",
title : "Value",
xtype : "TreeViewColumn",
- resizable : TRUE,
+ resizable : true,
xns : Gtk,
items : [
{
},
id : "valrender",
xtype : "CellRendererCombo",
- editable : FALSE,
+ editable : false,
+ has_entry : true,
+ xns : Gtk,
+ text_column : 0,
setOptions : (string[] ar) {
var m = _this.valrendermodel.el;
m.clear();
}
},
- has_entry : TRUE,
- xns : Gtk,
- text_column : 0,
listeners : {
editing_started : ( editable, path) => {
//_this.editing = true;
{
- "id": "file-gtk-19",
- "name": "WindowLeftTree",
- "parent": "",
- "title": false,
- "path": "/home/alan/gitlive/app.Builder.js/Builder4/WindowLeftTree.bjs",
- "items": [
+ "name" : "WindowLeftTree",
+ "parent" : "",
+ "title" : "",
+ "path" : "/home/alan/gitlive/app.Builder.js/Builder4/WindowLeftTree.bjs",
+ "permname" : "",
+ "modOrder" : "",
+ "items" : [
{
- ".signal:bool:before_node_change(JsRender.Node? node)": "",
- ".signal:void:changed()": "",
- ".signal:void:node_selected(JsRender.Node? node)": "",
- "id": "WindowLeftTree",
- "pack": "add",
- "xtype": "ScrolledWindow",
- "|JsRender.JsRender:getActiveFile": "() {\n return this.model.file;\n}\n",
- "|JsRender.Node?:getActiveElement": " () { // return path to actie node.\n\n var path = this.getActivePath();\n if (path.length < 1) {\n return null;\n }\n return _this.model.pathToNode(path);\n}\n",
- "|init": " this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n",
- "|shadow_type": "Gtk.ShadowType.IN",
- "|string:getActivePath": " () {\n var model = this.model;\n var view = this.view.el;\n if (view.get_selection().count_selected_rows() < 1) {\n return \"\";\n }\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n view.get_selection().get_selected(out mod, out iter);\n return mod.get_path(iter).to_string();\n}\n",
- "|xns": "Gtk",
- "items": [
+ "id" : "WindowLeftTree",
+ "* init" : " this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n",
+ "$ shadow_type" : "Gtk.ShadowType.IN",
+ "| string getActivePath" : " () {\n var model = this.model;\n var view = this.view.el;\n if (view.get_selection().count_selected_rows() < 1) {\n return \"\";\n }\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n view.get_selection().get_selected(out mod, out iter);\n return mod.get_path(iter).to_string();\n}\n",
+ "* pack" : "add",
+ "xtype" : "ScrolledWindow",
+ "| JsRender.JsRender getActiveFile" : "() {\n return this.model.file;\n}\n",
+ "$ xns" : "Gtk",
+ "| JsRender.Node? getActiveElement" : " () { // return path to actie node.\n\n var path = this.getActivePath();\n if (path.length < 1) {\n return null;\n }\n return _this.model.pathToNode(path);\n \n}\n",
+ "@ void changed()" : "",
+ "@ void node_selected(JsRender.Node? node)" : "",
+ "@ bool before_node_change(JsRender.Node? node)" : "",
+ "items" : [
{
- "listeners": {
- "button_press_event": " ( ev) => {\n //console.log(\"button press?\");\n if (! _this.before_node_change(null) ) {\n return true;\n }\n\n \n if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {\n //print(\"click\" + ev.type);\n return false;\n }\n Gtk.TreePath res;\n if (!_this.view.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {\n return true;\n }\n \n this.el.get_selection().select_path(res);\n \n //if (!this.get('/LeftTreeMenu').el) { \n // this.get('/LeftTreeMenu').init(); \n // }\n \n _this.LeftTreeMenu.el.set_screen(Gdk.Screen.get_default());\n _this.LeftTreeMenu.el.show_all();\n _this.LeftTreeMenu.el.popup(null, null, null, 3, ev.time);\n // print(\"click:\" + res.path.to_string());\n return true;\n}",
- "drag_begin": "( ctx) => {\n\t//print('SOURCE: drag-begin');\n \n \n //this.targetData = \"\";\n \n // find what is selected in our tree...\n \n var s = _this.view.el.get_selection();\n if (s.count_selected_rows() < 1) {\n return;\n }\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n s.get_selected(out mod, out iter);\n\n \n\n // set some properties of the tree for use by the dropped element.\n GLib.Value value;\n _this.model.el.get_value(iter, 2, out value);\n var data = (JsRender.Node)(value.dup_object());\n var xname = data.fqn();\n print (\"XNAME IS \" + xname+ \"\\n\");\n this.dragData = xname;\n this.dropList = _this.model.file.palete().getDropList(xname);\n \n print (\"DROP LIST IS \" + string.joinv(\", \", this.dropList) + \"\\n\");\n \n\n // make the drag icon a picture of the node that was selected\n var path = _this.model.el.get_path(iter);\n\n //this.treepath = path.to_string();\n \n var pix = this.el.create_row_drag_icon ( path);\n \n Gtk.drag_set_icon_surface (ctx, pix) ;\n \n return;\n}",
- "drag_end": " (drag_context) => {\n\t//Seed.print('LEFT-TREE: drag-end');\n this.dragData = \"\";\n this.dropList = null;\n// this.targetData = \"\";\n this.highlightDropPath(\"\",0);\n// return true;\n}",
- "drag_motion": " ( ctx, x, y, time) => {\n \n // the point of this is to detect where an item could be dropped..\n print(\"got drag motion\");\n this.drag_in_motion = true;\n this.drag_x = x;\n this.drag_y = y;\n \n // request data that will be recieved by the recieve... \n Gtk.drag_get_data\n (\n this.el, // will receive 'drag-data-received' signal \n ctx, // represents the current state of the DnD \n Gdk.Atom.intern(\"STRING\",true), // the target type we want \n time // time stamp \n );\n return true;\n \n}",
- "drag_drop": " ( ctx, x, y, time) => {\n //Seed.print(\"TARGET: drag-drop\");\n this.drag_in_motion = false; \n // request data that will be recieved by the recieve... \n Gtk.drag_get_data\n (\n this.el, // will receive 'drag-data-received' signal \n ctx, // represents the current state of the DnD \n Gdk.Atom.intern(\"STRING\",true), // the target type we want \n time // time stamp \n );\n\n \n // No target offered by source => error\n \n\n return false;\n}",
- "drag_data_received": " (ctx, x, y, sel, info, time) => {\n //print(\"Tree: drag-data-received\");\n\n //print(\"GETTING POS\");\n var targetData = \"\";\n \n Gtk.TreePath path;\n Gtk.TreeViewDropPosition pos;\n var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);\n \n // if there are not items in the tree.. the we have to set isOver to true for anything..\n var isEmpty = false;\n if (_this.model.el.iter_n_children(null) < 1) {\n print(\"got NO children?\\n\");\n isOver = true; //??? \n isEmpty = true;\n pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;\n }\n \n \n //console.log(\"LEFT-TREE: drag-motion\");\n var src = Gtk.drag_get_source_widget(ctx);\n \n // a drag from elsewhere...- prevent drop..\n if (src != this.el) {\n //print(\"drag_data_recieved from another element\");\n \n \n var selection_text = sel.get_text();\n \n if (selection_text == null || selection_text.length < 1 || !isOver) {\n // nothing valid foudn to drop...\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0, time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n // no drop action...\n return; \n \n }\n \n // dropList --- need to gather this ... \n //print(\"get dropList for : %s\\n\",selection_text); \n var dropList = _this.model.file.palete().getDropList(selection_text);\n \n print(\"dropList: %s\\n\", string.joinv(\" , \", dropList));\n \n targetData = _this.model.findDropNodeByPath( isEmpty ? \"\" : path.to_string(), dropList, pos);\n \n print(\"targetDAta: \" + targetData +\"\\n\");\n \n if (targetData.length < 1) {\n \n // invalid drop path..\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0, time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n // no drop action...\n return;\n }\n // valid drop path..\n \n var td_ar = targetData.split(\"|\");\n \n \n if (this.drag_in_motion) { \n Gdk.drag_status(ctx, Gdk.DragAction.COPY ,time);\n\n this.highlightDropPath( td_ar[0] , (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));\n return;\n }\n // continue on to allow drop..\n \n\n // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..\n var node = new JsRender.Node();\n node.setFqn(selection_text);\n\n _this.model.dropNode(targetData, node);\n print(\"ADD new node!!!\\n\");\n \n ///Xcls_DialogTemplateSelect.singleton().show( _this.model.file.palete(), node);\n \n Gtk.drag_finish (ctx, false, false,time);\n \n \n \n \n \n return;\n \n }\n \n \n //var action = Gdk.DragAction.COPY;\n // unless we are copying!!! ctl button..\n var action = (ctx.get_actions() & Gdk.DragAction.MOVE) > 0 ? Gdk.DragAction.MOVE : Gdk.DragAction.COPY ;\n \n \n if (_this.model.el.iter_n_children(null) < 1) {\n // no children.. -- asume it's ok..\n \n targetData = \"|%d|\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);\n if (this.drag_in_motion) { \n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0); \n Gdk.drag_status(ctx, action ,time);\n return;\n }\n // continue through to allow drop...\n\n } else {\n \n \n\n \n \n //print(\"ISOVER? \" + isOver);\n if (!isOver) {\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0 ,time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0); \n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n return; // not over apoint!?! - no action on drop or motion..\n }\n \n // drag node is parent of child..\n //console.log(\"SRC TREEPATH: \" + src.treepath);\n //console.log(\"TARGET TREEPATH: \" + data.path.to_string());\n \n // nned to check a few here..\n //Gtk.TreeViewDropPosition.INTO_OR_AFTER\n //Gtk.TreeViewDropPosition.INTO_OR_BEFORE\n //Gtk.TreeViewDropPosition.AFTER\n //Gtk.TreeViewDropPosition.BEFORE\n \n // what's in the selected data....\n var selection_text = sel.get_text();\n \n \n \n if (selection_text == null || selection_text.length < 1) {\n //print(\"Error - drag selection text returned NULL\");\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0 ,time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n return; /// -- fixme -- this is not really correct..\n } \n \n // see if we are dragging into ourself?\n print (\"got selection text of \" + selection_text);\n \n var target_path = path.to_string();\n //print(\"target_path=\"+target_path);\n\n // \n if (selection_text == target_path) {\n print(\"self drag ?? == we should perhaps allow copy onto self..\\n\");\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0 ,time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n\n return; /// -- fixme -- this is not really correct..\n\n }\n \n // check that \n //print(\"DUMPING DATA\");\n //console.dump(data);\n // path, pos\n \n //print(data.path.to_string() +' => '+ data.pos);\n \n // dropList is a list of xtypes that this node could be dropped on.\n // it is set up when we start to drag..\n \n \n targetData = _this.model.findDropNodeByPath( path.to_string(), this.dropList, pos);\n \n print(\"targetDAta: \" + targetData +\"\\n\");\n \n if (targetData.length < 1) {\n //print(\"Can not find drop node path\");\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0, time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n return;\n }\n \n var td_ar = targetData.split(\"|\");\n \n \n if (this.drag_in_motion) { \n Gdk.drag_status(ctx, action ,time);\n this.highlightDropPath(td_ar[0], (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));\n return;\n }\n // continue on to allow drop..\n }\n\n // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..\n\n\n var delete_selection_data = false;\n \n if (ctx.get_actions() == Gdk.DragAction.ASK) {\n /* Ask the user to move or copy, then set the ctx action. */\n }\n\n if (ctx.get_actions() == Gdk.DragAction.MOVE) {\n delete_selection_data = true;\n }\n \n \n // drag around.. - reorder..\n _this.model.moveNode(targetData, ctx.get_actions());\n \n \n \n \n \n // we can send stuff to souce here...\n\n\n // do we always say failure, so we handle the reall drop?\n Gtk.drag_finish (ctx, false, false,time); //delete_selection_data, time);\n \n}",
- "cursor_changed": " ( ) => {\n\n\n if (this.blockChanges) { // probably not needed.. \n return ;\n }\n if (!_this.before_node_change(null) ) {\n\t this.blockChanges = true;\n\t this.el.get_selection().unselect_all();\n\t this.blockChanges = false;\n\t return;\n }\n if (_this.model.file == null) {\n return;\n } \n \n //var render = this.get('/LeftTree').getRenderer(); \n print(\"LEFT TREE -> view -> selection changed called\\n\");\n \n \n // -- it appears that the selection is not updated.\n \n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n \n\n if (this.el.get_selection().count_selected_rows() < 1) {\n\n print(\"selected rows < 1\\n\");\n //??this.model.load( false);\n _this.node_selected(null);\n \n return false ;\n }\n \n //console.log('changed');\n var s = this.el.get_selection();\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n s.get_selected(out mod, out iter);\n \n \n // var val = \"\";\n GLib.Value value;\n _this.model.el.get_value(iter, 2, out value);\n _this.model.activePath = mod.get_path(iter).to_string();\n \n var node = (JsRender.Node)value.dup_object();\n _this.node_selected(node);\n return false;\n }); \n //_this.after_node_change(node);\n\n// _this.model.file.changed(node, \"tree\");\n \n //Seed.print( value.get_string());\n return ;\n \n}",
- "drag_data_get": " ( drag_context, data, info, time) => {\n\n\n print(\"drag-data-get\");\n var s = this.el.get_selection();\n if (s.count_selected_rows() < 1) {\n data.set_text(\"\",0); \n print(\"return empty string - no selection..\");\n return;\n }\n \n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n \n s.get_selected(out mod, out iter);\n \n \n var tp = mod.get_path(iter).to_string();\n data.set_text(tp,tp.length);\n print(\"return \" + tp);\n}"
+ "listeners" : {
+ "button_press_event" : " ( ev) => {\n //console.log(\"button press?\");\n if (! _this.before_node_change(null) ) {\n return true;\n }\n\n \n if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {\n //print(\"click\" + ev.type);\n return false;\n }\n Gtk.TreePath res;\n if (!_this.view.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {\n return true;\n }\n \n this.el.get_selection().select_path(res);\n \n //if (!this.get('/LeftTreeMenu').el) { \n // this.get('/LeftTreeMenu').init(); \n // }\n \n _this.LeftTreeMenu.el.set_screen(Gdk.Screen.get_default());\n _this.LeftTreeMenu.el.show_all();\n _this.LeftTreeMenu.el.popup(null, null, null, 3, ev.time);\n // print(\"click:\" + res.path.to_string());\n return true;\n}",
+ "cursor_changed" : " ( ) => {\n\n\n if (this.blockChanges) { // probably not needed.. \n return ;\n }\n if (!_this.before_node_change(null) ) {\n\t this.blockChanges = true;\n\t this.el.get_selection().unselect_all();\n\t this.blockChanges = false;\n\t return;\n }\n if (_this.model.file == null) {\n return;\n } \n \n //var render = this.get('/LeftTree').getRenderer(); \n print(\"LEFT TREE -> view -> selection changed called\\n\");\n \n \n // -- it appears that the selection is not updated.\n \n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n \n\n if (this.el.get_selection().count_selected_rows() < 1) {\n\n print(\"selected rows < 1\\n\");\n //??this.model.load( false);\n _this.node_selected(null);\n \n return false ;\n }\n \n //console.log('changed');\n var s = this.el.get_selection();\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n s.get_selected(out mod, out iter);\n \n \n // var val = \"\";\n GLib.Value value;\n _this.model.el.get_value(iter, 2, out value);\n _this.model.activePath = mod.get_path(iter).to_string();\n \n var node = (JsRender.Node)value.dup_object();\n _this.node_selected(node);\n return false;\n }); \n //_this.after_node_change(node);\n\n// _this.model.file.changed(node, \"tree\");\n \n //Seed.print( value.get_string());\n return ;\n \n}",
+ "drag_begin" : "( ctx) => {\n\t//print('SOURCE: drag-begin');\n \n \n //this.targetData = \"\";\n \n // find what is selected in our tree...\n \n var s = _this.view.el.get_selection();\n if (s.count_selected_rows() < 1) {\n return;\n }\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n s.get_selected(out mod, out iter);\n\n \n\n // set some properties of the tree for use by the dropped element.\n GLib.Value value;\n _this.model.el.get_value(iter, 2, out value);\n var data = (JsRender.Node)(value.dup_object());\n var xname = data.fqn();\n print (\"XNAME IS \" + xname+ \"\\n\");\n this.dragData = xname;\n this.dropList = _this.model.file.palete().getDropList(xname);\n \n print (\"DROP LIST IS \" + string.joinv(\", \", this.dropList) + \"\\n\");\n \n\n // make the drag icon a picture of the node that was selected\n var path = _this.model.el.get_path(iter);\n\n //this.treepath = path.to_string();\n \n var pix = this.el.create_row_drag_icon ( path);\n \n Gtk.drag_set_icon_surface (ctx, pix) ;\n \n return;\n}",
+ "drag_end" : " (drag_context) => {\n\t//Seed.print('LEFT-TREE: drag-end');\n this.dragData = \"\";\n this.dropList = null;\n// this.targetData = \"\";\n this.highlightDropPath(\"\",0);\n// return true;\n}",
+ "drag_motion" : " ( ctx, x, y, time) => {\n \n // the point of this is to detect where an item could be dropped..\n print(\"got drag motion\");\n this.drag_in_motion = true;\n this.drag_x = x;\n this.drag_y = y;\n \n // request data that will be recieved by the recieve... \n Gtk.drag_get_data\n (\n this.el, // will receive 'drag-data-received' signal \n ctx, // represents the current state of the DnD \n Gdk.Atom.intern(\"STRING\",true), // the target type we want \n time // time stamp \n );\n return true;\n \n}",
+ "drag_data_get" : " ( drag_context, data, info, time) => {\n\n\n print(\"drag-data-get\");\n var s = this.el.get_selection();\n if (s.count_selected_rows() < 1) {\n data.set_text(\"\",0); \n print(\"return empty string - no selection..\");\n return;\n }\n \n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n \n s.get_selected(out mod, out iter);\n \n \n var tp = mod.get_path(iter).to_string();\n data.set_text(tp,tp.length);\n print(\"return \" + tp);\n}",
+ "drag_data_received" : " (ctx, x, y, sel, info, time) => {\n //print(\"Tree: drag-data-received\");\n\n //print(\"GETTING POS\");\n var targetData = \"\";\n \n Gtk.TreePath path;\n Gtk.TreeViewDropPosition pos;\n var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);\n \n // if there are not items in the tree.. the we have to set isOver to true for anything..\n var isEmpty = false;\n if (_this.model.el.iter_n_children(null) < 1) {\n print(\"got NO children?\\n\");\n isOver = true; //??? \n isEmpty = true;\n pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;\n }\n \n \n //console.log(\"LEFT-TREE: drag-motion\");\n var src = Gtk.drag_get_source_widget(ctx);\n \n // a drag from elsewhere...- prevent drop..\n if (src != this.el) {\n //print(\"drag_data_recieved from another element\");\n \n \n var selection_text = sel.get_text();\n \n if (selection_text == null || selection_text.length < 1 || !isOver) {\n // nothing valid foudn to drop...\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0, time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n // no drop action...\n return; \n \n }\n \n // dropList --- need to gather this ... \n //print(\"get dropList for : %s\\n\",selection_text); \n var dropList = _this.model.file.palete().getDropList(selection_text);\n \n print(\"dropList: %s\\n\", string.joinv(\" , \", dropList));\n \n targetData = _this.model.findDropNodeByPath( isEmpty ? \"\" : path.to_string(), dropList, pos);\n \n print(\"targetDAta: \" + targetData +\"\\n\");\n \n if (targetData.length < 1) {\n \n // invalid drop path..\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0, time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n // no drop action...\n return;\n }\n // valid drop path..\n \n var td_ar = targetData.split(\"|\");\n \n \n if (this.drag_in_motion) { \n Gdk.drag_status(ctx, Gdk.DragAction.COPY ,time);\n\n this.highlightDropPath( td_ar[0] , (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));\n return;\n }\n // continue on to allow drop..\n \n\n // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..\n var node = new JsRender.Node();\n node.setFqn(selection_text);\n\n _this.model.dropNode(targetData, node);\n print(\"ADD new node!!!\\n\");\n \n ///Xcls_DialogTemplateSelect.singleton().show( _this.model.file.palete(), node);\n \n Gtk.drag_finish (ctx, false, false,time);\n \n \n \n \n \n return;\n \n }\n \n \n //var action = Gdk.DragAction.COPY;\n // unless we are copying!!! ctl button..\n var action = (ctx.get_actions() & Gdk.DragAction.MOVE) > 0 ? Gdk.DragAction.MOVE : Gdk.DragAction.COPY ;\n \n \n if (_this.model.el.iter_n_children(null) < 1) {\n // no children.. -- asume it's ok..\n \n targetData = \"|%d|\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);\n if (this.drag_in_motion) { \n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0); \n Gdk.drag_status(ctx, action ,time);\n return;\n }\n // continue through to allow drop...\n\n } else {\n \n \n\n \n \n //print(\"ISOVER? \" + isOver);\n if (!isOver) {\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0 ,time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0); \n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n return; // not over apoint!?! - no action on drop or motion..\n }\n \n // drag node is parent of child..\n //console.log(\"SRC TREEPATH: \" + src.treepath);\n //console.log(\"TARGET TREEPATH: \" + data.path.to_string());\n \n // nned to check a few here..\n //Gtk.TreeViewDropPosition.INTO_OR_AFTER\n //Gtk.TreeViewDropPosition.INTO_OR_BEFORE\n //Gtk.TreeViewDropPosition.AFTER\n //Gtk.TreeViewDropPosition.BEFORE\n \n // what's in the selected data....\n var selection_text = sel.get_text();\n \n \n \n if (selection_text == null || selection_text.length < 1) {\n //print(\"Error - drag selection text returned NULL\");\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0 ,time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n return; /// -- fixme -- this is not really correct..\n } \n \n // see if we are dragging into ourself?\n print (\"got selection text of \" + selection_text);\n \n var target_path = path.to_string();\n //print(\"target_path=\"+target_path);\n\n // \n if (selection_text == target_path) {\n print(\"self drag ?? == we should perhaps allow copy onto self..\\n\");\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0 ,time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n\n return; /// -- fixme -- this is not really correct..\n\n }\n \n // check that \n //print(\"DUMPING DATA\");\n //console.dump(data);\n // path, pos\n \n //print(data.path.to_string() +' => '+ data.pos);\n \n // dropList is a list of xtypes that this node could be dropped on.\n // it is set up when we start to drag..\n \n \n targetData = _this.model.findDropNodeByPath( path.to_string(), this.dropList, pos);\n \n print(\"targetDAta: \" + targetData +\"\\n\");\n \n if (targetData.length < 1) {\n //print(\"Can not find drop node path\");\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0, time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n return;\n }\n \n var td_ar = targetData.split(\"|\");\n \n \n if (this.drag_in_motion) { \n Gdk.drag_status(ctx, action ,time);\n this.highlightDropPath(td_ar[0], (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));\n return;\n }\n // continue on to allow drop..\n }\n\n // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..\n\n\n var delete_selection_data = false;\n \n if (ctx.get_actions() == Gdk.DragAction.ASK) {\n /* Ask the user to move or copy, then set the ctx action. */\n }\n\n if (ctx.get_actions() == Gdk.DragAction.MOVE) {\n delete_selection_data = true;\n }\n \n \n // drag around.. - reorder..\n _this.model.moveNode(targetData, ctx.get_actions());\n \n \n \n \n \n // we can send stuff to souce here...\n\n\n // do we always say failure, so we handle the reall drop?\n Gtk.drag_finish (ctx, false, false,time); //delete_selection_data, time);\n \n}",
+ "drag_drop" : " ( ctx, x, y, time) => {\n //Seed.print(\"TARGET: drag-drop\");\n this.drag_in_motion = false; \n // request data that will be recieved by the recieve... \n Gtk.drag_get_data\n (\n this.el, // will receive 'drag-data-received' signal \n ctx, // represents the current state of the DnD \n Gdk.Atom.intern(\"STRING\",true), // the target type we want \n time // time stamp \n );\n\n \n // No target offered by source => error\n \n\n return false;\n}"
},
- ".bool:blockChanges": "false",
- ".bool:drag_in_motion": "",
- ".int:drag_x": "",
- ".int:drag_y": "",
- ".string:dragData": "",
- ".string[]:dropList": "",
- "id": "view",
- "pack": "add",
- "tooltip_column": 1,
- "xtype": "TreeView",
- "|enable_tree_lines": "true",
- "|headers_visible": "false",
- "|init": "{\n var description = new Pango.FontDescription();\n description.set_size(8000);\n this.el.modify_font(description);\n\n var selection = this.el.get_selection();\n selection.set_mode( Gtk.SelectionMode.SINGLE);\n\n\n // is this really needed??\n /*\n this.selection.signal['changed'].connect(function() {\n\t _this.get('/LeftTree.view').listeners.cursor_changed.apply(\n\t _this.get('/LeftTree.view'), [ _this.get('/LeftTree.view'), '']\n\t );\n });\n */\n Gtk.drag_source_set (\n\t this.el, /* widget will be drag-able */\n\t Gdk.ModifierType.BUTTON1_MASK, /* modifier that will start a drag */\n\t Builder4.Application.targetList, /* lists of target to support */\n\t Gdk.DragAction.COPY | Gdk.DragAction.MOVE /* what to do with data after dropped */\n );\n\n // ?? needed??\n //Gtk.drag_source_add_text_targets(this.el); \n\n Gtk.drag_dest_set\n (\n this.el, /* widget that will accept a drop */\n Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT,\n Builder4.Application.targetList, /* lists of target to support */\n Gdk.DragAction.COPY | Gdk.DragAction.MOVE /* what to do with data after dropped */\n );\n\n //Gtk.drag_dest_set_target_list(this.el, Builder.Application.targetList);\n //Gtk.drag_dest_add_text_targets(this.el);\n}\n",
- "|void:highlightDropPath": " ( string treepath, Gtk.TreeViewDropPosition pos) {\n\n // highlighting for drag/drop\n if (treepath.length > 0) {\n this.el.set_drag_dest_row( new Gtk.TreePath.from_string( treepath ), pos);\n } else {\n this.el.set_drag_dest_row(null, Gtk.TreeViewDropPosition.INTO_OR_AFTER);\n }\n \n}",
- "|void:selectNode": "(string treepath_str) {\n //this.selection.select_path(new Gtk.TreePath.from_string( treepath_str));\n var tp = new Gtk.TreePath.from_string(treepath_str);\n \n this.el.set_cursor(tp, null, false); \n this.el.scroll_to_cell(tp, null, false, 0,0);\n}\n",
- "|xns": "Gtk",
- "items": [
+ "# string dragData" : "",
+ "# string[] dropList" : "",
+ "# int drag_x" : "",
+ "id" : "view",
+ "# int drag_y" : "",
+ "* init" : "{\n var description = new Pango.FontDescription();\n description.set_size(8000);\n this.el.modify_font(description);\n\n var selection = this.el.get_selection();\n selection.set_mode( Gtk.SelectionMode.SINGLE);\n\n\n // is this really needed??\n /*\n this.selection.signal['changed'].connect(function() {\n\t _this.get('/LeftTree.view').listeners.cursor_changed.apply(\n\t _this.get('/LeftTree.view'), [ _this.get('/LeftTree.view'), '']\n\t );\n });\n */\n Gtk.drag_source_set (\n\t this.el, /* widget will be drag-able */\n\t Gdk.ModifierType.BUTTON1_MASK, /* modifier that will start a drag */\n\t Builder4.Application.targetList, /* lists of target to support */\n\t Gdk.DragAction.COPY | Gdk.DragAction.MOVE /* what to do with data after dropped */\n );\n\n // ?? needed??\n //Gtk.drag_source_add_text_targets(this.el); \n\n Gtk.drag_dest_set\n (\n this.el, /* widget that will accept a drop */\n Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT,\n Builder4.Application.targetList, /* lists of target to support */\n Gdk.DragAction.COPY | Gdk.DragAction.MOVE /* what to do with data after dropped */\n );\n\n //Gtk.drag_dest_set_target_list(this.el, Builder.Application.targetList);\n //Gtk.drag_dest_add_text_targets(this.el);\n}\n",
+ "tooltip_column" : 1,
+ "| void highlightDropPath" : " ( string treepath, Gtk.TreeViewDropPosition pos) {\n\n // highlighting for drag/drop\n if (treepath.length > 0) {\n this.el.set_drag_dest_row( new Gtk.TreePath.from_string( treepath ), pos);\n } else {\n this.el.set_drag_dest_row(null, Gtk.TreeViewDropPosition.INTO_OR_AFTER);\n }\n \n}",
+ "* pack" : "add",
+ "xtype" : "TreeView",
+ "$ enable_tree_lines" : true,
+ "$ headers_visible" : false,
+ "# bool drag_in_motion" : "",
+ "# bool blockChanges" : false,
+ "$ xns" : "Gtk",
+ "| void selectNode" : "(string treepath_str) {\n //this.selection.select_path(new Gtk.TreePath.from_string( treepath_str));\n var tp = new Gtk.TreePath.from_string(treepath_str);\n \n this.el.set_cursor(tp, null, false); \n this.el.scroll_to_cell(tp, null, false, 0,0);\n}\n",
+ "items" : [
{
- ".JsRender.JsRender?:file": "null",
- ".Project.Project?:project": "null",
- ".string:activePath": "\"\"",
- "currentTree": false,
- "id": "model",
- "n_columns": 3,
- "pack": "set_model",
- "xtype": "TreeStore",
- "|JsRender.Node:pathToNode": "(string path) {\n \n \n Gtk.TreeIter iter;\n _this.model.el.get_iter_from_string(out iter, path);\n \n GLib.Value value;\n _this.model.el.get_value(iter, 2, out value);\n \n return (JsRender.Node)value.dup_object();\n\n}",
- "|columns": "typeof(string),typeof(string),typeof(Object)",
- "|init": "print(\"model initialized\");\n\n",
- "|listAllTypes": "function() {\n var s = this.get('/LeftTree.view').selection;\n print (\"LIST ALL TYPES: \" + s.count_selected_rows() );\n \n if (s.count_selected_rows() > 0) {\n var iter = new Gtk.TreeIter(); \n s.get_selected(this.el, iter);\n\n // set some properties of the tree for use by the dropped element.\n var value = new GObject.Value('');\n this.el.get_value(iter, 2, value);\n var data = JSON.parse(value.value);\n \n \n var xname = this.get('/LeftTree.model').file.guessName(data);\n console.log('selected:' + xname);\n if (xname.length) {\n return [ xname ];\n }\n return []; // could not find it..\n }\n \n var ret = [ ];\n \n var _this = this;\n function addall(li)\n {\n li.forEach(function(el) {\n // this is specific to roo!!!?\n if (!el) { // skip empty?\n return;\n }\n var fullpath = _this.file.guessName(el);\n if (fullpath.length && ret.indexOf(fullpath) < 0) {\n ret.push(fullpath);\n }\n \n \n if (el.items && el.items.length) {\n addall(el.items);\n }\n \n });\n \n \n }\n \n addall([this.currentTree]);\n \n // only if we have nothing, should we add '*top'\n if (!ret.length) {\n ret = [ '*top' ];\n }\n //console.log('all types in tree');\n //console.dump(ret);\n \n return ret;\n \n}\n",
- "|string:findDropNode": " (string treepath_str, string[] targets) {\n\n // this is used by the dragdrop code in the roo version AFAIR..\n\n //var path = treepath_str.replace(/^builder-/, '');\n // treemap is depreciated... - should really check if model has any entries..\n\n if (this.el.iter_n_children(null) < 1) {\n //print(\"NO KEYS\");\n return \"|%d\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);\n }\n //print(\"FIND treepath: \" + path);\n //console.dump(this.treemap);\n \n //if (!treepath_str.match(/^builder-/)) {\n // return []; // nothing!\n //}\n if (targets.length > 0 && targets[0] == \"*\") {\n return treepath_str;\n }\n return this.findDropNodeByPath(treepath_str,targets, -1);\n}\n",
- "|string:findDropNodeByPath": " (string treepath_str, string[] targets, int in_pref = -1) {\n\n var path = treepath_str; // dupe it..\n \n int pref = in_pref < 0 ? Gtk.TreeViewDropPosition.INTO_OR_AFTER : in_pref;\n \n var last = \"\";\n \n //console.dump(this.treemap);\n \n print(\"findDropNodeByPath : got path length %d / %s\\n\", path.length, path);\n \n if (path.length == 0) {\n // top drop. // just return empty..\n return \"|%d\".printf((int)pref) ;\n \n }\n \n \n while (path.length > 0) {\n //print(\"LOOKING FOR PATH: \" + path);\n var node_data = this.pathToNode(path);\n \n if (node_data == null) {\n print(\"node not found\");\n return null;\n }\n \n var xname = node_data.fqn();\n var match = \"\";\n var prop = \"\";\n \n for (var i =0; i < targets.length; i++) {\n var tg = targets[i];\n if ((tg == xname) ) {\n match = tg;\n break;\n }\n // if target is \"xxxx:name\"\n if (tg.contains(xname +\":\")) {\n match = tg;\n var ar = tg.split(\":\");\n prop = ar[1];\n break;\n }\n }\n \n if (match.length > 0) {\n if (last.length > 0) { // pref is after/before..\n // then it's after last\n if (pref > 1) {\n return \"\";\n }\n return last + \"|%d\".printf((int)pref) + \"|\" + prop;\n\n \n }\n return path + \"|%d\".printf( (int) Gtk.TreeViewDropPosition.INTO_OR_AFTER) + \"|\" + prop;\n }\n last = \"\" + path;\n var par = path.split(\":\");\n string [] ppar = {};\n for (var i = 0; i < par.length-1; i++) {\n ppar += par[i];\n }\n \n path = string.joinv(\":\", ppar);\n\n\n }\n \n return \"\";\n \n}\n",
- "|void:deleteSelected": "() {\n \n print(\"DELETE SELECTED?\");\n //_this.view.blockChanges = true;\n print(\"GET SELECTION?\");\n\n var s = _this.view.el.get_selection();\n \n print(\"GET SELECTED?\");\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n\n \n if (!s.get_selected(out mod, out iter)) {\n return; // nothing seleted..\n }\n \n\n\n this.activePath= \"\"; \n print(\"GET vnode value?\");\n\n GLib.Value value;\n this.el.get_value(iter, 2, out value);\n var data = (JsRender.Node)(value.get_object());\n print(\"removing node from Render\\n\");\n if (data.parent == null) {\n this.file.tree = null;\n } else {\n data.remove();\n }\n print(\"removing node from Tree\\n\"); \n s.unselect_all();\n this.el.remove(ref iter);\n\n \n \n \n // \n \n \n\n\n this.activePath= \"\"; // again!?!? \n //this.changed(null,true);\n \n this.file.changed(null, \"tree\");\n \n _this.view.blockChanges = false;\n}\n",
- "|void:dropNode": "(string target_data_str, JsRender.Node node) {\n// print(\"drop Node\");\n // console.dump(node);\n // console.dump(target_data);\n \n \n // 0 = before , 1=after 2/3 onto\n \n \n var target_data= target_data_str.split(\"|\");\n \n var parent_str = target_data[0].length > 0 ? target_data[0] : \"\";\n var pos = target_data.length > 1 ? int.parse(target_data[1]) : 2; // ontop..\n \n \n Gtk.TreePath tree_path = parent_str.length > 0 ? new Gtk.TreePath.from_string( parent_str ) : null;\n \n \n \n //print(\"add \" + tp + \"@\" + target_data[1] );\n \n JsRender.Node parentNode = null;\n \n Gtk.TreeIter iter_after;\n Gtk.TreeIter iter_par ;\n \n \n if (target_data.length == 3 && target_data[2].length > 0) {\n node.props.set(\"* prop\", target_data[2]);\n }\n\n Gtk.TreePath expand_parent = null;\n \n var new_node = Xcls_DialogTemplateSelect.singleton().show( this.file.palete(), node);\n node = new_node;\n \n \n //print(\"pos is %d \\n\".printf(pos));\n \n Gtk.TreeIter n_iter; \n \n if ( parent_str.length < 1) {\n this.el.append(out n_iter, null); // drop at top level..\n node.parent = null;\n this.file.tree = node;\n \n \n } else if (pos < 2) {\n //print(target_data[1] > 0 ? 'insert_after' : 'insert_before');\n \n this.el.get_iter(out iter_after, tree_path ); \n this.el.iter_parent(out iter_par, iter_after);\n expand_parent = this.el.get_path(iter_par);\n \n GLib.Value value;\n this.el.get_value( iter_par, 2, out value);\n parentNode = (JsRender.Node)value.dup_object();\n \n \n this.el.get_value( iter_after, 2, out value);\n var relNode = (JsRender.Node)value.dup_object();\n \n if ( pos > 0 ) {\n \n this.el.insert_after(out n_iter, iter_par , iter_after);\n var ix = parentNode.items.index_of(relNode);\n parentNode.items.insert(ix+1, node);\n \n } else {\n this.el.insert_before(out n_iter, iter_par , iter_after);\n var ix = parentNode.items.index_of(relNode);\n parentNode.items.insert(ix, node);\n \n }\n //node.parent = parentNode;\n } else {\n // print(\"appending to \" + parent_str);\n this.el.get_iter(out iter_par, tree_path);\n this.el.append(out n_iter, iter_par );\n expand_parent = this.el.get_path(iter_par);\n \n GLib.Value value;\n this.el.get_value( iter_par, 2, out value);\n parentNode = (JsRender.Node)value.dup_object();\n node.parent = parentNode;\n parentNode.items.add(node);\n }\n \n // reparent node in tree...\n \n \n // why only on no parent???\n \n //if (node.parent = null) {\n \n \n \n //}\n \n \n // work out what kind of packing to use.. -- should be in \n if (!node.has(\"pack\") && parent_str.length > 1) {\n \n this.file.palete().fillPack(node,parentNode);\n \n \n }\n \n // add the node...\n \n this.el.set(n_iter, 0, node.nodeTitle(), 1, node.nodeTip(), -1 );\n var o = new GLib.Value(typeof(Object));\n o.set_object((Object)node);\n \n this.el.set_value(n_iter, 2, o);\n \n \n \n \n// load children - if it has any..\n \n if (node.items.size > 0) {\n this.load(node.items, n_iter);\n _this.view.el.expand_row(this.el.get_path(n_iter), true);\n } else if (expand_parent != null && !_this.view.el.is_row_expanded(expand_parent)) {\n _this.view.el.expand_row(expand_parent,true);\n }\n\n //if (tp != null && (node.items.length() > 0 || pos > 1)) {\n // _this.view.el.expand_row(this.el.get_path(iter_par), true);\n // }\n // wee need to get the empty proptypes from somewhere..\n \n //var olditer = this.activeIter;\n this.activePath = this.el.get_path(n_iter).to_string();\n\n\n \n \n _this.view.el.set_cursor(this.el.get_path(n_iter), null, false);\n _this.changed();\n \n \n \n}\n",
- "|void:load": "(Gee.ArrayList<JsRender.Node> tr, Gtk.TreeIter? iter) \n{\n Gtk.TreeIter citer;\n //this.insert(citer,iter,0);\n for(var i =0 ; i < tr.size; i++) {\n if (iter != null) {\n this.el.insert(out citer,iter,-1); // why not append?\n } else {\n this.el.append(out citer,null);\n }\n \n this.el.set(citer, 0, tr.get(i).nodeTitle(),\n 1, tr.get(i).nodeTip(), -1\n );\n var o = new GLib.Value(typeof(Object));\n o.set_object((Object)tr.get(i));\n \n this.el.set_value(citer, 2, o);\n \n if (tr.get(i).items.size > 0) {\n this.load(tr.get(i).items, citer);\n }\n \n }\n}",
- "|void:loadFile": "(JsRender.JsRender f) {\n //console.dump(f);\n this.el.clear();\n this.file = f;\n \n \n// if (!f) {\n// console.log('missing file');\n// return;\n// }\n \n // load the file if not loaded..\n if (f.tree == null) {\n f.loadItems( );\n }\n // if it's still null?\n if (f.tree == null) {\n return;\n }\n \n /// this.get('/Window').setTitle(f.project.getName() + ' - ' + f.name);\n \n //if (f.items.length && typeof(f.items[0]) == 'string') {\n \n //this.get('/RightEditor').el.show();\n //this.get('/RightEditor.view').load( f.items[0]);\n // return;\n //}\n //print(\"LOAD\");\n //print(JSON.stringify(f.items, null,4));\n //console.dump(f.items);\n var o = new Gee.ArrayList<JsRender.Node>();\n o.add(f.tree);\n this.load(o,null);\n \n _this.view.el.expand_all();\n\n if (f.tree.items.size < 1) {\n // single item..\n \n //this.get('/Window.leftvpaned').el.set_position(80);\n // select first...\n _this.view.el.set_cursor( \n new Gtk.TreePath.from_string(\"0\"), null, false);\n \n \n } else {\n //this.get('/Window.leftvpaned').el.set_position(200);\n }\n \n return;\n /* \n \n //print(\"hide right editior\");\n //this.get('/RightEditor').el.hide();\n //this.get('/Editor').el.hide();\n //print(\"set current tree\");\n //this.currentTree = this.toJS(false, false)[0];\n //console.dump(this.currentTree);\n //this.currentTree = this.currentTree || { items: [] };\n //_this.renderView();\n //console.dump(this.map);\n //var RightPalete = imports.Builder.RightPalete.RightPalete;\n \n \n var pm = this.get('/RightPalete.model');\n // set up provider..\n \n this.get('/RightPalete').provider = this.get('/LeftTree').getPaleteProvider();\n \n if (!this.get('/RightPalete').provider) {\n print (\"********* PALETE PROVIDER MISSING?!!\");\n }\n this.get('/LeftTree').renderView();\n \n pm.load( this.get('/LeftTree').getPaleteProvider().gatherList(this.listAllTypes()));\n \n \n \n this.get('/Window.view-notebook').el.set_current_page(\n this.get('/LeftTree.model').file.getType()== 'Roo' ? 0 : -1);\n */\n \n}\n",
- "|void:moveNode": "(string target_data, Gdk.DragAction action) \n{\n \n /// target_data = \"path|pos\");\n \n \n //print(\"MOVE NODE\");\n // console.dump(target_data);\n Gtk.TreeIter old_iter;\n Gtk.TreeModel mod;\n \n var s = _this.view.el.get_selection();\n s.get_selected(out mod , out old_iter);\n mod.get_path(old_iter);\n \n var node = this.pathToNode(mod.get_path(old_iter).to_string());\n //console.dump(node);\n if (node == null) {\n print(\"moveNode: ERROR - node is null?\");\n }\n \n \n\n // needs to drop first, otherwise the target_data \n // treepath will be invalid.\n\n \n if ((action & Gdk.DragAction.MOVE) > 0) {\n print(\"REMOVING OLD NODE : \" + target_data + \"\\n\");\n node.remove();\n this.dropNode(target_data, node);\n this.el.remove(ref old_iter);\n \n \n \n } else {\n print(\"DROPPING NODE // copy: \" + target_data + \"\\n\");\n node = node.deepClone();\n this.dropNode(target_data, node);\n }\n _this.changed();\n this.activePath= \"\";\n //this.updateNode(false,true);\n}\n",
- "|xns": "Gtk"
+ "currentTree" : false,
+ "id" : "model",
+ "| void moveNode" : "(string target_data, Gdk.DragAction action) \n{\n \n /// target_data = \"path|pos\");\n \n \n //print(\"MOVE NODE\");\n // console.dump(target_data);\n Gtk.TreeIter old_iter;\n Gtk.TreeModel mod;\n \n var s = _this.view.el.get_selection();\n s.get_selected(out mod , out old_iter);\n mod.get_path(old_iter);\n \n var node = this.pathToNode(mod.get_path(old_iter).to_string());\n //console.dump(node);\n if (node == null) {\n print(\"moveNode: ERROR - node is null?\");\n }\n \n \n\n // needs to drop first, otherwise the target_data \n // treepath will be invalid.\n\n \n if ((action & Gdk.DragAction.MOVE) > 0) {\n print(\"REMOVING OLD NODE : \" + target_data + \"\\n\");\n node.remove();\n this.dropNode(target_data, node);\n this.el.remove(ref old_iter);\n \n \n \n } else {\n print(\"DROPPING NODE // copy: \" + target_data + \"\\n\");\n node = node.deepClone();\n this.dropNode(target_data, node);\n }\n _this.changed();\n this.activePath= \"\";\n //this.updateNode(false,true);\n}\n",
+ "* init" : "print(\"model initialized\");\n\n",
+ "# JsRender.JsRender? file" : "null",
+ "* pack" : "set_model",
+ "xtype" : "TreeStore",
+ "| JsRender.Node pathToNode" : "(string path) {\n \n \n Gtk.TreeIter iter;\n _this.model.el.get_iter_from_string(out iter, path);\n \n GLib.Value value;\n _this.model.el.get_value(iter, 2, out value);\n \n return (JsRender.Node)value.dup_object();\n\n}",
+ "| void load" : "(Gee.ArrayList<JsRender.Node> tr, Gtk.TreeIter? iter) \n{\n Gtk.TreeIter citer;\n //this.insert(citer,iter,0);\n for(var i =0 ; i < tr.size; i++) {\n if (iter != null) {\n this.el.insert(out citer,iter,-1); // why not append?\n } else {\n this.el.append(out citer,null);\n }\n \n this.el.set(citer, 0, tr.get(i).nodeTitle(),\n 1, tr.get(i).nodeTip(), -1\n );\n var o = new GLib.Value(typeof(Object));\n o.set_object((Object)tr.get(i));\n \n this.el.set_value(citer, 2, o);\n \n if (tr.get(i).items.size > 0) {\n this.load(tr.get(i).items, citer);\n }\n \n }\n}",
+ "| void dropNode" : "(string target_data_str, JsRender.Node node) {\n// print(\"drop Node\");\n // console.dump(node);\n // console.dump(target_data);\n \n \n // 0 = before , 1=after 2/3 onto\n \n \n var target_data= target_data_str.split(\"|\");\n \n var parent_str = target_data[0].length > 0 ? target_data[0] : \"\";\n var pos = target_data.length > 1 ? int.parse(target_data[1]) : 2; // ontop..\n \n \n Gtk.TreePath tree_path = parent_str.length > 0 ? new Gtk.TreePath.from_string( parent_str ) : null;\n \n \n \n //print(\"add \" + tp + \"@\" + target_data[1] );\n \n JsRender.Node parentNode = null;\n \n Gtk.TreeIter iter_after;\n Gtk.TreeIter iter_par ;\n \n \n if (target_data.length == 3 && target_data[2].length > 0) {\n node.props.set(\"* prop\", target_data[2]);\n }\n\n Gtk.TreePath expand_parent = null;\n \n var new_node = Xcls_DialogTemplateSelect.singleton().show( this.file.palete(), node);\n node = new_node;\n \n \n //print(\"pos is %d \\n\".printf(pos));\n \n Gtk.TreeIter n_iter; \n \n if ( parent_str.length < 1) {\n this.el.append(out n_iter, null); // drop at top level..\n node.parent = null;\n this.file.tree = node;\n \n \n } else if (pos < 2) {\n //print(target_data[1] > 0 ? 'insert_after' : 'insert_before');\n \n this.el.get_iter(out iter_after, tree_path ); \n this.el.iter_parent(out iter_par, iter_after);\n expand_parent = this.el.get_path(iter_par);\n \n GLib.Value value;\n this.el.get_value( iter_par, 2, out value);\n parentNode = (JsRender.Node)value.dup_object();\n \n \n this.el.get_value( iter_after, 2, out value);\n var relNode = (JsRender.Node)value.dup_object();\n \n if ( pos > 0 ) {\n \n this.el.insert_after(out n_iter, iter_par , iter_after);\n var ix = parentNode.items.index_of(relNode);\n parentNode.items.insert(ix+1, node);\n \n } else {\n this.el.insert_before(out n_iter, iter_par , iter_after);\n var ix = parentNode.items.index_of(relNode);\n parentNode.items.insert(ix, node);\n \n }\n //node.parent = parentNode;\n } else {\n // print(\"appending to \" + parent_str);\n this.el.get_iter(out iter_par, tree_path);\n this.el.append(out n_iter, iter_par );\n expand_parent = this.el.get_path(iter_par);\n \n GLib.Value value;\n this.el.get_value( iter_par, 2, out value);\n parentNode = (JsRender.Node)value.dup_object();\n node.parent = parentNode;\n parentNode.items.add(node);\n }\n \n // reparent node in tree...\n \n \n // why only on no parent???\n \n //if (node.parent = null) {\n \n \n \n //}\n \n \n // work out what kind of packing to use.. -- should be in \n if (!node.has(\"pack\") && parent_str.length > 1) {\n \n this.file.palete().fillPack(node,parentNode);\n \n \n }\n \n // add the node...\n \n this.el.set(n_iter, 0, node.nodeTitle(), 1, node.nodeTip(), -1 );\n var o = new GLib.Value(typeof(Object));\n o.set_object((Object)node);\n \n this.el.set_value(n_iter, 2, o);\n \n \n \n \n// load children - if it has any..\n \n if (node.items.size > 0) {\n this.load(node.items, n_iter);\n _this.view.el.expand_row(this.el.get_path(n_iter), true);\n } else if (expand_parent != null && !_this.view.el.is_row_expanded(expand_parent)) {\n _this.view.el.expand_row(expand_parent,true);\n }\n\n //if (tp != null && (node.items.length() > 0 || pos > 1)) {\n // _this.view.el.expand_row(this.el.get_path(iter_par), true);\n // }\n // wee need to get the empty proptypes from somewhere..\n \n //var olditer = this.activeIter;\n this.activePath = this.el.get_path(n_iter).to_string();\n\n\n \n \n _this.view.el.set_cursor(this.el.get_path(n_iter), null, false);\n _this.changed();\n \n \n \n}\n",
+ "| string findDropNode" : " (string treepath_str, string[] targets) {\n\n // this is used by the dragdrop code in the roo version AFAIR..\n\n //var path = treepath_str.replace(/^builder-/, '');\n // treemap is depreciated... - should really check if model has any entries..\n\n if (this.el.iter_n_children(null) < 1) {\n //print(\"NO KEYS\");\n return \"|%d\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);\n }\n //print(\"FIND treepath: \" + path);\n //console.dump(this.treemap);\n \n //if (!treepath_str.match(/^builder-/)) {\n // return []; // nothing!\n //}\n if (targets.length > 0 && targets[0] == \"*\") {\n return treepath_str;\n }\n return this.findDropNodeByPath(treepath_str,targets, -1);\n}\n",
+ "# string activePath" : "\"\"",
+ "$ columns" : "typeof(string),typeof(string),typeof(Object)",
+ "# Project.Project? project" : "null",
+ "n_columns" : 3,
+ "$ xns" : "Gtk",
+ "| void loadFile" : "(JsRender.JsRender f) {\n //console.dump(f);\n this.el.clear();\n this.file = f;\n \n \n// if (!f) {\n// console.log('missing file');\n// return;\n// }\n \n // load the file if not loaded..\n if (f.tree == null) {\n f.loadItems( );\n }\n // if it's still null?\n if (f.tree == null) {\n return;\n }\n \n /// this.get('/Window').setTitle(f.project.getName() + ' - ' + f.name);\n \n //if (f.items.length && typeof(f.items[0]) == 'string') {\n \n //this.get('/RightEditor').el.show();\n //this.get('/RightEditor.view').load( f.items[0]);\n // return;\n //}\n //print(\"LOAD\");\n //print(JSON.stringify(f.items, null,4));\n //console.dump(f.items);\n var o = new Gee.ArrayList<JsRender.Node>();\n o.add(f.tree);\n this.load(o,null);\n \n _this.view.el.expand_all();\n\n if (f.tree.items.size < 1) {\n // single item..\n \n //this.get('/Window.leftvpaned').el.set_position(80);\n // select first...\n _this.view.el.set_cursor( \n new Gtk.TreePath.from_string(\"0\"), null, false);\n \n \n } else {\n //this.get('/Window.leftvpaned').el.set_position(200);\n }\n \n return;\n /* \n \n //print(\"hide right editior\");\n //this.get('/RightEditor').el.hide();\n //this.get('/Editor').el.hide();\n //print(\"set current tree\");\n //this.currentTree = this.toJS(false, false)[0];\n //console.dump(this.currentTree);\n //this.currentTree = this.currentTree || { items: [] };\n //_this.renderView();\n //console.dump(this.map);\n //var RightPalete = imports.Builder.RightPalete.RightPalete;\n \n \n var pm = this.get('/RightPalete.model');\n // set up provider..\n \n this.get('/RightPalete').provider = this.get('/LeftTree').getPaleteProvider();\n \n if (!this.get('/RightPalete').provider) {\n print (\"********* PALETE PROVIDER MISSING?!!\");\n }\n this.get('/LeftTree').renderView();\n \n pm.load( this.get('/LeftTree').getPaleteProvider().gatherList(this.listAllTypes()));\n \n \n \n this.get('/Window.view-notebook').el.set_current_page(\n this.get('/LeftTree.model').file.getType()== 'Roo' ? 0 : -1);\n */\n \n}\n",
+ "| string findDropNodeByPath" : " (string treepath_str, string[] targets, int in_pref = -1) {\n\n var path = treepath_str; // dupe it..\n \n int pref = in_pref < 0 ? Gtk.TreeViewDropPosition.INTO_OR_AFTER : in_pref;\n \n var last = \"\";\n \n //console.dump(this.treemap);\n \n print(\"findDropNodeByPath : got path length %d / %s\\n\", path.length, path);\n \n if (path.length == 0) {\n // top drop. // just return empty..\n return \"|%d\".printf((int)pref) ;\n \n }\n \n \n while (path.length > 0) {\n //print(\"LOOKING FOR PATH: \" + path);\n var node_data = this.pathToNode(path);\n \n if (node_data == null) {\n print(\"node not found\");\n return null;\n }\n \n var xname = node_data.fqn();\n var match = \"\";\n var prop = \"\";\n \n for (var i =0; i < targets.length; i++) {\n var tg = targets[i];\n if ((tg == xname) ) {\n match = tg;\n break;\n }\n // if target is \"xxxx:name\"\n if (tg.contains(xname +\":\")) {\n match = tg;\n var ar = tg.split(\":\");\n prop = ar[1];\n break;\n }\n }\n \n if (match.length > 0) {\n if (last.length > 0) { // pref is after/before..\n // then it's after last\n if (pref > 1) {\n return \"\";\n }\n return last + \"|%d\".printf((int)pref) + \"|\" + prop;\n\n \n }\n return path + \"|%d\".printf( (int) Gtk.TreeViewDropPosition.INTO_OR_AFTER) + \"|\" + prop;\n }\n last = \"\" + path;\n var par = path.split(\":\");\n string [] ppar = {};\n for (var i = 0; i < par.length-1; i++) {\n ppar += par[i];\n }\n \n path = string.joinv(\":\", ppar);\n\n\n }\n \n return \"\";\n \n}\n",
+ "| void deleteSelected" : "() {\n \n print(\"DELETE SELECTED?\");\n //_this.view.blockChanges = true;\n print(\"GET SELECTION?\");\n\n var s = _this.view.el.get_selection();\n \n print(\"GET SELECTED?\");\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n\n \n if (!s.get_selected(out mod, out iter)) {\n return; // nothing seleted..\n }\n \n\n\n this.activePath= \"\"; \n print(\"GET vnode value?\");\n\n GLib.Value value;\n this.el.get_value(iter, 2, out value);\n var data = (JsRender.Node)(value.get_object());\n print(\"removing node from Render\\n\");\n if (data.parent == null) {\n this.file.tree = null;\n } else {\n data.remove();\n }\n print(\"removing node from Tree\\n\"); \n s.unselect_all();\n this.el.remove(ref iter);\n\n \n \n \n // \n \n \n\n\n this.activePath= \"\"; // again!?!? \n //this.changed(null,true);\n \n this.file.changed(null, \"tree\");\n \n _this.view.blockChanges = false;\n}\n",
+ "$ listAllTypes" : "function() {\n var s = this.get('/LeftTree.view').selection;\n print (\"LIST ALL TYPES: \" + s.count_selected_rows() );\n \n if (s.count_selected_rows() > 0) {\n var iter = new Gtk.TreeIter(); \n s.get_selected(this.el, iter);\n\n // set some properties of the tree for use by the dropped element.\n var value = new GObject.Value('');\n this.el.get_value(iter, 2, value);\n var data = JSON.parse(value.value);\n \n \n var xname = this.get('/LeftTree.model').file.guessName(data);\n console.log('selected:' + xname);\n if (xname.length) {\n return [ xname ];\n }\n return []; // could not find it..\n }\n \n var ret = [ ];\n \n var _this = this;\n function addall(li)\n {\n li.forEach(function(el) {\n // this is specific to roo!!!?\n if (!el) { // skip empty?\n return;\n }\n var fullpath = _this.file.guessName(el);\n if (fullpath.length && ret.indexOf(fullpath) < 0) {\n ret.push(fullpath);\n }\n \n \n if (el.items && el.items.length) {\n addall(el.items);\n }\n \n });\n \n \n }\n \n addall([this.currentTree]);\n \n // only if we have nothing, should we add '*top'\n if (!ret.length) {\n ret = [ '*top' ];\n }\n //console.log('all types in tree');\n //console.dump(ret);\n \n return ret;\n \n}\n"
},
{
- "pack": "append_column",
- "xtype": "TreeViewColumn",
- "|init": " this.el.add_attribute(_this.renderer.el , \"markup\", 0 );\n ",
- "|xns": "Gtk",
- "items": [
+ "* init" : " this.el.add_attribute(_this.renderer.el , \"markup\", 0 );\n ",
+ "xtype" : "TreeViewColumn",
+ "* pack" : "append_column",
+ "$ xns" : "Gtk",
+ "items" : [
{
- "id": "renderer",
- "pack": "pack_start,true",
- "xtype": "CellRendererText",
- "|xns": "Gtk"
+ "id" : "renderer",
+ "* pack" : "pack_start,true",
+ "xtype" : "CellRendererText",
+ "$ xns" : "Gtk"
}
]
}
]
},
{
- "id": "LeftTreeMenu",
- "pack": false,
- "xtype": "Menu",
- "|xns": "Gtk",
- "items": [
+ "id" : "LeftTreeMenu",
+ "* pack" : false,
+ "xtype" : "Menu",
+ "$ xns" : "Gtk",
+ "items" : [
{
- "listeners": {
- "activate": " ( ) => {\n \n print(\"ACTIVATE?\");\n \n \n _this.model.deleteSelected();\n}"
+ "listeners" : {
+ "activate" : " ( ) => {\n \n print(\"ACTIVATE?\");\n \n \n _this.model.deleteSelected();\n}"
},
- "label": "Delete Element",
- "pack": "add",
- "xtype": "MenuItem",
- "|xns": "Gtk"
+ "label" : "Delete Element",
+ "* pack" : "add",
+ "xtype" : "MenuItem",
+ "$ xns" : "Gtk"
},
{
- "listeners": {
- "activate": " () => {\n\n DialogSaveTemplate.singleton().show(\n (Gtk.Window) _this.el.get_toplevel (), \n _this.model.file.palete(), \n _this.getActiveElement()\n );\n \n \n}"
+ "listeners" : {
+ "activate" : " () => {\n\n DialogSaveTemplate.singleton().show(\n (Gtk.Window) _this.el.get_toplevel (), \n _this.model.file.palete(), \n _this.getActiveElement()\n );\n \n \n}"
},
- "label": "Save as Template",
- "pack": "add",
- "xtype": "MenuItem",
- "|xns": "Gtk"
+ "label" : "Save as Template",
+ "* pack" : "add",
+ "xtype" : "MenuItem",
+ "$ xns" : "Gtk"
},
{
- "listeners": {
- "activate": " () => {\n var node = _this.getActiveElement();\n var name = DialogSaveModule.singleton().show(\n (Gtk.Window) _this.el.get_toplevel (), \n _this.model.file.project, \n node\n );\n if (name.length < 1) {\n return;\n \n }\n node.props.set(\"* xinclude\", name);\n node.items.clear();\n\n\n var s = _this.view.el.get_selection();\n \n print(\"GET SELECTED?\");\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n\n \n if (!s.get_selected(out mod, out iter)) {\n return; // nothing seleted..\n }\n Gtk.TreeIter citer;\n var n_cn = mod.iter_n_children(iter) -1;\n for (var i = n_cn; i > -1; i--) {\n mod.iter_nth_child(out citer, iter, i);\n \n\n print(\"removing node from Tree\\n\"); \n \n _this.model.el.remove(ref citer);\n }\n _this.changed();\n _this.node_selected(node);\n \n \n}"
+ "listeners" : {
+ "activate" : " () => {\n var node = _this.getActiveElement();\n var name = DialogSaveModule.singleton().show(\n (Gtk.Window) _this.el.get_toplevel (), \n _this.model.file.project, \n node\n );\n if (name.length < 1) {\n return;\n \n }\n node.props.set(\"* xinclude\", name);\n node.items.clear();\n\n\n var s = _this.view.el.get_selection();\n \n print(\"GET SELECTED?\");\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n\n \n if (!s.get_selected(out mod, out iter)) {\n return; // nothing seleted..\n }\n Gtk.TreeIter citer;\n var n_cn = mod.iter_n_children(iter) -1;\n for (var i = n_cn; i > -1; i--) {\n mod.iter_nth_child(out citer, iter, i);\n \n\n print(\"removing node from Tree\\n\"); \n \n _this.model.el.remove(ref citer);\n }\n _this.changed();\n _this.node_selected(node);\n \n \n}"
},
- "label": "Save as Module",
- "pack": "add",
- "xtype": "MenuItem",
- "|xns": "Gtk"
+ "label" : "Save as Module",
+ "* pack" : "add",
+ "xtype" : "MenuItem",
+ "$ xns" : "Gtk"
}
]
}
]
}
- ],
- "permname": "",
- "modOrder": ""
+ ]
}
\ No newline at end of file
console = imports.console;
XObject = imports.XObject.XObject;
WindowLeftTree=new XObject({
- xtype: Gtk.ScrolledWindow,
id : "WindowLeftTree",
- pack : "add",
- 'JsRender.JsRender:getActiveFile' : () {
- return this.model.file;
- },
- 'JsRender.Node?:getActiveElement' : () { // return path to actie node.
-
- var path = this.getActivePath();
- if (path.length < 1) {
- return null;
- }
- return _this.model.pathToNode(path);
- },
- init : this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);,
shadow_type : Gtk.ShadowType.IN,
- 'string:getActivePath' : () {
+ getActivePath : () {
var model = this.model;
var view = this.view.el;
if (view.get_selection().count_selected_rows() < 1) {
view.get_selection().get_selected(out mod, out iter);
return mod.get_path(iter).to_string();
},
+ xtype : "ScrolledWindow",
+ getActiveFile : () {
+ return this.model.file;
+ },
+ xns : Gtk,
+ getActiveElement : () { // return path to actie node.
+
+ var path = this.getActivePath();
+ if (path.length < 1) {
+ return null;
+ }
+ return _this.model.pathToNode(path);
+
+ },
+ 'changed()' : "",
+ 'node)' : "",
+ 'node)' : "",
items : [
- {
- xtype: Gtk.TreeView,
- listeners : {
- button_press_event : ( ev) => {
- //console.log("button press?");
- if (! _this.before_node_change(null) ) {
- return true;
- }
-
-
- if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
- //print("click" + ev.type);
- return false;
- }
- Gtk.TreePath res;
- if (!_this.view.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
- return true;
- }
-
- this.el.get_selection().select_path(res);
-
- //if (!this.get('/LeftTreeMenu').el) {
- // this.get('/LeftTreeMenu').init();
- // }
-
- _this.LeftTreeMenu.el.set_screen(Gdk.Screen.get_default());
- _this.LeftTreeMenu.el.show_all();
- _this.LeftTreeMenu.el.popup(null, null, null, 3, ev.time);
- // print("click:" + res.path.to_string());
- return true;
- },
- drag_begin : ( ctx) => {
- //print('SOURCE: drag-begin');
-
-
- //this.targetData = "";
-
- // find what is selected in our tree...
-
- var s = _this.view.el.get_selection();
- if (s.count_selected_rows() < 1) {
- return;
- }
- Gtk.TreeIter iter;
- Gtk.TreeModel mod;
- s.get_selected(out mod, out iter);
-
-
-
- // set some properties of the tree for use by the dropped element.
- GLib.Value value;
- _this.model.el.get_value(iter, 2, out value);
- var data = (JsRender.Node)(value.dup_object());
- var xname = data.fqn();
- print ("XNAME IS " + xname+ "\n");
- this.dragData = xname;
- this.dropList = _this.model.file.palete().getDropList(xname);
-
- print ("DROP LIST IS " + string.joinv(", ", this.dropList) + "\n");
-
-
- // make the drag icon a picture of the node that was selected
- var path = _this.model.el.get_path(iter);
-
- //this.treepath = path.to_string();
-
- var pix = this.el.create_row_drag_icon ( path);
-
- Gtk.drag_set_icon_surface (ctx, pix) ;
-
- return;
- },
- drag_end : (drag_context) => {
- //Seed.print('LEFT-TREE: drag-end');
- this.dragData = "";
- this.dropList = null;
- // this.targetData = "";
- this.highlightDropPath("",0);
- // return true;
- },
- drag_motion : ( ctx, x, y, time) => {
-
- // the point of this is to detect where an item could be dropped..
- print("got drag motion");
- this.drag_in_motion = true;
- this.drag_x = x;
- this.drag_y = y;
-
- // request data that will be recieved by the recieve...
- Gtk.drag_get_data
- (
- this.el, // will receive 'drag-data-received' signal
- ctx, // represents the current state of the DnD
- Gdk.Atom.intern("STRING",true), // the target type we want
- time // time stamp
- );
- return true;
-
- },
- drag_drop : ( ctx, x, y, time) => {
- //Seed.print("TARGET: drag-drop");
- this.drag_in_motion = false;
- // request data that will be recieved by the recieve...
- Gtk.drag_get_data
- (
- this.el, // will receive 'drag-data-received' signal
- ctx, // represents the current state of the DnD
- Gdk.Atom.intern("STRING",true), // the target type we want
- time // time stamp
- );
-
-
- // No target offered by source => error
-
-
- return false;
- },
- drag_data_received : (ctx, x, y, sel, info, time) => {
- //print("Tree: drag-data-received");
-
- //print("GETTING POS");
- var targetData = "";
-
- Gtk.TreePath path;
- Gtk.TreeViewDropPosition pos;
- var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);
-
- // if there are not items in the tree.. the we have to set isOver to true for anything..
- var isEmpty = false;
- if (_this.model.el.iter_n_children(null) < 1) {
- print("got NO children?\n");
- isOver = true; //???
- isEmpty = true;
- pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;
- }
-
-
- //console.log("LEFT-TREE: drag-motion");
- var src = Gtk.drag_get_source_widget(ctx);
-
- // a drag from elsewhere...- prevent drop..
- if (src != this.el) {
- //print("drag_data_recieved from another element");
-
-
- var selection_text = sel.get_text();
-
- if (selection_text == null || selection_text.length < 1 || !isOver) {
- // nothing valid foudn to drop...
- if (this.drag_in_motion) {
- Gdk.drag_status(ctx, 0, time);
- this.highlightDropPath("", (Gtk.TreeViewDropPosition)0);
- return;
- }
- Gtk.drag_finish (ctx, false, false, time); // drop failed..
- // no drop action...
- return;
-
- }
-
- // dropList --- need to gather this ...
- //print("get dropList for : %s\n",selection_text);
- var dropList = _this.model.file.palete().getDropList(selection_text);
-
- print("dropList: %s\n", string.joinv(" , ", dropList));
-
- targetData = _this.model.findDropNodeByPath( isEmpty ? "" : path.to_string(), dropList, pos);
-
- print("targetDAta: " + targetData +"\n");
-
- if (targetData.length < 1) {
-
- // invalid drop path..
- if (this.drag_in_motion) {
- Gdk.drag_status(ctx, 0, time);
- this.highlightDropPath("", (Gtk.TreeViewDropPosition)0);
- return;
- }
- Gtk.drag_finish (ctx, false, false, time); // drop failed..
- // no drop action...
- return;
- }
- // valid drop path..
-
- var td_ar = targetData.split("|");
-
-
- if (this.drag_in_motion) {
- Gdk.drag_status(ctx, Gdk.DragAction.COPY ,time);
-
- this.highlightDropPath( td_ar[0] , (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));
- return;
- }
- // continue on to allow drop..
-
-
- // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..
- var node = new JsRender.Node();
- node.setFqn(selection_text);
-
- _this.model.dropNode(targetData, node);
- print("ADD new node!!!\n");
-
- ///Xcls_DialogTemplateSelect.singleton().show( _this.model.file.palete(), node);
-
- Gtk.drag_finish (ctx, false, false,time);
-
-
-
-
-
- return;
-
- }
-
-
- //var action = Gdk.DragAction.COPY;
- // unless we are copying!!! ctl button..
- var action = (ctx.get_actions() & Gdk.DragAction.MOVE) > 0 ? Gdk.DragAction.MOVE : Gdk.DragAction.COPY ;
-
-
- if (_this.model.el.iter_n_children(null) < 1) {
- // no children.. -- asume it's ok..
-
- targetData = "|%d|".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);
- if (this.drag_in_motion) {
- this.highlightDropPath("", (Gtk.TreeViewDropPosition)0);
- Gdk.drag_status(ctx, action ,time);
- return;
- }
- // continue through to allow drop...
-
- } else {
-
-
-
-
-
- //print("ISOVER? " + isOver);
- if (!isOver) {
- if (this.drag_in_motion) {
- Gdk.drag_status(ctx, 0 ,time);
- this.highlightDropPath("", (Gtk.TreeViewDropPosition)0);
- return;
- }
- Gtk.drag_finish (ctx, false, false, time); // drop failed..
- return; // not over apoint!?! - no action on drop or motion..
- }
-
- // drag node is parent of child..
- //console.log("SRC TREEPATH: " + src.treepath);
- //console.log("TARGET TREEPATH: " + data.path.to_string());
-
- // nned to check a few here..
- //Gtk.TreeViewDropPosition.INTO_OR_AFTER
- //Gtk.TreeViewDropPosition.INTO_OR_BEFORE
- //Gtk.TreeViewDropPosition.AFTER
- //Gtk.TreeViewDropPosition.BEFORE
-
- // what's in the selected data....
- var selection_text = sel.get_text();
-
-
-
- if (selection_text == null || selection_text.length < 1) {
- //print("Error - drag selection text returned NULL");
- if (this.drag_in_motion) {
- Gdk.drag_status(ctx, 0 ,time);
- this.highlightDropPath("", (Gtk.TreeViewDropPosition)0);
- return;
- }
- Gtk.drag_finish (ctx, false, false, time); // drop failed..
- return; /// -- fixme -- this is not really correct..
- }
-
- // see if we are dragging into ourself?
- print ("got selection text of " + selection_text);
-
- var target_path = path.to_string();
- //print("target_path="+target_path);
-
- //
- if (selection_text == target_path) {
- print("self drag ?? == we should perhaps allow copy onto self..\n");
- if (this.drag_in_motion) {
- Gdk.drag_status(ctx, 0 ,time);
- this.highlightDropPath("", (Gtk.TreeViewDropPosition)0);
- return;
- }
- Gtk.drag_finish (ctx, false, false, time); // drop failed..
-
- return; /// -- fixme -- this is not really correct..
-
- }
-
- // check that
- //print("DUMPING DATA");
- //console.dump(data);
- // path, pos
-
- //print(data.path.to_string() +' => '+ data.pos);
-
- // dropList is a list of xtypes that this node could be dropped on.
- // it is set up when we start to drag..
-
-
- targetData = _this.model.findDropNodeByPath( path.to_string(), this.dropList, pos);
-
- print("targetDAta: " + targetData +"\n");
-
- if (targetData.length < 1) {
- //print("Can not find drop node path");
- if (this.drag_in_motion) {
- Gdk.drag_status(ctx, 0, time);
- this.highlightDropPath("", (Gtk.TreeViewDropPosition)0);
- return;
- }
- Gtk.drag_finish (ctx, false, false, time); // drop failed..
- return;
- }
-
- var td_ar = targetData.split("|");
-
-
- if (this.drag_in_motion) {
- Gdk.drag_status(ctx, action ,time);
- this.highlightDropPath(td_ar[0], (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));
- return;
- }
- // continue on to allow drop..
- }
-
- // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..
-
-
- var delete_selection_data = false;
-
- if (ctx.get_actions() == Gdk.DragAction.ASK) {
- /* Ask the user to move or copy, then set the ctx action. */
- }
-
- if (ctx.get_actions() == Gdk.DragAction.MOVE) {
- delete_selection_data = true;
- }
-
-
- // drag around.. - reorder..
- _this.model.moveNode(targetData, ctx.get_actions());
-
-
-
-
-
- // we can send stuff to souce here...
-
-
- // do we always say failure, so we handle the reall drop?
- Gtk.drag_finish (ctx, false, false,time); //delete_selection_data, time);
-
- },
- cursor_changed : ( ) => {
-
-
- if (this.blockChanges) { // probably not needed..
- return ;
- }
- if (!_this.before_node_change(null) ) {
- this.blockChanges = true;
- this.el.get_selection().unselect_all();
- this.blockChanges = false;
- return;
- }
- if (_this.model.file == null) {
- return;
- }
-
- //var render = this.get('/LeftTree').getRenderer();
- print("LEFT TREE -> view -> selection changed called\n");
-
-
- // -- it appears that the selection is not updated.
-
- GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {
-
-
- if (this.el.get_selection().count_selected_rows() < 1) {
-
- print("selected rows < 1\n");
- //??this.model.load( false);
- _this.node_selected(null);
-
- return false ;
- }
-
- //console.log('changed');
- var s = this.el.get_selection();
- Gtk.TreeIter iter;
- Gtk.TreeModel mod;
- s.get_selected(out mod, out iter);
-
-
- // var val = "";
- GLib.Value value;
- _this.model.el.get_value(iter, 2, out value);
- _this.model.activePath = mod.get_path(iter).to_string();
-
- var node = (JsRender.Node)value.dup_object();
- _this.node_selected(node);
- return false;
- });
- //_this.after_node_change(node);
-
- // _this.model.file.changed(node, "tree");
-
- //Seed.print( value.get_string());
- return ;
-
- },
- drag_data_get : ( drag_context, data, info, time) => {
-
-
- print("drag-data-get");
- var s = this.el.get_selection();
- if (s.count_selected_rows() < 1) {
- data.set_text("",0);
- print("return empty string - no selection..");
- return;
- }
-
- Gtk.TreeIter iter;
- Gtk.TreeModel mod;
-
- s.get_selected(out mod, out iter);
-
-
- var tp = mod.get_path(iter).to_string();
- data.set_text(tp,tp.length);
- print("return " + tp);
- }
- },
+ {
+ dragData : "",
+ dropList : "",
+ drag_x : "",
id : "view",
- pack : "add",
+ drag_y : "",
tooltip_column : 1,
- enable_tree_lines : true,
- headers_visible : false,
- init : {
- var description = new Pango.FontDescription();
- description.set_size(8000);
- this.el.modify_font(description);
-
- var selection = this.el.get_selection();
- selection.set_mode( Gtk.SelectionMode.SINGLE);
-
-
- // is this really needed??
- /*
- this.selection.signal['changed'].connect(function() {
- _this.get('/LeftTree.view').listeners.cursor_changed.apply(
- _this.get('/LeftTree.view'), [ _this.get('/LeftTree.view'), '']
- );
- });
- */
- Gtk.drag_source_set (
- this.el, /* widget will be drag-able */
- Gdk.ModifierType.BUTTON1_MASK, /* modifier that will start a drag */
- Builder4.Application.targetList, /* lists of target to support */
- Gdk.DragAction.COPY | Gdk.DragAction.MOVE /* what to do with data after dropped */
- );
-
- // ?? needed??
- //Gtk.drag_source_add_text_targets(this.el);
-
- Gtk.drag_dest_set
- (
- this.el, /* widget that will accept a drop */
- Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT,
- Builder4.Application.targetList, /* lists of target to support */
- Gdk.DragAction.COPY | Gdk.DragAction.MOVE /* what to do with data after dropped */
- );
-
- //Gtk.drag_dest_set_target_list(this.el, Builder.Application.targetList);
- //Gtk.drag_dest_add_text_targets(this.el);
- },
- 'void:highlightDropPath' : ( string treepath, Gtk.TreeViewDropPosition pos) {
+ highlightDropPath : ( string treepath, Gtk.TreeViewDropPosition pos) {
// highlighting for drag/drop
if (treepath.length > 0) {
}
},
- 'void:selectNode' : (string treepath_str) {
+ xtype : "TreeView",
+ enable_tree_lines : TRUE,
+ headers_visible : FALSE,
+ drag_in_motion : "",
+ blockChanges : false,
+ xns : Gtk,
+ selectNode : (string treepath_str) {
//this.selection.select_path(new Gtk.TreePath.from_string( treepath_str));
var tp = new Gtk.TreePath.from_string(treepath_str);
this.el.set_cursor(tp, null, false);
this.el.scroll_to_cell(tp, null, false, 0,0);
},
+ listeners : {
+ button_press_event : ( ev) => {
+ //console.log("button press?");
+ if (! _this.before_node_change(null) ) {
+ return true;
+ }
+
+
+ if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
+ //print("click" + ev.type);
+ return false;
+ }
+ Gtk.TreePath res;
+ if (!_this.view.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
+ return true;
+ }
+
+ this.el.get_selection().select_path(res);
+
+ //if (!this.get('/LeftTreeMenu').el) {
+ // this.get('/LeftTreeMenu').init();
+ // }
+
+ _this.LeftTreeMenu.el.set_screen(Gdk.Screen.get_default());
+ _this.LeftTreeMenu.el.show_all();
+ _this.LeftTreeMenu.el.popup(null, null, null, 3, ev.time);
+ // print("click:" + res.path.to_string());
+ return true;
+ },
+ cursor_changed : ( ) => {
+
+
+ if (this.blockChanges) { // probably not needed..
+ return ;
+ }
+ if (!_this.before_node_change(null) ) {
+ this.blockChanges = true;
+ this.el.get_selection().unselect_all();
+ this.blockChanges = false;
+ return;
+ }
+ if (_this.model.file == null) {
+ return;
+ }
+
+ //var render = this.get('/LeftTree').getRenderer();
+ print("LEFT TREE -> view -> selection changed called\n");
+
+
+ // -- it appears that the selection is not updated.
+
+ GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {
+
+
+ if (this.el.get_selection().count_selected_rows() < 1) {
+
+ print("selected rows < 1\n");
+ //??this.model.load( false);
+ _this.node_selected(null);
+
+ return false ;
+ }
+
+ //console.log('changed');
+ var s = this.el.get_selection();
+ Gtk.TreeIter iter;
+ Gtk.TreeModel mod;
+ s.get_selected(out mod, out iter);
+
+
+ // var val = "";
+ GLib.Value value;
+ _this.model.el.get_value(iter, 2, out value);
+ _this.model.activePath = mod.get_path(iter).to_string();
+
+ var node = (JsRender.Node)value.dup_object();
+ _this.node_selected(node);
+ return false;
+ });
+ //_this.after_node_change(node);
+
+ // _this.model.file.changed(node, "tree");
+
+ //Seed.print( value.get_string());
+ return ;
+
+ },
+ drag_begin : ( ctx) => {
+ //print('SOURCE: drag-begin');
+
+
+ //this.targetData = "";
+
+ // find what is selected in our tree...
+
+ var s = _this.view.el.get_selection();
+ if (s.count_selected_rows() < 1) {
+ return;
+ }
+ Gtk.TreeIter iter;
+ Gtk.TreeModel mod;
+ s.get_selected(out mod, out iter);
+
+
+
+ // set some properties of the tree for use by the dropped element.
+ GLib.Value value;
+ _this.model.el.get_value(iter, 2, out value);
+ var data = (JsRender.Node)(value.dup_object());
+ var xname = data.fqn();
+ print ("XNAME IS " + xname+ "\n");
+ this.dragData = xname;
+ this.dropList = _this.model.file.palete().getDropList(xname);
+
+ print ("DROP LIST IS " + string.joinv(", ", this.dropList) + "\n");
+
+
+ // make the drag icon a picture of the node that was selected
+ var path = _this.model.el.get_path(iter);
+
+ //this.treepath = path.to_string();
+
+ var pix = this.el.create_row_drag_icon ( path);
+
+ Gtk.drag_set_icon_surface (ctx, pix) ;
+
+ return;
+ },
+ drag_end : (drag_context) => {
+ //Seed.print('LEFT-TREE: drag-end');
+ this.dragData = "";
+ this.dropList = null;
+ // this.targetData = "";
+ this.highlightDropPath("",0);
+ // return true;
+ },
+ drag_motion : ( ctx, x, y, time) => {
+
+ // the point of this is to detect where an item could be dropped..
+ print("got drag motion");
+ this.drag_in_motion = true;
+ this.drag_x = x;
+ this.drag_y = y;
+
+ // request data that will be recieved by the recieve...
+ Gtk.drag_get_data
+ (
+ this.el, // will receive 'drag-data-received' signal
+ ctx, // represents the current state of the DnD
+ Gdk.Atom.intern("STRING",true), // the target type we want
+ time // time stamp
+ );
+ return true;
+
+ },
+ drag_data_get : ( drag_context, data, info, time) => {
+
+
+ print("drag-data-get");
+ var s = this.el.get_selection();
+ if (s.count_selected_rows() < 1) {
+ data.set_text("",0);
+ print("return empty string - no selection..");
+ return;
+ }
+
+ Gtk.TreeIter iter;
+ Gtk.TreeModel mod;
+
+ s.get_selected(out mod, out iter);
+
+
+ var tp = mod.get_path(iter).to_string();
+ data.set_text(tp,tp.length);
+ print("return " + tp);
+ },
+ drag_data_received : (ctx, x, y, sel, info, time) => {
+ //print("Tree: drag-data-received");
+
+ //print("GETTING POS");
+ var targetData = "";
+
+ Gtk.TreePath path;
+ Gtk.TreeViewDropPosition pos;
+ var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);
+
+ // if there are not items in the tree.. the we have to set isOver to true for anything..
+ var isEmpty = false;
+ if (_this.model.el.iter_n_children(null) < 1) {
+ print("got NO children?\n");
+ isOver = true; //???
+ isEmpty = true;
+ pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;
+ }
+
+
+ //console.log("LEFT-TREE: drag-motion");
+ var src = Gtk.drag_get_source_widget(ctx);
+
+ // a drag from elsewhere...- prevent drop..
+ if (src != this.el) {
+ //print("drag_data_recieved from another element");
+
+
+ var selection_text = sel.get_text();
+
+ if (selection_text == null || selection_text.length < 1 || !isOver) {
+ // nothing valid foudn to drop...
+ if (this.drag_in_motion) {
+ Gdk.drag_status(ctx, 0, time);
+ this.highlightDropPath("", (Gtk.TreeViewDropPosition)0);
+ return;
+ }
+ Gtk.drag_finish (ctx, false, false, time); // drop failed..
+ // no drop action...
+ return;
+
+ }
+
+ // dropList --- need to gather this ...
+ //print("get dropList for : %s\n",selection_text);
+ var dropList = _this.model.file.palete().getDropList(selection_text);
+
+ print("dropList: %s\n", string.joinv(" , ", dropList));
+
+ targetData = _this.model.findDropNodeByPath( isEmpty ? "" : path.to_string(), dropList, pos);
+
+ print("targetDAta: " + targetData +"\n");
+
+ if (targetData.length < 1) {
+
+ // invalid drop path..
+ if (this.drag_in_motion) {
+ Gdk.drag_status(ctx, 0, time);
+ this.highlightDropPath("", (Gtk.TreeViewDropPosition)0);
+ return;
+ }
+ Gtk.drag_finish (ctx, false, false, time); // drop failed..
+ // no drop action...
+ return;
+ }
+ // valid drop path..
+
+ var td_ar = targetData.split("|");
+
+
+ if (this.drag_in_motion) {
+ Gdk.drag_status(ctx, Gdk.DragAction.COPY ,time);
+
+ this.highlightDropPath( td_ar[0] , (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));
+ return;
+ }
+ // continue on to allow drop..
+
+
+ // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..
+ var node = new JsRender.Node();
+ node.setFqn(selection_text);
+
+ _this.model.dropNode(targetData, node);
+ print("ADD new node!!!\n");
+
+ ///Xcls_DialogTemplateSelect.singleton().show( _this.model.file.palete(), node);
+
+ Gtk.drag_finish (ctx, false, false,time);
+
+
+
+
+
+ return;
+
+ }
+
+
+ //var action = Gdk.DragAction.COPY;
+ // unless we are copying!!! ctl button..
+ var action = (ctx.get_actions() & Gdk.DragAction.MOVE) > 0 ? Gdk.DragAction.MOVE : Gdk.DragAction.COPY ;
+
+
+ if (_this.model.el.iter_n_children(null) < 1) {
+ // no children.. -- asume it's ok..
+
+ targetData = "|%d|".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);
+ if (this.drag_in_motion) {
+ this.highlightDropPath("", (Gtk.TreeViewDropPosition)0);
+ Gdk.drag_status(ctx, action ,time);
+ return;
+ }
+ // continue through to allow drop...
+
+ } else {
+
+
+
+
+
+ //print("ISOVER? " + isOver);
+ if (!isOver) {
+ if (this.drag_in_motion) {
+ Gdk.drag_status(ctx, 0 ,time);
+ this.highlightDropPath("", (Gtk.TreeViewDropPosition)0);
+ return;
+ }
+ Gtk.drag_finish (ctx, false, false, time); // drop failed..
+ return; // not over apoint!?! - no action on drop or motion..
+ }
+
+ // drag node is parent of child..
+ //console.log("SRC TREEPATH: " + src.treepath);
+ //console.log("TARGET TREEPATH: " + data.path.to_string());
+
+ // nned to check a few here..
+ //Gtk.TreeViewDropPosition.INTO_OR_AFTER
+ //Gtk.TreeViewDropPosition.INTO_OR_BEFORE
+ //Gtk.TreeViewDropPosition.AFTER
+ //Gtk.TreeViewDropPosition.BEFORE
+
+ // what's in the selected data....
+ var selection_text = sel.get_text();
+
+
+
+ if (selection_text == null || selection_text.length < 1) {
+ //print("Error - drag selection text returned NULL");
+ if (this.drag_in_motion) {
+ Gdk.drag_status(ctx, 0 ,time);
+ this.highlightDropPath("", (Gtk.TreeViewDropPosition)0);
+ return;
+ }
+ Gtk.drag_finish (ctx, false, false, time); // drop failed..
+ return; /// -- fixme -- this is not really correct..
+ }
+
+ // see if we are dragging into ourself?
+ print ("got selection text of " + selection_text);
+
+ var target_path = path.to_string();
+ //print("target_path="+target_path);
+
+ //
+ if (selection_text == target_path) {
+ print("self drag ?? == we should perhaps allow copy onto self..\n");
+ if (this.drag_in_motion) {
+ Gdk.drag_status(ctx, 0 ,time);
+ this.highlightDropPath("", (Gtk.TreeViewDropPosition)0);
+ return;
+ }
+ Gtk.drag_finish (ctx, false, false, time); // drop failed..
+
+ return; /// -- fixme -- this is not really correct..
+
+ }
+
+ // check that
+ //print("DUMPING DATA");
+ //console.dump(data);
+ // path, pos
+
+ //print(data.path.to_string() +' => '+ data.pos);
+
+ // dropList is a list of xtypes that this node could be dropped on.
+ // it is set up when we start to drag..
+
+
+ targetData = _this.model.findDropNodeByPath( path.to_string(), this.dropList, pos);
+
+ print("targetDAta: " + targetData +"\n");
+
+ if (targetData.length < 1) {
+ //print("Can not find drop node path");
+ if (this.drag_in_motion) {
+ Gdk.drag_status(ctx, 0, time);
+ this.highlightDropPath("", (Gtk.TreeViewDropPosition)0);
+ return;
+ }
+ Gtk.drag_finish (ctx, false, false, time); // drop failed..
+ return;
+ }
+
+ var td_ar = targetData.split("|");
+
+
+ if (this.drag_in_motion) {
+ Gdk.drag_status(ctx, action ,time);
+ this.highlightDropPath(td_ar[0], (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));
+ return;
+ }
+ // continue on to allow drop..
+ }
+
+ // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..
+
+
+ var delete_selection_data = false;
+
+ if (ctx.get_actions() == Gdk.DragAction.ASK) {
+ /* Ask the user to move or copy, then set the ctx action. */
+ }
+
+ if (ctx.get_actions() == Gdk.DragAction.MOVE) {
+ delete_selection_data = true;
+ }
+
+
+ // drag around.. - reorder..
+ _this.model.moveNode(targetData, ctx.get_actions());
+
+
+
+
+
+ // we can send stuff to souce here...
+
+
+ // do we always say failure, so we handle the reall drop?
+ Gtk.drag_finish (ctx, false, false,time); //delete_selection_data, time);
+
+ },
+ drag_drop : ( ctx, x, y, time) => {
+ //Seed.print("TARGET: drag-drop");
+ this.drag_in_motion = false;
+ // request data that will be recieved by the recieve...
+ Gtk.drag_get_data
+ (
+ this.el, // will receive 'drag-data-received' signal
+ ctx, // represents the current state of the DnD
+ Gdk.Atom.intern("STRING",true), // the target type we want
+ time // time stamp
+ );
+
+
+ // No target offered by source => error
+
+
+ return false;
+ }
+ },
items : [
- {
- xtype: Gtk.TreeStore,
+ {
currentTree : false,
id : "model",
- n_columns : 3,
- pack : "set_model",
- 'JsRender.Node:pathToNode' : (string path) {
-
-
- Gtk.TreeIter iter;
- _this.model.el.get_iter_from_string(out iter, path);
-
- GLib.Value value;
- _this.model.el.get_value(iter, 2, out value);
-
- return (JsRender.Node)value.dup_object();
-
- },
- columns : typeof(string),typeof(string),typeof(Object),
- init : print("model initialized");,
- listAllTypes : function() {
- var s = this.get('/LeftTree.view').selection;
- print ("LIST ALL TYPES: " + s.count_selected_rows() );
-
- if (s.count_selected_rows() > 0) {
- var iter = new Gtk.TreeIter();
- s.get_selected(this.el, iter);
-
- // set some properties of the tree for use by the dropped element.
- var value = new GObject.Value('');
- this.el.get_value(iter, 2, value);
- var data = JSON.parse(value.value);
-
-
- var xname = this.get('/LeftTree.model').file.guessName(data);
- console.log('selected:' + xname);
- if (xname.length) {
- return [ xname ];
- }
- return []; // could not find it..
- }
+ moveNode : (string target_data, Gdk.DragAction action)
+ {
+
+ /// target_data = "path|pos");
+
+
+ //print("MOVE NODE");
+ // console.dump(target_data);
+ Gtk.TreeIter old_iter;
+ Gtk.TreeModel mod;
- var ret = [ ];
+ var s = _this.view.el.get_selection();
+ s.get_selected(out mod , out old_iter);
+ mod.get_path(old_iter);
- var _this = this;
- function addall(li)
- {
- li.forEach(function(el) {
- // this is specific to roo!!!?
- if (!el) { // skip empty?
- return;
- }
- var fullpath = _this.file.guessName(el);
- if (fullpath.length && ret.indexOf(fullpath) < 0) {
- ret.push(fullpath);
- }
-
-
- if (el.items && el.items.length) {
- addall(el.items);
- }
-
- });
-
-
+ var node = this.pathToNode(mod.get_path(old_iter).to_string());
+ //console.dump(node);
+ if (node == null) {
+ print("moveNode: ERROR - node is null?");
}
- addall([this.currentTree]);
-
- // only if we have nothing, should we add '*top'
- if (!ret.length) {
- ret = [ '*top' ];
- }
- //console.log('all types in tree');
- //console.dump(ret);
- return ret;
-
- },
- 'string:findDropNode' : (string treepath_str, string[] targets) {
-
- // this is used by the dragdrop code in the roo version AFAIR..
- //var path = treepath_str.replace(/^builder-/, '');
- // treemap is depreciated... - should really check if model has any entries..
+ // needs to drop first, otherwise the target_data
+ // treepath will be invalid.
- if (this.el.iter_n_children(null) < 1) {
- //print("NO KEYS");
- return "|%d".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);
- }
- //print("FIND treepath: " + path);
- //console.dump(this.treemap);
- //if (!treepath_str.match(/^builder-/)) {
- // return []; // nothing!
- //}
- if (targets.length > 0 && targets[0] == "*") {
- return treepath_str;
+ if ((action & Gdk.DragAction.MOVE) > 0) {
+ print("REMOVING OLD NODE : " + target_data + "\n");
+ node.remove();
+ this.dropNode(target_data, node);
+ this.el.remove(ref old_iter);
+
+
+
+ } else {
+ print("DROPPING NODE // copy: " + target_data + "\n");
+ node = node.deepClone();
+ this.dropNode(target_data, node);
}
- return this.findDropNodeByPath(treepath_str,targets, -1);
+ _this.changed();
+ this.activePath= "";
+ //this.updateNode(false,true);
},
- 'string:findDropNodeByPath' : (string treepath_str, string[] targets, int in_pref = -1) {
+ file : "null",
+ xtype : "TreeStore",
+ pathToNode : (string path) {
+
+
+ Gtk.TreeIter iter;
+ _this.model.el.get_iter_from_string(out iter, path);
+
+ GLib.Value value;
+ _this.model.el.get_value(iter, 2, out value);
+
+ return (JsRender.Node)value.dup_object();
- var path = treepath_str; // dupe it..
-
- int pref = in_pref < 0 ? Gtk.TreeViewDropPosition.INTO_OR_AFTER : in_pref;
-
- var last = "";
-
- //console.dump(this.treemap);
-
- print("findDropNodeByPath : got path length %d / %s\n", path.length, path);
-
- if (path.length == 0) {
- // top drop. // just return empty..
- return "|%d".printf((int)pref) ;
-
- }
-
-
- while (path.length > 0) {
- //print("LOOKING FOR PATH: " + path);
- var node_data = this.pathToNode(path);
-
- if (node_data == null) {
- print("node not found");
- return null;
+ },
+ load : (Gee.ArrayList<JsRender.Node> tr, Gtk.TreeIter? iter)
+ {
+ Gtk.TreeIter citer;
+ //this.insert(citer,iter,0);
+ for(var i =0 ; i < tr.size; i++) {
+ if (iter != null) {
+ this.el.insert(out citer,iter,-1); // why not append?
+ } else {
+ this.el.append(out citer,null);
}
- var xname = node_data.fqn();
- var match = "";
- var prop = "";
+ this.el.set(citer, 0, tr.get(i).nodeTitle(),
+ 1, tr.get(i).nodeTip(), -1
+ );
+ var o = new GLib.Value(typeof(Object));
+ o.set_object((Object)tr.get(i));
- for (var i =0; i < targets.length; i++) {
- var tg = targets[i];
- if ((tg == xname) ) {
- match = tg;
- break;
- }
- // if target is "xxxx:name"
- if (tg.contains(xname +":")) {
- match = tg;
- var ar = tg.split(":");
- prop = ar[1];
- break;
- }
- }
+ this.el.set_value(citer, 2, o);
- if (match.length > 0) {
- if (last.length > 0) { // pref is after/before..
- // then it's after last
- if (pref > 1) {
- return "";
- }
- return last + "|%d".printf((int)pref) + "|" + prop;
-
-
- }
- return path + "|%d".printf( (int) Gtk.TreeViewDropPosition.INTO_OR_AFTER) + "|" + prop;
- }
- last = "" + path;
- var par = path.split(":");
- string [] ppar = {};
- for (var i = 0; i < par.length-1; i++) {
- ppar += par[i];
+ if (tr.get(i).items.size > 0) {
+ this.load(tr.get(i).items, citer);
}
-
- path = string.joinv(":", ppar);
-
-
- }
-
- return "";
-
- },
- 'void:deleteSelected' : () {
-
- print("DELETE SELECTED?");
- //_this.view.blockChanges = true;
- print("GET SELECTION?");
-
- var s = _this.view.el.get_selection();
-
- print("GET SELECTED?");
- Gtk.TreeIter iter;
- Gtk.TreeModel mod;
-
-
- if (!s.get_selected(out mod, out iter)) {
- return; // nothing seleted..
- }
-
-
-
- this.activePath= "";
- print("GET vnode value?");
-
- GLib.Value value;
- this.el.get_value(iter, 2, out value);
- var data = (JsRender.Node)(value.get_object());
- print("removing node from Render\n");
- if (data.parent == null) {
- this.file.tree = null;
- } else {
- data.remove();
+
}
- print("removing node from Tree\n");
- s.unselect_all();
- this.el.remove(ref iter);
-
-
-
-
- //
-
-
-
-
- this.activePath= ""; // again!?!?
- //this.changed(null,true);
-
- this.file.changed(null, "tree");
-
- _this.view.blockChanges = false;
},
- 'void:dropNode' : (string target_data_str, JsRender.Node node) {
+ dropNode : (string target_data_str, JsRender.Node node) {
// print("drop Node");
// console.dump(node);
// console.dump(target_data);
},
- 'void:load' : (Gee.ArrayList<JsRender.Node> tr, Gtk.TreeIter? iter)
- {
- Gtk.TreeIter citer;
- //this.insert(citer,iter,0);
- for(var i =0 ; i < tr.size; i++) {
- if (iter != null) {
- this.el.insert(out citer,iter,-1); // why not append?
- } else {
- this.el.append(out citer,null);
- }
-
- this.el.set(citer, 0, tr.get(i).nodeTitle(),
- 1, tr.get(i).nodeTip(), -1
- );
- var o = new GLib.Value(typeof(Object));
- o.set_object((Object)tr.get(i));
-
- this.el.set_value(citer, 2, o);
-
- if (tr.get(i).items.size > 0) {
- this.load(tr.get(i).items, citer);
- }
-
+ findDropNode : (string treepath_str, string[] targets) {
+
+ // this is used by the dragdrop code in the roo version AFAIR..
+
+ //var path = treepath_str.replace(/^builder-/, '');
+ // treemap is depreciated... - should really check if model has any entries..
+
+ if (this.el.iter_n_children(null) < 1) {
+ //print("NO KEYS");
+ return "|%d".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);
+ }
+ //print("FIND treepath: " + path);
+ //console.dump(this.treemap);
+
+ //if (!treepath_str.match(/^builder-/)) {
+ // return []; // nothing!
+ //}
+ if (targets.length > 0 && targets[0] == "*") {
+ return treepath_str;
}
+ return this.findDropNodeByPath(treepath_str,targets, -1);
},
- 'void:loadFile' : (JsRender.JsRender f) {
+ activePath : "\"\"",
+ columns : typeof(string),typeof(string),typeof(Object),
+ project : "null",
+ n_columns : 3,
+ xns : Gtk,
+ loadFile : (JsRender.JsRender f) {
//console.dump(f);
this.el.clear();
this.file = f;
*/
},
- 'void:moveNode' : (string target_data, Gdk.DragAction action)
- {
-
- /// target_data = "path|pos");
-
-
- //print("MOVE NODE");
- // console.dump(target_data);
- Gtk.TreeIter old_iter;
- Gtk.TreeModel mod;
+ findDropNodeByPath : (string treepath_str, string[] targets, int in_pref = -1) {
+
+ var path = treepath_str; // dupe it..
+
+ int pref = in_pref < 0 ? Gtk.TreeViewDropPosition.INTO_OR_AFTER : in_pref;
+
+ var last = "";
+
+ //console.dump(this.treemap);
+
+ print("findDropNodeByPath : got path length %d / %s\n", path.length, path);
+
+ if (path.length == 0) {
+ // top drop. // just return empty..
+ return "|%d".printf((int)pref) ;
+
+ }
+
+
+ while (path.length > 0) {
+ //print("LOOKING FOR PATH: " + path);
+ var node_data = this.pathToNode(path);
+
+ if (node_data == null) {
+ print("node not found");
+ return null;
+ }
+
+ var xname = node_data.fqn();
+ var match = "";
+ var prop = "";
+
+ for (var i =0; i < targets.length; i++) {
+ var tg = targets[i];
+ if ((tg == xname) ) {
+ match = tg;
+ break;
+ }
+ // if target is "xxxx:name"
+ if (tg.contains(xname +":")) {
+ match = tg;
+ var ar = tg.split(":");
+ prop = ar[1];
+ break;
+ }
+ }
+
+ if (match.length > 0) {
+ if (last.length > 0) { // pref is after/before..
+ // then it's after last
+ if (pref > 1) {
+ return "";
+ }
+ return last + "|%d".printf((int)pref) + "|" + prop;
+
+
+ }
+ return path + "|%d".printf( (int) Gtk.TreeViewDropPosition.INTO_OR_AFTER) + "|" + prop;
+ }
+ last = "" + path;
+ var par = path.split(":");
+ string [] ppar = {};
+ for (var i = 0; i < par.length-1; i++) {
+ ppar += par[i];
+ }
+
+ path = string.joinv(":", ppar);
+
+
+ }
+
+ return "";
+
+ },
+ deleteSelected : () {
+ print("DELETE SELECTED?");
+ //_this.view.blockChanges = true;
+ print("GET SELECTION?");
+
var s = _this.view.el.get_selection();
- s.get_selected(out mod , out old_iter);
- mod.get_path(old_iter);
- var node = this.pathToNode(mod.get_path(old_iter).to_string());
- //console.dump(node);
- if (node == null) {
- print("moveNode: ERROR - node is null?");
+ print("GET SELECTED?");
+ Gtk.TreeIter iter;
+ Gtk.TreeModel mod;
+
+
+ if (!s.get_selected(out mod, out iter)) {
+ return; // nothing seleted..
+ }
+
+
+
+ this.activePath= "";
+ print("GET vnode value?");
+
+ GLib.Value value;
+ this.el.get_value(iter, 2, out value);
+ var data = (JsRender.Node)(value.get_object());
+ print("removing node from Render\n");
+ if (data.parent == null) {
+ this.file.tree = null;
+ } else {
+ data.remove();
}
+ print("removing node from Tree\n");
+ s.unselect_all();
+ this.el.remove(ref iter);
+
+
+
+
+ //
- // needs to drop first, otherwise the target_data
- // treepath will be invalid.
+ this.activePath= ""; // again!?!?
+ //this.changed(null,true);
- if ((action & Gdk.DragAction.MOVE) > 0) {
- print("REMOVING OLD NODE : " + target_data + "\n");
- node.remove();
- this.dropNode(target_data, node);
- this.el.remove(ref old_iter);
+ this.file.changed(null, "tree");
+
+ _this.view.blockChanges = false;
+ },
+ listAllTypes : function() {
+ var s = this.get('/LeftTree.view').selection;
+ print ("LIST ALL TYPES: " + s.count_selected_rows() );
+
+ if (s.count_selected_rows() > 0) {
+ var iter = new Gtk.TreeIter();
+ s.get_selected(this.el, iter);
+
+ // set some properties of the tree for use by the dropped element.
+ var value = new GObject.Value('');
+ this.el.get_value(iter, 2, value);
+ var data = JSON.parse(value.value);
+
+
+ var xname = this.get('/LeftTree.model').file.guessName(data);
+ console.log('selected:' + xname);
+ if (xname.length) {
+ return [ xname ];
+ }
+ return []; // could not find it..
+ }
+
+ var ret = [ ];
+
+ var _this = this;
+ function addall(li)
+ {
+ li.forEach(function(el) {
+ // this is specific to roo!!!?
+ if (!el) { // skip empty?
+ return;
+ }
+ var fullpath = _this.file.guessName(el);
+ if (fullpath.length && ret.indexOf(fullpath) < 0) {
+ ret.push(fullpath);
+ }
-
- } else {
- print("DROPPING NODE // copy: " + target_data + "\n");
- node = node.deepClone();
- this.dropNode(target_data, node);
+ if (el.items && el.items.length) {
+ addall(el.items);
+ }
+
+ });
+
+
}
- _this.changed();
- this.activePath= "";
- //this.updateNode(false,true);
+
+ addall([this.currentTree]);
+
+ // only if we have nothing, should we add '*top'
+ if (!ret.length) {
+ ret = [ '*top' ];
+ }
+ //console.log('all types in tree');
+ //console.dump(ret);
+
+ return ret;
+
}
},
- {
- xtype: Gtk.TreeViewColumn,
- pack : "append_column",
- init : this.el.add_attribute(_this.renderer.el , "markup", 0 );,
+ {
+ xtype : "TreeViewColumn",
+ xns : Gtk,
items : [
- {
- xtype: Gtk.CellRendererText,
+ {
id : "renderer",
- pack : "pack_start,true"
+ xtype : "CellRendererText",
+ xns : Gtk
}
]
+
}
]
+
},
- {
- xtype: Gtk.Menu,
+ {
id : "LeftTreeMenu",
- pack : false,
+ xtype : "Menu",
+ xns : Gtk,
items : [
- {
- xtype: Gtk.MenuItem,
- listeners : {
- activate : ( ) => {
-
- print("ACTIVATE?");
-
-
- _this.model.deleteSelected();
- }
- },
+ {
label : "Delete Element",
- pack : "add"
- },
- {
- xtype: Gtk.MenuItem,
+ xtype : "MenuItem",
+ xns : Gtk,
listeners : {
- activate : () => {
-
- DialogSaveTemplate.singleton().show(
- (Gtk.Window) _this.el.get_toplevel (),
- _this.model.file.palete(),
- _this.getActiveElement()
- );
-
-
- }
- },
- label : "Save as Template",
- pack : "add"
+ activate : ( ) => {
+
+ print("ACTIVATE?");
+
+
+ _this.model.deleteSelected();
+ }
+ }
},
- {
- xtype: Gtk.MenuItem,
+ {
+ label : "Save as Template",
+ xtype : "MenuItem",
+ xns : Gtk,
listeners : {
- activate : () => {
- var node = _this.getActiveElement();
- var name = DialogSaveModule.singleton().show(
- (Gtk.Window) _this.el.get_toplevel (),
- _this.model.file.project,
- node
- );
- if (name.length < 1) {
- return;
-
- }
- node.props.set("* xinclude", name);
- node.items.clear();
-
-
- var s = _this.view.el.get_selection();
-
- print("GET SELECTED?");
- Gtk.TreeIter iter;
- Gtk.TreeModel mod;
-
-
- if (!s.get_selected(out mod, out iter)) {
- return; // nothing seleted..
- }
- Gtk.TreeIter citer;
- var n_cn = mod.iter_n_children(iter) -1;
- for (var i = n_cn; i > -1; i--) {
- mod.iter_nth_child(out citer, iter, i);
-
-
- print("removing node from Tree\n");
-
- _this.model.el.remove(ref citer);
- }
- _this.changed();
- _this.node_selected(node);
-
-
- }
- },
+ activate : () => {
+
+ DialogSaveTemplate.singleton().show(
+ (Gtk.Window) _this.el.get_toplevel (),
+ _this.model.file.palete(),
+ _this.getActiveElement()
+ );
+
+
+ }
+ }
+ },
+ {
label : "Save as Module",
- pack : "add"
+ xtype : "MenuItem",
+ xns : Gtk,
+ listeners : {
+ activate : () => {
+ var node = _this.getActiveElement();
+ var name = DialogSaveModule.singleton().show(
+ (Gtk.Window) _this.el.get_toplevel (),
+ _this.model.file.project,
+ node
+ );
+ if (name.length < 1) {
+ return;
+
+ }
+ node.props.set("* xinclude", name);
+ node.items.clear();
+
+
+ var s = _this.view.el.get_selection();
+
+ print("GET SELECTED?");
+ Gtk.TreeIter iter;
+ Gtk.TreeModel mod;
+
+
+ if (!s.get_selected(out mod, out iter)) {
+ return; // nothing seleted..
+ }
+ Gtk.TreeIter citer;
+ var n_cn = mod.iter_n_children(iter) -1;
+ for (var i = n_cn; i > -1; i--) {
+ mod.iter_nth_child(out citer, iter, i);
+
+
+ print("removing node from Tree\n");
+
+ _this.model.el.remove(ref citer);
+ }
+ _this.changed();
+ _this.node_selected(node);
+
+
+ }
+ }
}
]
+
}
]
+
});
WindowLeftTree.init();
XObject.cache['/WindowLeftTree'] = WindowLeftTree;
this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC); }
// user defined functions
- public string getActivePath () {
+ public string getActivePath () {
var model = this.model;
var view = this.view.el;
if (view.get_selection().count_selected_rows() < 1) {
view.get_selection().get_selected(out mod, out iter);
return mod.get_path(iter).to_string();
}
- public JsRender.Node? getActiveElement () { // return path to actie node.
+ public JsRender.JsRender getActiveFile () {
+ return this.model.file;
+ }
+ public JsRender.Node? getActiveElement () { // return path to actie node.
var path = this.getActivePath();
if (path.length < 1) {
return _this.model.pathToNode(path);
}
- public JsRender.JsRender getActiveFile () {
- return this.model.file;
- }
public class Xcls_view : Object
{
public Gtk.TreeView el;
}
// user defined functions
- public void highlightDropPath ( string treepath, Gtk.TreeViewDropPosition pos) {
+ public void highlightDropPath ( string treepath, Gtk.TreeViewDropPosition pos) {
// highlighting for drag/drop
if (treepath.length > 0) {
}
}
- public void selectNode (string treepath_str) {
+ public void selectNode (string treepath_str) {
//this.selection.select_path(new Gtk.TreePath.from_string( treepath_str));
var tp = new Gtk.TreePath.from_string(treepath_str);
{
_this = _owner;
_this.model = this;
- this.el = new Gtk.TreeStore( 3, typeof(string),typeof(string),typeof(Object) );
+ this.el = new Gtk.TreeStore( 3, typeof(string),typeof(string),typeof(Object) );
// my vars (dec)
this.file = null;
print("model initialized"); }
// user defined functions
- public string findDropNodeByPath (string treepath_str, string[] targets, int in_pref = -1) {
-
- var path = treepath_str; // dupe it..
-
- int pref = in_pref < 0 ? Gtk.TreeViewDropPosition.INTO_OR_AFTER : in_pref;
-
- var last = "";
-
- //console.dump(this.treemap);
-
- print("findDropNodeByPath : got path length %d / %s\n", path.length, path);
-
- if (path.length == 0) {
- // top drop. // just return empty..
- return "|%d".printf((int)pref) ;
-
- }
-
-
- while (path.length > 0) {
- //print("LOOKING FOR PATH: " + path);
- var node_data = this.pathToNode(path);
-
- if (node_data == null) {
- print("node not found");
- return null;
- }
-
- var xname = node_data.fqn();
- var match = "";
- var prop = "";
-
- for (var i =0; i < targets.length; i++) {
- var tg = targets[i];
- if ((tg == xname) ) {
- match = tg;
- break;
- }
- // if target is "xxxx:name"
- if (tg.contains(xname +":")) {
- match = tg;
- var ar = tg.split(":");
- prop = ar[1];
- break;
- }
- }
-
- if (match.length > 0) {
- if (last.length > 0) { // pref is after/before..
- // then it's after last
- if (pref > 1) {
- return "";
- }
- return last + "|%d".printf((int)pref) + "|" + prop;
-
-
- }
- return path + "|%d".printf( (int) Gtk.TreeViewDropPosition.INTO_OR_AFTER) + "|" + prop;
- }
- last = "" + path;
- var par = path.split(":");
- string [] ppar = {};
- for (var i = 0; i < par.length-1; i++) {
- ppar += par[i];
- }
-
- path = string.joinv(":", ppar);
-
-
- }
-
- return "";
-
- }
- public void load (Gee.ArrayList<JsRender.Node> tr, Gtk.TreeIter? iter)
- {
- Gtk.TreeIter citer;
- //this.insert(citer,iter,0);
- for(var i =0 ; i < tr.size; i++) {
- if (iter != null) {
- this.el.insert(out citer,iter,-1); // why not append?
- } else {
- this.el.append(out citer,null);
- }
-
- this.el.set(citer, 0, tr.get(i).nodeTitle(),
- 1, tr.get(i).nodeTip(), -1
- );
- var o = new GLib.Value(typeof(Object));
- o.set_object((Object)tr.get(i));
-
- this.el.set_value(citer, 2, o);
-
- if (tr.get(i).items.size > 0) {
- this.load(tr.get(i).items, citer);
- }
-
- }
- }
- public void moveNode (string target_data, Gdk.DragAction action)
+ public void moveNode (string target_data, Gdk.DragAction action)
{
/// target_data = "path|pos");
this.activePath= "";
//this.updateNode(false,true);
}
- public JsRender.Node pathToNode (string path) {
+ public JsRender.Node pathToNode (string path) {
Gtk.TreeIter iter;
return (JsRender.Node)value.dup_object();
}
- public string findDropNode (string treepath_str, string[] targets) {
-
- // this is used by the dragdrop code in the roo version AFAIR..
-
- //var path = treepath_str.replace(/^builder-/, '');
- // treemap is depreciated... - should really check if model has any entries..
-
- if (this.el.iter_n_children(null) < 1) {
- //print("NO KEYS");
- return "|%d".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);
- }
- //print("FIND treepath: " + path);
- //console.dump(this.treemap);
-
- //if (!treepath_str.match(/^builder-/)) {
- // return []; // nothing!
- //}
- if (targets.length > 0 && targets[0] == "*") {
- return treepath_str;
+ public void load (Gee.ArrayList<JsRender.Node> tr, Gtk.TreeIter? iter)
+ {
+ Gtk.TreeIter citer;
+ //this.insert(citer,iter,0);
+ for(var i =0 ; i < tr.size; i++) {
+ if (iter != null) {
+ this.el.insert(out citer,iter,-1); // why not append?
+ } else {
+ this.el.append(out citer,null);
+ }
+
+ this.el.set(citer, 0, tr.get(i).nodeTitle(),
+ 1, tr.get(i).nodeTip(), -1
+ );
+ var o = new GLib.Value(typeof(Object));
+ o.set_object((Object)tr.get(i));
+
+ this.el.set_value(citer, 2, o);
+
+ if (tr.get(i).items.size > 0) {
+ this.load(tr.get(i).items, citer);
+ }
+
}
- return this.findDropNodeByPath(treepath_str,targets, -1);
}
- public void dropNode (string target_data_str, JsRender.Node node) {
+ public void dropNode (string target_data_str, JsRender.Node node) {
// print("drop Node");
// console.dump(node);
// console.dump(target_data);
}
- public void deleteSelected () {
-
- print("DELETE SELECTED?");
- //_this.view.blockChanges = true;
- print("GET SELECTION?");
-
- var s = _this.view.el.get_selection();
-
- print("GET SELECTED?");
- Gtk.TreeIter iter;
- Gtk.TreeModel mod;
-
-
- if (!s.get_selected(out mod, out iter)) {
- return; // nothing seleted..
- }
-
+ public string findDropNode (string treepath_str, string[] targets) {
+ // this is used by the dragdrop code in the roo version AFAIR..
- this.activePath= "";
- print("GET vnode value?");
+ //var path = treepath_str.replace(/^builder-/, '');
+ // treemap is depreciated... - should really check if model has any entries..
- GLib.Value value;
- this.el.get_value(iter, 2, out value);
- var data = (JsRender.Node)(value.get_object());
- print("removing node from Render\n");
- if (data.parent == null) {
- this.file.tree = null;
- } else {
- data.remove();
+ if (this.el.iter_n_children(null) < 1) {
+ //print("NO KEYS");
+ return "|%d".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);
}
- print("removing node from Tree\n");
- s.unselect_all();
- this.el.remove(ref iter);
-
-
-
-
- //
-
-
-
-
- this.activePath= ""; // again!?!?
- //this.changed(null,true);
-
- this.file.changed(null, "tree");
+ //print("FIND treepath: " + path);
+ //console.dump(this.treemap);
- _this.view.blockChanges = false;
+ //if (!treepath_str.match(/^builder-/)) {
+ // return []; // nothing!
+ //}
+ if (targets.length > 0 && targets[0] == "*") {
+ return treepath_str;
+ }
+ return this.findDropNodeByPath(treepath_str,targets, -1);
}
- public void loadFile (JsRender.JsRender f) {
+ public void loadFile (JsRender.JsRender f) {
//console.dump(f);
this.el.clear();
this.file = f;
*/
}
+ public string findDropNodeByPath (string treepath_str, string[] targets, int in_pref = -1) {
+
+ var path = treepath_str; // dupe it..
+
+ int pref = in_pref < 0 ? Gtk.TreeViewDropPosition.INTO_OR_AFTER : in_pref;
+
+ var last = "";
+
+ //console.dump(this.treemap);
+
+ print("findDropNodeByPath : got path length %d / %s\n", path.length, path);
+
+ if (path.length == 0) {
+ // top drop. // just return empty..
+ return "|%d".printf((int)pref) ;
+
+ }
+
+
+ while (path.length > 0) {
+ //print("LOOKING FOR PATH: " + path);
+ var node_data = this.pathToNode(path);
+
+ if (node_data == null) {
+ print("node not found");
+ return null;
+ }
+
+ var xname = node_data.fqn();
+ var match = "";
+ var prop = "";
+
+ for (var i =0; i < targets.length; i++) {
+ var tg = targets[i];
+ if ((tg == xname) ) {
+ match = tg;
+ break;
+ }
+ // if target is "xxxx:name"
+ if (tg.contains(xname +":")) {
+ match = tg;
+ var ar = tg.split(":");
+ prop = ar[1];
+ break;
+ }
+ }
+
+ if (match.length > 0) {
+ if (last.length > 0) { // pref is after/before..
+ // then it's after last
+ if (pref > 1) {
+ return "";
+ }
+ return last + "|%d".printf((int)pref) + "|" + prop;
+
+
+ }
+ return path + "|%d".printf( (int) Gtk.TreeViewDropPosition.INTO_OR_AFTER) + "|" + prop;
+ }
+ last = "" + path;
+ var par = path.split(":");
+ string [] ppar = {};
+ for (var i = 0; i < par.length-1; i++) {
+ ppar += par[i];
+ }
+
+ path = string.joinv(":", ppar);
+
+
+ }
+
+ return "";
+
+ }
+ public void deleteSelected () {
+
+ print("DELETE SELECTED?");
+ //_this.view.blockChanges = true;
+ print("GET SELECTION?");
+
+ var s = _this.view.el.get_selection();
+
+ print("GET SELECTED?");
+ Gtk.TreeIter iter;
+ Gtk.TreeModel mod;
+
+
+ if (!s.get_selected(out mod, out iter)) {
+ return; // nothing seleted..
+ }
+
+
+
+ this.activePath= "";
+ print("GET vnode value?");
+
+ GLib.Value value;
+ this.el.get_value(iter, 2, out value);
+ var data = (JsRender.Node)(value.get_object());
+ print("removing node from Render\n");
+ if (data.parent == null) {
+ this.file.tree = null;
+ } else {
+ data.remove();
+ }
+ print("removing node from Tree\n");
+ s.unselect_all();
+ this.el.remove(ref iter);
+
+
+
+
+ //
+
+
+
+
+ this.activePath= ""; // again!?!?
+ //this.changed(null,true);
+
+ this.file.changed(null, "tree");
+
+ _this.view.blockChanges = false;
+ }
}
public class Xcls_TreeViewColumn4 : Object
{