WebKit = imports.gi.WebKit;
Vte = imports.gi.Vte;
GtkClutter = imports.gi.GtkClutter;
+Gdl = imports.gi.Gdl;
console = imports.console;
XObject = imports.XObject.XObject;
Window=new XObject({
// that is done by GTK..
+ if (!this.get('/Editor').save()) {
+ // popup!! - click handled..
+ return true;
+ }
if (!this.el.expanded) {
this.onExpand();
id : "expander",
label : "Select Project or File",
pack : "pack_start,false,true",
+ init : function() {
+ XObject.prototype.init.call(this);
+ this.el.add_events (Gdk.EventMask.BUTTON_MOTION_MASK );
+ },
onCollapse : function() {
var nb = this.get('/LeftTopPanel.notebook');
nb.el.set_current_page(0);
},
- init : function() {
- XObject.prototype.init.call(this);
- this.el.add_events (Gdk.EventMask.BUTTON_MOTION_MASK );
- },
onExpand : function() {
var nb = this.get('/LeftTopPanel.notebook');
var pm = imports.Builder.Provider.ProjectManager.ProjectManager;
listeners : {
button_press_event : function (self, ev) {
console.log("button press?");
+
+ if (!this.get('/Editor').save()) {
+ // popup!! - click handled..
+ return true;
+ }
+
if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button.button != 3) {
print("click" + ev.type);
return false;
var res = {};
this.get('/LeftTree.view').el.get_path_at_pos(ev.button.x,ev.button.y, res);
- if (!this.get('/LeftTreeMenu').el) this.get('/LeftTreeMenu').init();
+ if (!this.get('/LeftTreeMenu').el) { this.get('/LeftTreeMenu').init(); }
this.get('/LeftTreeMenu').el.set_screen(Gdk.Screen.get_default());
this.get('/LeftTreeMenu').el.show_all();
},
{
xtype: Gtk.Button,
- pack : "add",
listeners : {
button_press_event : function (self, event) {
- this.get('/MidPropTree.model').showData('events');
+
+ if (!this.get('/Editor').save()) {
+ // popup!! - click handled..
+ return true;
+ }
+ this.get('/MidPropTree.model').showData('events');
return false;
}
},
+ pack : "add",
items : [
{
xtype: Gtk.HBox,
},
{
xtype: Gtk.Button,
- pack : "add",
listeners : {
button_press_event : function (self, ev) {
+
+ if (!this.get('/Editor').save()) {
+ // popup!! - click handled..
+ return true;
+ }
+
var p = this.get('/AddPropertyPopup');
if (!p.el) {
p.init();
return true;
}
},
+ pack : "add",
items : [
{
xtype: Gtk.HBox,
button_press_event : function (self, ev) {
+ if (!this.get('/Editor').save()) {
+ // popup!! - click handled..
+ return true;
+ }
var res = { };
if (!this.el.get_path_at_pos(ev.button.x,ev.button.y, res)) {
]);
},
load : function(ar) {
+ // might casue problesm..
+ // this.get('/Editor.RightEditor').save();
+
+ this.get('/Editor').el.hide();
+ this.get('/Editor').activePath = false;
+
+
this.el.clear();
-
+
//this.get('/RightEditor').el.hide();
if (ar === false) {
return ;
id : "AutoRedraw",
label : "Auto Redraw On",
pack : "pack_start,false,false,0"
+ },
+ {
+ xtype: Gtk.Button,
+ listeners : {
+ clicked : function (self) {
+ this.get('/RightBrowser.view').redraws = 99;
+ this.get('/RightBrowser.view').renderJS(null,true);
+ }
+ },
+ label : "Full Redraw",
+ pack : "pack_start,false,false,0"
}
]
},
console_message : function (self, object, p0, p1) {
print(object);
// console.log(object);
+
+
+ if (object.match(/variable/) && object.match(/Builder/)) {
+ print("got builder missing message");
+ this.refreshRequired = true;
+ this.lastRedraw = 0;
+ this.runRefresh();
+ return true;
+ }
+
+
if (!object.match(/^\{/)) {
//this.get('/Terminal').feed(object);
return true; // do not handle!!! -> later maybe in console..
}
+
+
+
+
// console.log(object);
var val = JSON.parse(object);
return null; //new WebKit.WebView();
}
},
- redraws : 0,
id : "view",
pack : "add",
+ redraws : 0,
init : function() {
XObject.prototype.init.call(this);
// this may not work!?
*/
},
viewAdd : function(item, par)
- {
+ {
+
// does something similar to xobject..
item.pack = (typeof(item.pack) == 'undefined') ? 'add' : item.pack;
return;
}
print("CREATE: " + item['|xns'] + '.' + item['xtype']);
+
+
var type = item['|xns'] + '.' + item['xtype'];
if (item['|xns'] == 'GtkClutter') { // we can not add this yet!
return false;
}
+
var ns = imports.gi[item['|xns']];
- var ctr = ns[item['xtype']];
+ var ctr = ns[item['xtype']]; // why are we using array here..?
+
+
+
var ctr_args = { };
for(var k in item) {
var kv = item[k];
if (kv.match(new RegExp('function'))) {
continue;
}
- print("WASL " + k + '=' + kv);
+ print("WASL " + k + '=' + kv);
try {
eval( 'kv = ' + kv);
} catch(e) { continue; }
ctr_args[k] = kv;
}
+ var altctr = XObject.baseXObject({ xtype: ctr} );
+ if (!item.pack && altctr) {
+ // try XObject.
+ item.pack = altctr.prototype.pack;
+
+
+
+ }
var el = new ctr(ctr_args);
items : [
{
xtype: Gtk.TreeView,
- pack : "add",
- init : function() {
- XObject.prototype.init.call(this);
- this.el.set_size_request(150,-1);
- // set_reorderable: [1]
-
- var description = new Pango.FontDescription.c_new();
- description.set_size(8000);
- this.el.modify_font(description);
-
- this.selection = this.el.get_selection();
- this.selection.set_mode( Gtk.SelectionMode.SINGLE);
- // this.selection.signal['changed'].connect(function() {
- // _view.listeners['cursor-changed'].apply(_view, [ _view, '']);
- //});
- // see: http://live.gnome.org/GnomeLove/DragNDropTutorial
-
- Gtk.drag_source_set (
- this.el, /* widget will be drag-able */
- Gdk.ModifierType.BUTTON1_MASK, /* modifier that will start a drag */
- null, /* lists of target to support */
- 0, /* size of list */
- Gdk.DragAction.COPY /* what to do with data after dropped */
- );
- //Gtk.drag_source_set_target_list(this.el, LeftTree.targetList);
-
- Gtk.drag_source_set_target_list(this.el, this.get('/Window').targetList);
- Gtk.drag_source_add_text_targets(this.el);
- /*
- print("RP: TARGET:" + LeftTree.atoms["STRING"]);
- targets = new Gtk.TargetList();
- targets.add( LeftTree.atoms["STRING"], 0, 0);
- targets.add_text_targets( 1 );
- Gtk.drag_dest_set_target_list(this.el, LeftTree.targetList);
-
- //if you want to allow text to be output elsewhere..
- //Gtk.drag_source_add_text_targets(this.el);
- */
- return true;
- },
- headers_visible : false,
- enable_tree_lines : true,
listeners : {
drag_begin : function (self, ctx) {
// we could fill this in now...
this.el.dropList = false;
this.get('/LeftTree.view').highlight(false);
return true;
+ },
+ button_press_event : function (self, event) {
+
+ if (!this.get('/Editor').save()) {
+ // popup!! - click handled..
+ return true;
+ }
+ return false;
}
},
+ pack : "add",
+ enable_tree_lines : true,
+ headers_visible : false,
+ init : function() {
+ XObject.prototype.init.call(this);
+ this.el.set_size_request(150,-1);
+ // set_reorderable: [1]
+
+ var description = new Pango.FontDescription.c_new();
+ description.set_size(8000);
+ this.el.modify_font(description);
+
+ this.selection = this.el.get_selection();
+ this.selection.set_mode( Gtk.SelectionMode.SINGLE);
+ // this.selection.signal['changed'].connect(function() {
+ // _view.listeners['cursor-changed'].apply(_view, [ _view, '']);
+ //});
+ // see: http://live.gnome.org/GnomeLove/DragNDropTutorial
+
+ Gtk.drag_source_set (
+ this.el, /* widget will be drag-able */
+ Gdk.ModifierType.BUTTON1_MASK, /* modifier that will start a drag */
+ null, /* lists of target to support */
+ 0, /* size of list */
+ Gdk.DragAction.COPY /* what to do with data after dropped */
+ );
+ //Gtk.drag_source_set_target_list(this.el, LeftTree.targetList);
+
+ Gtk.drag_source_set_target_list(this.el, this.get('/Window').targetList);
+ Gtk.drag_source_add_text_targets(this.el);
+ /*
+ print("RP: TARGET:" + LeftTree.atoms["STRING"]);
+ targets = new Gtk.TargetList();
+ targets.add( LeftTree.atoms["STRING"], 0, 0);
+ targets.add_text_targets( 1 );
+ Gtk.drag_dest_set_target_list(this.el, LeftTree.targetList);
+
+ //if you want to allow text to be output elsewhere..
+ //Gtk.drag_source_add_text_targets(this.el);
+ */
+ return true;
+ },
items : [
{
xtype: Gtk.ListStore,