[Sciviews-commits] r26 - in komodo/SciViews-K/content: . js/tools

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jun 29 19:11:52 CEST 2008


Author: romain
Date: 2008-06-29 19:11:52 +0200 (Sun, 29 Jun 2008)
New Revision: 26

Modified:
   komodo/SciViews-K/content/js/tools/strings.js
   komodo/SciViews-K/content/rconsole.xul
Log:
minor improvements to console

Modified: komodo/SciViews-K/content/js/tools/strings.js
===================================================================
--- komodo/SciViews-K/content/js/tools/strings.js	2008-06-29 08:51:24 UTC (rev 25)
+++ komodo/SciViews-K/content/js/tools/strings.js	2008-06-29 17:11:52 UTC (rev 26)
@@ -4,7 +4,8 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 // sv.tools.strings.replaceCRLF(str, code); // Replace LF and CR by 'code'
-// sv.tools.strings.removeLastCRLF(str); // Remove last CR and or LF
+// sv.tools.strings.removeLastCRLF(str);    // Remove last CR and or LF
+// sv.tools.strings.toRegex;                // changes a string to a regular expression
 ////////////////////////////////////////////////////////////////////////////////
 
 // Define the 'sv.tools.strings' namespace
@@ -33,3 +34,17 @@
     return(str);
 }
 
+// changes a string to a regular expression
+sv.tools.strings.toRegex = function(str){
+	// round brackets
+	str = str.replace( "(", "\\(" );
+	str = str.replace( ")", "\\)" );
+	
+	// square brackets
+	str = str.replace( "[", "\\[" );
+	str = str.replace( "]", "\\]" );
+	
+	// TODO: anything else
+	return( str ) ;
+}
+

Modified: komodo/SciViews-K/content/rconsole.xul
===================================================================
--- komodo/SciViews-K/content/rconsole.xul	2008-06-29 08:51:24 UTC (rev 25)
+++ komodo/SciViews-K/content/rconsole.xul	2008-06-29 17:11:52 UTC (rev 26)
@@ -85,7 +85,7 @@
       <tabpanel flex="1" id="sciviews_rconsole_tabpanel">
   
       
-      <vbox flex="1" id="sciviews_rconsole_console_vbox"> 
+      <vbox id="sciviews_rconsole_console_vbox" flex="1" style="margin-left:10px;"> 
       
         <richlistbox id="sciviews_rconsole_console_results" flex="1" />
         
@@ -98,43 +98,63 @@
           
         <!-- here is the input area where R code is typed and sent to the console -->
         <textbox id="sciviews_rconsole_console_input" cols="20"
-                   onkeypress="sv.r.console.handleConsoleInputKey(event)"
+                   onkeypress="sv.r.console.handleConsoleKeyPress(event)"
+                   onkeyup="sv.r.console.handleConsoleKeyUp(event)"
                    flex="1" multiline="true" rows="2" />
         </hbox>
  
       </vbox>
       
+      <splitter><grippy/></splitter>
       
       <tabbox flex="1">
         <tabs>
+          <tab label="completion" id="sciviews_rconsole_console_tab_completion" />
           <tab label="history" id="sciviews_rconsole_console_tab_history" />
-          <tab label="help"  id="sciviews_rconsole_console_tab_help" />
         </tabs>
         <tabpanels flex="1">
           
+          <!-- completion tab -->
+          <!-- TODO: use this as a tooltip -->
           <tabpanel>
-            <vbox flex="1">
-              <hbox>
-                <textbox
-                id="sciviews_rconsole_history_filter"
-                style="min-width:40px; margin-right:0px;"
-                type="timed"
-                timeout="500"
-                flex="1"
-                oninput="sv.r.console.refreshHistory();"
-                multiline="false" rows="1"
-                tooltiptext="&sciviews.console.history.filter.tip;" />
-              </hbox>  
-              <richlistbox id="sciviews_rconsole_console_history_richlistbox" flex="1"/>
-            </vbox>
+              <vbox flex="1">
+                <tree flex="1">
+                  <treecols>
+                    <treecol primary="true" label="completion" flex="4"/>
+                    <treecol label="description" flex="1"/>
+                  </treecols>
+                  <treechildren id="sciviews_rconsole_completion_tree_main">
+                    <treeitem>
+                      <treerow>
+                        <treecell label="" />
+                        <treecell label="" />
+                      </treerow>
+                    </treeitem>
+                  </treechildren> 
+                </tree>  
+              </vbox>
+              
           </tabpanel>
           
+          <!-- history tab -->
           <tabpanel>
-            <vbox flex="1"> 
-              <browser id="sciviews_rconsole_browser" src="" flex="1"/>
-            </vbox>
+              <vbox flex="1">
+                <hbox>
+                  <label>history</label>
+                  <textbox
+                  id="sciviews_rconsole_history_filter"
+                  style="min-width:40px; margin-right:0px; max-width:100px;"
+                  type="timed"
+                  timeout="500"
+                  flex="1"
+                  oninput="sv.r.console.refreshHistory();"
+                  multiline="false" rows="1"
+                  tooltiptext="&sciviews.console.history.filter.tip;" />
+                </hbox>  
+                <richlistbox id="sciviews_rconsole_console_history_richlistbox" flex="1"/>
+              </vbox>
           </tabpanel>
-        
+          
         </tabpanels>  
       </tabbox>
       



More information about the Sciviews-commits mailing list