summaryrefslogtreecommitdiff
path: root/scripting/workben/bindings
diff options
context:
space:
mode:
authorTomas O'Connor <toconnor@openoffice.org>2003-05-15 15:44:28 +0000
committerTomas O'Connor <toconnor@openoffice.org>2003-05-15 15:44:28 +0000
commitebf16d9db3a2f5cafc5fd47347826d3112a245b9 (patch)
tree3aa184fa75d6e0b951a9ebfbd08cd00cada9d8f6 /scripting/workben/bindings
parent67f3aaa95b08680bb2ded4a3844063a8267b5c5a (diff)
Select appropriate filter in file chooser dialog
Diffstat (limited to 'scripting/workben/bindings')
-rw-r--r--scripting/workben/bindings/ScriptBinding.xba39
1 files changed, 28 insertions, 11 deletions
diff --git a/scripting/workben/bindings/ScriptBinding.xba b/scripting/workben/bindings/ScriptBinding.xba
index a9f585a0096a..7db5dc0975f2 100644
--- a/scripting/workben/bindings/ScriptBinding.xba
+++ b/scripting/workben/bindings/ScriptBinding.xba
@@ -1605,6 +1605,13 @@ end sub
REM ------ Event Handling Functions (Buttons) ------
+Sub DoNewAndEdit()
+ combo = bindingDialog.getControl( &quot;LanguageCombo&quot; )
+ language = combo.text
+ RunDebugger(language, &quot;&quot;, &quot;&quot;)
+ bindingDialog.endExecute()
+End Sub
+
Sub DoBrowseAndEdit()
Dim oFilePicker As Object, oSimpleFileAccess As Object
Dim oSettings As Object, oPathSettings As Object
@@ -1619,7 +1626,15 @@ Sub DoBrowseAndEdit()
oFilePicker.AppendFilter( bshfilter, &quot;*.bsh&quot; )
oFilePicker.AppendFilter( rhinofilter, &quot;*.js&quot; )
- &apos; oFilePicker.SetCurrentFilter( &quot;BeanShell (*.bsh)&quot; )
+
+ combo = bindingDialog.getControl( &quot;LanguageCombo&quot; )
+ language = combo.text
+
+ if language = &quot;BeanShell&quot; then
+ oFilePicker.SetCurrentFilter( bshfilter )
+ elseif language = &quot;Rhino&quot; then
+ oFilePicker.SetCurrentFilter( rhinofilter )
+ end if
If sFileURL = &quot;&quot; Then
oSettings = CreateUnoService( &quot;com.sun.star.frame.Settings&quot; )
@@ -1682,16 +1697,18 @@ sub DoEdit()
menuScriptList = bindingDialog.getControl( &quot;ScriptList&quot; )
selectedScript = menuScriptList.getSelectedItem()
- scripts() = scriptDisplayList(0)
- for n = LBOUND( scripts() ) to UBOUND( scripts() )
- if ( scripts( n ).Name = selectedScript ) then
- scriptInfo = scripts( n ).Value
- exit for
- end if
- next n
+ if not (selectedScript = &quot;&quot;) then
+ scripts() = scriptDisplayList(0)
+ for n = LBOUND( scripts() ) to UBOUND( scripts() )
+ if ( scripts( n ).Name = selectedScript ) then
+ scriptInfo = scripts( n ).Value
+ exit for
+ end if
+ next n
- RunDebugger(scriptInfo.getLanguage, scriptInfo.getParcelURI, scriptInfo.getFunctionName)
- bindingDialog.endExecute()
+ RunDebugger(scriptInfo.getLanguage, scriptInfo.getParcelURI, scriptInfo.getFunctionName)
+ bindingDialog.endExecute()
+ end if
end sub
sub MenuOKButton()
@@ -1881,4 +1898,4 @@ end sub
sub HelpOKButton()
helpDialog.endExecute()
end sub
-</script:module> \ No newline at end of file
+</script:module>