Commits

Anonymous committed 3b0e637

CWS-TOOLING: integrate CWS qascripts03
2008-11-27 11:44:44 +0100 jsk r264472 : #i96648#
2008-11-27 11:09:28 +0100 jsk r264466 : #i96649#
2008-11-27 11:06:37 +0100 jsk r264465 : #i96603#
2008-11-27 11:02:45 +0100 jsk r264463 : #i96651#
2008-11-27 09:46:29 +0100 jsk r264453 : #i96645#
2008-11-27 09:12:12 +0100 jsk r264448 : #i96566#
2008-11-26 15:45:29 +0100 jsk r264403 : #i96614#

  • Participants
  • Parent commits fe6408c

Comments (0)

Files changed (8)

File testautomation/extensions/optional/includes/location.inc

 
 testcase tExtensionLocation
 
-    '///<h3>Test the extension locator service</h3>
-    '///<p>This test installs a dummy extension and loads a document afterwards
-    '///+ which comes with a macro to trigger the locator service. By running the
-    '///+ macro a messagebox should pop open to display the installation path of 
-    '///+ the extension.</b><br><br>
+    printlog( "Test the extension locator service" )
 
      ' The location of the sample extension and helper document
     dim cWorkPath as string
     printlog( "Using extension: " & cWorkPath & EXTENSION_NAME )
     printlog( "Using document.: " & cWorkPath & DOCUMENT_NAME )
 
-    '///<ul>
-    '///+<li>Load the testdocument</li>
     brc = hFileOpen( cWorkPath & DOCUMENT_NAME )
     if ( not brc ) then
-        warnlog( "Error while loading document" )
-    endif
-
-    '///+<li>Allow macro execution</li>
-    brc = hAllowMacroExecution()
-    if ( not brc ) then
+        brc = hAllowMacroExecution()
+        if ( not brc ) then
+            warnlog( "This is not the macro execution warning" )
+        endif
+    else
         warnlog( "Macro execution warning is missing" )
     endif
 
-    '///+<li>Run the macro</li>
     irc = hMacroOrganizerRunMacro( MACRO_NAME )
     if ( irc = 0 ) then
         warnlog( "No macro with the given name could be found, aborting" )
         goto endsub
     endif
 
-    '///+<li>Test that the messagebox is open and verify that it contains an empty string</li>
     kontext "active"
     if ( active.exists( 2 ) ) then
         cMsg = active.getText()
         warnlog( "No messagebox displayed, please check that the macro is executed" )
     endif
 
-    '///+<li>Add the extension</li>
     irc = hExtensionAddGUI( cWorkPath & EXTENSION_NAME , "verbose,InstallForUser" )
-
-    '///+<li>Run the macro</li>
     irc = hMacroOrganizerRunMacro( MACRO_NAME )
     if ( irc = 0 ) then
         warnlog( "No macro with the given name could be found" )
     endif
 
-    '///+<li>Test that the messagebox is open and verify that it contains an empty string</li>
-    '///<ul>
     kontext "active"
     if ( active.exists( 2 ) ) then
         cMsg = active.getText()
 
-        '///+<li>Verify that the messagebox is not empty</li>
         if ( cMsg = "" ) then
             warnlog( "The messagebox is empty, please check." )
         else
 
-
             printlog( "Content of messagebox: " & cMsg )
 
-            '///+<li>Verify that it is a file-URL</li>
             if ( instr( cMsg , "file:///" ) > 0 ) then
                 printlog( "Found File-URL" )
             else
                 warnlog( "This does not appear to be a File-URL, please check!" )
             endif
 
-            '///+<li>Verify that the string contains the extension name</li>
             if ( instr( cMsg , EXTENSION_NAME ) > 0 ) then
                 printlog( "Extension string is present" )
             else
                 warnlog( "Extension name seems to be missing" )
             endif
 
-            '///+<li>Test file presence on filesystem level</li>
             if ( dir( cMsg ) = "" ) then
                 warnlog( "The extension could not be found at the expected location" )
             else
     else
         warnlog( "No messagebox displayed, please check that the macro is executed" )
     endif
-    '///</ul>
-    '///+<li>Cleanup: Remove the extension</li>
+
     irc = hExtensionRemoveGUI( EXTENSION_NAME )
     if ( irc <> 0 ) then
         warnlog( "the extension was NOT cleanly removed" )
     endif
 
-    '///+<li>Cleanup: Close document</li>
     hDestroyDocument()
 
-    '///</ul>
-
 endcase
 

File testautomation/extensions/optional/includes/publisher.inc

 
 testcase tExtensionPublisher
 
-    '///<h1>Extension publisher and release notes</h1>
+    printlog( "Extension Manager and Release Notes" )
 
     if ( gISOLang <> "en-US" ) then
         qaerrorlog( "Test does not handle translated strings, aborting" )
         goto endsub
     endif
 
-    '///<u><pre>Synopsis</pre></u>With CWS jl76 extensions can bring a link to the extension 
-    '///+ publisher and the release notes which are displayed in the online update dialog
-    '///+ for extensions - if provided. Otherwise these fields are not visible.<br>
-    '///<u><pre>Specification document</pre></u>
-    '///+ <a href=http://specs.openoffice.org/appwide/packagemanager/online_update_for_extensions.odt>
-    '///+ http://specs.openoffice.org/appwide/packagemanager/online_update_for_extensions.odt</a><br>
-    '///<u><pre>Files used</pre></u>(gTesttoolPath)/extensions/input/publisher/*.oxt,*.info<br>
-    '///<u><pre>Test case specification</pre></u>
+    ' Specification document
+    ' http://specs.openoffice.org/appwide/packagemanager/online_update_for_extensions.odt
+    ' http://specs.openoffice.org/appwide/packagemanager/online_update_for_extensions.odt
     
     ' This is the path where the test-extensions and the info file are located
     dim cBasePath as string
     iExtensionCount = hGetExtensionCount()
     
     
-    '///<ul>
-    '///+<li>Read info-file about the testdocuments.</li>
     hGetDataFileSection( cInfoFile, cConfigArray(), "info", "", "" )
     iFileCount = int( hGetValueForKeyAsString( cConfigArray() , "filecount" ) )
     printlog( cInfoFile & " specifies " & iFileCount & " documents to load" )
 
-    '///+<li>Install all extensions specified in the info-file.<br>
-    '///+You may use &quot;unopkg&quot; or the Extension Manager GUI.<br>
-    '///+The test uses &quot;unopkg&quot;.</li>
     printlog( "Installing extensions" )
     for iCurrentFile = 1 to iFileCount
         
         
     next iCurrentFile
     printlog( "Finished installing extensions" )
-       
-    '///+<li>Open the extension manager GUI (if not open yet).</li>
+
     kontext "PackageManager"
     if ( not PackageManager.exists() ) then
         ToolsPackageManager
         goto endsub
     endif
     
-    '///+<li>Wait about 5 seconds - the &quot;Live-Deployment&quot; needs time to strike.</li>
     iExitCounter = 0
     kontext "PackageManager"
     WaitSlot()
         endif
     loop
  
-    '///+<li>Click on  &quot;update...&quot;<br>
-    '///+The &quot;Update Extensions&quot; dialog should open.</li>
     kontext "PackageManager"
     if ( Updates.isEnabled() ) then
     
         printlog( "Updates-button is enabled" )
         Updates.click()
         
-        '///+<li>Wait max 200 seconds for the &quot;Update&quot; dialog listbox to get populated.</li>
         kontext "ExtensionUpdate"
         if ( ExtensionUpdate.exists( 2 ) ) then
         
-            
-            '///+<li>Verify that all extensions (currently 7) are present - and only those</li>
             iExitCounter = 0
             do while ( AvailableUpdatesList.getItemCount() < iFileCount ) 
                 printlog( "Waiting for Updates List to populate..." )
                 endif
             loop
             
-            '///+<li>&quot;Show all updates&quot; checkbox must be disabled.<br> 
-            '///+There are no additional extensions installed at this time</li>
             if ( ShowAllUpdates.exists() ) then
                 if ( ShowAllUpdates.isEnabled() ) then
                     warnlog( """Show all updates"" should be disabled" )
                 printlog( "Available updates list populated in " & iExitCounter & " seconds" )
                 
                 if ( iExitCounter < 20 ) then
-                    '///+<li>Select each listed extension and verify its attributes.</li>
-                    '///<ul>
+
                     for iCurrentFile = 1 to iFileCount
                     
-                        '///+<li>Retrieve the name of the extension from the config file.</li>
                         hGetDataFileSection( cInfoFile, cConfigArray(), iCurrentFile, "", "" )
                         cCurrentFileName = hGetValueForKeyAsString( cConfigArray() , "display_name" )
                         
-                        '///+<li>Retrieve configuration of the extension from config file: Release Notes.</li>
                         cHasReleaseNotes = hGetValueForKeyAsString( cConfigArray() , "has_release_notes" )
                         cReleaseNotes    = hGetValueForKeyAsString( cConfigArray() , "release_notes" )
                         
-                        '///+<li>Retrieve configuration of the extension from config file: Publisher.</li>
                         cHasPublisher = hGetValueForKeyAsString( cConfigArray() , "has_publisher" )
                         cPublisher    = hGetValueForKeyAsString( cConfigArray() , "publisher" )
                         
-                        '///+<li>Select the current extension by index.</li>
                         AvailableUpdatesList.select( iCurrentFile )
                         
-                        '///+<li>Verify that the extension is the one we expect.</li>
                         if ( AvailableUpdatesList.getText() = cCurrentFileName ) then
                             printlog( "Testing extension: " & cCurrentFileName )
                             
-                            '///+<li>Verify the configuration for the Release Notes.</li>
                             if ( lcase( cHasReleaseNotes ) = "yes" ) then
                                 if ( ReleaseNotesText.isVisible() ) then
                                     printlog( " - Release notes text is visible. Good." )
                                 endif
                             endif
                             
-                            '///+<li>Verify the configuration for the Publisher.</li>
                             if ( lcase( cHasPublisher ) = "yes" ) then
                                 if ( UpdatePublisherText.isVisible() ) then
                                     printlog( " - Publisher text is visible. Good." )
             else
                 warnlog( "No extensions available for update. Installation failed?" )
             endif
-            '///</ul>
-            
-            '///+<li>Close the extension update dialog.</li>
+
             kontext "ExtensionUpdate"
             ExtensionUpdate.cancel()
         else
         warnlog( "Update-button on extension manager ui is disabled" )
     endif
     
-    '///+<li>Close extension manager GUI</li>
     kontext "PackageManager"
     PackageManager.close()
     
-    '///+<li>Cleanup - remove all test-extensions.</li>
     printlog( "Removing extensions" )
     for iCurrentFile = 1 to iFileCount
         hGetDataFileSection( cInfoFile, cConfigArray(), iCurrentFile, "", "" )
         sExtensionCLI( "remove" , cCurrentFileName )
     next iCurrentFile
     printlog( "Finished removing extensions" )
-    '///</ul>
 
 endcase
 

File testautomation/framework/tools/includes/all_interfaces.txt

-
-function checkCheckBox( _file as string , sKey as string , control as object , optional cBugID as string ) as boolean
-function checkComboBox( _file as string , sKey as string , control as object ) as boolean
-function  checkEntryField( _file as string , sKey as string , control as object , optional cBugID as string ) as boolean
-function checkListBox( _file as string , sKey as string , control as object ) as boolean
-function checkListItem( _file as string , _iIndex as integer , sKey as string  , control as object ) as boolean
-function checkRadioButton( _file as string , sKey as string , control as object ) as boolean
-function checkRadioButtons( _file as string  , sKey as string  , control1 as object  , control2 as object  , optional control3 as object  , optional control4 as object ) as integer
-function hAccessStandardBar() as boolean
-function hAddTrustedPath( cPath as string ) as boolean
-function hAllowMacroExecution() as boolean
-function hBatchLoadJavaFiles( aFileList() , cIdent as string )
-function hCancelFilterDialog() as boolean
-function hChangeDoc() as string
-function hCheckPropertyPresence ( cSetting as string , iPos as integer ) as boolean
+function hGetFileLocationAPI() as string
+function hGetDocTypeAPI() as string
+function listdebug( lsList() as string , cComment as string ) as integer
+function initlistdebug( cComment as string ) as integer
+function listmoveitem( source() as string, target() as string, itemid as integer ) as integer
+function listconvertpath( lsList() as string ) as integer
+function listInsertSection( lsList() as string, cSection as string ) as integer
+function CheckAsianLanguageSupport( sSupport as String )  as String
+function fStartupNavigator(navigatorItem as String , subItemNum as Integer)
+function fCloseNavigator
+function fGetCountryName( CountryID as Integer ) as String
+function hToolsCustomizeOpen() as boolean
+function hToolsCustomizeSelectTab( cTab as string ) as boolean
+function hToolsCustomizeClose( iMode as integer  ) as boolean
+function hToolsCustomizeAddNewMenu( cName as string, bMode as boolean ) as boolean
+function hDeselectSeparator() as integer
 function hClickCommandButton( iItemToClick as integer ) as boolean
-function hClickNextButton() as boolean
-function hCloseBasicIDE() as boolean
-function hCloseCollectionBar() as boolean
-function hCloseHelp() as boolean
-function hCloseNavigator() as boolean
-function hClosePropertyBrowser() as boolean
-function hCloseScriptOrganizer() as boolean
-function hCompareSubStrings( cRef as string, cSub as string ) as integer
-function hConvertStringToLong( cValue as string ) as long
-function hCountMatchesInList( acItemList() as string, cSearchTerm as string ) as integer
-function hCreateBasicWorkFiles() as string
+function hFileOpenMultiSelect( iArray() as integer ) as integer
+function hSaveLoadDelSuccess( cFile as string ) as integer
+function hLoadFileExpectSuccess( fpath as string ) as boolean
+function hLoadFileExpectFailure( fpath as string ) as boolean
+function hSaveFileExpectSuccess( fpath as string , bReplace as boolean ) as boolean
+function hSaveFileExpectFailure( fpath as string , errortype as integer ) as boolean
 function hCreateDirectoryExpectSuccess( dirname as string ) as boolean
-function hCreateDocument() as boolean
-function hCreateFaxDevice( cName as string ) as boolean
-function hCreateModuleForDoc( optional cName as string ) as boolean
-function hCreateScriptingObject( cName as string ) as boolean
-function hDeleteFile( cFileOrig as string ) as boolean
 function hDeleteFileViaFileOpen( cFile as String ) as boolean
-function hDeleteLibrary( iLocation as integer, cLibName as string ) as boolean
-function hDeleteMacro() as boolean
-function hDeleteScript( cName as string , bSuccess as boolean ) as boolean
-function hDeleteUserTemplates() as integer
-function hDelPrinter( cPrinterName as string ) as integer
-function hDenyMacroExecution() as boolean
-function hDeselectSeparator() as integer
-function hDestroyDocument() as boolean
-function hDocumentInfoSelectTab( cTabPage as string ) as boolean
-function hDocumentTypeKeys( cString as string ) as boolean
+function hGetFileCountViaFileOpen() as integer
+function hNameGen_append( iDecChar as long ) as string
+function hNameGen_lead( iDecChar as long ) as string
+function hGetRelPath( cStartDir, cFileName as String ) as string
+function hFindFileObjectViaFileOpen( cName as string ) as integer
+function hGetControlParams( cParam as string ) as integer
+function hGetControlName( iControl as integer ) as string
+function hInsertControl( iControl as integer ) as string
 function hDrawControlOnDialog( iControl as integer ) as string
 function hDrawControl( xPos as integer, yPos as integer, xEnd as integer, yEnd as integer ) as boolean
-function hExpandAllNodes( oControl as object ) as integer
-function hExpandNode( oControl as object, iNode as integer ) as integer
-function hFileOpenMultiSelect( iArray() as integer ) as integer
-function hFindCopyRemoveJavaLogs( cSourcePath as string ) as boolean
-function hFindFileObjectViaFileOpen( cName as string ) as integer
-function hFindFirstDialog() as boolean
-function hFindTemplate( sTemplateName as string ) as integer
-function hFindUNOTemplateInFilterList( sFilter as string ) as integer
-function hFinishWizard( iMode as integer ) as boolean
-function hGetAccel( cCommand as string ) as string
-function hGetBasicWorkFile( cMajorID as string ) as string
-function hGetControlName( iControl as integer ) as string
-function hGetControlParams( cParam as string ) as integer
+function hGetControlPosXO( iControl as integer ) as integer
+function hGetControlPosYO( iControl as integer ) as integer
 function hGetControlPosXE( iControl as integer ) as integer
+function hGetControlPosYE( iControl as integer ) as integer
 function hGetControlPosXM( iControl as integer ) as integer
-function hGetControlPosXO( iControl as integer ) as integer
-function hGetControlPosYE( iControl as integer ) as integer
 function hGetControlPosYM( iControl as integer ) as integer
-function hGetControlPosYO( iControl as integer ) as integer
-function hGetDataPairAsString( sKey as string, sVal as long ) as string
-function hGetDirTreeLevel( cFullPath as string ) as integer
-function hGetDocTypeAPI() as string
-function hGetFileCountViaFileOpen() as integer
-function hGetFileFolderName( iFolder as integer ) as string
-function hGetFileLocationAPI() as string
-function hGetFileSizeAsLong( cFileName as string ) as long
-function hGetFilter680FromUNO( bTemplate as boolean ) as string
+function hSelectControl( iControl as integer ) as boolean
+function hOpenHelp() as boolean
+function hCloseHelp() as boolean
+function hSelectHelpTab( cTab as string ) as boolean
+function hUseBookmarksContextMenu( cAction as string ) as boolean
+function hHelpGetAboutItemCount() as integer
+function hHelpGetSearchIndexItemCount() as integer
 function hGetHelpContentHeader( iLength as integer ) as string
 function hGetI18nData( cSection as string, cLanguage as string ) as string
-function hGetIndexForKeyAsInt( lsList() as string, sKey as string ) as integer
-function hGetInputPath( byval sBasePath as string, byval sFile as string ) as string
-function hGetKeyForPairAsString( cLine as string ) as string
-function hGetKeyForValueAsInt( lsList() as string, sVal as string ) as integer
-function hGetKeyForValueAsString( lsList() as string, sVal as string ) as string
-function hGetListItems( oControl as object, aList() as string ) as integer
-function hGetNodeCount( oControl as object ) as integer
-function hGetNodeName( oControl as object , iNode as integer ) as string
+function hGetTwoDigitLangCode( iLanguage as integer ) as string
+function hTestLocale() as boolean
+function hInitSingleDoc() as boolean
+function hInitBackingMode() as boolean
+function hInitWriteDocIdentifier( cString as string ) as boolean
+function hBatchLoadJavaFiles( aFileList() , cIdent as string )
+function hFindCopyRemoveJavaLogs( cSourcePath as string ) as boolean
+sub GetPathList ( ls1 () as String, ls2 () as String, ls3 () as String )
+sub CreatePathList
+function URLGraphicCheck ( bRelativ as Boolean, sFile as String )
+sub DialogTestForViewOptions
+sub DialogTextForViewOptions_move
+sub MouseTestForViewOptions
+sub Make3D
+sub hResetAutosave()
+sub DeleteColor( cColorName as String )
+sub modifyColorRGB_PGUP( iColor as Integer )
+sub createNewColor( aColor() as String )
+sub getColorRGB( aColor() as String )
+sub compareTwoColorsRGB( aColor() as String )
+sub ModifyColorRGB( aColor() as String )
+function hOpenPropertyBrowser() as boolean
+function hClosePropertyBrowser() as boolean
+function hPBSetControlName( cControl as string ) as boolean
+function hPBGetControlName( cControl as string ) as boolean
+function hCheckPropertyPresence ( cSetting as string , iPos as integer ) as boolean
+function hSetPBTabPage( iPage as integer ) as boolean
+function hSetLabelName( sLabelName as string ) as boolean
+function hWaitForObject( oControl as object, iTime as integer ) as integer
+function hGetPrivateHttpServer( _proxy as string, _port as string ) as boolean
+function hGetPrivateFtpServer( _proxy as string, _port as string ) as boolean
+function hGetPrivateSocksServer( _proxy as string, _port as string ) as boolean
+function hGetPrivateInputPath( bVerbose as boolean ) as string
+function hGetPrivateInputFile( bVerbose as boolean ) as string
+function hCreateScriptingObject( cName as string ) as boolean
+function hRenameScriptingObject( cName as string ) as boolean
+function hDeleteScript( cName as string , bSuccess as boolean ) as boolean
+function hOpenScriptOrganizer( iDialog as integer ) as boolean
+function hCloseScriptOrganizer() as boolean
+function hOpenRunMacroDialog() as boolean
+function hSelectXMLSecTab( cTab as string ) as boolean
 function hGetPrinterPosition( cName as string, bWarn as boolean ) as integer
-function hGetPrivateFtpServer( _proxy as string, _port as string ) as boolean
-function hGetPrivateHttpServer( _proxy as string, _port as string ) as boolean
-function hGetPrivateInputFile( bVerbose as boolean ) as string
-function hGetPrivateInputPath( bVerbose as boolean ) as string
-function hGetPrivateSocksServer( _proxy as string, _port as string ) as boolean
+function hDelPrinter( cPrinterName as string ) as integer
+function hGetSpadminPath() as string
+function hShutdownOffice() as integer
+function hOpenSpadmin() as boolean
+function hWaitForSpAdmin() as boolean
+function hCreateFaxDevice( cName as string ) as boolean
+function hDocumentInfoSelectTab( cTabPage as string ) as boolean
+function hFindTemplate( sTemplateName as string ) as integer
 function hGetRefFilePath( cCategory as string, location as string) as string
-function hGetRelPath( cStartDir, cFileName as String ) as string
-function hGetSpadminPath() as string
-function hGetStringFromStaticTextField( oControl as object ) as string
-function hGetTabNameFromOrganizer() as string
-function hGetTwoDigitLangCode( iLanguage as integer ) as string
-function hGetValueForKeyAsInt( lsList() as string, sKey as string ) as integer
-function hGetValueForKeyAsLong( lsList() as string, sKey as string ) as long
-function hGetValueForPairAsLong( cLine as string ) as long
-function hGetValueForPairAsString( cLine as string ) as string
-function hGetVisibleNodeNames( oControl as object , lsList() as string ) as integer
-function hGetWizardParams( cType as string, cParam as string ) as integer
-function hGetWorkFile( cFileName as string ) as string
-function hGetWorkPath() as string
-function hHandleActivesOnLoad( iTries as integer , iAdd as integer ) as boolean
-function hHandleInitialDialogs() as integer
-function hHandleSaveError() as integer
-function hHelpGetAboutItemCount() as integer
-function hHelpGetSearchIndexItemCount() as integer
-function hHideModule() as boolean
-function hIdentifyWriterDoc( cString as string, bWarn as boolean ) as boolean
-function hIDESelectTabByIndex( iIndex as integer ) as string
-function hInitBackingMode() as boolean
-function hInitBasicIde( cModule as string ) as boolean
-function hInitFormControls( cModule as string ) as boolean
-function hInitSingleDoc() as boolean
-function hInitWriteDocIdentifier( cString as string ) as boolean
-function hInsertControl( iControl as integer ) as string
-function hInsertMacroFromFile( cMacroId ) as integer
-function hInsertMacro( _id as integer ) as boolean
-function hIsEditWindowEmpty() as boolean
-function hIsMacroEditButtonEnabled() as boolean
-function hIsMacroNewButtonEnabled() as boolean
+function hSelectCategory( cCategory as string ) as boolean
+function hSelectFileFolder( iFolder as integer , bVerbose as boolean  ) as integer
+function hGetFileFolderName( iFolder as integer ) as string
+function hSelectDocumentObject( iTitle as integer , iMode as integer ) as string
+function hIsTemplateDialogClosed() as boolean
 function hIsObjectAFolder( iObjects as integer ) as boolean
-function hIsTemplateDialogClosed() as boolean
-function hListAppendList( aBaseList() as string, aListToAppend() as string ) as integer
-function hListAppend( sNewString as string, aTargetList() as string ) as integer
-function hListCompare( aListOne() as String, aListTwo() as String ) as boolean
-function hListDelete( aList() as string, iItemToDelete as integer ) as boolean
-function hListFileGetSize( sFileIn as string ) as integer
-function hListPrependString( aList() as string, cString as string ) as boolean
-function hListTestLowerBoundary( aList() as string ) as boolean
-function hListTestUpperBoundary( aList() as string ) as boolean
-function hLoadFileExpectFailure( fpath as string ) as boolean
-function hLoadFileExpectSuccess( fpath as string ) as boolean
-function hMacroOrganizerRunMacro( cMacroName as string ) as integer
-function hManageComparisionList( sFileIn as string, sFileOut as string, sListOut() as string ) as integer
-function hMaximizeDocument() as boolean
-function hNameBasicModule( cName as string ) as boolean
-function hNameGen_append( iDecChar as long ) as string
-function hNameGen_lead( iDecChar as long ) as string
-function hNewDialog() as boolean
-function hNewModule() as boolean
-function hNumericDocType( doctype as integer ) as string
-function hOpenBasicIDE() as boolean
-function hOpenBasicObjectOrganizer( iTabPage as integer ) as boolean
-function hOpenBasicOrganizerFromDoc() as boolean
-function hOpenDigitalSignaturesDialog() as boolean
-function hOpenHelp() as boolean
-function hOpenPropertyBrowser() as boolean
-function hOpenRunMacroDialog() as boolean
-function hOpenScriptOrganizer( iDialog as integer ) as boolean
-function hOpenSpadmin() as boolean
-function hOpenWizardWithMenu( cType as string ) as integer
-function hPBGetControlName( cControl as string ) as boolean
-function hPBSetControlName( cControl as string ) as boolean
-function hRemoveLineBreaks( cString as string ) as string
-function hRemoveTrustedPath( cPath as string ) as boolean
-function hRenameScriptingObject( cName as string ) as boolean
-function hRenameTab( cTabName as string ) as integer
-function hReOpenBasicDialog() as boolean
+function hDeleteUserTemplates() as integer
+function hAccessStandardBar() as boolean
 function hResetStandardBar() as boolean
-function hSaveFileExpectFailure( fpath as string , errortype as integer ) as boolean
-function hSaveFileExpectSuccess( fpath as string , bReplace as boolean ) as boolean
-function hSaveLoadDelSuccess( cFile as string ) as integer
-function hSecurityEnterPasswordOnLoad( cPassword as string, bValid as boolean ) as boolean
-function hSecurityEnterPasswordOnSave( cPassword as string ) as boolean
-function hSelectBasicObjectOrganizerTab( iTabPage as integer ) as boolean
-function hSelectCategory( cCategory as string ) as boolean
-function hSelectControl( iControl as integer ) as boolean
-function hSelectDialogPane() as boolean
-function hSelectDocumentObject( iTitle as integer , iMode as integer ) as string
-function hSelectFileFolder( iFolder as integer , bVerbose as boolean  ) as integer
-function hSelectHelpTab( cTab as string ) as boolean
-function hSelectNextNode( oControl as object ) as integer
-function hSelectNodeByName( oControl as object , _name as string ) as integer
-function hSelectNode( oControl as object , _id as integer ) as string
-function hSelectTheLastModule( bEditEnabled as Boolean ) as boolean
-function hSelectTheLastNode( oControl as object ) as integer
-function hSelectTopNode( oControl as object ) as boolean
-function hSelectXMLSecTab( cTab as string ) as boolean
-function hSetControlValue( oObject as object, cValue as string ) as integer
-function hSetLabelName( sLabelName as string ) as boolean
-function hSetPasswordRecommendation( bEnable as boolean ) as boolean
-function hSetPBTabPage( iPage as integer ) as boolean
-function hSetProxies( HTTP_Server as string, HTTP_Port as string, FTP_Server as string, FTP_Port as string, NoProxyFor as string ) as integer
-function hSetTemplateSavePath( cFile as string ) as integer
-function hShowMacroControls() as boolean
-function hShutdownOffice() as integer
 function hStandardbarItemGetCount() as integer
+function hToggleToolbarItem( iMenuPos as integer )
 function hStandardbarLoadUrl() as boolean
 function hStandardbarNewDialog()
 function hStandardbarSaveAs()
-function hSwitchMacroSecurityTab( cTab as string )
-function hTestLocale() as boolean
-function hTestMacro( _id as integer ) as integer
-function hToggleToolbarItem( iMenuPos as integer )
-function hToolsCustomizeAddNewMenu( cName as string, bMode as boolean ) as boolean
-function hToolsCustomizeClose( iMode as integer  ) as boolean
-function hToolsCustomizeOpen() as boolean
-function hToolsCustomizeSelectTab( cTab as string ) as boolean
-function hUseBookmarksContextMenu( cAction as string ) as boolean
-function hUseImpressAutopilot( bEnable as boolean ) as boolean
-function hVerifyNodeName( oControl as object , cName as string ) as boolean
-function hWaitForObject( oControl as object, iTime as integer ) as integer
-function hWaitForSpAdmin() as boolean
-function hWaitForTreelist( oTreeList as object, cContext as string, iItemCount as integer ) as boolean
+function hSetProxies( HTTP_Server as string, HTTP_Port as string, FTP_Server as string, FTP_Port as string, NoProxyFor as string ) as integer
+function hMaximizeDocument() as boolean
+function hOpenWizardWithMenu( cType as string ) as integer
+function hFinishWizard( iMode as integer ) as boolean
+function hGetWizardParams( cType as string, cParam as string ) as integer
 function hWaitForWizard() as integer
-function hWaitWhileLoading() as boolean
-function initlistdebug( cComment as string ) as integer
-function keycompare( found as string, expected as string, sKey as string, optional cBugID as string) as boolean
-function listconvertpath( lsList() as string ) as integer
-function listdebug( lsList() as string , cComment as string ) as integer
-function listInsertSection( lsList() as string, cSection as string ) as integer
-function listmoveitem( source() as string, target() as string, itemid as integer ) as integer
-function setCheckBox( _file as string , sKey as string , control as object , optional bverbose as boolean ) as boolean
-function setComboBox( _file as string , sKey as string , control as object , optional bverbose as boolean  ) as integer
-function  setEntryField( _file as string , sKey as string , control as object , optional bverbose as boolean ) as string
-function setListBox( _file as string , sKey as string , control as object , optional bverbose as boolean  ) as integer
+function hSetTemplateSavePath( cFile as string ) as integer
+function hHandleSaveError() as integer
+function hClickNextButton() as boolean
+

File testautomation/global/tools/includes/required/t_files.inc

 '*
 '\******************************************************************************
 
-private const C_INFO = TRUE ' Set this to TRUE to increase verbosity of some functions
+private const C_INFO = FALSE ' Set this to TRUE to increase verbosity of some functions
 
 function hGrafikEinfuegen  ( Grafik$ ) as Boolean
     '/// hGrafikEinfuegen hGraphicInsert

File testautomation/global/tools/includes/required/t_menu.inc

 'encoding UTF-8  Do not remove or change this line!
-'**************************************************************************
+'*******************************************************************************
 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-'* 
+'*
 '* Copyright 2008 by Sun Microsystems, Inc.
 '*
 '* OpenOffice.org - a multi-platform office productivity suite
 '* <http://www.openoffice.org/license.html>
 '* for a copy of the LGPLv3 License.
 '*
-'/************************************************************************
+'/******************************************************************************
 '*
 '* Owner : thorsten.bosbach@sun.com
 '*
 '* short description : wrappers for accessing menues (context-, bar-, button- menues)
 '*
-'***********************************************************************************
-' #1 hMenuItemGetCount
-' #1 hMenuSelectNr
-' #1 hMenuItemCheck
-' #1 hMenuItemUnCheck
-' #1 hMenuFindSelect
-' #1 hMenuItemIsChecked
-' #1 hMenuItemIsEnabled
-' #1 hMenuItemGetText
-' #1 hMenuItemGetTextMitTilde
-' #1 hMenuGetTextList
-' #1 hMenuGetTextListMitTilden
-' #1 hMenuGetListOhneTilde
-' #1 hMenuGetTildenList
-' #1 hhEntferneTilde
-' #1 hMenuGetItemCommand
-' #1 hWindowGetCount
-' #1 hWindowGetIndex
-' #1 hWindowGetText
-' #1 hWindowSelect
-' #1 hUseMenu
-' #1 hMenuClose
-' #1 hOeffneNeuImMenue
-' #1 hOeffneEinstellungenImMenue
-' #1 hOeffneImMenue
-' #1 hGetWindowCaption
-' #1 fSplitWindowTitle
-' #1 hMenuGetItemID
-' #1 hOpenContextMenu
-'\*****************************************************************
+'\******************************************************************************
 
 function hMenuItemGetCount as Integer
-'/// OUTPUT: number of entries in the activated menu (without seperators) ///'
-'///+ menu left open ///'
- Dim i, j, Ende, nID as Integer
-   Sleep 2
 
-   j=0
-   for i=1 to MenuGetItemCount
-      if NOT MenuIsSeperator ( i ) then j=j+1
-   next i
-   hMenuItemGetCount = j
+    '/// OUTPUT: number of entries in the activated menu (without seperators) ///'
+    '///+ menu left open ///'
+    dim iCurrentMenuItem as integer
+    dim iValidMenuItems as integer
+
+    sleep( 2 )
+
+    iValidMenuItems = 0
+    for iCurrentMenuItem = 1 to MenuGetItemCount
+        if ( NOT MenuIsSeperator ( iCurrentMenuItem ) ) then
+            iValidMenuItems = iValidMenuItems + 1
+        endif
+    next iCurrentMenuItem
+    hMenuItemGetCount = iValidMenuItems
+
 end function
 
-'-------------------------------------------------------------------------
+'*******************************************************************************
 
 function hMenuSelectNr ( EintragsNr as Integer ) as String
-'/// Selects the given nr. of <b>enabled</b> menu entry.
-'/// <u>Note</u>: If there are disabled menu items are included the routine ignores them!
-'///INPUT : number of entry from the top (>=1) OR
-'///INPUT : number of entry from the bottom (<=-1)
-'///INPUT : 0 to close menu
-'///+ OUTPUT: text of the entry
- Dim i, j, RealEnd, Ende as Integer
- Dim nID as long
-   Sleep 2
 
-   Ende = EintragsNr
-   RealEnd = MenuGetItemCount
-   If (Ende > 0) then
-       if Ende > RealEnd then
-          Warnlog "hMenuSelectNr canceled: Entry number "+ Ende +" does not exists, because there are only " + RealEnd + "  entries! "
-          hMenuClose
-          exit function
-       end if
-       j=0
-       for i=1 to Ende
-          if MenuIsSeperator ( i+j ) then j = j+1
-       next i
-   else
-       if ((RealEnd + Ende) < 0) then
-          Warnlog "hMenuSelectNr canceled: Entry number "+ Ende +" does not exists, because there are only " + RealEnd + "  entries! "
-          hMenuClose
-          exit function
-       end if
-       j=1
-       for i=-1 to Ende step -1
-          if MenuIsSeperator (RealEnd +i+j) then dec(j)
-       next i
-       j = j + RealEnd
-   endif
-   if EintragsNr = 0 then
+    '/// Selects the given nr. of <b>enabled</b> menu entry.
+    '/// <u>Note</u>: If there are disabled menu items are included the routine ignores them!
+    '///INPUT : number of entry from the top (>=1) OR
+    '///INPUT : number of entry from the bottom (<=-1)
+    '///INPUT : 0 to close menu
+    '///+ OUTPUT: text of the entry
+    
+    Dim i, j, RealEnd, Ende as Integer
+    Dim nID as long
+    
+    sleep( 2 )
+
+    Ende = EintragsNr
+    RealEnd = MenuGetItemCount
+    If (Ende > 0) then
+        if Ende > RealEnd then
+            Warnlog "hMenuSelectNr canceled: Entry number "+ Ende +" does not exists, because there are only " + RealEnd + "  entries! "
+            hMenuClose
+            exit function
+        endif
+        j=0
+        for i=1 to Ende
+            if MenuIsSeperator ( i+j ) then
+                j = j+1
+            endif
+        next i
+    else
+        if ((RealEnd + Ende) < 0) then
+            Warnlog "hMenuSelectNr canceled: Entry number "+ Ende +" does not exists, because there are only " + RealEnd + "  entries! "
+            hMenuClose
+            exit function
+        endif
+        j=1
+        for i=-1 to Ende step -1
+            if MenuIsSeperator (RealEnd +i+j) then
+                j = j -1
+            endif
+        next i
+        j = j + RealEnd
+    endif
+    if EintragsNr = 0 then
         hMenuClose
         exit function
-   endif
-   nID = MenuGetItemID ( EintragsNr+j )
-   hMenuSelectNr = MenuGetItemText ( nID )
-   MenuSelect ( nID )
+    endif
+    nID = MenuGetItemID ( EintragsNr+j )
+    hMenuSelectNr = MenuGetItemText ( nID )
+    MenuSelect ( nID )
+
 end function
 
+'*******************************************************************************
+
 function hMenuItemCheck ( EintragsNr as Integer ) as String
-'/// check the menu item (if it is checked, it stays checked) ///'
-'///+ INPUT : number of entry from the top (>=1)///'
-'///+ OUTPUT: text of the entry ///'
- Dim i as Integer, j as Integer, RealEnd as Integer, Ende as Integer, nID as Integer
 
-   Ende = EintragsNr
-   RealEnd = hMenuItemGetCount
-   if Ende > RealEnd then
-      Warnlog "hMenuItemCheck canceled: Entry number "+ Ende +" does not exists, because there are only " + RealEnd + "  entries! "
-      hMenuClose
-      exit function
-   end if
-   j=0
-   for i=1 to Ende
-      if MenuIsSeperator ( i+j ) then j = j+1
-   next i
-   nID = MenuGetItemID ( EintragsNr+j )
-   hMenuItemCheck = MenuGetItemText ( nID )
-   if NOT MenuIsItemChecked ( nID ) then
-      MenuSelect ( nID )
-   else
-      hMenuClose
-   end if
+    '/// check the menu item (if it is checked, it stays checked) ///'
+    '///+ INPUT : number of entry from the top (>=1)///'
+    '///+ OUTPUT: text of the entry ///'
+    Dim i as Integer, j as Integer, RealEnd as Integer, Ende as Integer, nID as Integer
+
+    Ende = EintragsNr
+    RealEnd = hMenuItemGetCount
+        
+    if Ende > RealEnd then
+        Warnlog "hMenuItemCheck canceled: Entry number "+ Ende +" does not exists, because there are only " + RealEnd + "  entries! "
+        hMenuClose
+        exit function
+    endif
+    j=0
+    for i=1 to Ende
+        if MenuIsSeperator ( i+j ) then
+            j = j+1
+        endif
+    next i
+    nID = MenuGetItemID ( EintragsNr+j )
+    hMenuItemCheck = MenuGetItemText ( nID )
+    if NOT MenuIsItemChecked ( nID ) then
+        MenuSelect ( nID )
+    else
+        hMenuClose()
+    endif
+
 end function
 
+'*******************************************************************************
+
 function hMenuItemUnCheck ( EintragsNr as Integer ) as String
-'/// UNcheck the menu item (if it is UNchecked, it stays UNchecked) ///'
-'///+ INPUT : number of entry from the top (>=1)///'
-'///+ OUTPUT: text of the entry ///'
- Dim i, j, RealEnd, Ende, nID as Integer
 
-   Ende = EintragsNr
-   RealEnd = hMenuItemGetCount
-   if Ende > RealEnd then
-      Warnlog "hMenuItemUnCheck canceled: Entry number "+ Ende +" does not exists, because there are only " + RealEnd + "  entries! "
-      hMenuClose
-      exit function
-   end if
-   j=0
-   for i=1 to Ende
-      if MenuIsSeperator ( i+j ) then j = j+1
-   next i
-   nID = MenuGetItemID ( EintragsNr+j )
-   hMenuItemUnCheck = MenuGetItemText ( nID )
-   if MenuIsItemChecked ( nID ) then
-      MenuSelect ( nID )
-   else
-      hMenuClose
-   end if
+    '/// UNcheck the menu item (if it is UNchecked, it stays UNchecked) ///'
+    '///+ INPUT : number of entry from the top (>=1)///'
+    '///+ OUTPUT: text of the entry ///'
+    Dim i, j, RealEnd, Ende, nID as Integer
+
+    Ende = EintragsNr
+    RealEnd = hMenuItemGetCount
+    if Ende > RealEnd then
+        Warnlog "hMenuItemUnCheck canceled: Entry number "+ Ende +" does not exists, because there are only " + RealEnd + "  entries! "
+        hMenuClose
+        exit function
+    endif
+    j=0
+    for i=1 to Ende
+        if MenuIsSeperator ( i+j ) then
+            j = j+1
+        endif
+    next i
+    nID = MenuGetItemID ( EintragsNr+j )
+    hMenuItemUnCheck = MenuGetItemText ( nID )
+    if MenuIsItemChecked ( nID ) then
+        MenuSelect ( nID )
+    else
+        hMenuClose()
+    endif
+
 end function
 
-'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+'*******************************************************************************
 
 function hMenuFindSelect(MenuID as variant, SelectSlot as Boolean, ExpectedNr as integer, optional VerboseWrongPosition as Boolean) as Boolean
-'/// Find specified MenuID in Menu, check if its found on the expected place, ///'
-'/// if not - report the correct slot, and if specified to do so - Select the correct slot. ///'
-'///+ INPUT: MenuID: the string-name of the menu-entry we are lookin for. ///'
-'///+ INPUT: TRUE, if the slot should be called, ///'
-'///+            FALSE, if the slot shouldn't be called. ///'
-'///+ INPUT: Optional: TRUE, if errors should be reported. ///'
-'///+                           FALSE, silent mode for errors. ///'
-'///+ INPUT: Optional: The Expected Number of entry from the top (>=1) ///'
-'///+ OUTPUT: If not found at the expected place - the correct Entry-number is reported ///'
- Dim i as Integer
- Dim RealId as Integer
- Dim RealPosition as Integer
- Dim MenuIDAsNumber as integer
- Dim MenuIDAsString as string
- Dim RealEnd as Integer
- Dim nID as string
- Dim found as string
- Dim StringType as Boolean
+
+    '/// Find specified MenuID in Menu, check if its found on the expected place, ///'
+    '/// if not - report the correct slot, and if specified to do so - Select the correct slot. ///'
+    '///+ INPUT: MenuID: the string-name of the menu-entry we are lookin for. ///'
+    '///+ INPUT: TRUE, if the slot should be called, ///'
+    '///+            FALSE, if the slot shouldn't be called. ///'
+    '///+ INPUT: Optional: TRUE, if errors should be reported. ///'
+    '///+                           FALSE, silent mode for errors. ///'
+    '///+ INPUT: Optional: The Expected Number of entry from the top (>=1) ///'
+    '///+ OUTPUT: If not found at the expected place - the correct Entry-number is reported ///'
+
+    Dim i as Integer
+    Dim RealId as Integer
+    Dim RealPosition as Integer
+    Dim MenuIDAsNumber as integer
+    Dim MenuIDAsString as string
+    Dim RealEnd as Integer
+    Dim nID as string
+    Dim found as string
+    Dim StringType as Boolean
 
     '/// find out if we are going to search for an ID, or a string (.uno:) ///'
     if IsNumeric(MenuID) then
     else
         MenuIDAsString = MenuID
         StringType = TRUE
-    end if
+    endif
 
     RealEnd = MenuGetItemCount
     if ExpectedNr > RealEnd then
         Warnlog "Entry number "+ ExpectedNr +" is higher than the number of entries (" + RealEnd + ") in this menu! "
-    end if
+    endif
 
     if StringType = FALSE then  'Search for the number.
 
         if nID <> MenuID then
             if VerboseWrongPosition = TRUE then
                 warnlog " the questioned ID (" + MenuID + ") were not found on position " + ExpectedNr
-            end if
+            endif
             Found = FALSE
             for i=1 to RealEnd
                 nID = MenuGetItemID (i)
                     RealPosition = i
                     if VerboseWrongPosition = TRUE then
                         warnlog "The real Position (Separators included) was: " + i
-                    end if
+                    endif
                     i = RealEnd
-                end if
+                endif
             next i
         else
             Found = TRUE
             RealPosition = ExpectedNr
             RealId = MenuGetItemID (ExpectedNr)
-        end if
+        endif
 
         if Found = TRUE then
             if SelectSlot then
                 printlog "the slot was found, but the tester had choosen NOT to open the slot"
                 hMenuFindSelect = TRUE
                 hMenuClose
-            end if
+            endif
         else
             if VerboseWrongPosition = TRUE then
                 warnlog "The slot was NOT found. Has either been removed, or it's a bug."
-            end if
+            endif
             hMenuFindSelect = FALSE
             hMenuClose
-       end if
+        endif
 
-   else 'StringType = TRUE   :   Seach for the .uno; -name.
-       nID = lCase(MenuGetItemCommand (MenuGetItemID (ExpectedNr)))
+    else 'StringType = TRUE   :   Seach for the .uno; -name.
+        nID = lCase(MenuGetItemCommand (MenuGetItemID (ExpectedNr)))
 
-       if nID <> lCase(MenuID) then
-           if VerboseWrongPosition = TRUE then
-               warnlog " the questioned ID (" + MenuID + ") were not found on position " + ExpectedNr
-           end if
-           Found = FALSE
-           for i=1 to RealEnd
-               nID = MenuGetItemCommand (MenuGetItemID (i))
-               printlog "For the position '" + i + "', the ItemCommand was: " + nID + " and the ID was: " + MenuGetItemID (i) + "."
-               if nID = MenuID then
-                   Found = TRUE
-                   RealID = MenuGetItemID (i)
-                   RealPosition = i
-                   if VerboseWrongPosition = TRUE then
-                       warnlog "The real Position (Separators included) was: " + i
-                   end if
-                   i = RealEnd
-               end if
-           next i
-       else
-           Found = TRUE
-           RealPosition = ExpectedNr
-           RealId = MenuGetItemID (ExpectedNr)
-       end if
-       if Found = TRUE then
-           if SelectSlot then
-               MenuSelect (RealID)
-               hMenuFindSelect = TRUE
-           else
-               printlog "the slot was found, but the tester had choosen NOT to open the slot"
-               hMenuFindSelect = TRUE
-               hMenuClose
-           end if
-       else
-           if VerboseWrongPosition = TRUE then
-               warnlog "The slot was NOT found. Has either been removed, or it's a bug."
-           end if
-           hMenuFindSelect = FALSE
-           hMenuClose
-       end if
-   end if 'StringType = TRUE
-   wait 200   'Wait 0,2 seconds in case we just have called a Submenu.
+        if nID <> lCase(MenuID) then
+            if VerboseWrongPosition = TRUE then
+                warnlog " the questioned ID (" + MenuID + ") were not found on position " + ExpectedNr
+            endif
+            Found = FALSE
+            for i=1 to RealEnd
+                nID = MenuGetItemCommand (MenuGetItemID (i))
+                printlog "For the position '" + i + "', the ItemCommand was: " + nID + " and the ID was: " + MenuGetItemID (i) + "."
+                if nID = MenuID then
+                    Found = TRUE
+                    RealID = MenuGetItemID (i)
+                    RealPosition = i
+                    if VerboseWrongPosition = TRUE then
+                        warnlog "The real Position (Separators included) was: " + i
+                    endif
+                    i = RealEnd
+                endif
+            next i
+        else
+            Found = TRUE
+            RealPosition = ExpectedNr
+            RealId = MenuGetItemID (ExpectedNr)
+        endif
+        if Found = TRUE then
+            if SelectSlot then
+                MenuSelect (RealID)
+                hMenuFindSelect = TRUE
+            else
+                printlog "the slot was found, but the tester had choosen NOT to open the slot"
+                hMenuFindSelect = TRUE
+                hMenuClose()
+            endif
+        else
+            if VerboseWrongPosition = TRUE then
+                warnlog "The slot was NOT found. Has either been removed, or it's a bug."
+            endif
+            hMenuFindSelect = FALSE
+            hMenuClose()
+        endif
+    endif 'StringType = TRUE
+    wait 200   'Wait 0,2 seconds in case we just have called a Submenu.
+
 end function
 
-'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+'*******************************************************************************
 
 function hMenuItemIsChecked ( EintragsNr as Integer ) as Boolean
-'/// is the the menu item checked ? ///'
-'///+ INPUT : number of entry from the top (>=1)///'
-'///+ OUTPUT: True = yes!, False = no! ///'
- Dim i, j, Ende, RealEnd, nID as Integer
 
-   Ende = EintragsNr
-   RealEnd = hMenuItemGetCount
-   if Ende > RealEnd then
-      Warnlog "hMenuItemIsChecked canceled: Entry number "+ Ende +" does not exists, because there are only " + RealEnd + "  entries! "
-      hMenuClose
-      exit function
-   end if
-   j=0
-   for i=1 to Ende
-      if MenuIsSeperator ( i+j ) then j = j+1
-   next i
-   nID = MenuGetItemID ( EintragsNr + j )
-   hMenuItemIsChecked = MenuIsItemChecked ( nID )
+    '/// is the the menu item checked ? ///'
+    '///+ INPUT : number of entry from the top (>=1)///'
+    '///+ OUTPUT: True = yes!, False = no! ///'
+
+    Dim i, j, Ende, RealEnd, nID as Integer
+
+    Ende = EintragsNr
+    RealEnd = hMenuItemGetCount
+    if Ende > RealEnd then
+        Warnlog "hMenuItemIsChecked canceled: Entry number "+ Ende +" does not exists, because there are only " + RealEnd + "  entries! "
+        hMenuClose
+        exit function
+    endif
+    j=0
+    for i=1 to Ende
+        if MenuIsSeperator ( i+j ) then 
+            j = j+1
+        endif
+    next i
+    nID = MenuGetItemID ( EintragsNr + j )
+    hMenuItemIsChecked = MenuIsItemChecked ( nID )
+
 end function
 
+'*******************************************************************************
+
 function hMenuItemIsEnabled ( EintragsNr as Integer ) as Boolean
-'/// is the the menu item enabled (not greyed out) ? ///'
-'///+ INPUT : number of entry from the top (>=1)///'
-'///+ OUTPUT: True = yes!, False = no! ///'
-'///+ menu left open ///'
- Dim i, j, Ende, RealEnd, nID as Integer
 
-   Ende = EintragsNr
-   RealEnd = MenuGetItemCount
-   if Ende > RealEnd then
-      Warnlog "hMenuItemIsEnabled canceled: Entry number "+ Ende +" does not exists, because there are only " + RealEnd + "  entries! "
-      hMenuClose
-      exit function
-   end if
-   j=0
-   for i=1 to Ende
-      if MenuIsSeperator ( i+j ) then j = j+1
-   next i
-   nID = MenuGetItemID ( EintragsNr + j )
-   hMenuItemIsEnabled = MenuIsItemEnabled ( nID )
+    '/// is the the menu item enabled (not greyed out) ? ///'
+    '///+ INPUT : number of entry from the top (>=1)///'
+    '///+ OUTPUT: True = yes!, False = no! ///'
+    '///+ menu left open ///'
+
+    Dim i, j, Ende, RealEnd, nID as Integer
+
+    Ende = EintragsNr
+    RealEnd = MenuGetItemCount
+    if Ende > RealEnd then
+        Warnlog "hMenuItemIsEnabled canceled: Entry number "+ Ende +" does not exists, because there are only " + RealEnd + "  entries! "
+        hMenuClose
+        exit function
+    endif
+    j=0
+    for i=1 to Ende
+        if MenuIsSeperator ( i+j ) then
+            j = j+1
+        endif
+    next i
+    nID = MenuGetItemID ( EintragsNr + j )
+    hMenuItemIsEnabled = MenuIsItemEnabled ( nID )
+
 end function
 
+'*******************************************************************************
+
 function hMenuItemGetText ( EintragsNr as Integer ) as String
-'///+ INPUT : number of entry from the top (>=1)///'
-'///+ OUTPUT: text of item without tilde ///'
-'///+ menu left open ///'
- Dim i, j, RealEnd, Ende, nID as Integer
 
-   Ende = EintragsNr
-   RealEnd = MenuGetItemCount
-   if Ende > RealEnd then
-      Warnlog "hMenuItemGetText canceled: Entry number "+ Ende +" does not exists, because there are only " + RealEnd + "  entries! "
-      hMenuClose
-      exit function
-   end if
-   j=0
-   for i=1 to Ende
-      if MenuIsSeperator ( i+j ) then j = j+1
-   next i
-   nID = MenuGetItemID ( EintragsNr + j )
-   hMenuItemGetText = hhEntferneTilde ( MenuGetItemText ( nID ) )
+    '///+ INPUT : number of entry from the top (>=1)///'
+    '///+ OUTPUT: text of item without tilde ///'
+    '///+ menu left open ///'
+
+    Dim i, j, RealEnd, Ende, nID as Integer
+
+    Ende = EintragsNr
+    RealEnd = MenuGetItemCount
+    if Ende > RealEnd then
+        Warnlog "hMenuItemGetText canceled: Entry number "+ Ende +" does not exists, because there are only " + RealEnd + "  entries! "
+        hMenuClose
+        exit function
+    endif
+    j=0
+    for i=1 to Ende
+        if MenuIsSeperator ( i+j ) then
+            j = j+1
+        endif
+    next i
+    nID = MenuGetItemID ( EintragsNr + j )
+    hMenuItemGetText = hhEntferneTilde ( MenuGetItemText ( nID ) )
+
 end function
 
-function hMenuItemGetTextMitTilde ( EintragsNr as Integer ) as String
-'/// INPUT : number of entry from the top (>=1)///'
-'///+ OUTPUT: text of item with tilde (which indicates the shortcurt of the entry)///'
-'///+ menu left open ///'
- Dim i, j, RealEnd, Ende, nID as Integer
+'*******************************************************************************
 
-   Ende = EintragsNr
-   RealEnd = MenuGetItemCount
-   if Ende > RealEnd then
-      Warnlog "hMenuItemGetTextMitTilde canceled: Entry number "+ Ende +" does not exists, because there are only " + RealEnd + "  entries! "
-      hMenuClose
-      exit function
-   end if
-   j=0
-   for i=1 to Ende
-      if MenuIsSeperator ( i+j ) then j = j+1
-   next i
-   nID = MenuGetItemID ( EintragsNr + j )
-   hMenuItemGetTextMitTilde = MenuGetItemText ( nID )
+sub hMenuClose
+
+    '/// close menue ///'
+    '///+ after a hMenuClose you have to execute Kontext.UseMenu again
+    '///+ if you want to open any other menu.
+    MenuSelect ( 0 )
+
+end sub
+
+'*******************************************************************************
+
+function hhEntferneTilde ( sEintrag as String ) as String
+
+    '///+ INPUT : string with tilde ///'
+    '///+ OUTPUT: string without tilde ///'
+
+    Dim i
+    i = Instr ( 1, sEintrag, "~", 1 )
+    if i <> 0 then
+        hhEntferneTilde = Left ( sEintrag, i-1 ) + Right ( sEintrag, ( Len(sEintrag) - i ) )
+    else
+        hhEntferneTilde = sEintrag
+    endif
+
 end function
 
-function hMenuGetTextList ( lsEintragsliste() as String ) as Integer
-'/// INPUT : a 'list-variable' aka string array; ///'
-'///+ OUTPUT: number of entries in the menue/list; the list-variable contains now the strings of the menu (withOUT tildes) ///'
-'///+ menu left open ///'
- Dim i, j, nID as Integer
- Dim Eintrag as String
+'*******************************************************************************
 
-   lsEintragsListe(0) = 0
-   j=0
-   for i=1 to MenuGetItemCount
-      if NOT MenuIsSeperator ( i ) then
-         nID = MenuGetItemID ( i )
-         Eintrag = hhEntferneTilde ( MenuGetItemText ( nID ) )
-         ListAppend ( lsEintragsListe(), Eintrag )
-         j=j+1
-      end if
-   next i
-   hMenuGetTextList = j
+function hMenuGetItemCommand ( EintragsNr as Integer ) as String
+
+    '/// <u>hMenuGetItemCommand(Nr)</u> ///
+    '///+ To read the slot/UNO slot which is behind a menu item. ///
+    '///+ Seperators will be ignored for the input INTEGER!
+
+    Dim i as integer
+    Dim j as integer
+    Dim RealEnd as integer
+    Dim DasEnde as integer
+    Dim nID as Integer
+    DasEnde = EintragsNr
+    RealEnd = MenuGetItemCount
+    if DasEnde > RealEnd then
+        warnlog "Parameter (" & DasEnde & ") bigger than items in menu (" & RealEnd & ") , 'hMenuGetItemCommand' canceled."
+    else
+        j=0
+        for i=1 to DasEnde
+            if MenuIsSeperator ( i+j ) then
+                j = j+1
+            endif
+        next i
+        nID = MenuGetItemID ( EintragsNr+j )
+        hMenuGetItemCommand = MenuGetItemCommand ( nID )
+    endif
+
 end function
 
-function hMenuGetTextListMitTilden ( lsEintragsliste() as String ) as Integer
-'/// INPUT : a 'list-variable' aka string array; ///'
-'///+ OUTPUT: number of entries in the menue/list; the list-variable contains now the strings of the menu (with tildes) ///'
-'///+ menu left open ///'
- Dim i, j, nID as Integer
- Dim Eintrag as String
+'*******************************************************************************
 
-   lsEintragsListe(0) = 0
-   j=0
-   for i=1 to MenuGetItemCount
-      if NOT MenuIsSeperator ( i ) then
-         nID = MenuGetItemID ( i )
-         Eintrag = MenuGetItemText ( nID )
-         ListAppend ( lsEintragsListe(), Eintrag )
-         j=j+1
-      end if
-   next i
-   hMenuGetTextListMitTilden = j
+function hMenuGetItemId ( EintragsNr as Integer ) as integer
+
+    '///+ To read the Slot ID which is behind a menu item. ///
+    '///+ Seperators will be ignored for the input INTEGER!
+
+    Dim i as integer
+    Dim j as integer
+    Dim RealEnd as integer
+    Dim DasEnde as integer
+    DasEnde = EintragsNr
+    RealEnd = MenuGetItemCount
+    if DasEnde > RealEnd then
+        warnlog "Parameter (" & DasEnde & ") bigger than items in menu (" & RealEnd & ") , 'hMenuGetItemId' canceled."
+    else
+        j=0
+        for i=1 to DasEnde
+            if MenuIsSeperator ( i+j ) then
+                j = j+1
+            endif
+        next i
+        hMenuGetItemId = MenuGetItemID ( EintragsNr+j )
+    endif
+
 end function
 
-function hMenuGetListOhneTilde ( lsEintragsliste() as String ) as Integer
-'/// put the entries of the menues in a list that don't have a tilde -> BUG ///'
-'///+ INPUT : a 'list-variable' aka string array; ///'
-'///+ OUTPUT: number of entries without a tilde; the list-variable contains now the strings of the menu without tildes ///'
-'///+ menu left open ///'
- Dim i, j, nID as Integer
- Dim Eintrag as String
-
-   lsEintragsListe(0) = 0
-   j=0
-   for i=1 to MenuGetItemCount
-      if NOT MenuIsSeperator ( i ) then
-         nID = MenuGetItemID ( i )
-         Eintrag = MenuGetItemText ( nID )
-         if Eintrag = ( hhEntferneTilde ( Eintrag ) ) then
-            ListAppend ( lsEintragsListe(), Eintrag )
-            j=j+1
-         end if
-      end if
-   next i
-   hMenuGetListOhneTilde = j
-end function
-
-function hMenuGetTildenList ( lsEintragsliste() as String ) as Integer
-'/// put the entries of the menues in a list that HAVE a tilde ///'
-'///+ INPUT : a 'list-variable' aka string array; ///'
-'///+ OUTPUT: number of entries a tilde; the list-variable contains now the strings of the menu with tildes ///'
-'///+ menu left open ///'
- Dim i, j, nID, Stelle as Integer
- Dim Eintrag as String
-
-   lsEintragsListe(0) = 0
-   j=0
-   for i=1 to MenuGetItemCount
-      if NOT MenuIsSeperator ( i ) then
-         nID = MenuGetItemID ( i )
-         Eintrag = MenuGetItemText ( nID ) + " - "
-         Stelle = Instr ( 1, Eintrag, "~", 1 )
-         if Stelle <> 0 then
-            Eintrag = Eintrag + Mid ( Eintrag, Stelle, 2 )
-         end if
-         ListAppend ( lsEintragsListe(), Eintrag )
-         j=j+1
-      end if
-   next i
-   hMenuGetTildenList = j
-end function
-
-
-sub hMenuClose
-'/// close menue ///'
-'///+ after a hMenuClose you have to execute Kontext.UseMenu again
-'///+ if you want to open any other menu.
-    MenuSelect ( 0 )
-end sub
-
-' ***************************************************************************
-' ************                subroutines                *****************
-' ***************************************************************************
-
-function hhEntferneTilde ( sEintrag as String ) as String
-'///+ INPUT : string with tilde ///'
-'///+ OUTPUT: string without tilde ///'
- Dim i
-   i = Instr ( 1, sEintrag, "~", 1 )
-   if i <> 0 then
-      hhEntferneTilde = Left ( sEintrag, i-1 ) + Right ( sEintrag, ( Len(sEintrag) - i ) )
-   else
-      hhEntferneTilde = sEintrag
-   end if
-end function
-
-sub hOeffneNeuImMenue
-'/// open the entry 'new' in all languages in a menu ///'
-'///+ menue has to be opened before! ///'
- Dim SpracheNeu as string
- Dim Treffer as string
- Dim y, GrossesEnde, openID as integer
-
-   select case iSprache
-      case 01   : SpracheNeu = "New"
-      case 03   : SpracheNeu = "Novo"
-      case 31   : SpracheNeu = "Nieuw"
-      case 33   : SpracheNeu = "Nouveau"
-      case 34   : SpracheNeu = "Nuevo"
-      case 39   : SpracheNeu = "Nuovo"
-      case 46   : SpracheNeu = "Nytt"
-      case 49   : SpracheNeu = "Neu"
-      case else : warnlog "Sprache nicht aufgenommen in hOeffneImMenue!!!!"
-   end select
-   GrossesEnde = MenuGetItemCount
-
-   for y=1 to GrossesEnde-1
-      Treffer = hMenuItemGetText ( y )
-        if InStr ( Treffer , SpracheNeu ) > 0 then
-          Exit For
-        end if
-   next y
-   hMenuSelectNr ( y )
-end sub
-
-sub hOeffneEinstellungenImMenue
-'/// open the entry 'Properties' in all languages in a menu ///'
-'///+ menue has to be opened before! ///'
-   Dim SpracheEinstellungen as string
-   Dim Treffer as string
-   Dim y, GrossesEnde, openID as integer
-
-   select case iSprache
-
-      case 01   : SpracheEinstellungen = "Properties"
-      case 03   : SpracheEinstellungen = "Eigenschaften"
-      case 31   : SpracheEinstellungen = "Eigenschappen"
-      case 33   : SpracheEinstellungen = "Prop"
-      case 34   : SpracheEinstellungen = "Eigenschaften"
-      case 39   : SpracheEinstellungen = "Propriet"
-      case 46   : SpracheEinstellungen = "Egenskaper"
-      case 49   : SpracheEinstellungen = "Eigenschaften"
-      case else : warnlog "Sprache nicht aufgenommen in hOeffneEinstellungenImMenue!!!!"
-
-   end select
-   GrossesEnde = MenuGetItemCount
-
-   for y=1 to GrossesEnde-1
-      Treffer = hMenuItemGetText ( y )
-        if InStr ( Treffer , SpracheEinstellungen ) > 0 then
-          Exit For
-        end if
-   next y
-   hMenuSelectNr ( y )
-end sub
-
-sub hOeffneImMenue ( OeffneDas$ )
-'/// open an entry in in a menu ///'
-'///+ INPUT: string of emntry to open ///'
-'///+ menue has to be opened before! ///'
-Dim Treffer as string
-   Dim y, GrossesEnde, openID as integer
-   GrossesEnde = MenuGetItemCount
-
-   for y=1 to GrossesEnde-1
-      Treffer = hMenuItemGetText ( y )
-        if InStr ( Treffer , OeffneDas$ ) > 0 then
-          Exit For
-        end if
-   next y
-   hMenuSelectNr ( y )
-   sleep(2)
-end sub
-
-'-------------------------------------------------------------------------
-
-function hMenuGetItemCommand ( EintragsNr as Integer ) as String
-'/// <u>hMenuGetItemCommand(Nr)</u> ///
-'///+ To read the slot/UNO slot which is behind a menu item. ///
-'///+ Seperators will be ignored for the input INTEGER!
-   Dim i as integer
-   Dim j as integer
-   Dim RealEnd as integer
-   Dim DasEnde as integer
-   Dim nID as Integer
-   DasEnde = EintragsNr
-   RealEnd = MenuGetItemCount
-   if DasEnde > RealEnd then
-      warnlog "Parameter (" & DasEnde & ") bigger than items in menu (" & RealEnd & ") , 'hMenuGetItemCommand' canceled."
-     else
-      j=0
-      for i=1 to DasEnde
-       if MenuIsSeperator ( i+j ) then
-        j = j+1
-       end if
-      next i
-      nID = MenuGetItemID ( EintragsNr+j )
-      hMenuGetItemCommand = MenuGetItemCommand ( nID )
-   end if
-end function
-
-function hMenuGetItemId ( EintragsNr as Integer ) as integer
-'///+ To read the Slot ID which is behind a menu item. ///
-'///+ Seperators will be ignored for the input INTEGER!
-   Dim i as integer
-   Dim j as integer
-   Dim RealEnd as integer
-   Dim DasEnde as integer
-   DasEnde = EintragsNr
-   RealEnd = MenuGetItemCount
-   if DasEnde > RealEnd then
-      warnlog "Parameter (" & DasEnde & ") bigger than items in menu (" & RealEnd & ") , 'hMenuGetItemId' canceled."
-     else
-      j=0
-      for i=1 to DasEnde
-       if MenuIsSeperator ( i+j ) then
-        j = j+1
-       end if
-      next i
-      hMenuGetItemId = MenuGetItemID ( EintragsNr+j )
-   end if
-end function
-
-'-------------------------------------------------------------------------
-
+'*******************************************************************************
 
 '/// Functions for the lower part of the 'Window' Menu ///'
 '///+ philosophie: you can't do any actions on the first document -> it get's the number 0 and it doesn't count ///'
 '///+ so the first window you can work with gets the number 1 and counting starts with 1 ... ///'
-
 '///<b> function hUseMenu () </b>///'
 '///+ very global function: depends on 'gApplication' just activates the menu-bar ///'
-
-'///<b> function hWindowGetCount () as integer </b>///'
-'///+ returns the number of windows (all inclusive the first one!) ///'
-
 '///<b> function hWindowGetIndex () as integer </b>///'
 '///+ returns the number of the active window ///'
-
 '///<b> function hWindowGetText (optional iWindow as integer) as string </b>///'
 '///+ returns the text of the menu entry without the tilde: ///'
 '///+ w/ calling parameter: the active window ///'
 '///+ w/o calling parameter: the window i ///'
-
 '///<b> function hWindowSelect (iWindow as integer) </b>///'
 '///+ switches to the window i ///'
 '///+ calling parameter: id of the window to activate ///'
 
-'-------------------------------------------------------------------------
+'*******************************************************************************
 
-function hWindowGetCount () as integer
-'///<b> function hWindowGetCount () as integer </b>///'
-'///+ returns the number of windows ///'
+function hWindowGetIndex () as integer
 
-   'uShort GetDocumentCount() ' testool command
-   hWindowGetCount = GetDocumentCount()
+    '///<b> function hWindowGetIndex () as integer </b>///'
+    '///+ returns the number of the active window ///'
+    
+    dim iMenues as integer      ' takes the number of entries in the windows menue
+    dim iNotWindows as integer  ' number of open windows
+    dim iKandidate as integer
+    dim i as integer
+
+    iNotWindows = GetDocumentCount()
+    hUseMenu()
+
+    iMenues = hMenuItemGetCount
+    hMenuSelectNr(iMenues-1)    ' 'windows' ist usually the one before the last
+    waitslot() 'wait 200
+    iKandidate = 0
+    iMenues = hMenuItemGetCount
+    for i = ((iMenues - iNotWindows) + 1) to iMenues
+        if (hMenuItemIsChecked (i)) then
+            if (iKandidate = 0) then
+                iKandidate = i
+            else
+                Warnlog "unexpected error 4711 - more than one window active??!! hWindowGetIndex () "
+            endif
+        endif
+    next i
+    iMenues = (iKandidate - (iMenues - iNotWindows) - 1)
+    hMenuClose()
+
+    hWindowGetIndex = iMenues
+
 end function
 
-'-------------------------------------------------------------------------
+'*******************************************************************************
 
-function hWindowGetIndex () as integer
-'///<b> function hWindowGetIndex () as integer </b>///'
-'///+ returns the number of the active window ///'
-   dim iMenues as integer      ' takes the number of entries in the windows menue
-   dim iNotWindows as integer  ' number of open windows
-   dim iKandidate as integer
-   dim i as integer
+function hWindowGetText (optional iWindow as integer) as string
 
-   iNotWindows = hWindowGetCount ()
-   hUseMenu()
+    '///<b> function hWindowGetText (optional iWindow as integer) as string </b>///'
+    '///+ returns the text of the menu entry without the tilde: ///'
+    '///+ w/ calling parameter: the active window ///'
+    '///+ w/o calling parameter: the window i ///'
 
-   iMenues = hMenuItemGetCount
-   hMenuSelectNr(iMenues-1)    ' 'windows' ist usually the one before the last
-   wait 200
-   iKandidate = 0
-   iMenues = hMenuItemGetCount
-   for i = ((iMenues - iNotWindows) + 1) to iMenues
-      if (hMenuItemIsChecked (i)) then
-         if (iKandidate = 0) then
-            iKandidate = i
-         else
-            Warnlog "unexpected error 4711 - more than one window active??!! hWindowGetIndex () "
-         endif
-      endif
-   next i
-   iMenues = (iKandidate - (iMenues - iNotWindows) - 1)
-   hMenuClose
+    dim iMenues as integer      ' takes the number of entries in the windows menue
+    dim iNotWindows as integer  ' number of open windows
+    dim iUseWindow
 
-   hWindowGetIndex = iMenues
+    if (isMissing(iWindow) = FALSE) then
+        iUseWindow = iWindow
+    else
+        iUseWindow = hWindowGetIndex()
+    endif
+
+    iNotWindows = GetDocumentCount()
+    hUseMenu()
+
+    iMenues = hMenuItemGetCount
+    hMenuSelectNr(iMenues-1)    ' 'windows' ist usually the one before the last
+    
+    waitslot() 'wait 200
+    iMenues = hMenuItemGetCount
+    hWindowGetText = hMenuItemGetTextMitTilde (iUseWindow + (iMenues - iNotWindows) + 1)
+    hWindowGetText = hhEntferneTilde(hWindowGetText)
+    hMenuClose()
+
 end function
 
-'-------------------------------------------------------------------------
+'*******************************************************************************
 
-function hWindowGetText (optional iWindow as integer) as string
-'///<b> function hWindowGetText (optional iWindow as integer) as string </b>///'
-'///+ returns the text of the menu entry without the tilde: ///'
-'///+ w/ calling parameter: the active window ///'
-'///+ w/o calling parameter: the window i ///'
-   dim iMenues as integer      ' takes the number of entries in the windows menue
-   dim iNotWindows as integer  ' number of open windows
-   dim iUseWindow
+function hWindowSelect (iWindow as integer)
 
+    '///<b> function hWindowSelect (iWindow as integer) </b>///'
+    '///+ switches to the window i ///'
+    '///+ calling parameter: id of the window to activate ///'
 
-   if (isMissing(iWindow) = FALSE) then
-      iUseWindow = iWindow
-   else
-      iUseWindow = hWindowGetIndex()
-   endif
+    dim iMenues as integer      ' takes the number of entries in the windows menue
+    dim iNotWindows as integer  ' number of open windows
 
-   iNotWindows = hWindowGetCount ()
-   hUseMenu()
+    iNotWindows = GetDocumentCount ()
+    hUseMenu()
 
-   iMenues = hMenuItemGetCount
-   hMenuSelectNr(iMenues-1)    ' 'windows' ist usually the one before the last
-   wait 200
-   iMenues = hMenuItemGetCount
-   hWindowGetText = hMenuItemGetTextMitTilde (iUseWindow + (iMenues - iNotWindows) + 1)
-   hWindowGetText = hhEntferneTilde(hWindowGetText)
-   hMenuClose
+    'ActivateDocument iNumber as integer ' is a testtool command, but there is no system that stays behind iNumber :-[
+    iMenues = hMenuItemGetCount
+    hMenuSelectNr(iMenues-1)    ' 'windows' ist usually the one before the last
+    WaitSlot() 'wait 200
+
+    iMenues = hMenuItemGetCount
+    hMenuSelectNr (iWindow + 1 + (iMenues - iNotWindows))
+
 end function
 
-'-------------------------------------------------------------------------
+'*******************************************************************************
 
-function hWindowSelect (iWindow as integer)
-'///<b> function hWindowSelect (iWindow as integer) </b>///'
-'///+ switches to the window i ///'
-'///+ calling parameter: id of the window to activate ///'
-   dim iMenues as integer      ' takes the number of entries in the windows menue
-   dim iNotWindows as integer  ' number of open windows
+function hUseMenu ()
 
-   iNotWindows = hWindowGetCount ()
-   hUseMenu()
+    '///<b> function hUseMenu () </b>///'
+    '///+ very global function: depends on 'gApplication' just activates the menu-bar ///'
 
-   'ActivateDocument iNumber as integer ' is a testtool command, but there is no system that stays behind iNumber :-[
-   iMenues = hMenuItemGetCount
-   hMenuSelectNr(iMenues-1)    ' 'windows' ist usually the one before the last
-   wait 200
-   iMenues = hMenuItemGetCount
-   hMenuSelectNr (iWindow + 1 + (iMenues - iNotWindows))
+    Select Case Ucase(gApplication)
+    Case "WRITER"
+
+        Kontext "DocumentWriter"
+        DocumentWriter.UseMenu
+
+    Case "MASTERDOC"
+
+        Kontext "DocumentMasterDoc"
+        DocumentMasterDoc.UseMenu
+
+    Case "HTMLDOKUMENT"
+
+        Kontext "DocumentWriterWeb"
+        DocumentWriterWeb.UseMenu
+
+    case "CALC" ' there are 2 entries over :-( usually only one, html 0 :-((((
+
+        Kontext "DocumentCalc"
+        DocumentCalc.UseMenu
+
+    case "DRAW"
+
+        Kontext "DocumentDraw"
+        DocumentDraw.UseMenu
+
+    case "IMPRESS"
+
+        Kontext "DocumentImpress"
+        DocumentImpress.UseMenu
+
+    case "MATH" :
+
+        Kontext "DocumentMath"
+        DocumentMath.UseMenu
+
+    case "INSIGHT" :
+
+        Kontext "Insight"
+        Insight.UseMenu
+
+    case "BASIC" :
+
+        Kontext "BasicIde"
+        BasicIde.UseMenu
+
+    case "NONE" :
+
+        Kontext "DocumentBackground"
+        DocumentBackground.UseMenu
+
+    end select
+
 end function
 
-'-------------------------------------------------------------------------
+'*******************************************************************************
 
-function hUseMenu ()
-'///<b> function hUseMenu () </b>///'
-'///+ very global function: depends on 'gApplication' just activates the menu-bar ///'
-   Select Case Ucase(gApplication)
-      Case "WRITER"
-         Kontext "DocumentWriter"
-         DocumentWriter.UseMenu
+function hOpenContextMenu()
 
-      Case "MASTERDOC"
-         Kontext "Documen