[Rqda-commits] r69 - in pkg: . R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Mar 20 05:34:59 CET 2009
Author: wincent
Date: 2009-03-20 05:34:58 +0100 (Fri, 20 Mar 2009)
New Revision: 69
Modified:
pkg/ChangeLog
pkg/R/FileButton.R
pkg/R/root_gui.R
Log:
Modified: pkg/ChangeLog
===================================================================
--- pkg/ChangeLog 2009-03-19 12:23:26 UTC (rev 68)
+++ pkg/ChangeLog 2009-03-20 04:34:58 UTC (rev 69)
@@ -1,3 +1,6 @@
+2009-03-20
+ * Find a word and highlight it in the open file (via popup menu in File Tab).
+
2009-03-19
* Add/modify File/Case attributes from popup menu.
Modified: pkg/R/FileButton.R
===================================================================
--- pkg/R/FileButton.R 2009-03-19 12:23:26 UTC (rev 68)
+++ pkg/R/FileButton.R 2009-03-20 04:34:58 UTC (rev 69)
@@ -264,4 +264,17 @@
} else gmessage("No file is found.",con=TRUE)
}
}
-
+FileNamesWidgetMenu$"Find a word..."$handler <- function(h, ...) {
+ if (is_projOpen(env=.rqda,conName="qdacon")) {
+ content <- tryCatch(svalue(RQDA:::.rqda$.openfile_gui),error=function(e){NULL})
+ if (!is.null(content)) {
+ word <- ginput("Type the word you intend to find.",con=TRUE)
+ Encoding(content) <- Encoding(word) <- "UTF-8"
+ idx1 <- gregexpr(word,content)[[1]] -1
+ idx2 <- idx1 + attr(idx1,"match.length")
+ idx <- data.frame(idx1,idx2)
+ ClearMark(.rqda$.openfile_gui,0,nchar(content),FALSE,TRUE)
+ HL(.rqda$.openfile_gui,idx,NULL,"yellow")
+ }
+ }
+}
Modified: pkg/R/root_gui.R
===================================================================
--- pkg/R/root_gui.R 2009-03-19 12:23:26 UTC (rev 68)
+++ pkg/R/root_gui.R 2009-03-20 04:34:58 UTC (rev 69)
@@ -35,8 +35,8 @@
glabel(
"Author: <ronggui.huang at gmail.com>\n
-License: New style BSD License\n
-Version: 0.1-6\n",
+License: BSD License\n
+Version: 0.1-7\n",
container=.proj_gui
)
More information about the Rqda-commits
mailing list