diff options
author | Tomas O'Connor <toconnor@openoffice.org> | 2003-05-15 15:44:28 +0000 |
---|---|---|
committer | Tomas O'Connor <toconnor@openoffice.org> | 2003-05-15 15:44:28 +0000 |
commit | ebf16d9db3a2f5cafc5fd47347826d3112a245b9 (patch) | |
tree | 3aa184fa75d6e0b951a9ebfbd08cd00cada9d8f6 /scripting/workben/bindings | |
parent | 67f3aaa95b08680bb2ded4a3844063a8267b5c5a (diff) |
Select appropriate filter in file chooser dialog
Diffstat (limited to 'scripting/workben/bindings')
-rw-r--r-- | scripting/workben/bindings/ScriptBinding.xba | 39 |
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( "LanguageCombo" ) + language = combo.text + RunDebugger(language, "", "") + 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, "*.bsh" ) oFilePicker.AppendFilter( rhinofilter, "*.js" ) - ' oFilePicker.SetCurrentFilter( "BeanShell (*.bsh)" ) + + combo = bindingDialog.getControl( "LanguageCombo" ) + language = combo.text + + if language = "BeanShell" then + oFilePicker.SetCurrentFilter( bshfilter ) + elseif language = "Rhino" then + oFilePicker.SetCurrentFilter( rhinofilter ) + end if If sFileURL = "" Then oSettings = CreateUnoService( "com.sun.star.frame.Settings" ) @@ -1682,16 +1697,18 @@ sub DoEdit() menuScriptList = bindingDialog.getControl( "ScriptList" ) 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 = "") 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> |