1 static Xcls_GtkView _GtkView;
3 public class Xcls_GtkView : Object
6 private Xcls_GtkView _this;
8 public static Xcls_GtkView singleton()
10 if (_GtkView == null) {
11 _GtkView= new Xcls_GtkView();
15 public Xcls_notebook notebook;
16 public Xcls_label_preview label_preview;
17 public Xcls_label_code label_code;
18 public Xcls_view_layout view_layout;
19 public Xcls_container container;
20 public Xcls_sourceviewscroll sourceviewscroll;
21 public Xcls_sourceview sourceview;
22 public Xcls_buffer buffer;
23 public Xcls_search_entry search_entry;
24 public Xcls_search_results search_results;
25 public Xcls_nextBtn nextBtn;
26 public Xcls_backBtn backBtn;
27 public Xcls_search_settings search_settings;
28 public Xcls_case_sensitive case_sensitive;
29 public Xcls_regex regex;
30 public Xcls_multiline multiline;
33 public Gtk.Widget lastObj;
34 public Gtk.CssProvider css;
35 public Xcls_MainWindow main_window;
36 public GtkSource.SearchContext searchcontext;
37 public int last_search_end;
38 public JsRender.JsRender file;
44 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
48 this.last_search_end = 0;
52 this.el.hexpand = true;
53 this.el.vexpand = true;
54 new Xcls_notebook( _this );
55 this.el.append( _this.notebook.el );
61 this.css = new Gtk.CssProvider();
63 this.css.load_from_string(
64 "#gtkview-view-layout { background-color: #ccc; }"
67 Gtk.StyleContext.add_provider_for_display(
68 this.el.get_display(),
70 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
77 // user defined functions
78 public void loadFile (JsRender.JsRender file)
82 if (file.tree == null) {
85 this.notebook.el.page = 0;// gtk preview
90 this.sourceview.loadFile();
91 this.searchcontext = null;
94 if (this.lastObj != null) {
95 this.container.el.remove(this.lastObj);
98 // hide the compile view at present..
101 var w = this.el.get_width();
102 var h = this.el.get_height();
104 print("ALLOC SET SIZES %d, %d\n", w,h);
106 // set the container size min to 500/500 or 20 px less than max..
107 w = int.max (w-20, 500);
108 h = int.max (h-20, 500);
110 print("SET SIZES %d, %d\n", w,h);
111 _this.container.el.set_size_request(w,h);
113 _this.view_layout.el.set_size_request(w,h);
114 // should be baded on calc.. -- see update_scrolled.
116 var fc = this.container.el.get_first_child();
118 this.container.el.remove(fc);
121 var xmlstr = JsRender.NodeToGlade.mungeFile( file);
122 var builder = new Gtk.Builder.from_string (xmlstr, xmlstr.length);
123 var obj = (Gtk.Widget) builder.get_object("w"+ file.tree.oid.to_string());
124 this.container.el.append(obj);
130 var x = new JsRender.NodeToGtk((Project.Gtk) file.project, file.tree);
131 var obj = x.munge() as Gtk.Widget;
138 this.container.el.append(obj);
144 public void highlightNodeAtLine (int ln) {
146 // this is done from clicking on the editor..
151 var node = _this.file.lineToNode(ln+1);
154 //print("can not find node\n");
157 var prop = node.lineToProp(ln+1);
158 print("prop : %s", prop == null ? "???" : prop.name);
161 // ---------- this selects the tree's node...
163 var ltree = _this.main_window.windowstate.left_tree;
164 ltree.model.selectNode(node);
165 //var tp = ltree.model.treePathFromNode(node);
167 //print("got tree path %s\n", tp);
171 //_this.sourceview.allow_node_scroll = false; /// block node scrolling..
174 //print("changing cursor on tree..\n");
178 // let's try allowing editing on the methods.
179 // a little klunky at present..
180 _this.sourceview.prop_selected = "";
183 //see if we can find it..
184 var kv = prop.split(":");
187 //var k = prop.get_key(kv[1]);
188 // fixme -- need to determine if it's an editable property...
189 _this.sourceview.prop_selected = prop;
191 } else if (kv[0] == "l") {
192 _this.sourceview.prop_selected = prop;
197 //ltree.view.setCursor(tp, "editor");
198 // ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false);
199 _this.sourceview.nodeSelected(node,false);
201 // scrolling is disabled... as node selection calls scroll 10ms after it changes.
202 // GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {
203 // this.allow_node_scroll = true;
219 public void forwardSearch (bool change_focus) {
221 if (this.searchcontext == null) {
224 this.notebook.el.page = 1;
225 Gtk.TextIter beg, st,en;
226 bool has_wrapped_around;
227 var buf = this.sourceview.el.get_buffer();
228 buf.get_iter_at_offset(out beg, this.last_search_end);
229 if (!this.searchcontext.forward(beg, out st, out en, out has_wrapped_around)) {
230 this.last_search_end = 0;
233 this.last_search_end = en.get_offset();
235 this.sourceview.el.grab_focus();
237 buf.place_cursor(st);
241 this.sourceview.el.scroll_to_iter(st, 0.0f, true, 0.0f, 0.5f);
244 var ln = st.get_line();
246 this.highlightNodeAtLine(ln);
248 public void backSearch (bool change_focus) {
250 if (this.searchcontext == null) {
254 Gtk.TextIter beg, st,en;
255 bool has_wrapped_around;
256 this.buffer.el.get_iter_at_offset(out beg, this.last_search_end -1 );
258 if (!this.searchcontext.backward(beg, out st, out en, out has_wrapped_around)) {
260 this.last_search_end = 0;
263 this.last_search_end = en.get_offset();
265 this.sourceview.el.grab_focus();
267 this.buffer.el.place_cursor(st);
268 this.sourceview.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);
269 var ln = st.get_line();
270 this.highlightNodeAtLine(ln);
273 public int search (string in_txt) {
274 this.notebook.el.page = 1;
278 var s = new GtkSource.SearchSettings();
279 s.case_sensitive = _this.case_sensitive.el.active;
280 s.regex_enabled = _this.regex.el.active;
281 s.wrap_around = false;
283 this.searchcontext = new GtkSource.SearchContext(this.buffer.el,s);
284 this.searchcontext.set_highlight(true);
287 if (_this.multiline.el.active) {
288 txt = in_txt.replace("\\n", "\n");
291 s.set_search_text(txt);
292 Gtk.TextIter beg, st,en;
293 bool has_wrapped_around;
294 this.buffer.el.get_start_iter(out beg);
295 this.searchcontext.forward(beg, out st, out en, out has_wrapped_around);
296 this.last_search_end = 0;
298 return this.searchcontext.get_occurrences_count();
304 public void createThumb () {
307 if (this.file == null) {
310 // only screenshot the gtk preview..
311 if (this.notebook.el.page > 0 ) {
316 this.file.widgetToIcon(this.container.el);
325 // should we hold until it's printed...
331 public void updateErrorMarks (string category) {
335 var buf = _this.buffer.el;
338 buf.get_bounds (out start, out end);
340 buf.remove_source_marks (start, end, category);
342 GLib.debug("highlight errors");
344 // we should highlight other types of errors..
349 if (_this.file == null) {
350 GLib.debug("file is null?");
354 var ar = this.file.getErrors(category);
355 if (ar == null || ar.get_n_items() < 1) {
356 GLib.debug("higjlight %s has no errors", category);
364 var tlines = buf.get_line_count () +1;
368 for (var i = 0; i < ar.get_n_items();i++) {
369 var err = (Palete.CompileError) ar.get_item(i);
372 // print("get inter\n");
373 var eline = err.line + 1;
374 GLib.debug("GOT ERROR on line %d -- converted to %d ",
378 if (eline > tlines || eline < 0) {
383 buf.get_iter_at_line( out iter, eline);
386 var msg = "Line: %d %s : %s".printf(eline+1, err.category, err.msg);
387 buf.create_source_mark( msg, err.category, iter);
388 GLib.debug("set line %d to %s", eline, msg);
389 //this.marks.set(eline, msg);
398 public void scroll_to_line (int line) {
401 GLib.Timeout.add(100, () => {
404 this.notebook.el.set_current_page(1);
406 var buf = this.sourceview.el.get_buffer();
408 var sbuf = (GtkSource.Buffer) buf;
412 sbuf.get_iter_at_line(out iter, line);
413 this.sourceview.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);
419 public class Xcls_notebook : Object
421 public Gtk.Notebook el;
422 private Xcls_GtkView _this;
428 public Xcls_notebook(Xcls_GtkView _owner )
431 _this.notebook = this;
432 this.el = new Gtk.Notebook();
436 // set gobject values
437 this.el.overflow = Gtk.Overflow.VISIBLE;
438 new Xcls_label_preview( _this );
439 new Xcls_label_code( _this );
440 var child_3 = new Xcls_ScrolledWindow5( _this );
442 this.el.append_page ( child_3.el , _this.label_preview.el );
443 var child_4 = new Xcls_Box8( _this );
445 this.el.append_page ( child_4.el , _this.label_code.el );
448 // user defined functions
450 public class Xcls_label_preview : Object
453 private Xcls_GtkView _this;
459 public Xcls_label_preview(Xcls_GtkView _owner )
462 _this.label_preview = this;
463 this.el = new Gtk.Label( "Preview" );
467 // set gobject values
470 // user defined functions
473 public class Xcls_label_code : Object
476 private Xcls_GtkView _this;
482 public Xcls_label_code(Xcls_GtkView _owner )
485 _this.label_code = this;
486 this.el = new Gtk.Label( "Preview Generated Code" );
490 // set gobject values
493 // user defined functions
496 public class Xcls_ScrolledWindow5 : Object
498 public Gtk.ScrolledWindow el;
499 private Xcls_GtkView _this;
505 public Xcls_ScrolledWindow5(Xcls_GtkView _owner )
508 this.el = new Gtk.ScrolledWindow();
512 // set gobject values
513 new Xcls_view_layout( _this );
514 this.el.set_child ( _this.view_layout.el );
517 // user defined functions
519 public class Xcls_view_layout : Object
522 private Xcls_GtkView _this;
528 public Xcls_view_layout(Xcls_GtkView _owner )
531 _this.view_layout = this;
532 this.el = new Gtk.Fixed();
536 // set gobject values
537 this.el.name = "gtkview-view-layout";
538 new Xcls_container( _this );
539 this.el.put ( _this.container.el , 10,10 );
542 // user defined functions
544 public class Xcls_container : Object
547 private Xcls_GtkView _this;
553 public Xcls_container(Xcls_GtkView _owner )
556 _this.container = this;
557 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
561 // set gobject values
564 // user defined functions
569 public class Xcls_Box8 : Object
572 private Xcls_GtkView _this;
578 public Xcls_Box8(Xcls_GtkView _owner )
581 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
585 // set gobject values
586 new Xcls_sourceviewscroll( _this );
587 this.el.append( _this.sourceviewscroll.el );
588 var child_2 = new Xcls_Box13( _this );
590 this.el.append( child_2.el );
593 // user defined functions
595 public class Xcls_sourceviewscroll : Object
597 public Gtk.ScrolledWindow el;
598 private Xcls_GtkView _this;
604 public Xcls_sourceviewscroll(Xcls_GtkView _owner )
607 _this.sourceviewscroll = this;
608 this.el = new Gtk.ScrolledWindow();
612 // set gobject values
613 this.el.vexpand = true;
614 new Xcls_sourceview( _this );
615 this.el.set_child ( _this.sourceview.el );
618 // user defined functions
620 public class Xcls_sourceview : Object
622 public GtkSource.View el;
623 private Xcls_GtkView _this;
628 public bool zallow_node_scroll;
629 public string prop_selected;
630 public Gtk.CssProvider css;
631 public JsRender.Node? node_selected;
634 public Xcls_sourceview(Xcls_GtkView _owner )
637 _this.sourceview = this;
638 this.el = new GtkSource.View();
641 this.loading = false;
642 this.zallow_node_scroll = true;
643 this.prop_selected = "";
645 // set gobject values
646 this.el.name = "gtkview-view";
647 this.el.editable = false;
648 this.el.show_line_marks = true;
649 this.el.show_line_numbers = true;
650 this.el.tab_width = 4;
651 new Xcls_buffer( _this );
652 this.el.set_buffer ( _this.buffer.el );
653 var child_2 = new Xcls_EventControllerKey12( _this );
655 this.el.add_controller( child_2.el );
662 this.css = new Gtk.CssProvider();
664 this.css.load_from_string("#gtkview-view { font: 10px monospace ;}");
666 Gtk.StyleContext.add_provider_for_display(
667 this.el.get_display(),
669 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
677 var attrs = new GtkSource.MarkAttributes();
678 var pink = Gdk.RGBA();
679 pink.parse ( "pink");
680 attrs.set_background ( pink);
681 attrs.set_icon_name ( "process-stop");
682 attrs.query_tooltip_text.connect(( mark) => {
683 //print("tooltip query? %s\n", mark.name);
687 this.el.set_mark_attributes ("ERR", attrs, 1);
689 var wattrs = new GtkSource.MarkAttributes();
690 var blue = Gdk.RGBA();
691 blue.parse ( "#ABF4EB");
692 wattrs.set_background ( blue);
693 wattrs.set_icon_name ( "process-stop");
694 wattrs.query_tooltip_text.connect(( mark) => {
695 //print("tooltip query? %s\n", mark.name);
699 this.el.set_mark_attributes ("WARN", wattrs, 1);
703 var dattrs = new GtkSource.MarkAttributes();
704 var purple = Gdk.RGBA();
705 purple.parse ( "#EEA9FF");
706 dattrs.set_background ( purple);
707 dattrs.set_icon_name ( "process-stop");
708 dattrs.query_tooltip_text.connect(( mark) => {
709 //print("tooltip query? %s\n", mark.name);
713 this.el.set_mark_attributes ("DEPR", dattrs, 1);
716 var gattrs = new GtkSource.MarkAttributes();
717 var grey = Gdk.RGBA();
718 grey.parse ( "#ccc");
719 gattrs.set_background ( grey);
722 this.el.set_mark_attributes ("grey", gattrs, 1);
732 this.el.query_tooltip.connect( (x, y, keyboard_tooltip, tooltip) => {
734 //GLib.debug("query tooltip");
738 var yoff = (int) _this.sourceviewscroll.el.vadjustment.value;
740 this.el.get_iter_at_position (out iter, out trailing, x, y + yoff);
742 var l = iter.get_line();
743 // GLib.debug("query tooltip line %d", (int) l);
744 var marks = _this.buffer.el.get_source_marks_at_line(l, "ERR");
745 if (marks.is_empty()) {
746 marks = _this.buffer.el.get_source_marks_at_line(l, "WARN");
748 if (marks.is_empty()) {
749 marks = _this.buffer.el.get_source_marks_at_line(l, "DEPR");
752 // GLib.debug("query tooltip line marks %d", (int) marks.length());
754 marks.@foreach((m) => {
755 //GLib.debug("got mark %s", m.name);
756 str += (str.length > 0 ? "\n" : "") + m.name;
759 // true if there is a mark..
760 tooltip.set_text( str);
761 return str.length > 0 ? true : false;
766 // user defined functions
767 public void loadFile ( ) {
769 var buf = this.el.get_buffer();
771 var sbuf = (GtkSource.Buffer) buf;
772 var cpos = buf.cursor_position;
774 print("BEFORE LOAD cursor = %d\n", cpos);
775 var vadj_pos = this.el.get_vadjustment().get_value();
777 if (_this.file == null || _this.file.xtype != "Gtk") {
778 print("xtype != Gtk");
779 this.loading = false;
785 var regex = new Regex("\\.bjs$");
788 valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , ".vala");
789 } catch (GLib.RegexError e) {
790 this.loading = false;
795 if (!FileUtils.test(valafn,FileTest.IS_REGULAR) ) {
796 print("File path has no errors\n");
797 this.loading = false;
804 GLib.FileUtils.get_contents (valafn, out str);
806 this.loading = false;
810 // print("setting str %d\n", str.length);
811 buf.set_text(str, str.length);
812 var lm = GtkSource.LanguageManager.get_default();
814 //?? is javascript going to work as js?
816 ((GtkSource.Buffer)(buf)) .set_language(lm.get_language(_this.file.language));
819 _this.main_window.windowstate.updateErrorMarksAll();
820 // restore the cursor position?
821 // after reloading the contents.
822 GLib.Timeout.add(500, () => {
823 _this.buffer.in_cursor_change = true;
824 print("RESORTING cursor to = %d\n", cpos);
825 Gtk.TextIter cpos_iter;
826 buf.get_iter_at_offset(out cpos_iter, cpos);
827 buf.place_cursor(cpos_iter);
829 this.el.get_vadjustment().set_value(vadj_pos);;
830 _this.buffer.in_cursor_change = false;
834 //_this.buffer.checkSyntax();
839 this.loading = false;
841 public void nodeSelected (JsRender.Node? sel, bool scroll) {
847 // this is connected in widnowstate
848 print("Roo-view - node selected\n");
849 var buf = this.el.get_buffer();
851 var sbuf = (GtkSource.Buffer) buf;
857 // clear all the marks..
861 sbuf.get_bounds (out start, out end);
862 sbuf.remove_source_marks (start, end, "grey");
864 this.node_selected = sel;
870 sbuf.get_iter_at_line(out iter, sel.line_start);
873 Gtk.TextIter cur_iter;
874 sbuf.get_iter_at_offset(out cur_iter, sbuf.cursor_position);
877 if (!_this.buffer.in_cursor_change) {
879 this.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);
884 for (var i = 0; i < buf.get_line_count();i++) {
885 if (i < sel.line_start || i > sel.line_end) {
887 sbuf.get_iter_at_line(out iter, i);
888 sbuf.create_source_mark(null, "grey", iter);
896 public string toString () {
899 this.el.get_buffer().get_start_iter(out s);
900 this.el.get_buffer().get_end_iter(out e);
901 var ret = this.el.get_buffer().get_text(s,e,true);
902 //print("TO STRING? " + ret);
906 public class Xcls_buffer : Object
908 public GtkSource.Buffer el;
909 private Xcls_GtkView _this;
913 public int error_line;
914 public bool in_cursor_change;
916 public int last_line;
919 public Xcls_buffer(Xcls_GtkView _owner )
923 this.el = new GtkSource.Buffer( null );
926 this.error_line = -1;
927 this.in_cursor_change = false;
931 // set gobject values
934 this.el.cursor_moved.connect( ( ) => {
935 GLib.debug("cursor moved called");
938 if (this.in_cursor_change ) {
939 GLib.debug("cursor changed : %d [ignoring nested call)", this.el.cursor_position);
943 GLib.debug("cursor changed : %d", this.el.cursor_position);
945 this.el.get_iter_at_offset(out cpos, this.el.cursor_position);
947 var ln = cpos.get_line();
948 if (this.last_line == ln ){
952 var node = _this.file.lineToNode(ln);
955 print("can not find node\n");
958 this.in_cursor_change = true;
959 var ltree = _this.main_window.windowstate.left_tree;
960 ltree.model.selectNode(node);
961 this.in_cursor_change = false;
965 // user defined functions
968 public class Xcls_EventControllerKey12 : Object
970 public Gtk.EventControllerKey el;
971 private Xcls_GtkView _this;
977 public Xcls_EventControllerKey12(Xcls_GtkView _owner )
980 this.el = new Gtk.EventControllerKey();
984 // set gobject values
987 this.el.key_pressed.connect( (keyval, keycode, state) => {
991 if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
992 GLib.debug("SAVE: ctrl-g pressed");
993 _this.forwardSearch(true);
996 if (keyval == Gdk.Key.f && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
997 GLib.debug("SAVE: ctrl-f pressed");
998 _this.search_entry.el.grab_focus();
1006 // user defined functions
1011 public class Xcls_Box13 : Object
1014 private Xcls_GtkView _this;
1020 public Xcls_Box13(Xcls_GtkView _owner )
1023 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1027 // set gobject values
1028 this.el.homogeneous = false;
1029 this.el.vexpand = false;
1030 new Xcls_search_entry( _this );
1031 this.el.append( _this.search_entry.el );
1032 new Xcls_search_results( _this );
1033 this.el.append( _this.search_results.el );
1034 new Xcls_nextBtn( _this );
1035 this.el.append( _this.nextBtn.el );
1036 new Xcls_backBtn( _this );
1037 this.el.append( _this.backBtn.el );
1038 var child_5 = new Xcls_MenuButton19( _this );
1040 this.el.append( child_5.el );
1043 // user defined functions
1045 public class Xcls_search_entry : Object
1047 public Gtk.SearchEntry el;
1048 private Xcls_GtkView _this;
1052 public Gtk.CssProvider css;
1055 public Xcls_search_entry(Xcls_GtkView _owner )
1058 _this.search_entry = this;
1059 this.el = new Gtk.SearchEntry();
1063 // set gobject values
1064 this.el.name = "gtkview-search-entry";
1065 this.el.hexpand = true;
1066 this.el.placeholder_text = "Press enter to search";
1067 this.el.search_delay = 3;
1068 var child_1 = new Xcls_EventControllerKey15( _this );
1070 this.el.add_controller( child_1.el );
1074 this.css = new Gtk.CssProvider();
1076 this.css.load_from_string("
1077 #gtkview-search-entry { font: 10px monospace ;}"
1080 Gtk.StyleContext.add_provider_for_display(
1081 this.el.get_display(),
1083 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
1087 this.el.search_changed.connect( () => {
1089 _this.search(_this.search_entry.el.text);
1090 _this.search_results.updateResults();
1092 GLib.Timeout.add_seconds(1,() => {
1093 _this.search_results.updateResults();
1102 // user defined functions
1103 public void forwardSearch (bool change_focus) {
1106 _this.forwardSearch(change_focus);
1110 switch(_this.windowstate.state) {
1111 case WindowState.State.CODEONLY:
1112 //case WindowState.State.CODE:
1113 // search the code being edited..
1114 _this.windowstate.code_editor_tab.forwardSearch(change_focus);
1117 case WindowState.State.PREVIEW:
1118 if (_this.windowstate.file.xtype == "Gtk") {
1119 _this.windowstate.window_gladeview.forwardSearch(change_focus);
1121 _this.windowstate.window_rooview.forwardSearch(change_focus);
1130 public class Xcls_EventControllerKey15 : Object
1132 public Gtk.EventControllerKey el;
1133 private Xcls_GtkView _this;
1139 public Xcls_EventControllerKey15(Xcls_GtkView _owner )
1142 this.el = new Gtk.EventControllerKey();
1146 // set gobject values
1149 this.el.key_pressed.connect( (keyval, keycode, state) => {
1151 if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
1152 GLib.debug("SAVE: ctrl-g pressed");
1153 _this.forwardSearch(true);
1158 if (keyval == Gdk.Key.Return && _this.search_entry.el.text.length > 0) {
1159 _this.forwardSearch(true);
1165 // print(event.key.keyval)
1171 // user defined functions
1175 public class Xcls_search_results : Object
1177 public Gtk.Label el;
1178 private Xcls_GtkView _this;
1184 public Xcls_search_results(Xcls_GtkView _owner )
1187 _this.search_results = this;
1188 this.el = new Gtk.Label( "No Results" );
1192 // set gobject values
1193 this.el.margin_end = 4;
1194 this.el.margin_start = 4;
1197 // user defined functions
1198 public void updateResults () {
1199 this.el.visible = true;
1201 var res = _this.searchcontext.get_occurrences_count();
1203 _this.search_results.el.label = "??? Matches";
1207 _this.nextBtn.el.sensitive = false;
1208 _this.backBtn.el.sensitive = false;
1211 _this.search_results.el.label = "%d Matches".printf(res);
1212 _this.nextBtn.el.sensitive = true;
1213 _this.backBtn.el.sensitive = true;
1216 _this.search_results.el.label = "No Matches";
1221 public class Xcls_nextBtn : Object
1223 public Gtk.Button el;
1224 private Xcls_GtkView _this;
1228 public bool always_show_image;
1231 public Xcls_nextBtn(Xcls_GtkView _owner )
1234 _this.nextBtn = this;
1235 this.el = new Gtk.Button();
1238 this.always_show_image = true;
1240 // set gobject values
1241 this.el.icon_name = "go-down";
1242 this.el.sensitive = false;
1245 this.el.clicked.connect( ( ) => {
1246 _this.forwardSearch(true);
1252 // user defined functions
1255 public class Xcls_backBtn : Object
1257 public Gtk.Button el;
1258 private Xcls_GtkView _this;
1262 public bool always_show_image;
1265 public Xcls_backBtn(Xcls_GtkView _owner )
1268 _this.backBtn = this;
1269 this.el = new Gtk.Button();
1272 this.always_show_image = true;
1274 // set gobject values
1275 this.el.icon_name = "go-up";
1276 this.el.sensitive = false;
1279 this.el.clicked.connect( ( ) => {
1281 _this.backSearch(true);
1286 // user defined functions
1289 public class Xcls_MenuButton19 : Object
1291 public Gtk.MenuButton el;
1292 private Xcls_GtkView _this;
1296 public bool always_show_image;
1299 public Xcls_MenuButton19(Xcls_GtkView _owner )
1302 this.el = new Gtk.MenuButton();
1305 this.always_show_image = true;
1307 // set gobject values
1308 this.el.icon_name = "emblem-system";
1309 this.el.always_show_arrow = true;
1310 new Xcls_search_settings( _this );
1311 this.el.popover = _this.search_settings.el;
1314 // user defined functions
1316 public class Xcls_search_settings : Object
1318 public Gtk.PopoverMenu el;
1319 private Xcls_GtkView _this;
1325 public Xcls_search_settings(Xcls_GtkView _owner )
1328 _this.search_settings = this;
1329 this.el = new Gtk.PopoverMenu.from_model(null);
1333 // set gobject values
1334 var child_1 = new Xcls_Box21( _this );
1336 this.el.set_child ( child_1.el );
1339 // user defined functions
1341 public class Xcls_Box21 : Object
1344 private Xcls_GtkView _this;
1350 public Xcls_Box21(Xcls_GtkView _owner )
1353 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1357 // set gobject values
1358 new Xcls_case_sensitive( _this );
1359 this.el.append( _this.case_sensitive.el );
1360 new Xcls_regex( _this );
1361 this.el.append( _this.regex.el );
1362 new Xcls_multiline( _this );
1363 this.el.append( _this.multiline.el );
1366 // user defined functions
1368 public class Xcls_case_sensitive : Object
1370 public Gtk.CheckButton el;
1371 private Xcls_GtkView _this;
1377 public Xcls_case_sensitive(Xcls_GtkView _owner )
1380 _this.case_sensitive = this;
1381 this.el = new Gtk.CheckButton();
1385 // set gobject values
1386 this.el.label = "Case Sensitive";
1389 // user defined functions
1392 public class Xcls_regex : Object
1394 public Gtk.CheckButton el;
1395 private Xcls_GtkView _this;
1401 public Xcls_regex(Xcls_GtkView _owner )
1405 this.el = new Gtk.CheckButton();
1409 // set gobject values
1410 this.el.label = "Regex";
1413 // user defined functions
1416 public class Xcls_multiline : Object
1418 public Gtk.CheckButton el;
1419 private Xcls_GtkView _this;
1425 public Xcls_multiline(Xcls_GtkView _owner )
1428 _this.multiline = this;
1429 this.el = new Gtk.CheckButton();
1433 // set gobject values
1434 this.el.label = "Multi-line (add \\n)";
1437 // user defined functions