[Sciviews-commits] r246 - komodo/SciViews-K/skin/icons komodo/SciViews-K/skin/images pkg/svIDE/R pkg/svIDE/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jan 24 22:22:42 CET 2010


Author: phgrosjean
Date: 2010-01-24 22:22:42 +0100 (Sun, 24 Jan 2010)
New Revision: 246

Added:
   komodo/SciViews-K/skin/icons/readme.txt
   komodo/SciViews-K/skin/images/htest.png
   komodo/SciViews-K/skin/images/nls.png
   komodo/SciViews-K/skin/images/package_manager.png
   komodo/SciViews-K/skin/images/quitR.png
   komodo/SciViews-K/skin/images/run_enter.png
   komodo/SciViews-K/skin/images/run_line_begin.png
   komodo/SciViews-K/skin/images/run_line_end.png
   komodo/SciViews-K/skin/images/run_line_endpage.png
   komodo/SciViews-K/skin/images/source.png
   komodo/SciViews-K/skin/images/source_para.png
   komodo/SciViews-K/skin/images/source_sel.png
   pkg/svIDE/R/makeIconGallery.R
   pkg/svIDE/man/makeIconGallery.Rd
Log:
Icon gallery management function

Added: komodo/SciViews-K/skin/icons/readme.txt
===================================================================
--- komodo/SciViews-K/skin/icons/readme.txt	                        (rev 0)
+++ komodo/SciViews-K/skin/icons/readme.txt	2010-01-24 21:22:42 UTC (rev 246)
@@ -0,0 +1,11 @@
+The .txt files contain manual compilation of icon lists to create.
+The corresponding .html files are created using the makeIconGallery()
+function from svIDE >= 0.9-49 R package. Here is a little R script to
+build them all at once:
+
+icndir <- "<icons directory>"
+require(svIDE)
+setwd(icndir)
+lst <- list.files(pattern = "\\.txt$")
+lst <- lst[lst != "readme.txt"]
+for (f in lst) print(makeIconGallery(f))
\ No newline at end of file

Added: komodo/SciViews-K/skin/images/htest.png
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K/skin/images/htest.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: komodo/SciViews-K/skin/images/nls.png
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K/skin/images/nls.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: komodo/SciViews-K/skin/images/package_manager.png
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K/skin/images/package_manager.png
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: komodo/SciViews-K/skin/images/quitR.png
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K/skin/images/quitR.png
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: komodo/SciViews-K/skin/images/run_enter.png
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K/skin/images/run_enter.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: komodo/SciViews-K/skin/images/run_line_begin.png
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K/skin/images/run_line_begin.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: komodo/SciViews-K/skin/images/run_line_end.png
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K/skin/images/run_line_end.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: komodo/SciViews-K/skin/images/run_line_endpage.png
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K/skin/images/run_line_endpage.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: komodo/SciViews-K/skin/images/source.png
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K/skin/images/source.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: komodo/SciViews-K/skin/images/source_para.png
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K/skin/images/source_para.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: komodo/SciViews-K/skin/images/source_sel.png
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K/skin/images/source_sel.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: pkg/svIDE/R/makeIconGallery.R
===================================================================
--- pkg/svIDE/R/makeIconGallery.R	                        (rev 0)
+++ pkg/svIDE/R/makeIconGallery.R	2010-01-24 21:22:42 UTC (rev 246)
@@ -0,0 +1,43 @@
+# Create an iframe to represent all icons in a category in Komodo
+# iconpicker from a list of URIs
+makeIconGallery <- function (flist) {
+	flist <- as.character(flist)[1]
+	if (!file.exists(flist))
+		stop("'flist' file not found")
+	# Read the list
+	icns <- readLines(flist)
+	# Eliminate empty lines
+	icns <- icns[icns != ""]
+	if (length(icns) < 1)
+		stop("Nothing in the 'flist' file!")
+	# Create the iframe
+	iframe <- sub("\\.txt$", ".html", flist)
+	if (iframe == flist)
+		iframe <- paste(flist, "html", sep =".")
+	head <- '<html>
+<body>
+<style>img:hover { border-color: black; }</style>
+<style>img { border-color: white; }</style>
+
+'
+	tail <- '</body>\n</html>'
+	item <- '<img border="1"
+	ondblclick="parent.ValidatedPickIcon(<<<uri>>>);"
+	onclick="parent.Pick_Icon(\'<<<uri>>>\');"
+    src="<<<uri>>>"
+    alt="<<<icn>>>"
+    style="padding: 4px;"/>
+	 
+'
+	cat(head, file = iframe)
+	for (i in 1:length(icns)) {
+		uri <- icns[i]
+		icn <- basename(uri)
+		itm <- gsub("<<<uri>>>", uri, item)
+		itm <- sub("<<<icn>>>", icn, itm)
+		cat(itm, file = iframe, append = TRUE)
+	}
+	cat(tail, file = iframe, append = TRUE)
+	# Check if the file exists
+	return(invisible(file.exists(iframe)))
+}
\ No newline at end of file

Added: pkg/svIDE/man/makeIconGallery.Rd
===================================================================
--- pkg/svIDE/man/makeIconGallery.Rd	                        (rev 0)
+++ pkg/svIDE/man/makeIconGallery.Rd	2010-01-24 21:22:42 UTC (rev 246)
@@ -0,0 +1,29 @@
+\name{makeIconGallery}
+\alias{makeIconGallery}
+
+\title{ Create galleries of icons for SciViews-K and Komodo }
+
+\description{
+  The "pick icon" dialog box of Komodo uses icon galleries. SciViews-K redefines
+  such galleries for easier access to the icons, and it supplements about 1800
+  additional icons. The present function builds those galleries, based on a list
+  of icons manually compiled.
+}
+
+\usage{
+makeIconGallery(flist)
+}
+
+\arguments{
+  \item{flist}{ the path to the ASCII text file containing the URIs of the
+    different icons to collect together in the gallery. It is supposed to use
+	the .txt extension, which is replaced by .html in the gallery file. }
+}
+
+\value{
+  \code{TRUE} (success) or \code{FALSE} (error) is returned invisibly.
+}
+
+\author{Philippe Grosjean (\email{phgrosjean at sciviews.org})}
+
+\keyword{ utilities }



More information about the Sciviews-commits mailing list