# Install file for GCDkit 6.1 patch no 221007 # The patch may be installed by: # * copying the install file into directory GCDkit/Patch # * drag & drop of this install file into the R Console # * manual pasting of the install file content into the R Console (ctrl-C, ctrl-V) patchID<-"221007" if (file.access(paste(gcdx.dir,"/Patch/patch",patchID,".r",sep=""), mode = 4)==-1){ cat ("Installing the file patch",patchID,".r\n",sep="") patch<-c( "#GCDkit 6.1 patch no 221007 ", "", "#updated function figLegend()", "figLegend<-","function (x = NULL, y = NULL, bg = \"#FFFFFFAA\", ...) " , "{" , " if (is.null(x)) {" , " ee <- locator(1)" , " x <- ee$x" , " y <- ee$y" , " }" , " showLegend(new.plot = FALSE, x = x, y = y, bg = bg, ...)" , "}" , "", "# updated function about()", "about<-","function () " , "{" , " img <<- tclVar()" , " tkimage.create(\"photo\", img, file = paste(gcdx.dir, \"logo.gif\", " , " sep = \"/\"))" , " tt <<- tktoplevel()" , " tkconfigure(tt, padx = 20, pady = 20, width = 100)" , " tkconfigure(tt, cursor = \"left_ptr\")" , " tit <- paste(\"About\", package.name)" , " tkwm.title(tt, tit)" , " tkfocus(tt)" , " txt.frame <- tkframe(tt, borderwidth = 0)" , " logo.fig <- tklabel(txt.frame, image = img)" , " tkgrid(logo.fig, sticky = \"nw\")" , " name <- as.character(packageDescription(package.name, fields = \"Package\"))" , " version <- \"6.1 patch 221007\"" , " codename <- as.character(packageDescription(package.name, " , " fields = \"Codename\"))" , " built <- as.character(packageDescription(package.name, fields = \"Built\"))" , " date <- as.Date(strsplit(built, \";\")[[1]][3])" , " date <- format(date, \"%d %B %Y\")" , " ver <- paste(name, \" \", version, \"\\n[\", codename, \", \", as.character(date), " , " \"]\\n(c) 1999-\", format(Sys.time(), \"%Y\"), \"\\n\", sep = \"\")" , " Rver <- paste(\"R for\", .Platform$OS.type, paste(getRversion(), " , " collapse = \".\"), sep = \" \")" , " authors <- paste(\"\\n\\nV. Janousek\\nCzech Geological Survey, \\nKlarov 3, 118 21 Prague 1\\nvojtech.janousek@geology.cz\\n \\nJ.-F. Moyen\\nUniversite St-Etienne, France\\n \\nV. Erban\\nex-Czech Geological Survey\\n \\nC. Farrow\\nex-University of Glasgow, Scotland\\n \", " , " sep = \"\")" , " message <- paste(ver, Rver, authors, sep = \"\")" , " txt <- paste(message, collapse = \"\\n\")" , " info <- tklabel(txt.frame, text = txt, wraplength = 300, " , " justify = \"left\")" , " tkgrid(info, row = 0, column = 1)" , " tkgrid(txt.frame)" , " OnOk <- function() {" , " tkgrab.release(tt)" , " tkdestroy(tt)" , " }" , " frame.but <- tkframe(tt)" , " tkconfigure(frame.but, pady = 10)" , " Ok.but <- tkbutton(frame.but, text = \" Dismiss \", command = OnOk, " , " fg = \"darkgreen\")" , " tkgrid(Ok.but, sticky = \"e\", row = 1, column = 1)" , " tkgrid(frame.but, sticky = \"e\")" , " tkfocus(tt)" , " tkwait.window(tt)" , " invisible(FALSE)" , "}" , " ns<-asNamespace(\"GCDkit\")" , " unlockBinding(\"figLegend\",ns)" , " assign(\"figLegend\",eval(parse(text=\"figLegend\")),envir=ns,inherits=TRUE)" , "#end") patchName<-paste(gcdx.dir,"/Patch/patch",patchID,".r",sep="") cat(patch,file=patchName,sep="\n") source(patchName) }