From noreply at r-forge.r-project.org Thu Feb 5 13:36:34 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 5 Feb 2015 13:36:34 +0100 (CET) Subject: [Sciviews-commits] r555 - in komodo: . SciViews-K SciViews-K/.komodotools SciViews-K/content SciViews-K/content/js SciViews-K/defaults SciViews-K/skin SciViews-K/skin/icons/misc SciViews-K/skin/images SciViews-K-dev/R Message-ID: <20150205123634.C224D18603F@r-forge.r-project.org> Author: phgrosjean Date: 2015-02-05 13:36:34 +0100 (Thu, 05 Feb 2015) New Revision: 555 Removed: komodo/SciViews-K-dev/R/captureAll.R komodo/SciViews-K-dev/R/parseText.R Modified: komodo/.DS_Store komodo/SciViews-K/.DS_Store komodo/SciViews-K/.komodotools/Build.komodotool komodo/SciViews-K/.komodotools/Build_and_Install.komodotool komodo/SciViews-K/.komodotools/Docs_-_Extensions.komodotool komodo/SciViews-K/SciViews-K.komodoproject komodo/SciViews-K/chrome.manifest komodo/SciViews-K/content/.DS_Store komodo/SciViews-K/content/RHelpWindow.xul komodo/SciViews-K/content/js/commands.js komodo/SciViews-K/content/js/rconsole.js komodo/SciViews-K/content/js/robjects.js komodo/SciViews-K/content/js/sciviews.js komodo/SciViews-K/content/overlayMain.xul komodo/SciViews-K/defaults/svStart.R komodo/SciViews-K/install.rdf komodo/SciViews-K/skin/.DS_Store komodo/SciViews-K/skin/icons/misc/.DS_Store komodo/SciViews-K/skin/images/.DS_Store Log: SciViews-K compatible with Komodo 9 Modified: komodo/.DS_Store =================================================================== (Binary files differ) Modified: komodo/SciViews-K/.DS_Store =================================================================== (Binary files differ) Modified: komodo/SciViews-K/.komodotools/Build.komodotool =================================================================== --- komodo/SciViews-K/.komodotools/Build.komodotool 2014-10-03 11:46:42 UTC (rev 554) +++ komodo/SciViews-K/.komodotools/Build.komodotool 2015-02-05 12:36:34 UTC (rev 555) @@ -11,7 +11,7 @@ "var project = ko.macros.current.project;", "var projectDir = ko.interpolate.interpolateString('%p');", "var callback = function() {", - " ko.statusBar.AddMessage('Build complete', 'projects', 5000, true);", + " require(\"notify/notify\").send(\"Build complete\", \"projects\");", " ko.projects.manager.saveProject(project);", "};", "var osPath = Components.classes[\"@activestate.com/koOsPath;1\"].", @@ -27,7 +27,7 @@ " callback);", "}" ], - "trigger": "", + "trigger": "trigger_postopen", "rank": 100, "version": "1.0.12", "async": 1, Modified: komodo/SciViews-K/.komodotools/Build_and_Install.komodotool =================================================================== --- komodo/SciViews-K/.komodotools/Build_and_Install.komodotool 2014-10-03 11:46:42 UTC (rev 554) +++ komodo/SciViews-K/.komodotools/Build_and_Install.komodotool 2015-02-05 12:36:34 UTC (rev 555) @@ -12,7 +12,7 @@ "var project = ko.macros.current.project;", "var projectDir = ko.interpolate.interpolateString('%p');", "var callback = function() {", - " ko.statusBar.AddMessage('Build complete', 'projects', 5000, true);", + " require(\"notify/notify\").send(\"Build complete\", \"projects\");", " ko.projects.manager.saveProject(project);", " var os = Components.classes[\"@activestate.com/koOs;1\"].", " getService(Components.interfaces.koIOs);", @@ -45,7 +45,7 @@ " callback);", "}" ], - "trigger": "", + "trigger": "trigger_postopen", "rank": 100, "version": "1.0.12", "async": 1, Modified: komodo/SciViews-K/.komodotools/Docs_-_Extensions.komodotool =================================================================== --- komodo/SciViews-K/.komodotools/Docs_-_Extensions.komodotool 2014-10-03 11:46:42 UTC (rev 554) +++ komodo/SciViews-K/.komodotools/Docs_-_Extensions.komodotool 2015-02-05 12:36:34 UTC (rev 555) @@ -6,7 +6,7 @@ "value": [ "ko.help.open('komodo_extensions');" ], - "trigger": "", + "trigger": "trigger_postopen", "rank": 100, "version": "1.0.12", "async": 1, Modified: komodo/SciViews-K/SciViews-K.komodoproject =================================================================== --- komodo/SciViews-K/SciViews-K.komodoproject 2014-10-03 11:46:42 UTC (rev 554) +++ komodo/SciViews-K/SciViews-K.komodoproject 2015-02-05 12:36:34 UTC (rev 555) @@ -57,6 +57,7 @@ 1 1 off + 1 Modified: komodo/SciViews-K/chrome.manifest =================================================================== --- komodo/SciViews-K/chrome.manifest 2014-10-03 11:46:42 UTC (rev 554) +++ komodo/SciViews-K/chrome.manifest 2015-02-05 12:36:34 UTC (rev 555) @@ -1,5 +1,18 @@ + + + + + + + + content sciviewsk jar:sciviewsk.jar!/content/ +skin sciviewsk classic/1.0 jar:sciviewsk.jar!/skin/ +locale sciviewsk en-US jar:sciviewsk.jar!/locale/en-US/ +locale sciviewsk en-GB jar:sciviewsk.jar!/locale/en-GB/ +locale sciviewsk fr-FR jar:sciviewsk.jar!/locale/fr-FR/ + overlay chrome://komodo/content/komodo.xul chrome://sciviewsk/content/overlayMain.xul appversion>6.99 overlay chrome://komodo/content/komodo.xul chrome://sciviewsk/content/overlayMain-ko6.xul appversion<=6.99 overlay chrome://komodo/content/pref/pref.xul chrome://sciviewsk/content/prefOverlay.xul @@ -7,10 +20,4 @@ overlay chrome://komodo/content/komodo.xul chrome://sciviewsk/content/RObjectsOverlay.xul appversion<=6.99 overlay chrome://places/content/places_panel.xul chrome://sciviewsk/content/placesOverlay.xul appversion>6.99 -locale sciviewsk en-US jar:sciviewsk.jar!/locale/en-US/ -locale sciviewsk en-GB jar:sciviewsk.jar!/locale/en-GB/ -locale sciviewsk fr-FR jar:sciviewsk.jar!/locale/fr-FR/ - -skin sciviewsk classic/1.0 jar:sciviewsk.jar!/skin/ - manifest components/component.manifest Modified: komodo/SciViews-K/content/.DS_Store =================================================================== (Binary files differ) Modified: komodo/SciViews-K/content/RHelpWindow.xul =================================================================== --- komodo/SciViews-K/content/RHelpWindow.xul 2014-10-03 11:46:42 UTC (rev 554) +++ komodo/SciViews-K/content/RHelpWindow.xul 2015-02-05 12:36:34 UTC (rev 555) @@ -311,7 +311,8 @@ // Make sure that help is started, but do not open a browser cmd = 'invisible(capture.output(suppressMessages(help.start(browser = function(...) return())))); '; // Return the home page of R >= 2.10 help system - cmd += 'cat(paste("\n", "http://127.0.0.1:", tools:::httpdPort, "/doc/html/index.html", sep = ""))'; + // TODO: Starting from R 3.2.0 only use tools::startDynamicHelp(NA) here! + cmd += 'cat(paste("\n", "http://127.0.0.1:", if (is.function(tools:::httpdPort)) tools::startDynamicHelp(NA) else tools::httpdPort, "/doc/html/index.html", sep = ""))'; res = sv.r.evalCallback(cmd, function (path) { path = sv.tools.strings.removeLastCRLF(path); Modified: komodo/SciViews-K/content/js/commands.js =================================================================== --- komodo/SciViews-K/content/js/commands.js 2014-10-03 11:46:42 UTC (rev 554) +++ komodo/SciViews-K/content/js/commands.js 2015-02-05 12:36:34 UTC (rev 555) @@ -195,11 +195,13 @@ isWin? "r-gui" : "r-terminal"); // Width of R output defined to fit R output panel (min = 66, max = 200) - var rcons = document.getElementById("rconsole-scintilla2"); + //var rcons = document.getElementById("rconsole-scintilla2"); // In ko7, we need a different code! - if (rcons == null) rcons = document - .getElementById("sciviews_rconsole_tab") - .contentDocument.getElementById("rconsole-scintilla2"); + //if (rcons == null) rcons = document + // .getElementById("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-scintilla2"); + var rcons = ko.widgets.getWidget("sciviews_rconsole_tab") + .contentDocument.getElementById("rconsole-scintilla2"); var scimoz = rcons.scimoz; var width = (Math.floor(window.innerWidth / scimoz.textWidth(0, "0")) - 7) @@ -398,7 +400,7 @@ // try/catch here somehow prevented from storing window // reference in RHelpWin. No idea why... RHelpWin = window.openDialog(rHelpXulUri, "RHelp", - "chrome=yes,dependent,resizable=yes," + + "chrome=yes,resizable=yes," + "scrollbars=yes,status=no,close,dialog=no", sv, uri); } else { // It seems we could enter in a deadlock situation here Modified: komodo/SciViews-K/content/js/rconsole.js =================================================================== --- komodo/SciViews-K/content/js/rconsole.js 2014-10-03 11:46:42 UTC (rev 554) +++ komodo/SciViews-K/content/js/rconsole.js 2015-02-05 12:36:34 UTC (rev 555) @@ -91,12 +91,14 @@ var _gRProcess = null; function _ClearUI () { - var descWidget = document.getElementById("rconsole-desc"); + //var descWidget = document.getElementById("rconsole-desc"); // In ko7, we need a different code! - if (descWidget == null) descWidget = document - .getElementById("sciviews_rconsole_tab") - .contentDocument.getElementById("rconsole-desc"); - descWidget.style.setProperty("color", "black", ""); + //if (descWidget == null) descWidget = document + // .getElementById("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-desc"); + var descWidget = ko.widgets.getWidget("sciviews_rconsole_tab") + .contentDocument.getElementById("rconsole-desc"); + descWidget.style.setProperty("color", "black", ""); descWidget.removeAttribute("value"); descWidget.removeAttribute("_command"); } @@ -116,11 +118,13 @@ _ClearUI(); // TODO: shouldn't we eliminate this??? - var treeWidget = document.getElementById("rconsole-tree"); + //var treeWidget = document.getElementById("rconsole-tree"); // In ko7, we need a different code! - if (treeWidget == null) treeWidget = document - .getElementById("sciviews_rconsole_tab") - .contentDocument.getElementById("rconsole-tree"); + //if (treeWidget == null) treeWidget = document + // .getElementById("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-tree"); + var treeWidget = ko.widgets.getWidget("sciviews_rconsole_tab") + .contentDocument.getElementById("rconsole-tree"); var boxObject = treeWidget.treeBoxObject .QueryInterface(Components.interfaces.nsITreeBoxObject); @@ -129,11 +133,13 @@ // visible before we can assign the view to it RConsole_Show(window); } - _gRTerminalView = (document.getElementById("rconsole-scintilla") == null) ? - document.getElementById("sciviews_rconsole_tab") - .contentDocument.getElementById("rconsole-scintilla") : - document.getElementById("rconsole-scintilla"); - _gRTerminalView.init(); + //_gRTerminalView = (document.getElementById("rconsole-scintilla") == null) ? + // document.getElementById("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-scintilla") : + // document.getElementById("rconsole-scintilla"); + _gRTerminalView = ko.widgets.getWidget("sciviews_rconsole_tab") + .contentDocument.getElementById("rconsole-scintilla"); + _gRTerminalView.init(); _gRTerminalView.initWithTerminal(_gRTerminalHandler); boxObject.view = _gRTerminalHandler; @@ -141,11 +147,13 @@ //["mousedown", "focus"].forEach(function(eventname) { // window.frameElement.addEventListener(eventname, function(event) { // if (event.originalTarget == event.target) { - // var deck = document.getElementById("rconsole-deck"); + // //var deck = document.getElementById("rconsole-deck"); // // In ko7, we need a different code! - // if (deck == null) deck = document - // .getElementById("sciviews_rconsole_tab") - // .contentDocument.getElementById("rconsole-deck"); + // //if (deck == null) deck = document + // // .getElementById("sciviews_rconsole_tab") + // // .contentDocument.getElementById("rconsole-deck"); + // var deck = ko.widgets.getWidget("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-deck"); // deck.focus(); // } // }, false); @@ -157,20 +165,24 @@ // by appending the prompt to it sv.cmdout.append(":> ", false); // Observe keypress event on the R Console panel - var rcons = document.getElementById("rconsole-scintilla"); + //var rcons = document.getElementById("rconsole-scintilla"); // In ko7, we need a different code! - if (rcons == null) rcons = document - .getElementById("sciviews_rconsole_tab") - .contentDocument.getElementById("rconsole-scintilla"); - rcons.addEventListener('keypress', sv.rconsole.rconsoleOnKeyPress, + //if (rcons == null) rcons = document + // .getElementById("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-scintilla"); + var rcons = ko.widgets.getWidget("sciviews_rconsole_tab") + .contentDocument.getElementById("rconsole-scintilla"); + rcons.addEventListener('keypress', sv.rconsole.rconsoleOnKeyPress, true); // And observe keypress events on the R Output panel - var rcons2 = document.getElementById("rconsole-scintilla2"); + //var rcons2 = document.getElementById("rconsole-scintilla2"); // In ko7, we need a different code! - if (rcons2 == null) rcons2 = document - .getElementById("sciviews_rconsole_tab") - .contentDocument.getElementById("rconsole-scintilla2"); - rcons2.addEventListener('keypress', sv.rconsole.routputOnKeyPress, + //if (rcons2 == null) rcons2 = document + // .getElementById("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-scintilla2"); + var rcons2 = ko.widgets.getWidget("sciviews_rconsole_tab") + .contentDocument.getElementById("rconsole-scintilla2"); + rcons2.addEventListener('keypress', sv.rconsole.routputOnKeyPress, true); } finally { ko.main.addWillCloseHandler(sv.rconsole.finalize); @@ -223,12 +235,14 @@ _ClearUI(); // Clear the console and make sure work wrap is none - var terminalView = document.getElementById("rconsole-scintilla"); + //var terminalView = document.getElementById("rconsole-scintilla"); // In ko7, we need a different code! - if (terminalView == null) terminalView = document - .getElementById("sciviews_rconsole_tab") - .contentDocument.getElementById("rconsole-scintilla"); - //var scimoz = terminalView.scimoz; + //if (terminalView == null) terminalView = document + // .getElementById("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-scintilla"); + var terminalView = ko.widgets.getWidget("sciviews_rconsole_tab") + .contentDocument.getElementById("rconsole-scintilla"); + //var scimoz = terminalView.scimoz; // Note the width of the R console in characters is approximately //Math.floor(window.innerWidth / scimoz.textWidth(0, "0")) - 7 // => set this option in R everytime the Komodo window size changes! @@ -244,22 +258,26 @@ _gRTerminalHandler.setCwd(cwd); terminalView.cwd = cwd; - var descWidget = document.getElementById("rconsole-desc"); + //var descWidget = document.getElementById("rconsole-desc"); // In ko7, we need a different code! - if (descWidget == null) descWidget = document - .getElementById("sciviews_rconsole_tab") - .contentDocument.getElementById("rconsole-desc"); - descWidget.setAttribute("value", "R is running (" + command + ")"); + //if (descWidget == null) descWidget = document + // .getElementById("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-desc"); + var descWidget = ko.widgets.getWidget("sciviews_rconsole_tab") + .contentDocument.getElementById("rconsole-desc"); + descWidget.setAttribute("value", "R is running (" + command + ")"); // Store the command name for later use descWidget.setAttribute("_command", command); if (clearContent) { - var listButton = document.getElementById("rconsole-list-button"); + //var listButton = document.getElementById("rconsole-list-button"); // In ko7, we need a different code! - if (listButton == null) listButton = document - .getElementById("sciviews_rconsole_tab") - .contentDocument.getElementById("rconsole-list-button"); - listButton.setAttribute("disabled", "true"); + //if (listButton == null) listButton = document + // .getElementById("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-list-button"); + var listButton = ko.widgets.getWidget("sciviews_rconsole_tab") + .contentDocument.getElementById("rconsole-list-button"); + listButton.setAttribute("disabled", "true"); _gRTerminalView.clear(); } } @@ -269,12 +287,14 @@ //dump("XXX RConsole_EndSession(retval="+retval+")\n"); _gRTerminalView.endSession(); - var descWidget = document.getElementById("rconsole-desc"); + //var descWidget = document.getElementById("rconsole-desc"); // In ko7, we need a different code! - if (descWidget == null) descWidget = document - .getElementById("sciviews_rconsole_tab") - .contentDocument.getElementById("rconsole-desc"); - var command = descWidget.getAttribute("_command"); + //if (descWidget == null) descWidget = document + // .getElementById("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-desc"); + var descWidget = ko.widgets.getWidget("sciviews_rconsole_tab") + .contentDocument.getElementById("rconsole-desc"); + var command = descWidget.getAttribute("_command"); var msg = null; var osSvc = Components.classes["@activestate.com/koOs;1"] .getService(Components.interfaces.koIOs); @@ -289,12 +309,14 @@ descWidget.setAttribute("value", msg); _gRProcess = null; - var closeButton = document.getElementById("rconsole-close-button"); + //var closeButton = document.getElementById("rconsole-close-button"); // In ko7, we need a different code! - if (closeButton == null) closeButton = document - .getElementById("sciviews_rconsole_tab") - .contentDocument.getElementById("rconsole-close-button"); - closeButton.setAttribute("disabled", "true"); + //if (closeButton == null) closeButton = document + // .getElementById("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-close-button"); + var closeButton = ko.widgets.getWidget("sciviews_rconsole_tab") + .contentDocument.getElementById("rconsole-close-button"); + closeButton.setAttribute("disabled", "true"); } // koIRunTerminationListener implementation whose only job is to call @@ -441,11 +463,13 @@ this.setProcessHandle = function RConsole_SetProcessHandle (process) { if (_gRTerminalHandler.active) { _gRProcess = process; - var closeButton = document.getElementById("rconsole-close-button"); + //var closeButton = document.getElementById("rconsole-close-button"); // In ko7, we need a different code! - if (closeButton == null) closeButton = document - .getElementById("sciviews_rconsole_tab") - .contentDocument.getElementById("rconsole-close-button"); + //if (closeButton == null) closeButton = document + // .getElementById("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-close-button"); + var closeButton = ko.widgets.getWidget("sciviews_rconsole_tab") + .contentDocument.getElementById("rconsole-close-button"); closeButton.removeAttribute("disabled"); } } @@ -457,22 +481,26 @@ function _SetView (editor, deck) { // Ignore editor, always use the window we're in - var deckWidget = document.getElementById("rconsole-deck"); + //var deckWidget = document.getElementById("rconsole-deck"); // In ko7, we need a different code! - if (deckWidget == null) deckWidget = document - .getElementById("sciviews_rconsole_tab") - .contentDocument.getElementById("rconsole-deck"); - deckWidget.setAttribute("selectedIndex", deck); + //if (deckWidget == null) deckWidget = document + // .getElementById("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-deck"); + var deckWidget = ko.widgets.getWidget("sciviews_rconsole_tab") + .contentDocument.getElementById("rconsole-deck"); + deckWidget.setAttribute("selectedIndex", deck); } this.toggleView = function RConsole_ToggleView (newview) { if (typeof newview == 'undefined' || newview == null) { - var deckWidget = document.getElementById("rconsole-deck"); + //var deckWidget = document.getElementById("rconsole-deck"); // In ko7, we need a different code! - if (deckWidget == null) deckWidget = document - .getElementById("sciviews_rconsole_tab") - .contentDocument.getElementById("rconsole-deck"); - if (deckWidget.getAttribute("selectedIndex") == 1) { + //if (deckWidget == null) deckWidget = document + // .getElementById("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-deck"); + var deckWidget = ko.widgets.getWidget("sciviews_rconsole_tab") + .contentDocument.getElementById("rconsole-deck"); + if (deckWidget.getAttribute("selectedIndex") == 1) { newview = 0; } else { newview = 1; @@ -488,11 +516,13 @@ this.onFocus = function RConsole_OnFocus(event) { if (event.originalTarget != window) return; - var deckWidget = document.getElementById("rconsole-deck"); + //var deckWidget = document.getElementById("rconsole-deck"); // In ko7, we need a different code! - if (deckWidget == null) deckWidget = document - .getElementById("sciviews_rconsole_tab") - .contentDocument.getElementById("rconsole-deck"); + //if (deckWidget == null) deckWidget = document + // .getElementById("sciviews_rconsole_tab") + // .contentDocument.getElementById("rconsole-deck"); + var deckWidget = ko.widgets.getWidget("sciviews_rconsole_tab") + .contentDocument.getElementById("rconsole-deck"); var selected = deckWidget.selectedPanel; if ("scintilla" in selected) { selected.scintilla.focus(); @@ -508,9 +538,9 @@ this.rconsoleOnKeyPress = function (event) { try { // TODO: implement the function that erase the command - if (event.keyCode == 13) { - // TODO: what am I supposed to do here??? - } + // if (event.keyCode == 13) { + // // TODO: what am I supposed to do here??? + // } // This does not work because another event is dealing with this // case differently Modified: komodo/SciViews-K/content/js/robjects.js =================================================================== --- komodo/SciViews-K/content/js/robjects.js 2014-10-03 11:46:42 UTC (rev 554) +++ komodo/SciViews-K/content/js/robjects.js 2015-02-05 12:36:34 UTC (rev 555) @@ -322,10 +322,13 @@ isInitialized = true; if (init) { - var tree = document.getElementById("sciviews_robjects_objects_tree"); + //var tree = document.getElementById("sciviews_robjects_objects_tree"); // In ko7, we need a different code! - if (tree == null) tree = document - .getElementById("sciviews_robjects_tab").contentDocument + //if (tree == null) tree = document + // .getElementById("sciviews_robjects_tab").contentDocument + // .getElementById("sciviews_robjects_objects_tree"); + var tree = ko.widgets.getWidget("sciviews_robjects_tab") + .contentDocument .getElementById("sciviews_robjects_objects_tree"); tree.view = this; } @@ -358,11 +361,13 @@ // Allow for filtering by exclusion: prepend with "!" function _getFilter () { - var tb = document.getElementById("sciviews_robjects_filterbox"); + //var tb = document.getElementById("sciviews_robjects_filterbox"); // In ko7, we need a different code! - if (tb == null) tb = document - .getElementById("sciviews_robjects_tab").contentDocument - .getElementById("sciviews_robjects_filterbox"); + //if (tb == null) tb = document + // .getElementById("sciviews_robjects_tab").contentDocument + // .getElementById("sciviews_robjects_filterbox"); + var tb = ko.widgets.getWidget("sciviews_robjects_tab") + .contentDocument.getElementById("sciviews_robjects_filterbox"); var obRx, text, not; text = tb.value; not = (text.substring(0, 1) == "!") @@ -512,11 +517,13 @@ this.sort = function (column, root) { var columnName, currentElement, tree, sortDirection, realOrder, order, sortDirs; - tree = document.getElementById("sciviews_robjects_objects_tree"); + //tree = document.getElementById("sciviews_robjects_objects_tree"); // In ko7, we need a different code! - if (tree == null) tree = document - .getElementById("sciviews_robjects_tab").contentDocument - .getElementById("sciviews_robjects_objects_tree"); + //if (tree == null) tree = document + // .getElementById("sciviews_robjects_tab").contentDocument + // .getElementById("sciviews_robjects_objects_tree"); + tree = ko.widgets.getWidget("sciviews_robjects_tab") + .contentDocument.getElementById("sciviews_robjects_objects_tree"); sortDirection = tree.getAttribute("sortDirection"); sortDirs = ["descending", "natural", "ascending", "descending"]; realOrder = sortDirs.indexOf(sortDirection) - 1; @@ -592,11 +599,13 @@ var cols = tree.getElementsByTagName("treecol"); for (var i = 0; i < cols.length; i++) cols[i].removeAttribute("sortDirection"); - var columnWidget = document.getElementById(columnName); + //var columnWidget = document.getElementById(columnName); // In ko7, we need a different code! - if (columnWidget == null) columnWidget = document - .getElementById("sciviews_robjects_tab").contentDocument - .getElementById(columnName); + //if (columnWidget == null) columnWidget = document + // .getElementById("sciviews_robjects_tab").contentDocument + // .getElementById(columnName); + var columnWidget = ko.widgets.getWidget("sciviews_robjects_tab") + .contentDocument.getElementById(columnName); columnWidget.setAttribute("sortDirection", sortDirection); if (!root || root == _this.treeData) { @@ -856,11 +865,14 @@ pos = _this.searchPath.indexOf(path); if (pos == -1) return(false); - var listWidget = document - .getElementById("sciviews_robjects_searchpath_listbox"); + //var listWidget = document + // .getElementById("sciviews_robjects_searchpath_listbox"); // In ko7, we need a different code! - if (listWidget == null) listWidget = document - .getElementById("sciviews_robjects_tab").contentDocument + //if (listWidget == null) listWidget = document + // .getElementById("sciviews_robjects_tab").contentDocument + // .getElementById("sciviews_robjects_searchpath_listbox"); + var listWidget = ko.widgets.getWidget("sciviews_robjects_tab") + .contentDocument .getElementById("sciviews_robjects_searchpath_listbox"); listWidget.getItemAtIndex(pos).checked = true; _addObject(path, "", _parseObjectList, path); @@ -893,11 +905,13 @@ // // isInitialized = true; // - // var objTree = document.getElementById("sciviews_robjects_objects_tree"); - // In ko7, we need a different code! - //if (objTree == null) objTree = document - // .getElementById("sciviews_robjects_tab").contentDocument - // .getElementById("sciviews_robjects_objects_tree"); + //// var objTree = document.getElementById("sciviews_robjects_objects_tree"); + //// In ko7, we need a different code! + ////if (objTree == null) objTree = document + //// .getElementById("sciviews_robjects_tab").contentDocument + //// .getElementById("sciviews_robjects_objects_tree"); + //var objTree = ko.widgets.getWidget("sciviews_robjects_tab") + // .contentDocument.getElementById("sciviews_robjects_objects_tree"); //objTree.view = this; // this.treeBox.scrollToRow(0); //}; @@ -918,11 +932,14 @@ // Display the list of packages in the search path this.displayPackageList = function () { var pack; - var node = document - .getElementById("sciviews_robjects_searchpath_listbox"); + //var node = document + // .getElementById("sciviews_robjects_searchpath_listbox"); // In ko7, we need a different code! - if (node == null) node = document - .getElementById("sciviews_robjects_tab").contentDocument + //if (node == null) node = document + // .getElementById("sciviews_robjects_tab").contentDocument + // .getElementById("sciviews_robjects_searchpath_listbox"); + var node = ko.widgets.getWidget("sciviews_robjects_tab") + .contentDocument .getElementById("sciviews_robjects_searchpath_listbox"); var selectedLabel = node.selectedItem ? @@ -966,18 +983,22 @@ var what = event.target.tagName; var broadcaster = document .getElementById("cmd_robjects_viewSearchPath"); - var box = document.getElementById(broadcaster.getAttribute("box")); + //var box = document.getElementById(broadcaster.getAttribute("box")); // In ko7, we need a different code! - if (box == null) box = document - .getElementById("sciviews_robjects_tab").contentDocument - .getElementById(broadcaster.getAttribute("box")); + //if (box == null) box = document + // .getElementById("sciviews_robjects_tab").contentDocument + // .getElementById(broadcaster.getAttribute("box")); + var box = ko.widgets.getWidget("sciviews_robjects_tab") + .contentDocument.getElementById(broadcaster.getAttribute("box")); if (what == "splitter" || what == "grippy") { - var splitter = document.getElementById("sciviews_robjects_splitter"); + //var splitter = document.getElementById("sciviews_robjects_splitter"); // In ko7, we need a different code! - if (splitter == null) splitter = document - .getElementById("sciviews_robjects_tab").contentDocument - .getElementById("sciviews_robjects_splitter"); + //if (splitter == null) splitter = document + // .getElementById("sciviews_robjects_tab").contentDocument + // .getElementById("sciviews_robjects_splitter"); + var splitter = ko.widgets.getWidget("sciviews_robjects_tab") + .contentDocument.getElementById("sciviews_robjects_splitter"); var state = splitter.getAttribute("state"); broadcaster.setAttribute("checked", state != "collapsed"); } else { @@ -1201,11 +1222,13 @@ menuItem.setAttribute("checked", true); } - var filterBox = document.getElementById("sciviews_robjects_filterbox"); + //var filterBox = document.getElementById("sciviews_robjects_filterbox"); // In ko7, we need a different code! - if (filterBox == null) filterBox = document - .getElementById("sciviews_robjects_tab").contentDocument - .getElementById("sciviews_robjects_filterbox"); + //if (filterBox == null) filterBox = document + // .getElementById("sciviews_robjects_tab").contentDocument + // .getElementById("sciviews_robjects_filterbox"); + var filterBox = ko.widgets.getWidget("sciviews_robjects_tab") + .contentDocument.getElementById("sciviews_robjects_filterbox"); filterBox.emptyText = menuItem.getAttribute("label") + "..."; filterBox.focus(); @@ -1243,11 +1266,13 @@ // Help can be shown only for one object: var noHelp = !isPackage || !isInPackage; - //var menuNode = document.getElementById("rObjectsContext"); + ////var menuNode = document.getElementById("rObjectsContext"); //// In ko7, we need a different code! - //if (menuNode == null) menuNode = document - // .getElementById("sciviews_robjects_tab").contentDocument - // .getElementById("rObjectsContext"); + ////if (menuNode == null) menuNode = document + //// .getElementById("sciviews_robjects_tab").contentDocument + //// .getElementById("rObjectsContext"); + //var menuNode = ko.widgets.getWidget("sciviews_robjects_tab") + // .contentDocument.getElementById("rObjectsContext"); var menuItems = event.target.childNodes; var testDisableIf, disable = false; @@ -1463,11 +1488,13 @@ case 93: // Windows context menu key - var contextMenu = document.getElementById("rObjectsContext"); + //var contextMenu = document.getElementById("rObjectsContext"); // In ko7, we need a different code! - if (contextMenu == null) contextMenu = document - .getElementById("sciviews_robjects_tab").contentDocument - .getElementById("rObjectsContext"); + //if (contextMenu == null) contextMenu = document + // .getElementById("sciviews_robjects_tab").contentDocument + // .getElementById("rObjectsContext"); + var contextMenu = ko.widgets.getWidget("sciviews_robjects_tab") + .contentDocument.getElementById("rObjectsContext"); [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/sciviews -r 555 From noreply at r-forge.r-project.org Thu Feb 5 13:38:12 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 5 Feb 2015 13:38:12 +0100 (CET) Subject: [Sciviews-commits] r556 - komodo/SciViews-K-dev/R Message-ID: <20150205123813.01C5218603F@r-forge.r-project.org> Author: phgrosjean Date: 2015-02-05 13:38:12 +0100 (Thu, 05 Feb 2015) New Revision: 556 Added: komodo/SciViews-K-dev/R/captureAll.R komodo/SciViews-K-dev/R/parseText.R Log: captureAll.R/parseText.R conflict resolved in SciViews-K dev/R/ Added: komodo/SciViews-K-dev/R/captureAll.R =================================================================== --- komodo/SciViews-K-dev/R/captureAll.R (rev 0) +++ komodo/SciViews-K-dev/R/captureAll.R 2015-02-05 12:38:12 UTC (rev 556) @@ -0,0 +1,261 @@ + +# 'imports' +if(existsFunction("getSrcFilename", where="package:utils")) { + getSrcFilename <- utils::getSrcFilename +} + +# Replacement for 'base::as.character.error', which does not translate "Error" +`as.character.error` <- function (x, ...) { + msg <- conditionMessage(x) + call <- conditionCall(x) + if (!is.null(call)) + paste(.gettextx("Error in "), deparse(call, control = NULL)[1L], " : ", + msg, "\n", sep = "") + else paste(.gettextx("Error: "), msg, "\n", sep = "") +} + +# Replacement for 'base::print.warnings'. Deparses using control=NULL to produce +# result identical to that in console +`print.warnings` <- function (x, ...) { + if (n <- length(x)) { + cat(ngettext(n, "Warning message:\n", "Warning messages:\n")) + msgs <- names(x) + for (i in seq_len(n)) { + ind <- if (n == 1L) "" + else paste(i, ": ", sep = "") + out <- if (length(x[[i]])) { + temp <- deparse(x[[i]], width.cutoff = 50L, nlines = 2L, + control = NULL) # the only modification + sm <- strsplit(msgs[i], "\n")[[1L]] + nl <- if (nchar(ind, "w") + nchar(temp[1L], "w") + + nchar(sm[1L], "w") <= 75L) + " " + else "\n " + paste(ind, "In ", temp[1L], if (length(temp) > + 1L) + " ...", " :", nl, msgs[i], sep = "") + } + else paste(ind, msgs[i], sep = "") + do.call("cat", c(list(out), attr(x, "dots"), fill = TRUE)) + } + } + invisible(x) +} + + +# use ngettext instead of gettext, which fails to translate many strings in "R" domain +# bug in R or a weird feature? +`.gettextfx` <- function (fmt, ..., domain = "R") +sprintf(ngettext(1, fmt, "", domain = domain), ...) + +`.gettextx` <- function (..., domain = "R") { + args <- lapply(list(...), as.character) + unlist(lapply(unlist(args), function(x) .Internal(ngettext(1, x, "", domain)))) +} + +unsink <- function() { +# DEBUG +sink(type="m");sink(type="o") +#browser() +# END DEBUG +} + + +# inspired by 'capture.output' and utils:::.try_silent +# Requires: R >= 2.13.0 [??] +`sv_captureAll` <- function(expr, split = FALSE, file = NULL, markStdErr=FALSE, + envir = .GlobalEnv) { + # TODO: support for 'file' and 'split' + + # markStdErr: if TRUE, stderr is separated from sddout by STX/ETX character + + last.warning <- list() + Traceback <- NULL + NframeOffset <- sys.nframe() + 19L + 3L # frame of reference (used in traceback) + + # length of the call stack when a condition + # occurs + # Note: if 'expr' is a call not expression, 'NframeOffset' is lower by 2 + # (i.e. 21): -1 for lapply, -1 for unwrapping 'expression()' + + getWarnLev <- function() options('warn')[[1L]] # this may change in course of + # evaluation, so must be retrieved dynamically + + rval <- NULL + tconn <- textConnection("rval", "w", local = TRUE) + sink(tconn, type = "output"); sink(tconn, type = "message") + on.exit({ + sink(type = "message"); sink(type = "output") + close(tconn) + }) + + inStdOut <- TRUE + + if (markStdErr) { + putMark <- function(to.stdout, id) { + do.mark <- FALSE + if (inStdOut) { + if (!to.stdout) { + cat("\x03") + inStdOut <<- FALSE + do.mark <- TRUE + }} else { # in StdErr stream + if (to.stdout) { + cat("\x02") + inStdOut <<- TRUE + do.mark <- TRUE + }} + + #if(do.mark) + #marks <<- c(marks, list(c(pos = sum(nchar(rval)), stream = to.stdout))) + #cat("<", id, inStdOut, ">") + } + } else putMark <- function(to.stdout, id) {} + + `evalVis` <- function(x) withVisible(eval(x, envir)) + + `restartError` <- function(e, calls, foffset) { + # remove call (eval(expr, envir, enclos)) from the message + ncls <- length(calls) + + if(identical(calls[[NframeOffset + foffset]], conditionCall(e))) + e$call <- NULL + + cfrom <- ncls - 2L + cto <- NframeOffset + foffset + + + Traceback <<- if(cfrom < cto) list() else + calls[seq.int(cfrom, cto, by=-1L)] + + putMark(FALSE, 1L) + #cat(.makeMessage(e, domain="R")) + cat(as.character.error(e)) + if(getWarnLev() == 0L && length(last.warning) > 0L) + cat(.gettextx("In addition: ")) + } + + res <- tryCatch(withRestarts(withCallingHandlers({ + # TODO: allow for multiple expressions and calls (like in + # 'capture.output'). The problem here is how to tell 'expression' + # from 'call' without evaluating it? + off <- 0L + + for(i in expr) { + # 'off' is passed to 'restartError' + off <- 0L # TODO: better way to find the right sys.call... + res1 <- evalVis(i) + off <- -2L + + if(res1$visible) { + # print/show should be evaluated also in 'envir' + resval <- res1$value + if(!missing(resval)) { + printfun <- as.name(if(isS4(resval)) "show" else "print") + if(is.language(resval)) { + #browser() + #eval(substitute(printfun(resval)), envir) + #utils::str(resval) + eval(substitute(printfun(quote(resval))), envir) + } else + eval(substitute(printfun(resval)), envir) + } else { + cat("\n") + } + } + } + }, + + message = function(e) { + putMark(FALSE, 8L) + cat(conditionMessage(e), sep = "") + putMark(TRUE, 9L) + invokeRestart("muffleMessage") + }, + error = function(e) invokeRestart("grmbl", e, sys.calls(), off), + warning = function(e) { + # remove call (eval(expr, envir, enclos)) from the message + if(isTRUE(all.equal(sys.call(NframeOffset + off), e$call, + check.attributes = FALSE))) + e$call <- NULL + + if(getWarnLev() != 0L) { + putMark(FALSE, 2L) + .Internal(.signalCondition(e, conditionMessage(e), conditionCall(e))) + .Internal(.dfltWarn(conditionMessage(e), conditionCall(e))) + putMark(TRUE, 3L) + } else { + last.warning <<- c(last.warning, structure(list(e$call), + names = e$message)) + } + invokeRestart("muffleWarning") + }), + # Restarts: + + # Handling user interrupts. Currently it works only from within R. + # TODO: how to trigger interrupt remotely? + abort = function(...) { + putMark(FALSE, 4L) + cat("Execution aborted. \n") + }, + + muffleMessage = function() NULL, + muffleWarning = function() NULL, + grmbl = restartError), + error = function(e) { #XXX: this is called if warnLevel=2 + putMark(FALSE, 5L) + cat(as.character.error(e)) + e #identity + }, finally = { } + ) + + if(getWarnLev() == 0L) { + nwarn <- length(last.warning) + assign("last.warning", last.warning, envir = baseenv()) + + if(nwarn != 0L) putMark(FALSE, 6L) + if(nwarn <= 10L) { + print.warnings(last.warning) + } else if (nwarn < 50L) { + cat(.gettextfx("There were %d warnings (use warnings() to see them)\n", nwarn)) + } else { + cat(.gettextx("There were 50 or more warnings (use warnings() to see the first 50)\n")) + } + } + putMark(TRUE, 7L) + + sink(type = "message"); sink(type = "output") + close(tconn) + on.exit() + + #filename <- attr(attr(sys.function(sys.parent()), "srcref"), "srcfile")$filename + filename <- getSrcFilename(sys.function(sys.parent()), full.names=TRUE) + if(length(filename) == 0) filename <- NULL + + #print(sys.function(sys.parent())) + + # allow for tracebacks of this call stack: + if(!is.null(Traceback)) { + assign(".Traceback", + if (is.null(filename)) { + #lapply(Traceback, deparse, control=NULL) + # keep only 'srcref' attribute + lapply(Traceback, function(x) structure(deparse(x, control=NULL), + srcref=attr(x, "srcref"))) + + } else { + lapply(Traceback, function(x) { + srcref <- attr(x, "srcref") + srcfile <- if(is.null(srcref)) NULL else attr(srcref, "srcfile") + structure(deparse(x, control=NULL), srcref = + if(is.null(srcfile) || isTRUE(srcfile$filename == filename)) + NULL else srcref) + }) + } + , envir = baseenv()) + } + return(rval) +} + + +`captureAllQ` <- function(expr, ...) + sv_captureAll(as.expression(substitute(expr)), ...) \ No newline at end of file Added: komodo/SciViews-K-dev/R/parseText.R =================================================================== --- komodo/SciViews-K-dev/R/parseText.R (rev 0) +++ komodo/SciViews-K-dev/R/parseText.R 2015-02-05 12:38:12 UTC (rev 556) @@ -0,0 +1,58 @@ + +`Parse` <- function (text) +{ + ## Deprecated, in favor of parseText() + .Deprecated("parseText") + return(parseText(text)) +} + + + + +`parseText` <- function (text) { + ## Parse R instructions provided as a string and return the expression if it + ## is correct, or a 'try-error' object if it is an incorrect code, or NA if + ## the (last) instruction is incomplete + + #text <- " <- aaaaa(ddd+)" + + res <- tryCatch(parse(text=text), error=identity) + + + if(inherits(res, "error")) { + # Check if this is incomplete code + msg <- conditionMessage(res) + rxUEOI <- sprintf(gsub("%d", "\\\\d+", gettext("%s%d:%d: %s", domain="R")), + if(getOption("keep.source")) ":" else "", + gettextf("unexpected %s", gettext("end of input", domain="R"), + domain="R")) + + + if(regexpr(rxUEOI, msg, perl=TRUE) == 1) return(NA) + + # This reformats the message as it would appear in the CLI: + #msg <- conditionMessage(res) + errinfo <- + strsplit(sub("(?::)?(\\d+):(\\d+): +([^\n]+)\n([\\s\\S]*)$", "\\1\n\\2\n\\3\n\\4", msg, perl=T), "\n", fixed=TRUE)[[1]] + + errpos <- as.numeric(errinfo[1:2]) + err <- errinfo[-(1:3)] + rx <- sprintf("^%d:", errpos[1]) + errcode <- sub(rx, "", err[grep(rx, err)]) + #errcode <- substr(strsplit(text, "(\r?\n|\r)")[[1]][errpos[1]], start = 0, stop = errpos[2]) + res <- simpleError(sprintf("%s in \"%s\"", errinfo[3], errcode)) + + #e <- res <- simpleError(msg, NULL) + e <- res + + # for legacy uses, make it a try-error + res <- .makeMessage(res) + class(res) <- "try-error" + attr(res, 'error') <- e + } + + return(res) +} + +assign("parseText", parseText, "komodoConnection") + From noreply at r-forge.r-project.org Thu Feb 5 13:39:03 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 5 Feb 2015 13:39:03 +0100 (CET) Subject: [Sciviews-commits] r557 - in pkg: SciViews SciViews/R svDialogs svDialogs/inst svDialogs/man svDoc svDoc/R svDoc/man svHttp svHttp/R svHttp/inst svHttp/man svKomodo svKomodo/R svKomodo/inst svKomodo/man svMisc/R tcltk2 tcltk2/R tcltk2/man Message-ID: <20150205123903.24328184FA3@r-forge.r-project.org> Author: phgrosjean Date: 2015-02-05 13:39:02 +0100 (Thu, 05 Feb 2015) New Revision: 557 Modified: pkg/SciViews/NAMESPACE pkg/SciViews/R/graphics.R pkg/SciViews/R/misc.R pkg/svDialogs/DESCRIPTION pkg/svDialogs/NEWS pkg/svDialogs/inst/NEWS.Rd pkg/svDialogs/man/svDialogs-package.Rd pkg/svDoc/DESCRIPTION pkg/svDoc/NEWS pkg/svDoc/R/asciidoc.R pkg/svDoc/TODO pkg/svDoc/man/svDoc-package.Rd pkg/svHttp/DESCRIPTION pkg/svHttp/NEWS pkg/svHttp/R/httpServer.R pkg/svHttp/inst/NEWS.Rd pkg/svHttp/man/svHttp-package.Rd pkg/svKomodo/DESCRIPTION pkg/svKomodo/NEWS pkg/svKomodo/R/svKomodo-internal.R pkg/svKomodo/inst/NEWS.Rd pkg/svKomodo/man/svKomodo-package.Rd pkg/svMisc/R/listMethods.R pkg/tcltk2/DESCRIPTION pkg/tcltk2/NEWS pkg/tcltk2/R/tk2widgets.R pkg/tcltk2/man/tcltk2-package.Rd pkg/tcltk2/man/tk2widgets.Rd Log: Various package updates Modified: pkg/SciViews/NAMESPACE =================================================================== --- pkg/SciViews/NAMESPACE 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/SciViews/NAMESPACE 2015-02-05 12:39:02 UTC (rev 557) @@ -100,9 +100,6 @@ "!", "@", "@<-", - "@:=", - ":=", - "=", "%:%", "%else%", isEmpty, Modified: pkg/SciViews/R/graphics.R =================================================================== --- pkg/SciViews/R/graphics.R 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/SciViews/R/graphics.R 2015-02-05 12:39:02 UTC (rev 557) @@ -323,6 +323,7 @@ ## Color management #palette() # get or set the color palette #colors() and colours() for a list of color names +## TODO: wrong name? colorToRgb? color2rgb <- .Recode(grDevices::col2rgb) # convert colors to rgb #rgb() #rgb2hsv() @@ -404,7 +405,7 @@ #n2mfrow() computes sensible mfrow from number of graphs # + .ps.prolog -## Dynamite plot by Samule Brown +## Dynamite plot by Samuel Brown ## http://www.r-bloggers.com/dynamite-plots-in-r/ ## Much critisize! See http://emdbolker.wikidot.com/blog%3Adynamite ## http://pablomarin-garcia.blogspot.co.nz/2010/02/why-dynamite-plots-are-bad.html Modified: pkg/SciViews/R/misc.R =================================================================== --- pkg/SciViews/R/misc.R 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/SciViews/R/misc.R 2015-02-05 12:39:02 UTC (rev 557) @@ -42,18 +42,18 @@ ## Warn when using = instead of <- for assignation... ## if option warnAssignWithEqualSign is TRUE -`=` <- function(x, value) -{ - if (isTRUE(getOption("warnAssignWithEqualSign"))) - warning("Use <- instead of = for assignation, or use == for equalty test") - assign(deparse(substitute(x)), value, envir = parent.frame()) -} +## NOTE: names(x) <- "a" assigns "a" to `names(x)` => this is wrong! +#`=` <- function(x, value) +#{ +# if (isTRUE(getOption("warnAssignWithEqualSign"))) +# warning("Use <- instead of = for assignation, or use == for equality test") +# assign(deparse(substitute(x)), value, envir = parent.frame()) +#} # is.wholenumber(), see ?as.integer => define isWholeInt? -## A convenient starting object for holding items: . == .GlobalEnv -## TODO: take care there is no clash with proto objects! -#. <- base::.GlobalEnv +## A convenient starting object for holding items: .. == .GlobalEnv +#.. <- base::.GlobalEnv ## Testing is.null(obj) is not enough to decide if an object is empty, because ## there may be like numeric(0), character(0), etc. The right way to do so is @@ -239,6 +239,7 @@ ## Reuse `@<-` to set attribute from a non S4 object ## TODO: also use it for S4 object, in the case a slot is not defined +## TODO: reduce the number of copies done here! `@<-` <- function (x, which, value) { arg <- substitute(which) @@ -255,19 +256,20 @@ ## TODO: we need also something like that for S4 slots! ## Since they really are attributes with checking, check first, and then, ## use setattr(), and it is done! -`@:=` <- function (x, which, value) -{ - arg <- substitute(which) - if (is.name(arg)) which <- as.character(arg) - if (isS4(x)) { - ## TODO: we need an assign by reference function for S4 slots here - `slot<-`(x, which, TRUE, value) - } else { - ## TODO: use setattr() from data.table, but we don't want to depend on all this stuff!!! - #setattr(x, which, value) - `attr<-`(x, which, value) - } -} +## This does not quite work yet, nor := +#`@:=` <- function (x, which, value) +#{ +# arg <- substitute(which) +# if (is.name(arg)) which <- as.character(arg) +# if (isS4(x)) { +# ## TODO: we need an assign by reference function for S4 slots here +# `slot<-`(x, which, TRUE, value) +# } else { +# ## TODO: use setattr() from data.table, but we don't want to depend on all this stuff!!! +# #setattr(x, which, value) +# `attr<-`(x, which, value) +# } +#} ## TODO: `[:=`, `$:=` and `[[:=` ## This does not work... @@ -279,51 +281,60 @@ ## like fun(x) <- value calls `fun<-` ## TODO: a validation mechanism for the value passed to the function? ## TODO: use alist() instead of list()!!! -`:=` <- function (x, value) { - call <- match.call() - X <- substitute(x) - ## pairlist() because NULL would be lost using list() - value <- pairlist(value = value) - ## In case single name, do the same as x[] <- value, i.e., keeping size - ## and attributes of x ("replacement inside x") - if (length(X) == 1) { -# tryCatch(do.call("[<-", c(list(x = X), value), envir = parent.frame(1)), -# error = function (e) { -# ## Construct a call that is closer to the actual syntax! -# e$call <- paste(deparse(call[[2]]), ":=", deparse(call[[3]])) -# stop(e) -# }) - stop(":= cannot be used directly on an object") - } - ## If a more complex call is provided, try to run `fun:=` instead - X <- as.pairlist(substitute(X)) - ## To emulate `fun<-`, but using `fun:=` - fun <- paste(deparse(X[[1]]), ":=", sep = "") - X[[1]] <- NULL - ## Use tryCatch() to ensure a better error message is issued - tryCatch(do.call(fun, c(X, value), envir = parent.frame(1)), - error = function (e) { - ## Construct a call that is closer to the actual syntax! - e$call <- paste(deparse(call[[2]]), ":=", deparse(call[[3]])) - stop(e) - }) - ## Like for `fun<-`, value is returned invisibly, probably to allow - ## something like x <- y[2] <- value - return(invisible(value)) -} +## TODO: this does not work as expected! +#`:=` <- function (x, value) { +# call <- match.call() +# X <- substitute(x) +# ## pairlist() because NULL would be lost using list() +# value <- pairlist(value = value) +# ## In case single name, do the same as x[] <- value, i.e., keeping size +# ## and attributes of x ("replacement inside x") +# if (length(X) == 1) { +## tryCatch(do.call("[<-", c(list(x = X), value), envir = parent.frame(1)), +## error = function (e) { +## ## Construct a call that is closer to the actual syntax! +## e$call <- paste(deparse(call[[2]]), ":=", deparse(call[[3]])) +## stop(e) +## }) +# stop(":= cannot be used directly on an object") +# } +# ## If a more complex call is provided, try to run `fun:=` instead +# X <- as.pairlist(substitute(X)) +# ## To emulate `fun<-`, but using `fun:=` +# fun <- paste(deparse(X[[1]]), ":=", sep = "") +# X[[1]] <- NULL +# ## Use tryCatch() to ensure a better error message is issued +# tryCatch(assign(deparse(X[[1]]), do.call(fun, c(X, value), +# envir = parent.frame(1))), +# error = function (e) { +# ## Construct a call that is closer to the actual syntax! +# e$call <- paste(deparse(call[[2]]), ":=", deparse(call[[3]])) +# stop(e) +# }) +# ## Like for `fun<-`, value is returned invisibly, probably to allow +# ## something like x <- y[2] <- value +# invisible(value) +#} ## I don't like much system.time(), first because it returns 3 numbers where ## we want most of the time only one, and second because it creates a new ## object proc_time, where a difftime object should be perfectly suitable -## => new function elapsed() +## => new function timing(). It also replaces the synonym unix.time() and +## the other function proc.time() when called without an expression. timing <- function (expr, gc.first = TRUE) { - res <- system.time(expr, gcFirst = gc.first) + if (missing(expr)) { + res <- proc.time() + } else { + res <- system.time(expr, gcFirst = gc.first) + } ## Results split into result and details - details <- as.difftime(res[c("user.self", "sys.self")], units = "secs") - details at names := c("user", "system") - res <- as.difftime(res["elapsed"], units = "secs") - res at details := details + #details <- as.difftime(res[c("user.self", "sys.self")], units = "secs") + #details at names <- c("user", "system") + details <- as.difftime(res, units = "secs") + #res <- as.difftime(res["elapsed"], units = "secs") + res <- details["elapsed"] + res at details <- details return(res) } ## Test... Modified: pkg/svDialogs/DESCRIPTION =================================================================== --- pkg/svDialogs/DESCRIPTION 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svDialogs/DESCRIPTION 2015-02-05 12:39:02 UTC (rev 557) @@ -1,14 +1,14 @@ Package: svDialogs Type: Package -Version: 0.9-56 -Date: 2014-10-03 +Version: 0.9-57 +Date: 2014-12-19 Title: SciViews GUI API - Dialog boxes Author: Philippe Grosjean [aut, cre] Authors at R: c(person("Philippe", "Grosjean", role = c("aut", "cre"), email = "phgrosjean at sciviews.org")) Maintainer: Philippe Grosjean Depends: R (>= 2.6.0), svGUI (>= 0.9-52) -SystemRequirements: TODO!!! +SystemRequirements: zenity Description: Rapidly construct dialog boxes for your GUI, including an automatic function assistant License: GPL-2 Modified: pkg/svDialogs/NEWS =================================================================== --- pkg/svDialogs/NEWS 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svDialogs/NEWS 2015-02-05 12:39:02 UTC (rev 557) @@ -1,5 +1,10 @@ = svDialogs News +== Changes in svDialogs 0.9-57 + +* Added requirements (zenity) in the DESCRIPTION file. + + == Changes in svDialogs 0.9-56 * The native Mac dialogs did not work any more, solved for 10.5 Leopard and Modified: pkg/svDialogs/inst/NEWS.Rd =================================================================== --- pkg/svDialogs/inst/NEWS.Rd 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svDialogs/inst/NEWS.Rd 2015-02-05 12:39:02 UTC (rev 557) @@ -1,6 +1,12 @@ \name{NEWS} \title{NEWS file for the svDialogs package} +\section{Changes in version 0.9-57}{ + \itemize{ + \item{ Added requirements (zenity) in the DESCRIPTION file. } + } +} + \section{Changes in version 0.9-56}{ \itemize{ \item{ The native Mac dialogs did not work any more, solved for 10.5 Modified: pkg/svDialogs/man/svDialogs-package.Rd =================================================================== --- pkg/svDialogs/man/svDialogs-package.Rd 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svDialogs/man/svDialogs-package.Rd 2015-02-05 12:39:02 UTC (rev 557) @@ -12,8 +12,8 @@ \tabular{ll}{ Package: \tab svDialogs\cr Type: \tab Package\cr - Version: \tab 0.9-56\cr - Date: \tab 2014-10-03\cr + Version: \tab 0.9-57\cr + Date: \tab 2014-12-19\cr License: \tab GPL 2 or above, at your convenience\cr } % TODO: add description of main functions here. Also add examples Modified: pkg/svDoc/DESCRIPTION =================================================================== --- pkg/svDoc/DESCRIPTION 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svDoc/DESCRIPTION 2015-02-05 12:39:02 UTC (rev 557) @@ -1,7 +1,7 @@ Package: svDoc Type: Package -Version: 0.9-10 -Date: 2014-03-03 +Version: 0.9-11 +Date: 2014-12-10 Title: SciViews GUI API - svDoc functions Author: Philippe Grosjean [aut, cre] Authors at R: c(person("Philippe", "Grosjean", role = c("aut", "cre"), Modified: pkg/svDoc/NEWS =================================================================== --- pkg/svDoc/NEWS 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svDoc/NEWS 2015-02-05 12:39:02 UTC (rev 557) @@ -1,5 +1,12 @@ = svDoc News +== Changes in svDoc 0.9-11 + +* Added Asciidoc backend for producing a flat ODT documents, readable by + OpenOffice 3 or higher (but with a .odt extension). + + + == Changes in svDoc 0.9-10 * AsciiDoc updates to version 8.6.9 (november 2013) Modified: pkg/svDoc/R/asciidoc.R =================================================================== --- pkg/svDoc/R/asciidoc.R 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svDoc/R/asciidoc.R 2015-02-05 12:39:02 UTC (rev 557) @@ -277,8 +277,9 @@ docbook = "xml", docbook45 = "xml", latex = "tex", + odt = "odt", stop("Unknown format,", - " use html/html4/html5/slidy/slidy2/wordpress/docbook/latex") + " use html/html4/html5/slidy/slidy2/wordpress/docbook/latex/odt") ) EndFile <- .fileExt(TxtFile, EndExt) @@ -389,6 +390,13 @@ ## Use AsciiDoc to convert the .txt file into an .html file cat("Running asciidoc to create ", basename(EndFile), "\n", sep = "") system(paste('"', python, '" "', asciidoc, opts, TxtFile, '"', sep = "")) + + ## Special case for 'odt': the file created has .fodt extension + ## and we want to rename it with an .odt extension + if (format == "odt") { + TempFile <- sub("\\.fodt$", ".odt", EndFile) + if (file.exists(TempFile)) file.rename(TempFile, EndFile) + } ## If there is a finalize code for this theme, run it now ## TODO... Modified: pkg/svDoc/TODO =================================================================== --- pkg/svDoc/TODO 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svDoc/TODO 2015-02-05 12:39:02 UTC (rev 557) @@ -1,5 +1,7 @@ = svDoc - To do list +* Other styles than sciviews for ODT export + * Add and support a syntax for line break (and page break?) * Check styles for paragraphs Modified: pkg/svDoc/man/svDoc-package.Rd =================================================================== --- pkg/svDoc/man/svDoc-package.Rd 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svDoc/man/svDoc-package.Rd 2015-02-05 12:39:02 UTC (rev 557) @@ -12,8 +12,8 @@ \tabular{ll}{ Package: \tab svDoc\cr Type: \tab Package\cr - Version: \tab 0.9-10\cr - Date: \tab 2014-03-03\cr + Version: \tab 0.9-11\cr + Date: \tab 2014-12-10\cr License: \tab GPL 2 or above, at your convenience\cr } % TODO: add description of main functions here. Also add examples Modified: pkg/svHttp/DESCRIPTION =================================================================== --- pkg/svHttp/DESCRIPTION 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svHttp/DESCRIPTION 2015-02-05 12:39:02 UTC (rev 557) @@ -1,7 +1,7 @@ Package: svHttp Type: Package -Version: 0.9-55 -Date: 2014-03-01 +Version: 0.9-56 +Date: 2015-02-05 Title: SciViews GUI API - R HTTP server Author: Philippe Grosjean [aut, cre] Authors at R: c(person("Philippe", "Grosjean", role = c("aut", "cre"), Modified: pkg/svHttp/NEWS =================================================================== --- pkg/svHttp/NEWS 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svHttp/NEWS 2015-02-05 12:39:02 UTC (rev 557) @@ -1,7 +1,13 @@ = svHttp News -== Changes in svHttp 0.9-54 +== Changes in svHttp 0.9-56 +* Starting from R revision >= 67550, the HTML help port is now retrieved using + tools::startDynamicHelp(NA). + + +== Changes in svHttp 0.9-55 + * LICENSE file eliminated. * No more use of ::: (not allowed by CRAN). Modified: pkg/svHttp/R/httpServer.R =================================================================== --- pkg/svHttp/R/httpServer.R 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svHttp/R/httpServer.R 2015-02-05 12:39:02 UTC (rev 557) @@ -21,7 +21,11 @@ ## This port is stored in 'ko.serve' option options(ko.serve = port) ## If the server is running on another port, restart it now - curport <- getNamespace("tools")$httpdPort + if (R.Version()$`svn rev` >= 67550) { + curport <- tools::startDynamicHelp(NA) + } else { + curport <- getNamespace("tools")$httpdPort + } if (curport > 0 && curport != port) startHttpServer(port = port) return(port) } else { # Get the server port @@ -132,27 +136,48 @@ stop("'port' must be a positive integer!") port <- as.integer(round(port[1])) ## The port on which the server currently runs - curport <- getNamespace("tools")$httpdPort - - ## Can we run the server? - if (curport == -1L || nzchar(Sys.getenv("R_DISABLE_HTTPD"))) - stop("R http server is disabled or cannot start") - - ## If it is currently running, stop it now - if (curport != 0L) { - if (curport != port) - warning("R http server currently running on port ", curport, - " and is restarted on port ", port, immediate. = TRUE) - curport <- stopHttpServer() - } - - ## Start the http server on the right port - if (curport == 0L) { + if (R.Version()$`svn rev` >= 67550) { oports <- getOption("help.ports") (on.exit(options(help.ports = oports))) options(help.ports = port) - curport <- tools::startDynamicHelp() - } else stop("Unable to start the http server") + curport <- tools::startDynamicHelp(NA) + + ## Can we run the server? + if (curport == -1L || nzchar(Sys.getenv("R_DISABLE_HTTPD"))) + stop("R http server is disabled or cannot start") + + ## If curport is not the right one, try restarting + if (curport != 0L) { + if (curport != port) + warning("R http server currently running on port ", curport, + " and is restarted on port ", port, immediate. = TRUE) + stopHttpServer() + curport <- tools::startDynamicHelp(TRUE) + } + + } else { # Old code before startDynamicHelp(NA) + curport <- getNamespace("tools")$httpdPort + + ## Can we run the server? + if (curport == -1L || nzchar(Sys.getenv("R_DISABLE_HTTPD"))) + stop("R http server is disabled or cannot start") + + ## If it is currently running, stop it now + if (curport != 0L) { + if (curport != port) + warning("R http server currently running on port ", curport, + " and is restarted on port ", port, immediate. = TRUE) + curport <- stopHttpServer() + } + + ## Start the http server on the right port + if (curport == 0L) { + oports <- getOption("help.ports") + (on.exit(options(help.ports = oports))) + options(help.ports = port) + curport <- tools::startDynamicHelp() + } else stop("Unable to start the http server") + } ## Is the HTTP server running on the right port now? if (curport == port) { Modified: pkg/svHttp/inst/NEWS.Rd =================================================================== --- pkg/svHttp/inst/NEWS.Rd 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svHttp/inst/NEWS.Rd 2015-02-05 12:39:02 UTC (rev 557) @@ -1,11 +1,25 @@ \name{NEWS} \title{NEWS file for the svHttp package} +\section{Changes in version 0.9-56}{ + \itemize{ + \item{ Starting from R revision >= 67550, the HTML help port is now + retrieved using \code{tools::startDynamicHelp(NA)}. } + } +} + +\section{Changes in version 0.9-55}{ + \itemize{ + \item{ LICENSE file eliminated. } + \item{ No more use of ::: (not allowed by CRAN). } + } +} + \section{Changes in version 0.9-54}{ \itemize{ \item{ NEWS file reworked to use the new Rd format. } \item{ Temporary data are now saved in SciViews:TempEnv environment - (was TempEnv), and one thus needs s svMisc >= 0.9-68. } + (was TempEnv), and one thus needs svMisc >= 0.9-68. } } } Modified: pkg/svHttp/man/svHttp-package.Rd =================================================================== --- pkg/svHttp/man/svHttp-package.Rd 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svHttp/man/svHttp-package.Rd 2015-02-05 12:39:02 UTC (rev 557) @@ -14,8 +14,8 @@ \tabular{ll}{ Package: \tab svHttp\cr Type: \tab Package\cr - Version: \tab 0.9-55\cr - Date: \tab 2012-03-01\cr + Version: \tab 0.9-56\cr + Date: \tab 2015-02-05\cr License: \tab GPL 2 or above, at your convenience\cr } % TODO: add description of main functions here. Also add examples Modified: pkg/svKomodo/DESCRIPTION =================================================================== --- pkg/svKomodo/DESCRIPTION 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svKomodo/DESCRIPTION 2015-02-05 12:39:02 UTC (rev 557) @@ -1,7 +1,7 @@ Package: svKomodo Type: Package -Version: 0.9-62 -Date: 2014-03-01 +Version: 0.9-63 +Date: 2015-02-05 Title: SciViews GUI API - Functions to interface with Komodo Edit/IDE Author: Philippe Grosjean [aut, cre] Authors at R: c(person("Philippe", "Grosjean", role = c("aut", "cre"), Modified: pkg/svKomodo/NEWS =================================================================== --- pkg/svKomodo/NEWS 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svKomodo/NEWS 2015-02-05 12:39:02 UTC (rev 557) @@ -1,5 +1,11 @@ = svKomodo News +== Changes in svKomodo 0.9-63 + +* Starting from R revision >= 67550, the HTML help port is now retrieved using + tools::startDynamicHelp(NA). + + == Changes in svKomodo 0.9-62 * Author field rebuild in DESCRIPTION file Modified: pkg/svKomodo/R/svKomodo-internal.R =================================================================== --- pkg/svKomodo/R/svKomodo-internal.R 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svKomodo/R/svKomodo-internal.R 2015-02-05 12:39:02 UTC (rev 557) @@ -141,10 +141,10 @@ req <- require if (type == "http") { req("svHttp", character.only = TRUE, lib.loc = lib) - if (interactive()) try(startHttpServer()) + if (interactive()) try(svHttp::startHttpServer()) } else { req("svSocket", character.only = TRUE, lib.loc = lib) - if (interactive()) try(startSocketServer()) + if (interactive()) try(svSocket::startSocketServer()) } ## This comes from svStart... and should really be placed here indeed! @@ -276,7 +276,11 @@ port <- try(tools::startDynamicHelp(), silent = TRUE) if (inherits(port, "try-error")) { ## Dynamic help is already started - port <- getNamespace("tools")$httpdPort + if (R.Version()$`svn rev` >= 67550) { + port <- tools::startDynamicHelp(NA) + } else { + port <- getNamespace("tools")$httpdPort + } } ## Record the home page for the help server in an option options(helphome = paste("http://127.0.0.1:", port, @@ -289,14 +293,20 @@ if (length(file) == 0) return("") ## Extension ".html" may be missing htmlfile <- basename(file) + ## Get the HTML help server port + if (R.Version()$`svn rev` >= 67550) { + port <- tools::startDynamicHelp(NA) + } else { + port <- getNamespace("tools")$httpdPort + } if (length(file) > 1) { ## If more then one topic is found - paste("http://127.0.0.1:", getNamespace("tools")$httpdPort, + paste("http://127.0.0.1:", port, "/library/NULL/help/", attr(x,"topic"), sep = "") } else { if(substring(htmlfile, nchar(htmlfile) -4) != ".html") htmlfile <- paste(htmlfile, ".html", sep="") - paste("http://127.0.0.1:", getNamespace("tools")$httpdPort, + paste("http://127.0.0.1:", port, "/library/", basename(dirname(dirname(file))), "/html/", htmlfile, sep = "") } Modified: pkg/svKomodo/inst/NEWS.Rd =================================================================== --- pkg/svKomodo/inst/NEWS.Rd 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svKomodo/inst/NEWS.Rd 2015-02-05 12:39:02 UTC (rev 557) @@ -3,6 +3,13 @@ \section{Changes in version 0.9-62}{ \itemize{ + \item{ Starting from R revision >= 67550, the HTML help port is now retrieved using + tools::startDynamicHelp(NA). } + } +} + +\section{Changes in version 0.9-62}{ + \itemize{ \item{ Author field rebuild in DESCRIPTION file } \item{ \code{.onAttach()} reworked to eliminate \code{:::} (not allowed by CRAN) } \item{ \code{utils::rc.settings} are adjusted in \code{.onAttach()} and @@ -10,7 +17,6 @@ } } - \section{Changes in version 0.9-61}{ \itemize{ \item{ Simplification of internal code to get Komodo location. It does not require Modified: pkg/svKomodo/man/svKomodo-package.Rd =================================================================== --- pkg/svKomodo/man/svKomodo-package.Rd 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svKomodo/man/svKomodo-package.Rd 2015-02-05 12:39:02 UTC (rev 557) @@ -13,8 +13,8 @@ \tabular{ll}{ Package: \tab svKomodo\cr Type: \tab Package\cr - Version: \tab 0.9-62\cr - Date: \tab 2014-03-01\cr + Version: \tab 0.9-63\cr + Date: \tab 2015-02-05\cr License: \tab GPL 2 or above, at your convenience\cr } % TODO: add description of main functions here. Also add examples Modified: pkg/svMisc/R/listMethods.R =================================================================== --- pkg/svMisc/R/listMethods.R 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/svMisc/R/listMethods.R 2015-02-05 12:39:02 UTC (rev 557) @@ -6,7 +6,7 @@ ## Check argument if (!inherits(f, "character")) - stop("'f' must ba a character string!") + stop("'f' must be a character string!") ## List methods for a given class if (!is.null(class)) { Modified: pkg/tcltk2/DESCRIPTION =================================================================== --- pkg/tcltk2/DESCRIPTION 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/tcltk2/DESCRIPTION 2015-02-05 12:39:02 UTC (rev 557) @@ -1,7 +1,7 @@ Package: tcltk2 Type: Package -Version: 1.2-10 -Date: 2014-03-02 +Version: 1.2-11 +Date: 2014-12-19 Title: Tcl/Tk Additions Author: Philippe Grosjean [aut, cre] Authors at R: c(person("Philippe", "Grosjean", role = c("aut", "cre"), Modified: pkg/tcltk2/NEWS =================================================================== --- pkg/tcltk2/NEWS 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/tcltk2/NEWS 2015-02-05 12:39:02 UTC (rev 557) @@ -1,5 +1,17 @@ = tcltk2 news +== Version 1.2-11 + +* After a problem for active menu items not displayed in a contrasted color on + some platforms, tk2menu() function receives two new arguments: + activebackground and activeforeground, but reasonable colors are used in case + these are not provided, with a fallback to white on darkblue in case it is not + possible to determine the color used for the current theme. That color is + *not* change when the theme is changed of existing menu items (but it is for + future menu items). This is due to the fact that Tk menus do not follow the + ttk styling scheme. + + == Version 1.2-10 * Reworked Author field in the DESCRIPTION file. Modified: pkg/tcltk2/R/tk2widgets.R =================================================================== --- pkg/tcltk2/R/tk2widgets.R 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/tcltk2/R/tk2widgets.R 2015-02-05 12:39:02 UTC (rev 557) @@ -255,14 +255,31 @@ return(w) } -tk2menu <- function (parent, ...) +#tk2menu <- function (parent, ...) +#{ +# if (!is.ttk()) stop("Tcl/Tk >= 8.5 is required") +# w <- tkwidget(parent, "menu", ...) +# class(w) <- c("tk2menu", "tk2widget", class(w)) +# return(w) +#} + +tk2menu <- function (parent, activebackground, activeforeground, ...) { - if (!is.ttk()) stop("Tcl/Tk >= 8.5 is required") - w <- tkwidget(parent, "menu", ...) - class(w) <- c("tk2menu", "tk2widget", class(w)) - return(w) + if (!is.ttk()) stop("Tcl/Tk >= 8.5 is required") + w <- tkwidget(parent, "menu", ...) + if (missing(activebackground)) + activebackground <- tk2style("tk2button", "selectbackground") + if (activebackground == "") activebackground = "darkblue" # Default value + if (missing(activeforeground)) + activeforeground <- tk2style("tk2button", "selectforeground") + if (activeforeground == "") activeforeground = "white" # Default value + tkconfigure(w, activebackground = activebackground, + activeforeground = activeforeground) + class(w) <- c("tk2menu", "tk2widget", class(w)) + return(w) } + tk2menubutton <- function (parent, tip = "", ...) { if (!is.ttk()) stop("Tcl/Tk >= 8.5 is required") Modified: pkg/tcltk2/man/tcltk2-package.Rd =================================================================== --- pkg/tcltk2/man/tcltk2-package.Rd 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/tcltk2/man/tcltk2-package.Rd 2015-02-05 12:39:02 UTC (rev 557) @@ -16,8 +16,8 @@ \tabular{ll}{ Package: \tab tcltk2\cr Type: \tab Package\cr -Version: \tab 1.2-10\cr -Date: \tab 2014-03-02\cr +Version: \tab 1.2-11\cr +Date: \tab 2014-12-19\cr License: \tab LGPL-3 plus see LICENSE file\cr LazyLoad: \tab yes\cr } Modified: pkg/tcltk2/man/tk2widgets.Rd =================================================================== --- pkg/tcltk2/man/tk2widgets.Rd 2015-02-05 12:38:12 UTC (rev 556) +++ pkg/tcltk2/man/tk2widgets.Rd 2015-02-05 12:39:02 UTC (rev 557) @@ -44,7 +44,7 @@ "browse", "multiple"), height = 5, tip = "", scroll = "both", autoscroll = "x", enabled = TRUE, \dots) tk2mclistbox(parent, tip ="", \dots) -tk2menu(parent, \dots) +tk2menu(parent, activebackground, activeforeground, \dots) tk2menubutton(parent, tip = "", \dots) tk2message(parent, text = "", justify = c("left", "center", "right"), width = -1, aspect = 150, tip = "", \dots) @@ -91,6 +91,10 @@ \item{aspect}{ sets the aspect ratio of the widget (100 = square, 200 = twice as large, 50 = twice as tall). Only used if \code{width} is negative. } \item{orientation}{ either \code{"horizontal"} or \code{"vertical"}. } + \item{activebackground}{ color to use for active background of menu items (if + not provided, a reasonable default value is used). } + \item{activeforeground}{ color to use for active foreground of menu items (if + not provided, a reasonable default value is used). } \item{\dots}{ further arguments passed to the widget. } }