[rkward-cvs] SF.net SVN: rkward:[2986] trunk/rkward/rkward

kapatp at users.sourceforge.net kapatp at users.sourceforge.net
Thu Sep 2 06:19:58 UTC 2010


Revision: 2986
          http://rkward.svn.sourceforge.net/rkward/?rev=2986&view=rev
Author:   kapatp
Date:     2010-09-02 06:19:58 +0000 (Thu, 02 Sep 2010)

Log Message:
-----------
Remove set.active.device option in rk.graph.on and fix rk.graph.off. See http://www.mail-archive.com/rkward-devel@lists.sourceforge.net/msg00898.html

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R
    trunk/rkward/rkward/windows/rkwindowcatcher.cpp

Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R	2010-09-01 16:52:25 UTC (rev 2985)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R	2010-09-02 06:19:58 UTC (rev 2986)
@@ -2,13 +2,13 @@
 ## These functions are accessible to the user.
 
 # Requests a graph to be written.
-rk.graph.on <- function (device.type=getOption ("rk.graphics.type"), width=getOption ("rk.graphics.width"), height=getOption ("rk.graphics.height"), quality, ..., set.active.device = TRUE) 
+rk.graph.on <- function (device.type=getOption ("rk.graphics.type"), width=getOption ("rk.graphics.width"), height=getOption ("rk.graphics.height"), quality, ...) 
 {
 	if (!is.numeric (width)) width <- 480
 	if (!is.numeric (height)) height <- 480
 	if (is.null (device.type)) device.type <- "PNG"	# default behavior is PNG for now
 
-	if (set.active.device) assign (".rk.active.device", dev.cur (), pos = "package:rkward")
+	assign (".rk.active.device", dev.cur (), pos = "package:rkward")
 
 	ret <- NULL
 	if (device.type == "PNG") {
@@ -51,7 +51,7 @@
 	# dev.off () sets dev.next () as active, which may not have been active before rk.graph.on was called;
 	# so reset the correct device as active:
 	i <- get (".rk.active.device", pos = "package:rkward")
-	if ((!is.null (i)) && i > 1) dev.set (i)
+	if ((!is.null (i)) && (i %in% dev.list ())) dev.set (i)
 	ret
 }
 

Modified: trunk/rkward/rkward/windows/rkwindowcatcher.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkwindowcatcher.cpp	2010-09-01 16:52:25 UTC (rev 2985)
+++ trunk/rkward/rkward/windows/rkwindowcatcher.cpp	2010-09-02 06:19:58 UTC (rev 2986)
@@ -333,7 +333,7 @@
 void RKCaughtX11Window::copyDeviceToOutput () {
 	RK_TRACE (MISC);
 
-	RKGlobals::rInterface ()->issueCommand ("assign (\".rk.active.device\", dev.cur (), pos=\"package:rkward\")\ndev.set (" + QString::number (device_number) + ")\ndev.copy (device=rk.graph.on, set.active.device = FALSE)\nrk.graph.off ()", RCommand::App | RCommand::DirectToOutput, i18n ("Copy contents of graphics device number %1 to output", device_number), error_dialog);
+	RKGlobals::rInterface ()->issueCommand ("dev.set (" + QString::number (device_number) + ")\ndev.copy (device=rk.graph.on)\nrk.graph.off ()", RCommand::App | RCommand::DirectToOutput, i18n ("Copy contents of graphics device number %1 to output", device_number), error_dialog);
 }
 
 void RKCaughtX11Window::printDevice () {


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