src/Builder4/GtkView.bjs
authorAlan Knowles <alan@roojs.com>
Tue, 2 Jun 2015 13:21:30 +0000 (21:21 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 2 Jun 2015 13:21:30 +0000 (21:21 +0800)
src/Builder4/GtkView.vala

src/Builder4/GtkView.bjs
src/Builder4/GtkView.vala

index 03b1a5b..845a72c 100644 (file)
@@ -26,6 +26,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\t\n\tGtk.TextIter beg, st,en;\n\t \n\tthis.buffer.el.get_iter_at_offset(out beg, this.last_search_end);\n\tthis.searchcontext.forward(beg, out st, out en);\n\tthis.last_search_end = en.get_offset();\n\t\n\tthis.view.el.grab_focus();\n\tthis.buffer.el.place_cursor(st);\n\tthis.view.el.scroll_to_iter(st,  0.1f, true, 0.0f, 0.5f);\n\t\n\n}\n",
    "items" : [
     {
      "id" : "notebook",
index 3663b29..5380003 100644 (file)
@@ -187,6 +187,24 @@ public class Xcls_GtkView : Object
        return this.searchcontext.get_occurrences_count();
     
        
+    }
+    public void forwardSearch () {
+    
+       if (this.searchcontext == null) {
+               return;
+       }
+       
+       Gtk.TextIter beg, st,en;
+        
+       this.buffer.el.get_iter_at_offset(out beg, this.last_search_end);
+       this.searchcontext.forward(beg, out st, out en);
+       this.last_search_end = en.get_offset();
+       
+       this.view.el.grab_focus();
+       this.buffer.el.place_cursor(st);
+       this.view.el.scroll_to_iter(st,  0.1f, true, 0.0f, 0.5f);
+       
+    
     }
     public class Xcls_notebook : Object
     {