src/Builder4/WindowRooView.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 3 Jun 2015 04:01:10 +0000 (12:01 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 3 Jun 2015 04:01:10 +0000 (12:01 +0800)
src/Builder4/WindowRooView.vala

src/Builder4/WindowRooView.bjs
src/Builder4/WindowRooView.vala

index 9347520..07ca48e 100644 (file)
@@ -25,7 +25,7 @@
    "$ xns" : "Gtk",
    "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
    "# Xcls_MainWindow main_window" : "",
-   "| void forwardSearch" : "() {\n\n\tif (this.searchcontext == null) {\n\t\treturn;\n\t}\n\tthis.notebook.el.page = 1;\n\tGtk.TextIter beg, st,en, stl;\n\t\n\tvar buf = this.sourceview.el.get_buffer();\n\tbuf.get_iter_at_offset(out beg, this.last_search_end);\n\tif (!this.searchcontext.forward(beg, out st, out en)) {\n\t\tthis.last_search_end = 0;\n\t} else { \n\t\tthis.last_search_end = en.get_offset();\n\t\n\t\tthis.sourceview.el.grab_focus();\n\t \n\t\tbuf.place_cursor(st);\n\t\tvar ln = st.get_line();\n\t\tbuf.get_iter_at_line(out stl,ln);\n\t\t \n\t\tthis.sourceview.el.scroll_to_iter(stl,  0.0f, true, 0.0f, 0.5f);\n\t}\n\n}\n",
+   "| void forwardSearch" : "(bool change_focus) {\n\n\tif (this.searchcontext == null) {\n\t\treturn;\n\t}\n\tthis.notebook.el.page = 1;\n\tGtk.TextIter beg, st,en, stl;\n\t\n\tvar buf = this.sourceview.el.get_buffer();\n\tbuf.get_iter_at_offset(out beg, this.last_search_end);\n\tif (!this.searchcontext.forward(beg, out st, out en)) {\n\t\tthis.last_search_end = 0;\n\t} else { \n\t\tthis.last_search_end = en.get_offset();\n\t\tif (change_focus) {\n\t\t\tthis.sourceview.el.grab_focus();\n\t\t}\n\t\tbuf.place_cursor(st);\n\t\tvar ln = st.get_line();\n\t\tbuf.get_iter_at_line(out stl,ln);\n\t\t \n\t\tthis.sourceview.el.scroll_to_iter(stl,  0.0f, true, 0.0f, 0.5f);\n\t}\n\n}\n",
    "items" : [
     {
      "id" : "notebook",
index 1f1fe56..0b50b8f 100644 (file)
@@ -125,7 +125,7 @@ public class Xcls_WindowRooView : Object
     public void requestRedraw () {
         this.view.renderJS(false);
     }
-    public void forwardSearch () {
+    public void forwardSearch (bool change_focus) {
     
        if (this.searchcontext == null) {
                return;
@@ -139,9 +139,9 @@ public class Xcls_WindowRooView : Object
                this.last_search_end = 0;
        } else { 
                this.last_search_end = en.get_offset();
-       
-               this.sourceview.el.grab_focus();
-        
+               if (change_focus) {
+                       this.sourceview.el.grab_focus();
+               }
                buf.place_cursor(st);
                var ln = st.get_line();
                buf.get_iter_at_line(out stl,ln);