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