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_error_counter;
38 public int last_search_end;
39 public JsRender.JsRender file;
45 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
49 this.last_error_counter = 0;
50 this.last_search_end = 0;
54 this.el.hexpand = true;
55 this.el.vexpand = true;
56 new Xcls_notebook( _this );
57 this.el.append( _this.notebook.el );
63 this.css = new Gtk.CssProvider();
65 this.css.load_from_string(
66 "#gtkview-view-layout { background-color: #ccc; }"
69 Gtk.StyleContext.add_provider_for_display(
70 this.el.get_display(),
72 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
79 // user defined functions
80 public void loadFile (JsRender.JsRender file)
84 if (file.tree == null) {
87 this.last_error_counter = -1;
88 this.notebook.el.page = 0;// gtk preview
93 this.sourceview.loadFile();
95 this.searchcontext = null;
96 this.last_error_counter = -1;
97 this.updateErrorMarks();
98 if (this.lastObj != null) {
99 this.container.el.remove(this.lastObj);
102 // hide the compile view at present..
105 var w = this.el.get_width();
106 var h = this.el.get_height();
108 print("ALLOC SET SIZES %d, %d\n", w,h);
110 // set the container size min to 500/500 or 20 px less than max..
111 w = int.max (w-20, 500);
112 h = int.max (h-20, 500);
114 print("SET SIZES %d, %d\n", w,h);
115 _this.container.el.set_size_request(w,h);
117 _this.view_layout.el.set_size_request(w,h);
118 // should be baded on calc.. -- see update_scrolled.
120 var fc = this.container.el.get_first_child();
122 this.container.el.remove(fc);
125 var xmlstr = JsRender.NodeToGlade.mungeFile( file);
126 var builder = new Gtk.Builder.from_string (xmlstr, xmlstr.length);
127 var obj = (Gtk.Widget) builder.get_object("w"+ file.tree.oid.to_string());
128 this.container.el.append(obj);
136 public void highlightNodeAtLine (int ln) {
138 // this is done from clicking on the editor..
143 var node = _this.file.lineToNode(ln+1);
146 //print("can not find node\n");
149 var prop = node.lineToProp(ln+1);
150 print("prop : %s", prop == null ? "???" : prop.name);
153 // ---------- this selects the tree's node...
155 var ltree = _this.main_window.windowstate.left_tree;
156 ltree.model.selectNode(node);
157 //var tp = ltree.model.treePathFromNode(node);
159 //print("got tree path %s\n", tp);
163 //_this.sourceview.allow_node_scroll = false; /// block node scrolling..
166 //print("changing cursor on tree..\n");
170 // let's try allowing editing on the methods.
171 // a little klunky at present..
172 _this.sourceview.prop_selected = "";
175 //see if we can find it..
176 var kv = prop.split(":");
179 //var k = prop.get_key(kv[1]);
180 // fixme -- need to determine if it's an editable property...
181 _this.sourceview.prop_selected = prop;
183 } else if (kv[0] == "l") {
184 _this.sourceview.prop_selected = prop;
189 //ltree.view.setCursor(tp, "editor");
190 // ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false);
191 _this.sourceview.nodeSelected(node,false);
193 // scrolling is disabled... as node selection calls scroll 10ms after it changes.
194 // GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {
195 // this.allow_node_scroll = true;
211 public void forwardSearch (bool change_focus) {
213 if (this.searchcontext == null) {
216 this.notebook.el.page = 1;
217 Gtk.TextIter beg, st,en;
218 bool has_wrapped_around;
219 var buf = this.sourceview.el.get_buffer();
220 buf.get_iter_at_offset(out beg, this.last_search_end);
221 if (!this.searchcontext.forward(beg, out st, out en, out has_wrapped_around)) {
222 this.last_search_end = 0;
225 this.last_search_end = en.get_offset();
227 this.sourceview.el.grab_focus();
229 buf.place_cursor(st);
233 this.sourceview.el.scroll_to_iter(st, 0.0f, true, 0.0f, 0.5f);
236 var ln = st.get_line();
238 this.highlightNodeAtLine(ln);
240 public void backSearch (bool change_focus) {
242 if (this.searchcontext == null) {
246 Gtk.TextIter beg, st,en;
247 bool has_wrapped_around;
248 this.buffer.el.get_iter_at_offset(out beg, this.last_search_end -1 );
250 if (!this.searchcontext.backward(beg, out st, out en, out has_wrapped_around)) {
252 this.last_search_end = 0;
255 this.last_search_end = en.get_offset();
257 this.sourceview.el.grab_focus();
259 this.buffer.el.place_cursor(st);
260 this.sourceview.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);
261 var ln = st.get_line();
262 this.highlightNodeAtLine(ln);
265 public int search (string in_txt) {
266 this.notebook.el.page = 1;
270 var s = new GtkSource.SearchSettings();
271 s.case_sensitive = _this.case_sensitive.el.active;
272 s.regex_enabled = _this.regex.el.active;
273 s.wrap_around = false;
275 this.searchcontext = new GtkSource.SearchContext(this.buffer.el,s);
276 this.searchcontext.set_highlight(true);
279 if (_this.multiline.el.active) {
280 txt = in_txt.replace("\\n", "\n");
283 s.set_search_text(txt);
284 Gtk.TextIter beg, st,en;
285 bool has_wrapped_around;
286 this.buffer.el.get_start_iter(out beg);
287 this.searchcontext.forward(beg, out st, out en, out has_wrapped_around);
288 this.last_search_end = 0;
290 return this.searchcontext.get_occurrences_count();
296 public void createThumb () {
299 if (this.file == null) {
302 // only screenshot the gtk preview..
303 if (this.notebook.el.page > 0 ) {
308 this.file.widgetToIcon(this.container.el);
317 // should we hold until it's printed...
323 public void updateErrorMarks () {
327 var buf = _this.buffer.el;
330 buf.get_bounds (out start, out end);
334 GLib.debug("highlight errors");
336 // we should highlight other types of errors..
341 if (_this.file == null) {
342 GLib.debug("file is null?");
346 var ar = this.file.getErrors();
348 buf.remove_source_marks (start, end, null);
349 this.last_error_counter = file.error_counter ;
350 GLib.debug("higjlight has no errors");
353 if (this.last_error_counter == file.error_counter) {
361 var tlines = buf.get_line_count () +1;
365 buf.remove_source_marks (start, end, null);
366 foreach(var diag in ar) {
370 // print("get inter\n");
371 var eline = (int)diag.range.start.line ;
373 if (eline > tlines || eline < 0) {
378 buf.get_iter_at_line( out iter, eline);
382 var msg = "Line: %d %s : %s".printf(eline+1, diag.category, diag.message);
383 buf.create_source_mark( msg, diag.category, iter);
384 GLib.debug("set line %d to %s", eline, msg);
385 //this.marks.set(eline, msg);
387 this.last_error_counter = file.error_counter ;
394 public void scroll_to_line (int line) {
397 GLib.Timeout.add(100, () => {
400 this.notebook.el.set_current_page(1);
402 var buf = this.sourceview.el.get_buffer();
404 var sbuf = (GtkSource.Buffer) buf;
408 sbuf.get_iter_at_line(out iter, line);
409 this.sourceview.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);
415 public class Xcls_notebook : Object
417 public Gtk.Notebook el;
418 private Xcls_GtkView _this;
424 public Xcls_notebook(Xcls_GtkView _owner )
427 _this.notebook = this;
428 this.el = new Gtk.Notebook();
432 // set gobject values
433 this.el.overflow = Gtk.Overflow.VISIBLE;
434 new Xcls_label_preview( _this );
435 new Xcls_label_code( _this );
436 var child_3 = new Xcls_ScrolledWindow5( _this );
438 this.el.append_page ( child_3.el , _this.label_preview.el );
439 var child_4 = new Xcls_Box8( _this );
441 this.el.append_page ( child_4.el , _this.label_code.el );
444 // user defined functions
446 public class Xcls_label_preview : Object
449 private Xcls_GtkView _this;
455 public Xcls_label_preview(Xcls_GtkView _owner )
458 _this.label_preview = this;
459 this.el = new Gtk.Label( "Preview" );
463 // set gobject values
466 // user defined functions
469 public class Xcls_label_code : Object
472 private Xcls_GtkView _this;
478 public Xcls_label_code(Xcls_GtkView _owner )
481 _this.label_code = this;
482 this.el = new Gtk.Label( "Preview Generated Code" );
486 // set gobject values
489 // user defined functions
492 public class Xcls_ScrolledWindow5 : Object
494 public Gtk.ScrolledWindow el;
495 private Xcls_GtkView _this;
501 public Xcls_ScrolledWindow5(Xcls_GtkView _owner )
504 this.el = new Gtk.ScrolledWindow();
508 // set gobject values
509 new Xcls_view_layout( _this );
510 this.el.set_child ( _this.view_layout.el );
513 // user defined functions
515 public class Xcls_view_layout : Object
518 private Xcls_GtkView _this;
524 public Xcls_view_layout(Xcls_GtkView _owner )
527 _this.view_layout = this;
528 this.el = new Gtk.Fixed();
532 // set gobject values
533 this.el.name = "gtkview-view-layout";
534 new Xcls_container( _this );
535 this.el.put ( _this.container.el , 10,10 );
538 // user defined functions
540 public class Xcls_container : Object
543 private Xcls_GtkView _this;
549 public Xcls_container(Xcls_GtkView _owner )
552 _this.container = this;
553 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
557 // set gobject values
560 // user defined functions
565 public class Xcls_Box8 : Object
568 private Xcls_GtkView _this;
574 public Xcls_Box8(Xcls_GtkView _owner )
577 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
581 // set gobject values
582 new Xcls_sourceviewscroll( _this );
583 this.el.append( _this.sourceviewscroll.el );
584 var child_2 = new Xcls_Box13( _this );
586 this.el.append( child_2.el );
589 // user defined functions
591 public class Xcls_sourceviewscroll : Object
593 public Gtk.ScrolledWindow el;
594 private Xcls_GtkView _this;
600 public Xcls_sourceviewscroll(Xcls_GtkView _owner )
603 _this.sourceviewscroll = this;
604 this.el = new Gtk.ScrolledWindow();
608 // set gobject values
609 this.el.vexpand = true;
610 new Xcls_sourceview( _this );
611 this.el.set_child ( _this.sourceview.el );
614 // user defined functions
616 public class Xcls_sourceview : Object
618 public GtkSource.View el;
619 private Xcls_GtkView _this;
624 public bool zallow_node_scroll;
625 public string prop_selected;
626 public Gtk.CssProvider css;
627 public JsRender.Node? node_selected;
630 public Xcls_sourceview(Xcls_GtkView _owner )
633 _this.sourceview = this;
634 this.el = new GtkSource.View();
637 this.loading = false;
638 this.zallow_node_scroll = true;
639 this.prop_selected = "";
641 // set gobject values
642 this.el.name = "gtkview-view";
643 this.el.editable = false;
644 this.el.show_line_marks = true;
645 this.el.show_line_numbers = true;
646 this.el.tab_width = 4;
647 new Xcls_buffer( _this );
648 this.el.set_buffer ( _this.buffer.el );
649 var child_2 = new Xcls_EventControllerKey12( _this );
651 this.el.add_controller( child_2.el );
658 this.css = new Gtk.CssProvider();
660 this.css.load_from_string("#gtkview-view { font: 10px monospace ;}");
662 Gtk.StyleContext.add_provider_for_display(
663 this.el.get_display(),
665 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
673 var attrs = new GtkSource.MarkAttributes();
674 var pink = Gdk.RGBA();
675 pink.parse ( "pink");
676 attrs.set_background ( pink);
677 attrs.set_icon_name ( "process-stop");
678 attrs.query_tooltip_text.connect(( mark) => {
679 //print("tooltip query? %s\n", mark.name);
683 this.el.set_mark_attributes ("ERR", attrs, 1);
685 var wattrs = new GtkSource.MarkAttributes();
686 var blue = Gdk.RGBA();
687 blue.parse ( "#ABF4EB");
688 wattrs.set_background ( blue);
689 wattrs.set_icon_name ( "process-stop");
690 wattrs.query_tooltip_text.connect(( mark) => {
691 //print("tooltip query? %s\n", mark.name);
695 this.el.set_mark_attributes ("WARN", wattrs, 1);
699 var dattrs = new GtkSource.MarkAttributes();
700 var purple = Gdk.RGBA();
701 purple.parse ( "#EEA9FF");
702 dattrs.set_background ( purple);
703 dattrs.set_icon_name ( "process-stop");
704 dattrs.query_tooltip_text.connect(( mark) => {
705 //print("tooltip query? %s\n", mark.name);
709 this.el.set_mark_attributes ("DEPR", dattrs, 1);
712 var gattrs = new GtkSource.MarkAttributes();
713 var grey = Gdk.RGBA();
714 grey.parse ( "#ccc");
715 gattrs.set_background ( grey);
718 this.el.set_mark_attributes ("grey", gattrs, 1);
728 this.el.query_tooltip.connect( (x, y, keyboard_tooltip, tooltip) => {
730 //GLib.debug("query tooltip");
734 var yoff = (int) _this.sourceviewscroll.el.vadjustment.value;
736 this.el.get_iter_at_position (out iter, out trailing, x, y + yoff);
738 var l = iter.get_line();
739 // GLib.debug("query tooltip line %d", (int) l);
740 var marks = _this.buffer.el.get_source_marks_at_line(l, "ERR");
741 if (marks.is_empty()) {
742 marks = _this.buffer.el.get_source_marks_at_line(l, "WARN");
744 if (marks.is_empty()) {
745 marks = _this.buffer.el.get_source_marks_at_line(l, "DEPR");
748 // GLib.debug("query tooltip line marks %d", (int) marks.length());
750 marks.@foreach((m) => {
751 //GLib.debug("got mark %s", m.name);
752 str += (str.length > 0 ? "\n" : "") + m.name;
755 // true if there is a mark..
756 tooltip.set_text( str);
757 return str.length > 0 ? true : false;
762 // user defined functions
763 public void loadFile ( ) {
765 var buf = this.el.get_buffer();
767 var sbuf = (GtkSource.Buffer) buf;
768 var cpos = buf.cursor_position;
770 print("BEFORE LOAD cursor = %d\n", cpos);
771 var vadj_pos = this.el.get_vadjustment().get_value();
773 if (_this.file == null || _this.file.xtype != "Gtk") {
774 print("xtype != Gtk");
775 this.loading = false;
781 var regex = new Regex("\\.bjs$");
784 valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , ".vala");
785 } catch (GLib.RegexError e) {
786 this.loading = false;
791 if (!FileUtils.test(valafn,FileTest.IS_REGULAR) ) {
792 print("File path has no errors\n");
793 this.loading = false;
800 GLib.FileUtils.get_contents (valafn, out str);
802 this.loading = false;
806 var str = _this.file.toSource();
808 // print("setting str %d\n", str.length);
809 buf.set_text(str, str.length);
810 var lm = GtkSource.LanguageManager.get_default();
812 //?? is javascript going to work as js?
814 ((GtkSource.Buffer)(buf)) .set_language(lm.get_language(_this.file.language));
817 _this.main_window.windowstate.updateErrorMarksAll();
818 // restore the cursor position?
819 // after reloading the contents.
820 GLib.Timeout.add(500, () => {
821 _this.buffer.in_cursor_change = true;
822 print("RESORTING cursor to = %d\n", cpos);
823 Gtk.TextIter cpos_iter;
824 buf.get_iter_at_offset(out cpos_iter, cpos);
825 buf.place_cursor(cpos_iter);
827 this.el.get_vadjustment().set_value(vadj_pos);;
828 _this.buffer.in_cursor_change = false;
832 //_this.buffer.checkSyntax();
837 this.loading = false;
839 public void nodeSelected (JsRender.Node? sel, bool scroll) {
845 // this is connected in widnowstate
846 print("Roo-view - node selected\n");
847 var buf = this.el.get_buffer();
849 var sbuf = (GtkSource.Buffer) buf;
855 // clear all the marks..
859 sbuf.get_bounds (out start, out end);
860 sbuf.remove_source_marks (start, end, "grey");
862 this.node_selected = sel;
868 sbuf.get_iter_at_line(out iter, sel.line_start);
871 Gtk.TextIter cur_iter;
872 sbuf.get_iter_at_offset(out cur_iter, sbuf.cursor_position);
875 if (!_this.buffer.in_cursor_change) {
877 this.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);
882 for (var i = 0; i < buf.get_line_count();i++) {
883 if (i < sel.line_start || i > sel.line_end) {
885 sbuf.get_iter_at_line(out iter, i);
886 sbuf.create_source_mark(null, "grey", iter);
894 public string toString () {
897 this.el.get_buffer().get_start_iter(out s);
898 this.el.get_buffer().get_end_iter(out e);
899 var ret = this.el.get_buffer().get_text(s,e,true);
900 //print("TO STRING? " + ret);
904 public class Xcls_buffer : Object
906 public GtkSource.Buffer el;
907 private Xcls_GtkView _this;
911 public int error_line;
912 public bool in_cursor_change;
914 public int last_line;
917 public Xcls_buffer(Xcls_GtkView _owner )
921 this.el = new GtkSource.Buffer( null );
924 this.error_line = -1;
925 this.in_cursor_change = false;
929 // set gobject values
932 this.el.cursor_moved.connect( ( ) => {
933 GLib.debug("cursor moved called");
936 if (this.in_cursor_change ) {
937 GLib.debug("cursor changed : %d [ignoring nested call)", this.el.cursor_position);
941 GLib.debug("cursor changed : %d", this.el.cursor_position);
943 this.el.get_iter_at_offset(out cpos, this.el.cursor_position);
945 var ln = cpos.get_line();
946 if (this.last_line == ln ){
950 var node = _this.file.lineToNode(ln);
953 print("can not find node\n");
956 this.in_cursor_change = true;
957 var ltree = _this.main_window.windowstate.left_tree;
958 ltree.model.selectNode(node);
959 this.in_cursor_change = false;
963 // user defined functions
966 public class Xcls_EventControllerKey12 : Object
968 public Gtk.EventControllerKey el;
969 private Xcls_GtkView _this;
975 public Xcls_EventControllerKey12(Xcls_GtkView _owner )
978 this.el = new Gtk.EventControllerKey();
982 // set gobject values
985 this.el.key_pressed.connect( (keyval, keycode, state) => {
989 if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
990 GLib.debug("SAVE: ctrl-g pressed");
991 _this.forwardSearch(true);
994 if (keyval == Gdk.Key.f && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
995 GLib.debug("SAVE: ctrl-f pressed");
996 _this.search_entry.el.grab_focus();
1004 // user defined functions
1009 public class Xcls_Box13 : Object
1012 private Xcls_GtkView _this;
1018 public Xcls_Box13(Xcls_GtkView _owner )
1021 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1025 // set gobject values
1026 this.el.homogeneous = false;
1027 this.el.vexpand = false;
1028 new Xcls_search_entry( _this );
1029 this.el.append( _this.search_entry.el );
1030 new Xcls_search_results( _this );
1031 this.el.append( _this.search_results.el );
1032 new Xcls_nextBtn( _this );
1033 this.el.append( _this.nextBtn.el );
1034 new Xcls_backBtn( _this );
1035 this.el.append( _this.backBtn.el );
1036 var child_5 = new Xcls_MenuButton19( _this );
1038 this.el.append( child_5.el );
1041 // user defined functions
1043 public class Xcls_search_entry : Object
1045 public Gtk.SearchEntry el;
1046 private Xcls_GtkView _this;
1050 public Gtk.CssProvider css;
1053 public Xcls_search_entry(Xcls_GtkView _owner )
1056 _this.search_entry = this;
1057 this.el = new Gtk.SearchEntry();
1061 // set gobject values
1062 this.el.name = "gtkview-search-entry";
1063 this.el.hexpand = true;
1064 this.el.placeholder_text = "Press enter to search";
1065 this.el.search_delay = 3;
1066 var child_1 = new Xcls_EventControllerKey15( _this );
1068 this.el.add_controller( child_1.el );
1072 this.css = new Gtk.CssProvider();
1074 this.css.load_from_string("
1075 #gtkview-search-entry { font: 10px monospace ;}"
1078 Gtk.StyleContext.add_provider_for_display(
1079 this.el.get_display(),
1081 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
1085 this.el.search_changed.connect( () => {
1087 _this.search(_this.search_entry.el.text);
1088 _this.search_results.updateResults();
1090 GLib.Timeout.add_seconds(1,() => {
1091 _this.search_results.updateResults();
1100 // user defined functions
1101 public void forwardSearch (bool change_focus) {
1104 _this.forwardSearch(change_focus);
1108 switch(_this.windowstate.state) {
1109 case WindowState.State.CODEONLY:
1110 //case WindowState.State.CODE:
1111 // search the code being edited..
1112 _this.windowstate.code_editor_tab.forwardSearch(change_focus);
1115 case WindowState.State.PREVIEW:
1116 if (_this.windowstate.file.xtype == "Gtk") {
1117 _this.windowstate.window_gladeview.forwardSearch(change_focus);
1119 _this.windowstate.window_rooview.forwardSearch(change_focus);
1128 public class Xcls_EventControllerKey15 : Object
1130 public Gtk.EventControllerKey el;
1131 private Xcls_GtkView _this;
1137 public Xcls_EventControllerKey15(Xcls_GtkView _owner )
1140 this.el = new Gtk.EventControllerKey();
1144 // set gobject values
1147 this.el.key_pressed.connect( (keyval, keycode, state) => {
1149 if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
1150 GLib.debug("SAVE: ctrl-g pressed");
1151 _this.forwardSearch(true);
1156 if (keyval == Gdk.Key.Return && _this.search_entry.el.text.length > 0) {
1157 _this.forwardSearch(true);
1163 // print(event.key.keyval)
1169 // user defined functions
1173 public class Xcls_search_results : Object
1175 public Gtk.Label el;
1176 private Xcls_GtkView _this;
1182 public Xcls_search_results(Xcls_GtkView _owner )
1185 _this.search_results = this;
1186 this.el = new Gtk.Label( "No Results" );
1190 // set gobject values
1191 this.el.margin_end = 4;
1192 this.el.margin_start = 4;
1195 // user defined functions
1196 public void updateResults () {
1197 this.el.visible = true;
1199 var res = _this.searchcontext.get_occurrences_count();
1201 _this.search_results.el.label = "??? Matches";
1205 _this.nextBtn.el.sensitive = false;
1206 _this.backBtn.el.sensitive = false;
1209 _this.search_results.el.label = "%d Matches".printf(res);
1210 _this.nextBtn.el.sensitive = true;
1211 _this.backBtn.el.sensitive = true;
1214 _this.search_results.el.label = "No Matches";
1219 public class Xcls_nextBtn : Object
1221 public Gtk.Button el;
1222 private Xcls_GtkView _this;
1226 public bool always_show_image;
1229 public Xcls_nextBtn(Xcls_GtkView _owner )
1232 _this.nextBtn = this;
1233 this.el = new Gtk.Button();
1236 this.always_show_image = true;
1238 // set gobject values
1239 this.el.icon_name = "go-down";
1240 this.el.sensitive = false;
1243 this.el.clicked.connect( ( ) => {
1244 _this.forwardSearch(true);
1250 // user defined functions
1253 public class Xcls_backBtn : Object
1255 public Gtk.Button el;
1256 private Xcls_GtkView _this;
1260 public bool always_show_image;
1263 public Xcls_backBtn(Xcls_GtkView _owner )
1266 _this.backBtn = this;
1267 this.el = new Gtk.Button();
1270 this.always_show_image = true;
1272 // set gobject values
1273 this.el.icon_name = "go-up";
1274 this.el.sensitive = false;
1277 this.el.clicked.connect( ( ) => {
1279 _this.backSearch(true);
1284 // user defined functions
1287 public class Xcls_MenuButton19 : Object
1289 public Gtk.MenuButton el;
1290 private Xcls_GtkView _this;
1294 public bool always_show_image;
1297 public Xcls_MenuButton19(Xcls_GtkView _owner )
1300 this.el = new Gtk.MenuButton();
1303 this.always_show_image = true;
1305 // set gobject values
1306 this.el.icon_name = "emblem-system";
1307 this.el.always_show_arrow = true;
1308 new Xcls_search_settings( _this );
1309 this.el.popover = _this.search_settings.el;
1312 // user defined functions
1314 public class Xcls_search_settings : Object
1316 public Gtk.PopoverMenu el;
1317 private Xcls_GtkView _this;
1323 public Xcls_search_settings(Xcls_GtkView _owner )
1326 _this.search_settings = this;
1327 this.el = new Gtk.PopoverMenu.from_model(null);
1331 // set gobject values
1332 var child_1 = new Xcls_Box21( _this );
1334 this.el.set_child ( child_1.el );
1337 // user defined functions
1339 public class Xcls_Box21 : Object
1342 private Xcls_GtkView _this;
1348 public Xcls_Box21(Xcls_GtkView _owner )
1351 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1355 // set gobject values
1356 new Xcls_case_sensitive( _this );
1357 this.el.append( _this.case_sensitive.el );
1358 new Xcls_regex( _this );
1359 this.el.append( _this.regex.el );
1360 new Xcls_multiline( _this );
1361 this.el.append( _this.multiline.el );
1364 // user defined functions
1366 public class Xcls_case_sensitive : Object
1368 public Gtk.CheckButton el;
1369 private Xcls_GtkView _this;
1375 public Xcls_case_sensitive(Xcls_GtkView _owner )
1378 _this.case_sensitive = this;
1379 this.el = new Gtk.CheckButton();
1383 // set gobject values
1384 this.el.label = "Case Sensitive";
1387 // user defined functions
1390 public class Xcls_regex : Object
1392 public Gtk.CheckButton el;
1393 private Xcls_GtkView _this;
1399 public Xcls_regex(Xcls_GtkView _owner )
1403 this.el = new Gtk.CheckButton();
1407 // set gobject values
1408 this.el.label = "Regex";
1411 // user defined functions
1414 public class Xcls_multiline : Object
1416 public Gtk.CheckButton el;
1417 private Xcls_GtkView _this;
1423 public Xcls_multiline(Xcls_GtkView _owner )
1426 _this.multiline = this;
1427 this.el = new Gtk.CheckButton();
1431 // set gobject values
1432 this.el.label = "Multi-line (add \\n)";
1435 // user defined functions