jl165 merging heads
[LibreOffice.git] / testautomation / dbaccess / tools / controltools.inc
blob28b0583c0b42d1626ce682259b0318404c021554
1 'encoding UTF-8  Do not remove or change this line!
2 '**************************************************************************
3 ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 ' Copyright 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org.  If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : marc.neumann@oracle.com
30 '* short description : Helper Routines for Form and Control Tests
32 '***************************************************************************************
34 ' #1 fSwitchAutopilotOff
35 ' #1 fSetControlProperty
36 ' #1 fGetControlProperty
37 ' #1 hDrawingWithSelection 
38 ' #1 fOpenControlPropertyBrowser
39 ' #1 addControl
40 ' #1 fSwitchControlDesignMode
41 ' #1 closePropertyBrowserAndDocument
42 ' #1 fOpenMoreControlsToolBar
44 '\**************************************************************************************
47 function fSwitchAutopilotOff(SwitchAutoOff as boolean)
48     '/// turn the Control autopilots off or on
49     '/// <u>parameter:</u>
50     '/// <b>SwitchAutoOff:</b> If true the autopilot is turned off, if the parameter is false the autopilot is turned on
51                 
52     '/// open a new document
53     printlog "open a new document"
54     gApplication = "WRITER"
55         call hNewDocument
56     Kontext "DocumentWriter"       
57         DocumentWriter.TypeKeys "tt_doc" , true
58         sleep(1)
59     Kontext "Toolbar"
60         call hToolbarSelect("FormControls",true)
61         Kontext "FormControls"          
62     '/// insert a group box to activate autopilot button
63         ListBox.Click
64         sleep(1)      
65     call hDrawingWithSelection ( 50, 50, 60, 60 )
66         sleep(2)
67     '/// check if auto pilot dialog is available
68     Kontext "AutoPilotListComboBox"
69     if AutoPilotListComboBox.Exists(3) then
70         Kontext "AutoPilotListComboBox"
71         AutoPilotListComboBox.Cancel
72         sleep(2)
73         if SwitchAutoOff = true then
74             Kontext "FormControls" 
75             printlog "switch autopilot off"     
76             UseWizards.Click
77             sleep(2)
78         else 
79             printlog "let autopilot on"
80         endif
81     else
82         if SwitchAutoOff = false then
83             Kontext "FormControls" 
84             printlog "switch autopilot on"      
85             UseWizards.Click
86             sleep(2)
87         else 
88             printlog "let autopilot off"
89         endif
90     endif       
91     hCloseDocument
92 end function
93 '--------------------------------------------------------------------------------------
94 function fSetControlProperty(sControlType, sPropertyName, sPropertyValue as string)
95         '/// set the property of a control via the control property browser    
96     '/// <u>parameter:</u>
97     '/// <b>sControlType:</b> The name of the control type f.e. TextBox
98     '/// <b>sPropertyName:</b> The name of the control property f.e. DefaultValue
99     '/// <b>sPropertyValue:</b> The value of the control property    
100     
101     ' switch to the General Page
102     Kontext "ControlPropertiesTabControl"
103         ControlPropertiesTabControl.setPage TabGeneralControl 
105     Kontext "TabGeneralControl" 
106     if TabGeneralControl.exists(3) then        
107         printlog "Set Property '" + sPropertyName + "' to the value '" + sPropertyValue + "' for a '" + sControlType + "' control."   
108         ' A - C
109                 
110                 if sPropertyName = "Accuracy" then
111                     Accuracy.setText(sPropertyValue)
112                 elseif sPropertyName = "Align" then        
113                     Align.select(Cint(sPropertyValue))
114                 elseif sPropertyName = "AdditionalInfo" then
115                     Information.setText(sPropertyValue)
116                     Information.TypeKeys("<RETURN>",true)
117                 elseif sPropertyName = "AutoComplete" then
118                     AutoComplete.select(Cint(sPropertyValue))
119                 elseif sPropertyName = "Background" then
120                     Background.select(Cint(sPropertyValue))
121                 elseif sPropertyName = "Border" then
122                     Border.select(Cint(sPropertyValue))
123                 elseif sPropertyName = "BorderColor" then
124                     BorderColor.select(Cint(sPropertyValue))
125                 elseif sPropertyName = "ButtonType" then
126                     ButtonType.select(Cint(sPropertyValue))
127                 elseif sPropertyName = "BlockIncrement" then
128                     BlockIncrement.setText(sPropertyValue)
129                 elseif sPropertyName = "CellBound" then
130                     Kontext "ControlPropertiesTabControl"
131                         ControlPropertiesTabControl.setPage TabDataControl
132                     Kontext "TabDataControl"
133                         CellBound.setText(sPropertyValue)
134                         CellBound.typeKeys("<RETURN>",true)
135                     Kontext "ControlPropertiesTabControl"
136                         ControlPropertiesTabControl.setPage TabGeneralControl
137                 elseif sPropertyName = "CellRange" then
138                     Kontext "ControlPropertiesTabControl"
139                         ControlPropertiesTabControl.setPage TabDataControl
140                     Kontext "TabDataControl"
141                         CellRange.setText(sPropertyValue)
142                         CellRange.typeKeys("<RETURN>",true)
143                     Kontext "ControlPropertiesTabControl"
144                         ControlPropertiesTabControl.setPage TabGeneralControl
145                 elseif sPropertyName = "CurrSymPosition" then
146                     CurrSymPosition.select(Cint(sPropertyValue))
147                 elseif sPropertyName = "CurrencySymbol" then
148                     CurrencySymbol.setText(sPropertyValue)
149             
150         'D - F
151         
152                 elseif sPropertyName = "DateMax" then
153                     DateMax.setText(sPropertyValue)
154                 elseif sPropertyName = "DateMin" then
155                     DateMin.setText(sPropertyValue)
156                 elseif sPropertyName = "DateFormat" then
157                     DateFormat.select(Cint(sPropertyValue))
158                 elseif sPropertyName = "DefaultButton" then
159                     DefaultButton.select(Cint(sPropertyValue))
160                 elseif sPropertyName = "DefaultSelection2" then
161                     DefaultSelection2.setText(sPropertyValue)
162                 elseif sPropertyName = "DefaultState" then
163                     DefaultState.select(Cint(sPropertyValue))
164                 elseif sPropertyName = "DefaultValue" then
165                     TabGeneralControl.MouseDown 1,1,1,true
166                     TabGeneralControl.MouseUp 1,1,1,true
167                     sleep(1)
168                     TabGeneralControl.TypeKeys "<TAB>" , 16 , true
169                     sleep(1)
170                     TabGeneralControl.TypeKeys sPropertyValue , true                    
171                     sleep(1)
172                     TabGeneralControl.TypeKeys "<RETURN>" , true
173                     sleep(1)
174                 elseif sPropertyName = "Delay" then
175                     Delay.setText(sPropertyValue)
176                 elseif sPropertyName = "DropDown" then
177                     DropDown.select(Cint(sPropertyValue))
178                 elseif sPropertyName = "Enabled" then
179                     Enabled.select(Cint(sPropertyValue))
180                 elseif sPropertyName = "EditMask" then
181                     EditMask.setText(sPropertyValue)    
182                 elseif sPropertyName = "FilteringSorting" then
183                     FilteringSorting.select(Cint(sPropertyValue))
184                 elseif sPropertyName = "Frame" then
185                     Frame.select(Cint(sPropertyValue))
186         
187         'G - L
188         
189                 elseif sPropertyName = "Graphics" then
190                     Graphics.setText(sPropertyValue)  
191                 elseif sPropertyName = "GraphicsAlignment" then
192                     GraphicsAlignment.select(Cint(sPropertyValue))
193                 elseif sPropertyName = "HelpText" then
194                     HelpText.setText(sPropertyValue)
195                 elseif sPropertyName = "HelpURL" then
196                     HelpURL.setText(sPropertyValue)
197                     HelpURL.TypeKeys "<RETURN>",true
198                 elseif sPropertyName = "HiddenValue" then
199                     HiddenValue.setText(sPropertyValue)
200                 elseif sPropertyName = "HideSelection" then
201                     HideSelection.select(Cint(sPropertyValue))
202                 elseif sPropertyName = "IconSize" then
203                     IconSize.select(Cint(sPropertyValue))
204                 elseif sPropertyName = "LineCount" then
205                      LineCount.setText(sPropertyValue) 
206                 elseif sPropertyName = "LineIncrement" then
207                     LineIncrement.setText(sPropertyValue)
208                 elseif sPropertyName = "LiteralMask" then
209                     LiteralMask.setText(sPropertyValue)
210                 elseif sPropertyName = "ListEntries" then
211                     ListEntries.setText(sPropertyValue)
212             
213         'M - O
214          
215                 elseif sPropertyName = "MaxTextLen" then
216                      MaxTextLen.setText(sPropertyValue)
217                 elseif sPropertyName = "MultiLine" then
218                     qaerrorlog "The Property MultiLine doesn't exists anymore."
219                     qaerrorlog "Please use TextType instead. This property will be removed soon."
220                     TextType.select(Cint(sPropertyValue))
221                 elseif sPropertyName = "MultiLine2" then
222                     MultiLine.select(Cint(sPropertyValue))
223                 elseif sPropertyName = "Multiselection" then
224                     Multiselection.select(Cint(sPropertyValue))
225                 elseif sPropertyName = "NameText" then
226                     NameText.setText(sPropertyValue)
227                     NameText.typeKeys("<RETURN>",true)
228                 elseif sPropertyName = "Navigation" then
229                     Navigation.select(Cint(sPropertyValue))
230                 elseif sPropertyName = "NavigationBar" then
231                     NavigationBar.select(Cint(sPropertyValue))            
232                 elseif sPropertyName = "Orientation" then
233                     Orientation.select(Cint(sPropertyValue))
234                 elseif sPropertyName = "Order" then
235                     Order.setText(sPropertyValue)
236             
237         'P - R
238         
239                 elseif sPropertyName = "Password" then
240                     Password.setText(sPropertyValue)
241                 elseif sPropertyName = "ReferenceValue" then
242                     Kontext "ControlPropertiesTabControl"
243                         ControlPropertiesTabControl.setPage TabDataControl
244                     Kontext "TabDataControl"
245                         ReferenceValue.setText(sPropertyValue)
246                         ReferenceValue.TypeKeys("<RETURN>",true)
247                     Kontext "ControlPropertiesTabControl"
248                         ControlPropertiesTabControl.setPage TabGeneralControl
249                 elseif sPropertyName = "Repeat" then
250                     Repeat.select(Cint(sPropertyValue))
251                 elseif sPropertyName = "Printable" then
252                     Printable.select(Cint(sPropertyValue))
253                 elseif sPropertyName = "Positioning" then
254                     Positioning.select(Cint(sPropertyValue))
255                 elseif sPropertyName = "RecordActions" then
256                     RecordActions.select(Cint(sPropertyValue))    
257                 elseif sPropertyName = "RecordMarker" then
258                     RecordMarker.select(Cint(sPropertyValue))
259                 elseif sPropertyName = "ReferenceValueOff" then
260                     Kontext "ControlPropertiesTabControl"
261                         ControlPropertiesTabControl.setPage TabDataControl
262                     Kontext "TabDataControl"
263                         ReferenceValueOff.setText(sPropertyValue)
264                         ReferenceValueOff.TypeKeys("<RETURN>",true)
265                     Kontext "ControlPropertiesTabControl"
266                         ControlPropertiesTabControl.setPage TabGeneralControl
267                 elseif sPropertyName = "Readonly" then
268                     Readonly.select(Cint(sPropertyValue))    
269                 elseif sPropertyName = "RowHeight" then
270                     RowHeight.setText(sPropertyValue)
271             
272         'S
273         
274                 elseif sPropertyName = "Scale" then
275                     Scale.select(Cint(sPropertyValue))
276                 elseif sPropertyName = "Spin" then            
277                     Spin.select(CInt(sPropertyValue))
278                 elseif sPropertyName = "StrictFormat" then            
279                     StrictFormat.select(CInt(sPropertyValue))
280                 elseif sPropertyName = "Scrollbars" then
281                     Scrollbars.select(Cint(sPropertyValue))
282                 elseif sPropertyName = "SymbolColor" then
283                     SymbolColor.select(Cint(sPropertyValue))        
284                 elseif sPropertyName = "TextType" then
285                     TextType.select(Cint(sPropertyValue))
286                 elseif sPropertyName = "ScrollValueMin" then
287                     ScrollValueMin.setText(sPropertyValue) 
288                 elseif sPropertyName = "ScrollValueMax" then
289                     ScrollValueMax.setText(sPropertyValue)
290                 elseif sPropertyName = "ScrollValueDefault" then
291                     ScrollValueDefault.setText(sPropertyValue)        
292         
293         'T - U
294         
295                 elseif sPropertyName = "TabOrder" then            
296                     Order.setText(sPropertyValue)
297                     TabGeneralControl.TypeKeys "<RETURN>",true
298                 elseif sPropertyName = "TabStop" then            
299                     TabStop.select(Cint(sPropertyValue))
300                 elseif sPropertyName = "TakeFocus" then            
301                     TakeFocus.select(Cint(sPropertyValue))
302                 elseif sPropertyName = "TextType" then            
303                     TextType.select(Cint(sPropertyValue))
304                 elseif sPropertyName = "ThousandSeperator" then            
305                     ThousandSeperator.select(CInt(sPropertyValue))
306                 elseif sPropertyName = "TimeFormat" then
307                     TimeFormat.select(Cint(sPropertyValue))
308                 elseif sPropertyName = "TimeMax" then
309                     TimeMax.setText(sPropertyValue)
310                 elseif sPropertyName = "TimeMin" then
311                     TimeMin.setText(sPropertyValue)
312                 elseif sPropertyName = "ToggleProp" then
313                     ToggleProp.select(Cint(sPropertyValue))
314                 elseif sPropertyName = "TriState" then
315                     TriState.select(Cint(sPropertyValue))
316                 elseif sPropertyName = "URL" then        
317                     URL.setText(sPropertyValue)
318             
319         'V - Z
320         
321                 elseif sPropertyName = "VisibleSize" then
322                     VisibleSize.setText(sPropertyValue)
323                 elseif sPropertyName = "ValueMin" then
324                     if sControlType = "FormattedField" then
325                         EffectiveMin.setText(sPropertyValue)
326                     else
327                         ValueMin.setText(sPropertyValue)
328                     endif
329                 elseif sPropertyName = "ValueMax" then
330                     if sControltype = "FormattedField" then
331                         EffectiveMax.setText(sPropertyValue)
332                     else
333                         ValueMax.setText(sPropertyValue)
334                     endif
335                 elseif sPropertyName = "ValueStep" then
336                     ValueStep.setText(sPropertyValue)
337         '        
338                 else
339                     warnlog "The property " + sPropertyName + " doesn't exists in the function fSetControlProperty."
340                     warnlog "Please add it to the function in dbaccess/tools/controltools.inc."          
341                 endif
342         
343         'need additional return
344         sleep(1)
345         TabGeneralControl.TypeKeys "<RETURN>",true
346     else
347         warnlog "The control property browser doesn't exists."
348     endif
349     sleep(1)
350 end function
351 '--------------------------------------------------------------------------------------
352 function fGetControlProperty(sControlType,sPropertyName)
353         '/// get the property of a control from the control property browser    
354     '/// <u>parameter:</u>
355     '/// <b>sControlType:</b> The name of the control type f.e. TextBox
356     '/// <b>sPropertyName:</b> The name of the control property f.e. DefaultValue
357             
358     Dim sReturn as String
360     ' switch to the General Page
361     Kontext "ControlPropertiesTabControl"
362         ControlPropertiesTabControl.setPage TabGeneralControl
364     Kontext "TabGeneralControl" 
365     if TabGeneralControl.exists(3) then
366         
367     ' A - C
368         
369         if sPropertyName = "Accuracy" then
370             sReturn = Accuracy.getSelIndex
371         elseif sPropertyName = "AdditionalInfo" then
372             sReturn = Information.getText
373         elseif sPropertyName = "Align" then
374             sReturn = Align.getSelIndex 
375         elseif sPropertyName = "AutoComplete" then
376             sReturn = AutoComplete.getSelIndex   
377         elseif sPropertyName = "Background" then
378             sReturn = Background.getSelIndex
379         elseif sPropertyName = "BlockIncrement" then
380             sReturn = BlockIncrement.getText
381         elseif sPropertyName = "Border" then
382             sReturn = Border.getSelIndex
383         elseif sPropertyName = "BorderColor" then
384             sReturn = BorderColor.getSelIndex
385         elseif sPropertyName = "ButtonType" then
386             sReturn = ButtonType.getSelIndex
387         elseif sPropertyName = "CellBound" then
388             Kontext "ControlPropertiesTabControl"
389                 ControlPropertiesTabControl.setPage TabDataControl
390             Kontext "TabDataControl"                
391                 sReturn = CellBound.getText()                
392             Kontext "ControlPropertiesTabControl"
393                 ControlPropertiesTabControl.setPage TabGeneralControl
394         elseif sPropertyName = "CellRange" then
395             Kontext "ControlPropertiesTabControl"
396                 ControlPropertiesTabControl.setPage TabDataControl
397             Kontext "TabDataControl"                
398                 sReturn = CellRange.getText()                
399             Kontext "ControlPropertiesTabControl"
400                 ControlPropertiesTabControl.setPage TabGeneralControl
401         elseif sPropertyName = "CurrSymPosition" then
402             sReturn = CurrSymPosition.getSelIndex
403         elseif sPropertyName = "CurrencySymbol" then
404             sReturn = CurrencySymbol.getText
405             
406     'D - F
407             
408         elseif sPropertyName = "DateMax" then
409             sReturn = DateMax.getText
410         elseif sPropertyName = "DateMin" then
411             sReturn = DateMin.getText    
412         elseif sPropertyName = "DateFormat" then
413             sReturn = DateFormat.getSelIndex
414         elseif sPropertyName = "DefaultButton" then
415             sReturn = DefaultButton.getSelIndex
416         elseif sPropertyName = "Delay" then
417             sReturn = Delay.getText
418         elseif sPropertyName = "DefaultState" then
419             sReturn = DefaultState.getSelIndex
420         elseif sPropertyName = "DefaultSelection2" then
421             sReturn = DefaultSelection2.getText
422         elseif sPropertyName = "DefaultValue" then
423             sReturn = DefaultValue.getText
424         elseif sPropertyName = "DropDown" then
425             sReturn = DropDown.getSelIndex
426         elseif sPropertyName = "EditMask" then
427             sReturn = EditMask.getText
428         elseif sPropertyName = "Enabled" then
429             sReturn = Enabled.getSelIndex
430         elseif sPropertyName = "FilteringSorting" then
431             sReturn = FilteringSorting.getSelIndex
432         elseif sPropertyName = "Formatkey" then
433             sReturn = Formatkey.getText
434         elseif sPropertyName = "Frame" then
435             sReturn = Frame.getSelIndex
436             
437     'G - L
438             
439         elseif sPropertyName = "Graphics" then
440             sReturn = Graphics.getSelText
441         elseif sPropertyName = "GraphicsAlignment" then  
442             sReturn = GraphicsAlignment.getSelIndex
443         elseif sPropertyName = "HelpText" then
444             sReturn = HelpText.getText
445         elseif sPropertyName = "HelpURL" then
446             sReturn = HelpURL.getText
447         elseif sPropertyName = "HiddenValue" then
448             sReturn = HiddenValue.getText 
449         elseif sPropertyName = "HideSelection" then
450             sReturn = HideSelection.getSelIndex            
451         elseif sPropertyName = "IconSize" then
452             sReturn = IconSize.getSelIndex
453         elseif sPropertyName = "LineCount" then
454             sReturn = LineCount.getText
455         elseif sPropertyName = "LineIncrement" then
456             sReturn = LineIncrement.getText
457         elseif sPropertyName = "LiteralMask" then
458             sReturn = LiteralMask.getText
459         elseif sPropertyName = "ListEntries" then  
460             sReturn = ListEntries.getText
461         
462     'M - O
463         
464         elseif sPropertyName = "MaxTextLen" then
465             sReturn = MaxTextLen.getText
466         elseif sPropertyName = "MultiLine" then
467             sReturn = MultiLine.getSelIndex
468         elseif sPropertyName = "MultiLine2" then
469             sReturn = MultiLine.getSelIndex
470         elseif sPropertyName = "Multiselection" then
471             sReturn = Multiselection.getSelIndex
472         elseif sPropertyName = "NameText" then
473             sReturn = NameText.getText
474         elseif sPropertyName = "Navigation" then
475             sReturn = Navigation.getSelIndex
476         elseif sPropertyName = "NavigationBar" then
477             sReturn = NavigationBar.getSelIndex
478         elseif sPropertyName = "Order" then
479             sReturn = Order.getText
480         elseif sPropertyName = "Orientation" then
481             sReturn = Orientation.getSelIndex        
482          
483     'P - R
484         
485         elseif sPropertyName = "Password" then
486             sReturn = Password.getText
487         elseif sPropertyName = "Positioning" then
488             sReturn = Positioning.getSelIndex
489         elseif sPropertyName = "Printable" then
490             sReturn = Printable.getSelIndex
491         elseif sPropertyName = "Readonly" then
492             sReturn = Readonly.getSelIndex
493         elseif sPropertyName = "RecordActions" then
494             sReturn = RecordActions.getSelIndex
495         elseif sPropertyName = "RecordMarker" then
496             sReturn = RecordMarker.getSelIndex
497         elseif sPropertyName = "ReferenceValue" then
498             Kontext "ControlPropertiesTabControl"
499                 ControlPropertiesTabControl.setPage TabDataControl
500             Kontext "TabDataControl"
501                 sReturn = ReferenceValue.getText
502             Kontext "ControlPropertiesTabControl"
503                 ControlPropertiesTabControl.setPage TabGeneralControl
504         elseif sPropertyName = "Repeat" then
505             sReturn = Repeat.getSelIndex  
506         elseif sPropertyName = "RowHeight" then
507             sReturn = RowHeight.getText
508     
509     'S
510         
511         elseif sPropertyName = "Scale" then
512             sReturn = Scale.getSelIndex
513         elseif sPropertyName = "Scrollbars" then
514             sReturn = Scrollbars.getSelIndex
515         elseif sPropertyName = "ScrollValueDefault" then
516             sReturn = ScrollValueDefault.getText
517         elseif sPropertyName = "ScrollValueMax" then
518             sReturn = ScrollValueMax.getText
519         elseif sPropertyName = "ScrollValueMin" then
520             sReturn = ScrollValueMin.getText
521         elseif sPropertyName = "Spin" then
522             sReturn = Spin.getSelIndex
523         elseif sPropertyName = "StrictFormat" then
524             sReturn = StrictFormat.getSelIndex
525         elseif sPropertyName = "SymbolColor" then
526             sReturn = SymbolColor.getSelIndex
527         
528     'T - U
529         
530         elseif sPropertyName = "TabStop" then
531             sReturn = TabStop.getSelIndex
532         elseif sPropertyName = "TakeFocus" then
533             sReturn = TakeFocus.getSelIndex
534         elseif sPropertyName = "TextType" then            
535             sReturn = TextType.getSelIndex
536         elseif sPropertyName = "ThousandSeperator" then
537             sReturn = ThousandSeperator.getSelIndex
538         elseif sPropertyName = "TimeFormat" then
539             sReturn = TimeFormat.getSelIndex
540         elseif sPropertyName = "TimeMax" then
541             sReturn = TimeMax.getText
542         elseif sPropertyName = "TimeMin" then
543             sReturn = TimeMin.getText
544         elseif sPropertyName = "ToggleProp" then  
545             sReturn = ToggleProp.getSelIndex
546         elseif sPropertyName = "TriState" then
547             sReturn = TriState.getSelIndex
548     
549     'V - Z
550     
551         elseif sPropertyName = "ValueMin" then
552             if sControlType = "FormattedField" then
553                 sReturn = EffectiveMin.getText
554             else
555                 sReturn = ValueMin.getText
556             endif
557         elseif sPropertyName = "ValueMax" then
558             if sControltype = "FormattedField" then
559                 sReturn = EffectiveMax.getText
560             else
561                 sReturn = ValueMax.getText
562             endif
563         elseif sPropertyName = "VisibleSize" then
564             sReturn = VisibleSize.getText
565         elseif sPropertyName = "ValueStep" then
566             sReturn = ValueStep.getText
567             
568         endif
569     else
570         warnlog "The control property browser doesn't exists."
571     endif
572     fGetControlProperty = sReturn
573 end function
574 '--------------------------------------------------------------------------------------
575 sub hDrawingWithSelection ( iStartX, iStartY, iEndX, iEndY )
576     '/// move the mouse with pressed mouse button      
577     '/// <u>parameter:</u>
578     '/// <b>iStartX:</b> The x start coordinate
579     '/// <b>iStartY:</b> The y start coordinate
580     '/// <b>iEndX:</b> The x end coordinate
581     '/// <b>iEndY:</b> The x end coordinate
583    select case gApplication
585       case "CALC"        : Kontext "DocumentCalc"
586                             DocumentCalc.MouseDown ( iStartX, iStartY )
587                             DocumentCalc.MouseMove ( iEndX, iEndY )
588                             DocumentCalc.MouseUp ( iEndX, iEndY )
590       case "WRITER"      : Kontext "DocumentWriter"
591                             DocumentWriter.MouseDown ( iStartX, iStartY )
592                             DocumentWriter.MouseMove ( iEndX, iEndY )
593                             DocumentWriter.MouseUp ( iEndX, iEndY )
595       case "HTML": Kontext "DocumentWriterWeb"
596                             DocumentWriterWeb.MouseDown ( iStartX, iStartY )
597                             DocumentWriterWeb.MouseMove ( iEndX, iEndY )
598                             DocumentWriterWeb.MouseUp ( iEndX, iEndY )
600       case "MASTERDOCUMENT"   : Kontext "DocumentMasterDoc"
601                             DocumentMasterDoc.MouseDown ( iStartX, iStartY )
602                             DocumentMasterDoc.MouseMove ( iEndX, iEndY )
603                             DocumentMasterDoc.MouseUp ( iEndX, iEndY )
605       case "IMPRESS"     : Kontext "DocumentImpress"
606                             DocumentImpress.MouseDown ( iStartX, iStartY )
607                             DocumentImpress.MouseMove ( iEndX, iEndY )
608                             DocumentImpress.MouseUp ( iEndX, iEndY )
610       case "DRAW"        : Kontext "DocumentDraw"
611                             DocumentDraw.MouseDown ( iStartX, iStartY )
612                             DocumentDraw.MouseMove ( iEndX, iEndY )
613                             DocumentDraw.MouseUp ( iEndX, iEndY )
615    end select
616 end sub
617 '--------------------------------------------------------------------------------------
618 function fOpenControlPropertyBrowser
619     '/// open the Control Properties Dialog      
620     '/// <u>parameter:</u>
621     '/// <u>return:</u>    
622     sleep(2)
624     call hToolbarSelect("FormControls",true)    
626     Kontext "FormControls"
627         ControlProperties.Click  
628     Kontext "ControlPropertiesDialog"
629     
630     if ControlPropertiesDialog.exists(3) then
631         'nothing
632     else
633        Kontext "FormControls"        
634             ControlProperties.Click    
635     endif
636         
637     sleep(2)
638     fOpenControlPropertyBrowser=true
639     
640 end function
641 '--------------------------------------------------------------------------------------
642 function addControl(sControl as String, isx as integer , isy as integer , iex as integer , iey as integer)
643     '/// add the specified control and the specified position      
644     '/// <u>parameter:</u>
645     '/// <b>sControl</b> the control name
646     '/// <b>isx</b> the start x coordinate
647     '/// <b>isy</b> the start y coordinate
648     '/// <b>iex</b> the end x coordinate
649     '/// <b>iey</b> the end y coordinate
650     '/// <u>return:</u>
652     dim oControl as Object
653         
654     if sControl = "SpinButton" then
655     
656         call hToolbarSelect("MoreControls",true)            
657         Kontext "MoreControls"  
658             SpinButton.Click        
660     elseif sControl = "ScrollBar" then
661     
662         call hToolbarSelect("MoreControls",true)        
663         Kontext "MoreControls"  
664             Scrollbar.Click
665             
666     elseif sControl = "ImageButton" then
667     
668         call hToolbarSelect("MoreControls",true)
669         Kontext "MoreControls"  
670             ImageButton.Click
671             
672     elseif sControl = "ImageControl" then
673            
674         call hToolbarSelect("MoreControls",true)
675         Kontext "MoreControls"  
676             ImageControl.Click
677             
678     elseif sControl = "FileControl" then
679         
680         call hToolbarSelect("MoreControls",true)
681         Kontext "MoreControls"  
682             FileControl.Click
683             
684     elseif sControl = "DateField" then
685            
686         call hToolbarSelect("MoreControls",true)       
687         Kontext "MoreControls"  
688             DateField.Click
689             
690     elseif sControl = "TimeField" then
691        
692         call hToolbarSelect("MoreControls",true)       
693         Kontext "MoreControls"  
694             TimeField.Click
695                    
696     elseif sControl = "NumericField" then
697            
698         call hToolbarSelect("MoreControls",true)        
699         Kontext "MoreControls"  
700             Numericfield.Click
701             
702     elseif sControl = "CurrencyField" then
703            
704         call hToolbarSelect("MoreControls",true)        
705         Kontext "MoreControls"  
706             CurrencyField.Click
707             
708     elseif sControl = "PatternField" then
709            
710         call hToolbarSelect("MoreControls",true)        
711         Kontext "MoreControls"  
712             PatternField.Click
713             
714     elseif sControl = "GroupBox" then
715           
716         call hToolbarSelect("MoreControls",true)        
717         Kontext "MoreControls"  
718             GroupBox.Click
719             
720     elseif sControl = "Grid" then
721            
722         call hToolbarSelect("MoreControls",true)        
723         Kontext "MoreControls"  
724             Grid.Click
725             
726     elseif sControl = "NavigationBar" then
727            
728         call hToolbarSelect("MoreControls",true)        
729         Kontext "MoreControls"  
730             NavigationBar.Click
731             
732     elseif sControl = "Edit" then
733     
734         call hToolbarSelect("FormControls",true)        
735         Kontext "FormControls"  
736             Edit.Click            
738     elseif sControl = "Label" then
739     
740         call hToolbarSelect("FormControls",true)        
741         Kontext "FormControls"  
742             Label.Click
743    
744     elseif sControl = "CheckBox" then
745     
746         call hToolbarSelect("FormControls",true)        
747         Kontext "FormControls"  
748             CheckBox.Click
749             
750     elseif sControl = "FormattedField" then
751     
752         call hToolbarSelect("FormControls",true)        
753         Kontext "FormControls"  
754             FormattedField.Click
755    
756     elseif sControl = "PushButton" then
757     
758         call hToolbarSelect("FormControls",true)        
759         Kontext "FormControls"  
760             PushButton.Click 
761     
762     elseif sControl = "ListBox" then
763     
764         call hToolbarSelect("FormControls",true)        
765         Kontext "FormControls"  
766             ListBox.Click
767    
768     elseif sControl = "ComboBox" then
769     
770         call hToolbarSelect("FormControls",true)        
771         Kontext "FormControls"  
772             ComboBox.Click
773             
774     elseif sControl = "RadioButton" then
775     
776         call hToolbarSelect("FormControls",true)        
777         Kontext "FormControls"  
778             RadioButton.Click
779             
780     else
781         warnlog "control " + sControl + " not found. add to addControl in control tools."    
782     endif
783     sleep(1)
784     
785     call hDrawingWithSelection ( isx, isy, iex, iey )
786     
787     sleep(2)
788         
789     Kontext "FormControls"
790     
791 end Function
792 '--------------------------------------------------------------------------------------
793 function fSwitchControlDesignMode()
794     '/// switch the control design on or off
795     '/// <u>parameter:</u>
796     '/// <u>return:</u>
797     
798     Kontext "Toolbar"
799         call hToolbarSelect("FormControls",true)
800         sleep(1)
801         Kontext "FormControls"
802         SwitchControlDesignMode.Click
803         
804 end function
805 '--------------------------------------------------------------------------------------
806 function closePropertyBrowserAndDocument
807     '/// close control property browser and the document
808     '/// only used in the Control_Serveral tests
809     '/// <u>parameter:</u>
810     '/// <u>return:</u>
811     
812     printlog "close control property browser"    
813     Kontext "ControlPropertiesDialog"
814         ControlPropertiesDialog.close
815     '/// close document
816     printlog "close document"
817     hCloseDocument
818     
819 end function
820 '--------------------------------------------------------------------------------------
821 function fOpenMoreControlsToolBar
822     '/// open the More Controls toolbar      
823     '/// <u>parameter:</u>
824     '/// <u>return:</u>
825     Kontext "MoreControls"
826     if not MoreControls.exists(1) then
827         Kontext "FormControls"
828             MoreControls.Click
829         Kontext "MoreControls"    
830     endif   
831 End function