diff options
author | neilm <neilm@openoffice.org> | 2002-11-19 17:40:20 +0000 |
---|---|---|
committer | neilm <neilm@openoffice.org> | 2002-11-19 17:40:20 +0000 |
commit | c73c75da49d345645bc4e9fd6f72ef294cf85aaa (patch) | |
tree | b64786df4069cb7b5fe71e384e23504874d9d0ed /scripting | |
parent | 3d7e5f229c65c921803d04d5e5a7b1812a1fb5d9 (diff) |
Changes to OK button and dialog population functions
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/workben/bindings/ScriptBinding.xba | 66 |
1 files changed, 35 insertions, 31 deletions
diff --git a/scripting/workben/bindings/ScriptBinding.xba b/scripting/workben/bindings/ScriptBinding.xba index e95a0b64a3f6..b610edc0d8e1 100644 --- a/scripting/workben/bindings/ScriptBinding.xba +++ b/scripting/workben/bindings/ScriptBinding.xba @@ -59,7 +59,7 @@ function ExecuteKeyBinding() PopulateScriptList() CreateAllKeyBindings() PopulateTopLevelKeyBindingList() - PopulateKeyBindingList( 1, 11, true ) + PopulateKeyBindingList( 1, 11 ) bindingDialog.execute() end function @@ -70,7 +70,7 @@ function ExecuteMenuBinding() ReadXMLToArray( "Menu" ) PopulateScriptList() PopulateMenuCombo() - PopulateSubMenuList( 1, true, false ) + PopulateSubMenuList( 1 ) MenuLabelBoxListener() bindingDialog.execute() end function @@ -203,6 +203,7 @@ function ReadXMLToArray( bindingType as string ) end if scriptName = scriptName + ExtractKeyCodeFromXMLLine( xmlline ) scriptNames( scriptCount ) = scriptName + ' msgbox( "scriptNames( scriptCount ) " + scriptCount + " " + scriptNames( scriptCount ) ) scriptLinePosition( scriptCount ) = lineCount scriptCount = scriptCount + 1 end if @@ -390,6 +391,7 @@ function RemoveScriptNameAndPosition( keyComboPosition ) for n = 1 to scriptCount scriptNames( n ) = updatedScriptNames( n ) + 'msgbox( "scriptNames( "+n+" ) " + scriptNames( n ) ) next n end function @@ -428,7 +430,7 @@ function PopulateMenuCombo() end function -function PopulateSubMenuList( menuItemPosition as integer, firstPopulation as boolean, additionalBinding as boolean ) +function PopulateSubMenuList( menuItemPosition as integer ) redim subMenuItems( 100 ) as string redim subMenuItemLinePosition( 100 ) as integer dim lineNumber as integer @@ -484,15 +486,15 @@ function PopulateSubMenuList( menuItemPosition as integer, firstPopulation as bo subMenuList.addItem( subMenuItems( n ), n - 1 ) next n - if( firstPopulation ) then - subMenuList.selectItemPos( 0, true ) - else - if( additionalBinding ) then - subMenuList.selectItemPos( currentPosition + 1, true ) - else + 'if( firstPopulation ) then + ' subMenuList.selectItemPos( 0, true ) + 'else + ' if( additionalBinding ) then + ' subMenuList.selectItemPos( currentPosition + 1, true ) + ' else subMenuList.selectItemPos( currentPosition, true ) - end if - end if + ' end if + 'end if SubMenuListListener() end function @@ -515,7 +517,7 @@ function PopulateTopLevelKeyBindingList() end function -function PopulateKeyBindingList( startPosition as integer, endPosition as integer, firstPopulation as boolean ) +function PopulateKeyBindingList( startPosition as integer, endPosition as integer ) dim formattedKeyBinding( 47 ) as string counter = 1 @@ -546,11 +548,11 @@ function PopulateKeyBindingList( startPosition as integer, endPosition as intege keyList.addItem( formattedKeyBinding( n ), n - 1 ) next n - if( firstPopulation ) then - keyList.selectItemPos( 0, true ) - else + 'if( firstPopulation ) then + ' keyList.selectItemPos( 0, true ) + 'else keyList.selectItemPos( currentPosition, true ) - end if + 'end if KeyListListener() end function @@ -774,7 +776,7 @@ end function 'Populates the SubMenuList with the appropriate menu items from the Top-level menu selected from the combo box -function MenuComboListener( firstPopulation as boolean, additionalBinding as boolean ) +function MenuComboListener() combo = bindingDialog.getControl( "MenuCombo" ) newToplevelMenu = combo.text counter = 0 @@ -782,30 +784,30 @@ function MenuComboListener( firstPopulation as boolean, additionalBinding as boo counter = counter + 1 loop while not( newToplevelMenu = menuItems( counter ) ) - PopulateSubMenuList( counter, firstPopulation, additionalBinding ) + PopulateSubMenuList( counter ) end function 'Populates the KeyList with the appropriate key combos from the Top-level key group selected from the combo box -function KeyComboListener( firstPopulation as boolean ) +function KeyComboListener() combo = bindingDialog.getControl( "KeyCombo" ) itemSelected = combo.text select case itemSelected case "SHIFT + CONTROL + F keys" - PopulateKeyBindingList( 1, 11, firstPopulation ) + PopulateKeyBindingList( 1, 11 ) case "SHIFT + CONTROL + digits" - PopulateKeyBindingList( 12, 21, firstPopulation ) + PopulateKeyBindingList( 12, 21 ) case "SHIFT + CONTROL + letters" - PopulateKeyBindingList( 22, 47, firstPopulation ) + PopulateKeyBindingList( 22, 47 ) case "CONTROL + F keys" - PopulateKeyBindingList( 48, 58, firstPopulation ) + PopulateKeyBindingList( 48, 58 ) case "CONTROL + digits" - PopulateKeyBindingList( 59, 68, firstPopulation ) + PopulateKeyBindingList( 59, 68 ) case "CONTROL + letters" - PopulateKeyBindingList( 69, 94, firstPopulation ) + PopulateKeyBindingList( 69, 94 ) case "SHIFT + F keys" - PopulateKeyBindingList( 95, 105, firstPopulation ) + PopulateKeyBindingList( 95, 105 ) case else msgbox "Error" end select @@ -860,7 +862,7 @@ function MenuDeleteButton() loop while not( newToplevelMenu = menuItems( counter ) ) UpdateTopLevelMenus( counter + 1, false ) - MenuComboListener( false, false ) + MenuComboListener() end function @@ -886,7 +888,7 @@ function MenuNewButton() AddNewMenuBinding( script, newMenuLabel, linePos ) - MenuComboListener( false, true ) + MenuComboListener() end function @@ -917,7 +919,7 @@ function KeyNewButton() AddNewKeyBinding( script, HasShiftKey( keyCombo ), HasControlKey( keyCombo ), ExtractKeyFromCombo( keyCombo ) ) - KeyComboListener( false ) + KeyComboListener() end function @@ -932,12 +934,14 @@ function KeyDeleteButton() end if for n = 1 to scriptCount + 'msgbox( "keyCombo " + keyCombo + " scriptNames( "+n+" ) " + scriptNames( n ) + " " + strcomp( keyCombo, scriptNames( n ) ) ) if strcomp( keyCombo, scriptNames( n ) ) = 0 then keyComboPosition = n exit for end if next n - + 'msgbox( "keyComboPosition " + keyComboPosition ) + linePosition = scriptLinePosition( keyComboPosition ) 'msgbox( "Key delete line pos " + linePosition ) @@ -947,7 +951,7 @@ function KeyDeleteButton() RemoveBinding( linePosition ) script = ExtractScriptIdFromXMLLine( xmlFile( linePosition ) ) - KeyComboListener( false ) + KeyComboListener() end function |