// my vars (def)
public Gtk.Widget lastObj;
- public int width;
public int last_search_end;
public Gtk.SourceSearchContext searchcontext;
public JsRender.JsRender file;
- public int height;
public Xcls_MainWindow main_window;
// ctor
// my vars (dec)
this.lastObj = null;
- this.width = 0;
this.last_search_end = 0;
this.file = null;
- this.height = 0;
// set gobject values
this.el.hexpand = true;
+ this.el.vexpand = true;
var child_0 = new Xcls_notebook( _this );
child_0.ref();
this.el.pack_start ( child_0.el , true,true,0 );
});
+ }
+ public int search (string txt) {
+ this.notebook.el.page = 1;
+ var s = new Gtk.SourceSearchSettings();
+ var buf = (Gtk.SourceBuffer) this.sourceview.el.get_buffer();
+ this.searchcontext = new Gtk.SourceSearchContext(buf,s);
+ this.searchcontext.set_highlight(true);
+ s.set_search_text(txt);
+
+ Gtk.TextIter beg, st,en;
+
+ buf.get_start_iter(out beg);
+ this.searchcontext.forward(beg, out st, out en);
+ this.last_search_end = 0;
+ return this.searchcontext.get_occurrences_count();
+
+
}
public void createThumb () {
this.notebook.el.page = 0;// gtk preview
this.sourceview.loadFile();
- }
- public int search (string txt) {
- this.notebook.el.page = 1;
- var s = new Gtk.SourceSearchSettings();
- var buf = (Gtk.SourceBuffer) this.sourceview.el.get_buffer();
- this.searchcontext = new Gtk.SourceSearchContext(buf,s);
- this.searchcontext.set_highlight(true);
- s.set_search_text(txt);
-
- Gtk.TextIter beg, st,en;
-
- buf.get_start_iter(out beg);
- this.searchcontext.forward(beg, out st, out en);
- this.last_search_end = 0;
- return this.searchcontext.get_occurrences_count();
-
-
}
public void requestRedraw () {
this.view.renderJS(false);
// my vars (def)
- public bool loading;
public bool button_is_pressed;
- public string prop_selected;
- public bool key_is_pressed;
public JsRender.Node? node_selected;
+ public bool loading;
public int editable_start_pos;
+ public string prop_selected;
+ public bool key_is_pressed;
// ctor
public Xcls_sourceview(Xcls_WindowRooView _owner )
this.el = new Gtk.SourceView();
// my vars (dec)
- this.loading = true;
this.button_is_pressed = false;
- this.prop_selected = "";
- this.key_is_pressed = false;
this.node_selected = null;
+ this.loading = true;
this.editable_start_pos = -1;
+ this.prop_selected = "";
+ this.key_is_pressed = false;
// set gobject values
this.el.editable = false;
{
+
var description = Pango.FontDescription.from_string("monospace");
description.set_size(8000);
this.el.override_font(description);
//buf.notify.connect(this.onCursorChanged);
-
var attrs = new Gtk.SourceMarkAttributes();
var pink = Gdk.RGBA();
pink.parse ( "pink");
this.el.button_press_event.connect( () => {
-
-
this.button_is_pressed = true;
return false;
});
}
// user defined functions
+ public void clearGreySelection () {
+ // clear all the marks..
+ var sbuf = (Gtk.SourceBuffer)this.el.buffer;
+
+ Gtk.TextIter start;
+ Gtk.TextIter end;
+
+ sbuf.get_bounds (out start, out end);
+ sbuf.remove_source_marks (start, end, "grey");
+
+
+ }
public void onCursorChanged (/*ParamSpec ps*/) {
if (!this.key_is_pressed && !this.button_is_pressed) {
// highlight the node..
}
- public void clearGreySelection () {
- // clear all the marks..
- var sbuf = (Gtk.SourceBuffer)this.el.buffer;
-
- Gtk.TextIter start;
- Gtk.TextIter end;
-
- sbuf.get_bounds (out start, out end);
- sbuf.remove_source_marks (start, end, "grey");
-
-
+ public string toString () {
+ Gtk.TextIter s;
+ Gtk.TextIter e;
+ this.el.get_buffer().get_start_iter(out s);
+ this.el.get_buffer().get_end_iter(out e);
+ var ret = this.el.get_buffer().get_text(s,e,true);
+ //print("TO STRING? " + ret);
+ return ret;
}
public void nodeSelected (JsRender.Node? sel, bool scroll ) {
- }
- public string toString () {
- Gtk.TextIter s;
- Gtk.TextIter e;
- this.el.get_buffer().get_start_iter(out s);
- this.el.get_buffer().get_end_iter(out e);
- var ret = this.el.get_buffer().get_text(s,e,true);
- //print("TO STRING? " + ret);
- return ret;
}
public void loadFile ( ) {
this.loading = true;
}
return false;
}
- public string toString () {
-
- Gtk.TextIter s;
- Gtk.TextIter e;
- this.el.get_start_iter(out s);
- this.el.get_end_iter(out e);
- var ret = this.el.get_text(s,e,true);
- //print("TO STRING? " + ret);
- return ret;
- }
public bool checkSyntax () {
);
}
+ public string toString () {
+
+ Gtk.TextIter s;
+ Gtk.TextIter e;
+ this.el.get_start_iter(out s);
+ this.el.get_end_iter(out e);
+ var ret = this.el.get_text(s,e,true);
+ //print("TO STRING? " + ret);
+ return ret;
+ }
}