[rkward-cvs] SF.net SVN: rkward:[3924] trunk/rkward/packages/rkwarddev

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Tue Oct 11 17:16:41 UTC 2011


Revision: 3924
          http://rkward.svn.sourceforge.net/rkward/?rev=3924&view=rev
Author:   m-eik
Date:     2011-10-11 17:16:41 +0000 (Tue, 11 Oct 2011)
Log Message:
-----------
rkwarddev: minor fixes in ID autogeneration

Modified Paths:
--------------
    trunk/rkward/packages/rkwarddev/ChangeLog
    trunk/rkward/packages/rkwarddev/DESCRIPTION
    trunk/rkward/packages/rkwarddev/R/rk.XML.spinbox.R
    trunk/rkward/packages/rkwarddev/R/rk.XML.tabbook.R
    trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R
    trunk/rkward/packages/rkwarddev/inst/CITATION
    trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.Rnw
    trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf
    trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.tex
    trunk/rkward/packages/rkwarddev/man/rk.XML.tabbook.Rd
    trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd

Modified: trunk/rkward/packages/rkwarddev/ChangeLog
===================================================================
--- trunk/rkward/packages/rkwarddev/ChangeLog	2011-10-11 15:59:36 UTC (rev 3923)
+++ trunk/rkward/packages/rkwarddev/ChangeLog	2011-10-11 17:16:41 UTC (rev 3924)
@@ -1,5 +1,9 @@
 ChangeLog for package rkwarddev
 
+## 0.03-5 (2011-10-11)
+  - rk.XML.tabbook() can now autogenerate IDs without a label
+  - fixed bug in autogeneration of IDs in rk.XML.spinbox()
+
 ## 0.03-4 (2011-10-10)
   - added functions rk.XML.code() and rk.XML.help()
   - fixed bug in internal function check.ID() (produced false entry nodes under certain circumstances)

Modified: trunk/rkward/packages/rkwarddev/DESCRIPTION
===================================================================
--- trunk/rkward/packages/rkwarddev/DESCRIPTION	2011-10-11 15:59:36 UTC (rev 3923)
+++ trunk/rkward/packages/rkwarddev/DESCRIPTION	2011-10-11 17:16:41 UTC (rev 3924)
@@ -14,8 +14,8 @@
 URL: http://rkward.sourceforge.net
 Authors at R: c(person(given="Meik", family="Michalke",
     email="meik.michalke at hhu.de", role=c("aut", "cre")))
-Version: 0.03-4
-Date: 2011-10-10
+Version: 0.03-5
+Date: 2011-10-11
 Collate:
     'echo.R'
     'id.R'

Modified: trunk/rkward/packages/rkwarddev/R/rk.XML.spinbox.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.XML.spinbox.R	2011-10-11 15:59:36 UTC (rev 3923)
+++ trunk/rkward/packages/rkwarddev/R/rk.XML.spinbox.R	2011-10-11 17:16:41 UTC (rev 3924)
@@ -21,7 +21,7 @@
 	attr.list <- list(label=label)
 
 	if(identical(id.name, "auto")){
-		attr.list[["id"]] <- list(id=auto.ids(label, prefix=ID.prefix("spinbox")))
+		attr.list[["id"]] <- auto.ids(label, prefix=ID.prefix("spinbox"))
 	} else if(!is.null(id.name)){
 		attr.list[["id"]] <- id.name
 	} else {}

Modified: trunk/rkward/packages/rkwarddev/R/rk.XML.tabbook.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.XML.tabbook.R	2011-10-11 15:59:36 UTC (rev 3923)
+++ trunk/rkward/packages/rkwarddev/R/rk.XML.tabbook.R	2011-10-11 17:16:41 UTC (rev 3924)
@@ -1,7 +1,6 @@
 #' Create XML node "tabbook" for RKWard plugins
 #'
 #' @param label Character string, a text label for this plugin element.
-#'		Must be set if \code{id.name="auto"}.
 #' @param tab.labels Character vector, where each string defines the name of one tab.
 #'		The number of \code{tab.labels} also defines the number of tabs.
 #' @param children An optional list with objects of class \code{XiMpLe.node} (or a list of these objects).
@@ -27,12 +26,6 @@
 #' cat(pasteXMLNode(test.tabbook))
 
 rk.XML.tabbook <- function(label=NULL, tab.labels, children=list(), id.name="auto"){
-	if(is.null(label)){
-		if(identical(id.name, "auto")){
-			stop(simpleError("If id.name=\"auto\", then 'label' must have a value!"))
-		} else {}
-	} else {}
-
 	num.tabs <-  length(tab.labels)
 	# check if number of children fits
 	if(length(children) > 0){
@@ -68,14 +61,22 @@
 
 
 	if(identical(id.name, "auto")){
-		tb.id <- auto.ids(label, prefix=ID.prefix("tabbook", length=4))
+		if(!is.null(label)){
+			tb.id <- auto.ids(label, prefix=ID.prefix("tabbook", length=4))
+		} else {
+			# try autogenerating some id
+			tb.id <- auto.ids(tab.labels, prefix=ID.prefix("tabbook", length=4))
+		}
 	} else if(!is.null(id.name)){
 		tb.id <- id.name[[1]]
 	} else {
 		tb.id <- NULL
 	}
 
-	tbk.attr.list <- list(id=tb.id, label=label)
+	tbk.attr.list <- list(id=tb.id)
+	if(!is.null(label)){
+		tbk.attr.list[["label"]] <- label
+	} else {}
 
 	tabbook <- new("XiMpLe.node",
 			name="tabbook",

Modified: trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R	2011-10-11 15:59:36 UTC (rev 3923)
+++ trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R	2011-10-11 17:16:41 UTC (rev 3924)
@@ -3,8 +3,8 @@
 #' \tabular{ll}{
 #' Package: \tab rkwarddev\cr
 #' Type: \tab Package\cr
-#' Version: \tab 0.03-4\cr
-#' Date: \tab 2011-10-10\cr
+#' Version: \tab 0.03-5\cr
+#' Date: \tab 2011-10-11\cr
 #' Depends: \tab R (>= 2.9.0),XiMpLe,rkward (>= 0.5.6)\cr
 #' Enhances: \tab rkward\cr
 #' Encoding: \tab UTF-8\cr

Modified: trunk/rkward/packages/rkwarddev/inst/CITATION
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/CITATION	2011-10-11 15:59:36 UTC (rev 3923)
+++ trunk/rkward/packages/rkwarddev/inst/CITATION	2011-10-11 17:16:41 UTC (rev 3924)
@@ -2,12 +2,12 @@
 		title="rkwarddev: A collection of tools for RKWard plugin development",
 		author="Meik Michalke",
 		year="2011",
-		note="(Version 0.03-4)",
+		note="(Version 0.03-5)",
 		url="http://rkward.sourceforge.net",
 
 		textVersion =
 		paste("Michalke, M. (2011). ",
-				"rkwarddev: A collection of tools for RKWard plugin development (Version 0.03-4). ",
+				"rkwarddev: A collection of tools for RKWard plugin development (Version 0.03-5). ",
 				"Available from http://rkward.sourceforge.net",
 				sep=""),
 

Modified: trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.Rnw
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.Rnw	2011-10-11 15:59:36 UTC (rev 3923)
+++ trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.Rnw	2011-10-11 17:16:41 UTC (rev 3924)
@@ -12,13 +12,13 @@
 \maketitle
 
 \begin{abstract}
-Writing plugins for \verb at RKWard@ means writing at least two XML files (a GUI description and a plugin map),
-one JavaScript file (to create the \verb at R@ code), maybe a help file (again in XML), and for plugins who
+Writing plugins for \texttt{RKWard} means writing at least two XML files (a GUI description and a plugin map),
+one JavaScript file (to create the  \texttt{R} code), maybe a help file (again in XML), and for plugins who
 should be distributed, a DESCRIPTION file. Furtermore, all of these files need to be in a certain directory
 structure.
 
-The \verb at rkwarddev@ package aims to simplify this, by enabling you to fulfill all the listed tasks in just
-one \verb at R@ script.
+The  \texttt{rkwarddev} package aims to simplify this, by enabling you to fulfill all the listed tasks in just
+one  \texttt{R} script.
 \end{abstract}
 
 \section{About the package}
@@ -26,58 +26,58 @@
 and JavaScript files. First of all, you don't have to use this package at all, it's totally fine to code your
 plugins however you like. The main reason why I wrote this package is that I like to really concentrate on
 what I'm doing, so this is my attempt to avoid the need to switch between three different languages all the
-time. I wanted to be able to constantly ''think in \verb at R@`` while working on a plugin. As a side effect, a
+time. I wanted to be able to constantly ''think in  \texttt{R}`` while working on a plugin. As a side effect, a
 lot of useful automation was implemented, and using this package will definitely save you quite some amount of
 typing.
 
 \section{Before we start}
-It is important to undertsand that while \verb at rkwarddev@ can help you to make designing new plugins
+It is important to undertsand that while  \texttt{rkwarddev} can help you to make designing new plugins
 much easier, you still need to know how the generated XML and JavaScript files work and interact. That is, if
 you didn't yet read the \textit{Introduction to Writing Plugins for
 RKWard},\footnote{\url{http://rkward.sourceforge.net/documents/devel/plugins/index.html}} please do so before
-you start working with this package. Once you're sure you understand how plugins in \verb at RKWard@ actually
+you start working with this package. Once you're sure you understand how plugins in  \texttt{RKWard} actually
 work, just come back here.
 
 \section{Ingredients}
 If you look at the contents of the package, you might feel a little lost because of the number of functions.
 So let's first see that there's actually some order in the chaos.
 
-Most functions start with the prefix \verb at rk.@ to indicate that they somehow belong to \verb at RKWard@
+Most functions start with the prefix  \texttt{rk.} to indicate that they somehow belong to  \texttt{RKWard}
 (we'll get to the exceptions later). After that, many names have another abbreviation by which they can
 roughly be classified into their specific ''area`` of plugin development:
 
 \begin{itemize}
-	\item \verb at rk.XML.*()@: XML code for GUI description (and plugin maps)
-	\item \verb at rk.JS.*()@: JavaScript code
-	\item \verb at rk.rkh.*()@: XML code for help pages
+	\item  \texttt{rk.XML.*()}: XML code for GUI description (and plugin maps)
+	\item  \texttt{rk.JS.*()}: JavaScript code
+	\item  \texttt{rk.rkh.*()}: XML code for help pages
 \end{itemize}
 
-In short, you should find a \verb at rk.XML.*()@ equivalent to every XML tag explained in the
+In short, you should find a  \texttt{rk.XML.*()} equivalent to every XML tag explained in the
 \textit{Introduction to Writing Plugins for
 RKWard},\footnote{\url{http://rkward.sourceforge.net/documents/devel/plugins/index.html}}
-e.\,g. \verb at rk.XML.dropdown()@ to generate a \verb@<dropdown>@ menu node. There are a few functions for
+e.\,g.  \texttt{rk.XML.dropdown()} to generate a  \texttt{<dropdown>} menu node. There are a few functions for
 JavaScript generation which fall out of this scheme. That is because firstly they should be intuitively to use
-just like their JavaScript equivalent (like \verb at echo()@), and secondly they are likely to be used very often
-in a script, so short names seemed to be a blessing here (like \verb at id()@ or \verb at qp()@).
+just like their JavaScript equivalent (like  \texttt{echo()}), and secondly they are likely to be used very often
+in a script, so short names seemed to be a blessing here (like  \texttt{id()} or  \texttt{qp()}).
 
 Adding to that, there are some special functions, which will all be explained later, but here's the list,
 roughly ordered by the development stage they're used for:
 
 \begin{itemize}
-	\item \verb at rk.paste.JS()@: Paste JavaScript code from \verb at R@ objects
-	\item \verb at rk.XML.plugin()@: Combine XML objects into one plugin GUI object
-	\item \verb at rk.JS.scan()@: Scan a GUI XML file (or \verb at R@ object) and generate JavaScript code
+	\item  \texttt{rk.paste.JS()}: Paste JavaScript code from  \texttt{R} objects
+	\item  \texttt{rk.XML.plugin()}: Combine XML objects into one plugin GUI object
+	\item  \texttt{rk.JS.scan()}: Scan a GUI XML file (or  \texttt{R} object) and generate JavaScript code
 		(define all relevant variables)
-	\item \verb at rk.JS.saveobj()@: Scan a GUI XML file (or \verb at R@ object) and generate JavaScript code
+	\item  \texttt{rk.JS.saveobj()}: Scan a GUI XML file (or  \texttt{R} object) and generate JavaScript code
 		(save result objects)
-	\item \verb at rk.JS.doc()@: Combine JavaScript parts into one plugin JavaScript file object
-	\item \verb at rk.rkh.scan()@: Scan a GUI XML file (or \verb at R@ object) and generate a help page skeleton
-	\item \verb at rk.rkh.doc()@: Combine XML objects into one help page object
-	\item \verb at rk.testsuite.doc()@: Paste a testsuite skeleton
-	\item \verb at rk.XML.pluginmap()@: Combine XML objects into one plugin map object
-	\item \verb at rk.plugin.skeleton()@: Generate actual plugin files from the plugin GUI, JavaScript, help page,
+	\item  \texttt{rk.JS.doc()}: Combine JavaScript parts into one plugin JavaScript file object
+	\item  \texttt{rk.rkh.scan()}: Scan a GUI XML file (or  \texttt{R} object) and generate a help page skeleton
+	\item  \texttt{rk.rkh.doc()}: Combine XML objects into one help page object
+	\item  \texttt{rk.testsuite.doc()}: Paste a testsuite skeleton
+	\item  \texttt{rk.XML.pluginmap()}: Combine XML objects into one plugin map object
+	\item  \texttt{rk.plugin.skeleton()}: Generate actual plugin files from the plugin GUI, JavaScript, help page,
 		testsuite and plugin map objects (i.\,e., put all of the above together)
-	\item \verb at rk.build.plugin()@: Compress the generated files into an installable \verb at R@ package for
+	\item  \texttt{rk.build.plugin()}: Compress the generated files into an installable  \texttt{R} package for
 		distribution
 \end{itemize}
 

Modified: trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf
===================================================================
(Binary files differ)

Modified: trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.tex
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.tex	2011-10-11 15:59:36 UTC (rev 3923)
+++ trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.tex	2011-10-11 17:16:41 UTC (rev 3924)
@@ -13,13 +13,13 @@
 \maketitle
 
 \begin{abstract}
-Writing plugins for \verb at RKWard@ means writing at least two XML files (a GUI description and a plugin map),
-one JavaScript file (to create the \verb at R@ code), maybe a help file (again in XML), and for plugins who
+Writing plugins for \texttt{RKWard} means writing at least two XML files (a GUI description and a plugin map),
+one JavaScript file (to create the  \texttt{R} code), maybe a help file (again in XML), and for plugins who
 should be distributed, a DESCRIPTION file. Furtermore, all of these files need to be in a certain directory
 structure.
 
-The \verb at rkwarddev@ package aims to simplify this, by enabling you to fulfill all the listed tasks in just
-one \verb at R@ script.
+The  \texttt{rkwarddev} package aims to simplify this, by enabling you to fulfill all the listed tasks in just
+one  \texttt{R} script.
 \end{abstract}
 
 \section{About the package}
@@ -27,58 +27,58 @@
 and JavaScript files. First of all, you don't have to use this package at all, it's totally fine to code your
 plugins however you like. The main reason why I wrote this package is that I like to really concentrate on
 what I'm doing, so this is my attempt to avoid the need to switch between three different languages all the
-time. I wanted to be able to constantly ''think in \verb at R@`` while working on a plugin. As a side effect, a
+time. I wanted to be able to constantly ''think in  \texttt{R}`` while working on a plugin. As a side effect, a
 lot of useful automation was implemented, and using this package will definitely save you quite some amount of
 typing.
 
 \section{Before we start}
-It is important to undertsand that while \verb at rkwarddev@ can help you to make designing new plugins
+It is important to undertsand that while  \texttt{rkwarddev} can help you to make designing new plugins
 much easier, you still need to know how the generated XML and JavaScript files work and interact. That is, if
 you didn't yet read the \textit{Introduction to Writing Plugins for
 RKWard},\footnote{\url{http://rkward.sourceforge.net/documents/devel/plugins/index.html}} please do so before
-you start working with this package. Once you're sure you understand how plugins in \verb at RKWard@ actually
+you start working with this package. Once you're sure you understand how plugins in  \texttt{RKWard} actually
 work, just come back here.
 
 \section{Ingredients}
 If you look at the contents of the package, you might feel a little lost because of the number of functions.
 So let's first see that there's actually some order in the chaos.
 
-Most functions start with the prefix \verb at rk.@ to indicate that they somehow belong to \verb at RKWard@
+Most functions start with the prefix  \texttt{rk.} to indicate that they somehow belong to  \texttt{RKWard}
 (we'll get to the exceptions later). After that, many names have another abbreviation by which they can
 roughly be classified into their specific ''area`` of plugin development:
 
 \begin{itemize}
-	\item \verb at rk.XML.*()@: XML code for GUI description (and plugin maps)
-	\item \verb at rk.JS.*()@: JavaScript code
-	\item \verb at rk.rkh.*()@: XML code for help pages
+	\item  \texttt{rk.XML.*()}: XML code for GUI description (and plugin maps)
+	\item  \texttt{rk.JS.*()}: JavaScript code
+	\item  \texttt{rk.rkh.*()}: XML code for help pages
 \end{itemize}
 
-In short, you should find a \verb at rk.XML.*()@ equivalent to every XML tag explained in the
+In short, you should find a  \texttt{rk.XML.*()} equivalent to every XML tag explained in the
 \textit{Introduction to Writing Plugins for
 RKWard},\footnote{\url{http://rkward.sourceforge.net/documents/devel/plugins/index.html}}
-e.\,g. \verb at rk.XML.dropdown()@ to generate a \verb@<dropdown>@ menu node. There are a few functions for
+e.\,g.  \texttt{rk.XML.dropdown()} to generate a  \texttt{<dropdown>} menu node. There are a few functions for
 JavaScript generation which fall out of this scheme. That is because firstly they should be intuitively to use
-just like their JavaScript equivalent (like \verb at echo()@), and secondly they are likely to be used very often
-in a script, so short names seemed to be a blessing here (like \verb at id()@ or \verb at qp()@).
+just like their JavaScript equivalent (like  \texttt{echo()}), and secondly they are likely to be used very often
+in a script, so short names seemed to be a blessing here (like  \texttt{id()} or  \texttt{qp()}).
 
 Adding to that, there are some special functions, which will all be explained later, but here's the list,
 roughly ordered by the development stage they're used for:
 
 \begin{itemize}
-	\item \verb at rk.paste.JS()@: Paste JavaScript code from \verb at R@ objects
-	\item \verb at rk.XML.plugin()@: Combine XML objects into one plugin GUI object
-	\item \verb at rk.JS.scan()@: Scan a GUI XML file (or \verb at R@ object) and generate JavaScript code
+	\item  \texttt{rk.paste.JS()}: Paste JavaScript code from  \texttt{R} objects
+	\item  \texttt{rk.XML.plugin()}: Combine XML objects into one plugin GUI object
+	\item  \texttt{rk.JS.scan()}: Scan a GUI XML file (or  \texttt{R} object) and generate JavaScript code
 		(define all relevant variables)
-	\item \verb at rk.JS.saveobj()@: Scan a GUI XML file (or \verb at R@ object) and generate JavaScript code
+	\item  \texttt{rk.JS.saveobj()}: Scan a GUI XML file (or  \texttt{R} object) and generate JavaScript code
 		(save result objects)
-	\item \verb at rk.JS.doc()@: Combine JavaScript parts into one plugin JavaScript file object
-	\item \verb at rk.rkh.scan()@: Scan a GUI XML file (or \verb at R@ object) and generate a help page skeleton
-	\item \verb at rk.rkh.doc()@: Combine XML objects into one help page object
-	\item \verb at rk.testsuite.doc()@: Paste a testsuite skeleton
-	\item \verb at rk.XML.pluginmap()@: Combine XML objects into one plugin map object
-	\item \verb at rk.plugin.skeleton()@: Generate actual plugin files from the plugin GUI, JavaScript, help page,
+	\item  \texttt{rk.JS.doc()}: Combine JavaScript parts into one plugin JavaScript file object
+	\item  \texttt{rk.rkh.scan()}: Scan a GUI XML file (or  \texttt{R} object) and generate a help page skeleton
+	\item  \texttt{rk.rkh.doc()}: Combine XML objects into one help page object
+	\item  \texttt{rk.testsuite.doc()}: Paste a testsuite skeleton
+	\item  \texttt{rk.XML.pluginmap()}: Combine XML objects into one plugin map object
+	\item  \texttt{rk.plugin.skeleton()}: Generate actual plugin files from the plugin GUI, JavaScript, help page,
 		testsuite and plugin map objects (i.\,e., put all of the above together)
-	\item \verb at rk.build.plugin()@: Compress the generated files into an installable \verb at R@ package for
+	\item  \texttt{rk.build.plugin()}: Compress the generated files into an installable  \texttt{R} package for
 		distribution
 \end{itemize}
 

Modified: trunk/rkward/packages/rkwarddev/man/rk.XML.tabbook.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.XML.tabbook.Rd	2011-10-11 15:59:36 UTC (rev 3923)
+++ trunk/rkward/packages/rkwarddev/man/rk.XML.tabbook.Rd	2011-10-11 17:16:41 UTC (rev 3924)
@@ -7,7 +7,7 @@
 }
 \arguments{
   \item{label}{Character string, a text label for this
-  plugin element. Must be set if \code{id.name="auto"}.}
+  plugin element.}
 
   \item{tab.labels}{Character vector, where each string
   defines the name of one tab. The number of

Modified: trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd	2011-10-11 15:59:36 UTC (rev 3923)
+++ trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd	2011-10-11 17:16:41 UTC (rev 3924)
@@ -8,8 +8,8 @@
 }
 \details{
   \tabular{ll}{ Package: \tab rkwarddev\cr Type: \tab
-  Package\cr Version: \tab 0.03-4\cr Date: \tab
-  2011-10-10\cr Depends: \tab R (>= 2.9.0),XiMpLe,rkward
+  Package\cr Version: \tab 0.03-5\cr Date: \tab
+  2011-10-11\cr Depends: \tab R (>= 2.9.0),XiMpLe,rkward
   (>= 0.5.6)\cr Enhances: \tab rkward\cr Encoding: \tab
   UTF-8\cr License: \tab GPL (>= 3)\cr LazyLoad: \tab
   yes\cr URL: \tab http://rkward.sourceforge.net\cr }

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the rkward-tracker mailing list