summaryrefslogtreecommitdiff
path: root/testautomation/global/tools/includes/required/t_tools3.inc
diff options
context:
space:
mode:
authorJoerg Skottke [jsk] <jsk@openoffice.org>2010-03-10 14:21:58 +0100
committerJoerg Skottke [jsk] <jsk@openoffice.org>2010-03-10 14:21:58 +0100
commit37917c34fd9b8110bdd4f802f0d63f692b204526 (patch)
tree7ae4a12160092708e89acf79c000dee26b29449c /testautomation/global/tools/includes/required/t_tools3.inc
parent26ec644ba23fc082629cdb0a5eaf0c2cb345bbd7 (diff)
vitomation01: #i109562 - removed init_tools.inc, performance.inc and all calls to those
Diffstat (limited to 'testautomation/global/tools/includes/required/t_tools3.inc')
-rw-r--r--testautomation/global/tools/includes/required/t_tools3.inc30
1 files changed, 30 insertions, 0 deletions
diff --git a/testautomation/global/tools/includes/required/t_tools3.inc b/testautomation/global/tools/includes/required/t_tools3.inc
index 9d83f5d09e82..c56929ed7b90 100644
--- a/testautomation/global/tools/includes/required/t_tools3.inc
+++ b/testautomation/global/tools/includes/required/t_tools3.inc
@@ -1179,3 +1179,33 @@ function hCloseDialog( oDialog as object, sUserFlags as string ) as boolean
if ( oDialog.notExists( TIMEOUT ) ) then hCloseDialog() = TRUE
end function
+
+'*******************************************************************************
+
+function hWaitForObject( oControl as object, iTime as integer ) as integer
+
+ const CFN = "hWaitForObject()::"
+ dim iWait as integer
+
+ if ( GVERBOSE ) then printlog( CFN & "Entering function for control: " & oControl.name() )
+
+ WaitSlot( 2000 )
+
+ for iWait = 0 to iTime
+ try
+ if ( oControl.isEnabled() ) then
+ printlog( CFN & "Control is enabled: " & oControl.name() )
+ hWaitForObject() = iWait
+ exit function
+ else
+ if ( GVERBOSE ) then printlog( "Waiting..." )
+ endif
+ catch
+ wait( 1 )
+ endcatch
+ next iWait
+
+ printlog( CFN & "Control not found or not enabled, timeout reached" )
+ hWaitForObject() = -1
+
+end function