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 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
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
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
58 '/// open a new document
59 printlog "open a new document"
60 gApplication = "WRITER"
62 Kontext "DocumentWriter"
63 DocumentWriter.TypeKeys "tt_doc" , true
66 call hToolbarSelect("FormControls",true)
67 Kontext "FormControls"
68 '/// insert a group box to activate autopilot button
71 call hDrawingWithSelection ( 50, 50, 60, 60 )
73 '/// check if auto pilot dialog is available
74 Kontext "AutoPilotListComboBox"
75 if AutoPilotListComboBox.Exists(3) then
76 Kontext "AutoPilotListComboBox"
77 AutoPilotListComboBox.Cancel
79 if SwitchAutoOff = true then
80 Kontext "FormControls"
81 printlog "switch autopilot off"
85 printlog "let autopilot on"
88 if SwitchAutoOff = false then
89 Kontext "FormControls"
90 printlog "switch autopilot on"
94 printlog "let autopilot off"
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
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."
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)
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
174 TabGeneralControl.TypeKeys "<TAB>" , 16 , true
176 TabGeneralControl.TypeKeys sPropertyValue , true
178 TabGeneralControl.TypeKeys "<RETURN>" , true
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))
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)
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)
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)
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)
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)
325 elseif sPropertyName = "VisibleSize" then
326 VisibleSize.setText(sPropertyValue)
327 elseif sPropertyName = "ValueMin" then
328 if sControlType = "FormattedField" then
329 EffectiveMin.setText(sPropertyValue)
331 ValueMin.setText(sPropertyValue)
333 elseif sPropertyName = "ValueMax" then
334 if sControltype = "FormattedField" then
335 EffectiveMax.setText(sPropertyValue)
337 ValueMax.setText(sPropertyValue)
339 elseif sPropertyName = "ValueStep" then
340 ValueStep.setText(sPropertyValue)
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."
347 'need additional return
349 TabGeneralControl.TypeKeys "<RETURN>",true
351 warnlog "The control property browser doesn't exists."
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
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
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
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
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
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
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
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
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
555 elseif sPropertyName = "ValueMin" then
556 if sControlType = "FormattedField" then
557 sReturn = EffectiveMin.getText
559 sReturn = ValueMin.getText
561 elseif sPropertyName = "ValueMax" then
562 if sControltype = "FormattedField" then
563 sReturn = EffectiveMax.getText
565 sReturn = ValueMax.getText
567 elseif sPropertyName = "VisibleSize" then
568 sReturn = VisibleSize.getText
569 elseif sPropertyName = "ValueStep" then
570 sReturn = ValueStep.getText
574 warnlog "The control property browser doesn't exists."
576 fGetControlProperty = sReturn
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 )
621 '--------------------------------------------------------------------------------------
622 function fOpenControlPropertyBrowser
623 '/// open the Control Properties Dialog
624 '/// <u>parameter:</u>
628 call hToolbarSelect("FormControls",true)
630 Kontext "FormControls"
631 ControlProperties.Click
632 Kontext "ControlPropertiesDialog"
634 if ControlPropertiesDialog.exists(3) then
637 Kontext "FormControls"
638 ControlProperties.Click
642 fOpenControlPropertyBrowser=true
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
656 dim oControl as Object
658 if sControl = "SpinButton" then
660 call hToolbarSelect("MoreControls",true)
661 Kontext "MoreControls"
664 elseif sControl = "ScrollBar" then
666 call hToolbarSelect("MoreControls",true)
667 Kontext "MoreControls"
670 elseif sControl = "ImageButton" then
672 call hToolbarSelect("MoreControls",true)
673 Kontext "MoreControls"
676 elseif sControl = "ImageControl" then
678 call hToolbarSelect("MoreControls",true)
679 Kontext "MoreControls"
682 elseif sControl = "FileControl" then
684 call hToolbarSelect("MoreControls",true)
685 Kontext "MoreControls"
688 elseif sControl = "DateField" then
690 call hToolbarSelect("MoreControls",true)
691 Kontext "MoreControls"
694 elseif sControl = "TimeField" then
696 call hToolbarSelect("MoreControls",true)
697 Kontext "MoreControls"
700 elseif sControl = "NumericField" then
702 call hToolbarSelect("MoreControls",true)
703 Kontext "MoreControls"
706 elseif sControl = "CurrencyField" then
708 call hToolbarSelect("MoreControls",true)
709 Kontext "MoreControls"
712 elseif sControl = "PatternField" then
714 call hToolbarSelect("MoreControls",true)
715 Kontext "MoreControls"
718 elseif sControl = "GroupBox" then
720 call hToolbarSelect("MoreControls",true)
721 Kontext "MoreControls"
724 elseif sControl = "Grid" then
726 call hToolbarSelect("MoreControls",true)
727 Kontext "MoreControls"
730 elseif sControl = "NavigationBar" then
732 call hToolbarSelect("MoreControls",true)
733 Kontext "MoreControls"
736 elseif sControl = "Edit" then
738 call hToolbarSelect("FormControls",true)
739 Kontext "FormControls"
742 elseif sControl = "Label" then
744 call hToolbarSelect("FormControls",true)
745 Kontext "FormControls"
748 elseif sControl = "CheckBox" then
750 call hToolbarSelect("FormControls",true)
751 Kontext "FormControls"
754 elseif sControl = "FormattedField" then
756 call hToolbarSelect("FormControls",true)
757 Kontext "FormControls"
760 elseif sControl = "PushButton" then
762 call hToolbarSelect("FormControls",true)
763 Kontext "FormControls"
766 elseif sControl = "ListBox" then
768 call hToolbarSelect("FormControls",true)
769 Kontext "FormControls"
772 elseif sControl = "ComboBox" then
774 call hToolbarSelect("FormControls",true)
775 Kontext "FormControls"
778 elseif sControl = "RadioButton" then
780 call hToolbarSelect("FormControls",true)
781 Kontext "FormControls"
785 warnlog "control " + sControl + " not found. add to addControl in control tools."
789 call hDrawingWithSelection ( isx, isy, iex, iey )
793 Kontext "FormControls"
796 '--------------------------------------------------------------------------------------
797 function fSwitchControlDesignMode()
798 '/// switch the control design on or off
799 '/// <u>parameter:</u>
803 call hToolbarSelect("FormControls",true)
805 Kontext "FormControls"
806 SwitchControlDesignMode.Click
809 '--------------------------------------------------------------------------------------
810 function closePropertyBrowserAndDocument
811 '/// close control property browser and the document
812 '/// only used in the Control_Serveral tests
813 '/// <u>parameter:</u>
816 printlog "close control property browser"
817 Kontext "ControlPropertiesDialog"
818 ControlPropertiesDialog.close
820 printlog "close document"
824 '--------------------------------------------------------------------------------------
825 function fOpenMoreControlsToolBar
826 '/// open the More Controls toolbar
827 '/// <u>parameter:</u>
829 Kontext "MoreControls"
830 if not MoreControls.exists(1) then
831 Kontext "FormControls"
833 Kontext "MoreControls"