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: formcontrols.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:19:05 $
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 : joerg.skottke@sun.com
36 ' ** short description : Tools to draw and select form controls in basic-ide
38 '\******************************************************************************
40 public const ICONTROLCOUNT = 22
42 function hGetControlParams( cParam as string ) as integer
44 '///<h3>Retrieve basic parameters to draw formcontrols to a dialog</h3>
45 '///<i>All values are in percent relative to the window size.
46 '///+ All values are optimized for 1024x768 pixels screen resolution but
47 '///+ have been tested successfully with 1280x1024 and 800x600</i><br>
48 '///<i>In most cases it is desired to place multiple controls on a single
49 '///+ dialog pane. To prevent the controls from overlapping each other
50 '///+ they are arranged in rows and columns. Each control is identified
51 '///+ by a unique number (see description for hInsertControl(...)). The
52 '///+ dimensions are defined in hGetControlParams(...). The coordinates
53 '///+ returned by this function can be used to draw and to select a control.</i><br>
56 '///+<li>Name of the coordinate (string). Valid options are:</li>
58 '///+<li>"XOREGO" (Upper left corner)</li>
59 '///+<li>"YOREGO" (Upper left corner)</li>
60 '///+<li>"XDIST" (Distance between the upper left corners of neighbor controls)</li>
61 '///+<li>"YDIST" (Distance between the upper left corners of neighbor controls)</li>
62 '///+<li>"XSIZE" (Width of control)</li>
63 '///+<li>"YSIZE" (Heighth of the control)</li>
68 '///+<li>Coordinate/Distance/Size in percent of window size (integer)</li>
70 '///+<li>A number between 1 and 100</li>
71 '///+<li>0 on error (invalid function parameter)</li>
74 '///<u>Description</u>:
77 cParam = ucase( cParam )
79 '///+<li>Currently following values are defined:</li>
82 '///+<li>XOREGO = 31</li>
83 case "XOREGO" : hGetControlParams() = 31
84 '///+<li>XDIST = 8</li>
85 case "XDIST" : hGetControlParams() = 8
86 '///+<li>XSIZE = 6</li>
87 case "XSIZE" : hGetControlParams() = 6
88 '///+<li>YOREGO = 30</li>
89 case "YOREGO" : hGetControlParams() = 30
90 '///+<li>YDIST = 7</li>
91 case "YDIST" : hGetControlParams() = 7
92 '///+<li>YSIZE = 5</li>
93 case "YSIZE" : hGetControlParams() = 5
94 '///+<li>Incorrect function parameter = 0</li>
95 case else : hGetControlParams() = 0
102 '*******************************************************************************
104 function hGetControlName( iControl as integer ) as string
106 '///<h3>A function to deliver a speaking name for all form controls</h3>
107 '///<i>Note that the numbers of the controls are unique</i><br>
108 '///<i>In most cases it is desired to place multiple controls on a single
109 '///+ dialog pane. To prevent the controls from overlapping each other
110 '///+ they are arranged in rows and columns. Each control is identified
111 '///+ by a unique number (see description for hInsertControl(...)). The
112 '///+ dimensions are defined in hGetControlParams(...). The coordinates
113 '///+ returned by this function can be used to draw and to select a control.</i><br>
116 '///+<li>Number of the control (integer)</li>
118 '///+<li>Any number between 1 and 22, see description below</li>
123 '///+<li>Name for a control (string)</li>
125 '///+<li>Name for a control (may contain whitespaces)</li>
126 '///+<li>An empty string in case of an invalid function parameter</li>
129 '///<u>Description</u>:
133 dim sControl as string
135 '///+<li>Currently following control are defined:</li>
138 '///+<li>Push Button</li>
139 case 1 : sControl = "Push Button"
140 '///+<li>Image Control</li>
141 case 2 : sControl = "Image Control"
142 '///+<li>Check Box</li>
143 case 3 : sControl = "Check Box"
144 '///+<li>Radio Button</li>
145 case 4 : sControl = "Radio Button"
146 '///+<li>Fixed Text</li>
147 case 5 : sControl = "Fixed Text"
148 '///+<li>Edit Field</li>
149 case 6 : sControl = "Edit Field"
150 '///+<li>List Box</li>
151 case 7 : sControl = "List Box"
152 '///+<li>Combo Box</li>
153 case 8 : sControl = "Combo Box"
154 '///+<li>Vertical ScrollBar</li>
155 case 9 : sControl = "Vertical ScrollBar"
156 '///+<li>Horizontal ScrollBar</li>
157 case 10 : sControl = "Horizontal ScrollBar"
159 case 11 : sControl = "Frame"
160 '///+<li>Progress Bar</li>
161 case 12 : sControl = "Progress Bar"
162 '///+<li>Vertical Fixed Line</li>
163 case 13 : sControl = "Vertical Fixed Line"
164 '///+<li>Horizontal Fixed Line</li>
165 case 14 : sControl = "Horizontal Fixed Line"
166 '///+<li>Date Field</li>
167 case 15 : sControl = "Date Field"
168 '///+<li>Time Field</li>
169 case 16 : sControl = "Time Field"
170 '///+<li>Numeric Field</li>
171 case 17 : sControl = "Numeric Field"
172 '///+<li>Currency Field</li>
173 case 18 : sControl = "Currency Field"
174 '///+<li>Form Field</li>
175 case 19 : sControl = "Form Field"
176 '///+<li>Pattern Field</li>
177 case 20 : sControl = "Pattern Field"
178 '///+<li>File Control</li>
179 case 21 : sControl = "File Control"
180 '///+<li>Tree Control</li>
181 case 22 : sControl = "Tree Control"
183 '///+<li>"" for function parameter < 1 or > 22 </li>
184 case else : sControl = ""
187 hGetControlName() = sControl
192 '*******************************************************************************
194 function hInsertControl( iControl as integer ) as string
196 '///<h3>Function to insert one of the BASIC formcontrols by index</h3>
197 '///<i>Note that the numbers of the controls are unique</i><br>
198 '///<i>In most cases it is desired to place multiple controls on a single
199 '///+ dialog pane. To prevent the controls from overlapping each other
200 '///+ they are arranged in rows and columns. Each control is identified
201 '///+ by a unique number (see description for hInsertControl(...)). The
202 '///+ dimensions are defined in hGetControlParams(...). The coordinates
203 '///+ returned by this function can be used to draw and to select a control.</i><br>
206 '///+<li>Number of the control (integer)</li>
208 '///+<li>Any number between 1 and 22, see description below</li>
213 '///+<li>Name for a control (string)</li>
215 '///+<li>Name for a control (may contain whitespaces)</li>
216 '///+<li>An empty string in case of an invalid function parameter</li>
219 '///<u>Description</u>:
222 const CFN = "hInsertControl::"
224 Kontext "ToolsCollectionBar"
226 '///+<li>Click on the requested button on the ToolsCollectionBar:</li>
229 '///+<li>Push Button</li>
230 case 1 : InsPushButton.click()
231 '///+<li>Image Control</li>
232 case 2 : InsImgCtrl.click()
233 '///+<li>Check Box</li>
234 case 3 : InsCheckbox.click()
235 '///+<li>Radio Button</li>
236 case 4 : InsRadioButton.click()
237 '///+<li>Fixed Text</li>
238 case 5 : InsFixedText.click()
239 '///+<li>Edit Field</li>
240 case 6 : InsEditField.click()
241 '///+<li>List Box</li>
242 case 7 : InsListbox.click()
243 '///+<li>Combo Box</li>
244 case 8 : InsComboBox.click()
245 '///+<li>Vertical ScrollBar</li>
246 case 9 : InsScrollBarV.click()
247 '///+<li>Horizontal ScrollBar</li>
248 case 10 : InsScrollBarH.click()
250 case 11 : InsFrame.click()
251 '///+<li>Progress Bar</li>
252 case 12 : InsProgressbar.click()
253 '///+<li>Vertical Fixed Line</li>
254 case 13 : InsFixedLineV.click()
255 '///+<li>Horizontal Fixed Line</li>
256 case 14 : InsFixedLineH.click()
257 '///+<li>Date Field</li>
258 case 15 : InsDateField.click()
259 '///+<li>Time Field</li>
260 case 16 : InsTimeField.click()
261 '///+<li>Numeric Field</li>
262 case 17 : InsNumField.click()
263 '///+<li>Currency Field</li>
264 case 18 : InsCurrencyField.click()
265 '///+<li>Form Field</li>
266 case 19 : InsFormField.click()
267 '///+<li>Pattern Field</li>
268 case 20 : InsPatternField.click()
269 '///+<li>File Control</li>
270 case 22 : InsFileCtrl.click()
271 '///+<li>Tree Control</li>
272 case 22 : InsTreeControl.click()
275 '///+<li>"" for function parameter < 1 or > 22 </li>
277 hInsertControl() = hGetControlName( iControl )
282 '*******************************************************************************
284 function hDrawControlOnDialog( iControl as integer ) as string
286 '///<h3>Draw a control on a dialog at a fixed position</h3>
287 '///<i>Note that the numbers of the controls are unique</i><br>
288 '///<i>In most cases it is desired to place multiple controls on a single
289 '///+ dialog pane. To prevent the controls from overlapping each other
290 '///+ they are arranged in rows and columns. Each control is identified
291 '///+ by a unique number (see description for hInsertControl(...)). The
292 '///+ dimensions are defined in hGetControlParams(...). The coordinates
293 '///+ returned by this function can be used to draw and to select a control.</i><br>
296 '///+<li>Number of the control (integer)</li>
298 '///+<li>Any number between 1 and 22, see description for hInsertControl()</li>
303 '///+<li>Name for a control (string)</li>
305 '///+<li>Name for a control (may contain whitespaces)</li>
306 '///+<li>An empty string in case of an invalid function parameter</li>
309 '///<u>Description</u>:
312 const CFN = "hDrawControlOnDialog::"
314 '///+<li>Verify function parameter (this is a top level function)</li>
315 if ( ( iControl < 1 ) or ( iControl > ICONTROLCOUNT ) ) then
316 warnlog( CFN & "Invalid control-number (iControl) passed: " & iControl )
317 hDrawControlOnDialog() = false
322 dim sControl as string ' The name of the current control
323 dim brc as boolean ' some returnvalue
325 ' coordinates of the controls on the dialog in the dialog-editor
331 '///+<li>determine where the control is to be painted (hGetControlPos...)</li>
332 iXO = hGetControlPosXO( iControl )
333 iYO = hGetControlPosYO( iControl )
334 iXE = hGetControlPosXE( iControl )
335 iYE = hGetControlPosYE( iControl )
337 '///+<li>click the desired control</li>
338 sControl = hInsertControl( iControl )
339 printlog( CFN & " at XO=" & iXO & _
345 '///+<li>Draw the control (using hDrawControl(...))</li>
346 brc = hDrawControl( iXO, iYO, iXE, iYE )
347 hDrawControlOnDialog() = sControl
352 '*******************************************************************************
354 function hDrawControl( xPos as integer, _
357 yEnd as integer ) as boolean
359 '///<h3>Draw a control on the dialog pane in the dialog editor</h3>
360 '///<i>Starting point: Basic IDE/Dialog editor</i><br>
361 '///<i>In most cases it is desired to place multiple controls on a single
362 '///+ dialog pane. To prevent the controls from overlapping each other
363 '///+ they are arranged in rows and columns. Each control is identified
364 '///+ by a unique number (see description for hInsertControl(...)). The
365 '///+ dimensions are defined in hGetControlParams(...). The coordinates
366 '///+ returned by this function can be used to draw and to select a control.</i><br>
367 '///<i>Note: All units are in percent of the relative to the current window size</i><br>
370 '///+<li>X-Orego (Upper left corner) (integer)</li>
372 '///+<li>Min = 0</li>
373 '///+<li>Max = 100 (allowed but not useful)</li>
375 '///+<li>Y-Orego (Upper left corner) (integer)</li>
377 '///+<li>Min = 0</li>
378 '///+<li>Max = 100 (allowed but not useful)</li>
380 '///+<li>X-End (Lower right corner) (integer)</li>
382 '///+<li>Min = 0</li>
383 '///+<li>Max = 100 (allowed but not useful)</li>
385 '///+<li>Y-End (Lower right corner) (integer)</li>
387 '///+<li>Min = 0</li>
388 '///+<li>Max = 100 (allowed but not useful)</li>
393 '///+<li>Errorstatus (boolean)</li>
395 '///+<li>TRUE on success</li>
396 '///+<li>FALSE on failure</li>
399 '///<u>Description</u>:
402 const CFN = "hDrawControl::"
404 '///+<li>Set context to Basic IDE</li>
407 '///+<li>Draw the control using mouse actions</li>
409 '///+<li>Mouse down on pos X/Y-Orego</li>
410 '///+<li>Mouse move to pos X/Y-End</li>
411 '///+<li>Mouse up on pos X/Y-End</li>
415 DialogWindow.MouseUp( 20 , 20 )
418 DialogWindow.MouseDown ( xPos, yPos )
419 DialogWindow.MouseMove ( xEnd, yEnd )
420 DialogWindow.MouseUp ( xEnd, yEnd )
421 hDrawControl() = true
423 warnlog( "#i39852# " & CFN & "Unable to complete mouseactions on dialog" )
424 hDrawControl() = false
430 '*******************************************************************************
432 function hGetControlPosXO( iControl as integer ) as integer
434 '///<h3>Retrieve the upper left X-coordinate for a control</h3>
435 '///<i>In most cases it is desired to place multiple controls on a single
436 '///+ dialog pane. To prevent the controls from overlapping each other
437 '///+ they are arranged in rows and columns. Each control is identified
438 '///+ by a unique number (see description for hInsertControl(...)). The
439 '///+ dimensions are defined in hGetControlParams(...). The coordinates
440 '///+ returned by this function can be used to draw and to select a control.</i><br>
443 '///+<li>Number of the control (integer)</li>
445 '///+<li>Any number between 1 and 22, see description for hInsertControl()</li>
450 '///+<li>X-Orego in percent of window size (integer)</li>
452 '///<u>Description</u>:
455 dim xOffset as integer
456 xOffset = hGetControlParams( "xorego" )
458 dim xDistance as integer
459 xDistance = hGetControlParams( "xdist" )
461 '///+<li>Define an offset for the control depending on its ID</li>
463 '///+<li>< 7 : Column one</li>
464 '///+<li>7 ... 12 : Column two</li>
465 '///+<li>13 ... 18 : Column three</li>
466 '///+<li>> 18 : Column four</li>
470 if ( iControl <= 6 ) then
471 hGetControlPosXO() = xOffset
472 elseif( ( iControl >= 7 ) and ( iControl <= 12 ) ) then
473 hGetControlPosXO() = xOffset + 1 * xDistance
474 elseif( ( iControl >= 13 ) and ( iControl <= 18 ) ) then
475 hGetControlPosXO() = xOffset + 2 * xDistance
477 hGetControlPosXO() = xOffset + 3 * xDistance
482 '*******************************************************************************
484 function hGetControlPosYO( iControl as integer ) as integer
486 '///<h3>Retrieve the upper left Y-coordinate for a control</h3>
487 '///<i>In most cases it is desired to place multiple controls on a single
488 '///+ dialog pane. To prevent the controls from overlapping each other
489 '///+ they are arranged in rows and columns. Each control is identified
490 '///+ by a unique number (see description for hInsertControl(...)). The
491 '///+ dimensions are defined in hGetControlParams(...). The coordinates
492 '///+ returned by this function can be used to draw and to select a control.</i><br>
495 '///+<li>Number of the control (integer)</li>
497 '///+<li>Any number between 1 and 21, see description for hInsertControl()</li>
502 '///+<li>Y-Orego in percent of window size (integer)</li>
504 '///<u>Description</u>:
506 dim yOffset as integer
507 yOffset = hGetControlParams( "yorego" )
509 dim yDistance as integer
510 yDistance = hGetControlParams( "ydist" )
512 '///+<li>Define an offset for the control depending on its ID</li>
514 '///+<li>1 , 7 , 13 , 19 : Row one</li>
515 '///+<li>2 , 8 , 14 , 20 : Row two</li>
516 '///+<li>3 , 9 , 15 , 21 : Row three</li>
517 '///+<li>4 , 10 , 16 , 22 : Row four</li>
518 '///+<li>5 , 11 , 17 : Row five</li>
519 '///+<li>6 , 12 , 18 : Row six</li>
524 case 1 , 7 , 13 , 19 : hGetControlPosYO() = yOffset
525 case 2 , 8 , 14 , 20 : hGetControlPosYO() = yOffset + 1 * yDistance
526 case 3 , 9 , 15 , 21 : hGetControlPosYO() = yOffset + 2 * yDistance
527 case 4 , 10 , 16 , 22 : hGetControlPosYO() = yOffset + 3 * yDistance
528 case 5 , 11 , 17 : hGetControlPosYO() = yOffset + 4 * yDistance
529 case 6 , 12 , 18 : hGetControlPosYO() = yOffset + 5 * yDistance
534 '*******************************************************************************
536 function hGetControlPosXE( iControl as integer ) as integer
538 '///<h3>Retrieve the lower right X-coordinate for a control</h3>
539 '///<i>In most cases it is desired to place multiple controls on a single
540 '///+ dialog pane. To prevent the controls from overlapping each other
541 '///+ they are arranged in rows and columns. Each control is identified
542 '///+ by a unique number (see description for hInsertControl(...)). The
543 '///+ dimensions are defined in hGetControlParams(...). The coordinates
544 '///+ returned by this function can be used to draw and to select a control.</i><br>
547 '///+<li>Number of the control (integer)</li>
549 '///+<li>Any number between 1 and 22, see description for hInsertControl()</li>
554 '///+<li>X-End in percent of window size (integer)</li>
556 '///<u>Description</u>:
559 '///+<li>Get pos for X-Orego, add "XSIZE"</li>
560 hGetControlPosXE() = hGetControlPosXO( iControl ) + _
561 hGetControlParams( "xsize" )
566 '*******************************************************************************
568 function hGetControlPosYE( iControl as integer ) as integer
570 '///<h3>Retrieve the lower right Y-coordinate for a control</h3>
571 '///<i>In most cases it is desired to place multiple controls on a single
572 '///+ dialog pane. To prevent the controls from overlapping each other
573 '///+ they are arranged in rows and columns. Each control is identified
574 '///+ by a unique number (see description for hInsertControl(...)). The
575 '///+ dimensions are defined in hGetControlParams(...). The coordinates
576 '///+ returned by this function can be used to draw and to select a control.</i><br>
579 '///+<li>Number of the control (integer)</li>
581 '///+<li>Any number between 1 and 22, see description for hInsertControl()</li>
586 '///+<li>Y-End in percent of window size (integer)</li>
588 '///<u>Description</u>:
591 '///+<li>Get pos for Y-Orego, add "YSIZE"</li>
592 hGetControlPosYE() = hGetControlPosYO( iControl ) + _
593 hGetControlParams( "ysize" )
598 '*******************************************************************************
600 function hGetControlPosXM( iControl as integer ) as integer
602 '///<h3>Retrieve the center (X) of a control</h3>
603 '///<i>In most cases it is desired to place multiple controls on a single
604 '///+ dialog pane. To prevent the controls from overlapping each other
605 '///+ they are arranged in rows and columns. Each control is identified
606 '///+ by a unique number (see description for hInsertControl(...)). The
607 '///+ dimensions are defined in hGetControlParams(...). The coordinates
608 '///+ returned by this function can be used to draw and to select a control.</i><br>
611 '///+<li>Number of the control (integer)</li>
613 '///+<li>Any number between 1 and 22, see description for hInsertControl()</li>
618 '///+<li>X-Center in percent of window size (integer)</li>
620 '///<u>Description</u>:
626 '///+<li>Find X-Orego</li>
627 XO = hGetControlPosXO( iControl )
629 '///+<li>Find X-End</li>
630 XE = hGetControlPosXE( iControl )
632 '///+<li>Calculate the distance, find the middle between the two</li>
633 hGetControlPosXM() = XO + 0.5 * ( XE - XO )
638 '*******************************************************************************
640 function hGetControlPosYM( iControl as integer ) as integer
642 '///<h3>Retrieve the center (Y) of a control</h3>
643 '///<i>In most cases it is desired to place multiple controls on a single
644 '///+ dialog pane. To prevent the controls from overlapping each other
645 '///+ they are arranged in rows and columns. Each control is identified
646 '///+ by a unique number (see description for hInsertControl(...)). The
647 '///+ dimensions are defined in hGetControlParams(...). The coordinates
648 '///+ returned by this function can be used to draw and to select a control.</i><br>
651 '///+<li>Number of the control (integer)</li>
653 '///+<li>Any number between 1 and 22, see description for hInsertControl()</li>
658 '///+<li>Y-Center in percent of window size (integer)</li>
660 '///<u>Description</u>:
666 '///+<li>Find Y-Orego</li>
667 YO = hGetControlPosYO( iControl )
669 '///+<li>Find Y-End</li>
670 YE = hGetControlPosYE( iControl )
672 '///+<li>Calculate the distance, find the middle between the two</li>
673 hGetControlPosYM() = YO + 0.5 * ( YE - YO )
678 '*******************************************************************************
680 function hSelectControl( iControl as integer ) as boolean
682 '///<h3>Function to select one of the BASIC formcontrols by index</h3>
683 '///<i>Note: Refer to the inline documentation for implementation details</i><br>
684 '///<i>In most cases it is desired to place multiple controls on a single
685 '///+ dialog pane. To prevent the controls from overlapping each other
686 '///+ they are arranged in rows and columns. Each control is identified
687 '///+ by a unique number (see description for hInsertControl(...)). The
688 '///+ dimensions are defined in hGetControlParams(...). The coordinates
689 '///+ returned by this function can be used to draw and to select a control.</i><br>
692 '///+<li>Number of the control (integer)</li>
694 '///+<li>Any number between 1 and 22, see description for hInsertControl()</li>
699 '///+<li>Errorstatus (boolean)</li>
701 '///+<li>TRUE if the properties-button on ToolsCollectionBar is enabled</li>
702 '///+<li>FALSE in any other case</li>
705 '///<u>Description</u>:
710 dim iTry as integer ' we try five times to grab the control
713 hSelectControl() = false
715 '///+<li>Check function parameter, this is a top level function</li>
716 if ( ( iControl < 1 ) or ( iControl > ICONTROLCOUNT ) ) then
717 warnlog( "Incorrect index passed to function" )
721 '///+<li>Verify that the ToolsCollectionBar is visible. if not: Abort</li>
722 kontext "ToolsCollectionBar"
723 if ( not ToolsCollectionBar.exists() ) then
724 warnlog( "The ToolsCollectionBar is not visible, open it first" )
728 '///+<li>Enable the selection mode on ToolsCollectionBar</li>
731 ' Note: The controls have areas where they ignore a mouseclick. E.g. the
732 ' framecontrol can only be grabbed at the border, you won't be able to
733 ' select it by clicking in the middle. Furthermore - even if the Dialog-
734 ' editor-window is maximized - we might still miss the upper left corner.
735 ' So what happens in this loop is that we try to click in the middle of the
736 ' control. This works in 21 out of 22 cases. If it fails, we try to grab the
737 ' border, first upper left corner then lower right. If this still fails,
738 ' we try to select the control by using a rectangle selection around the
739 ' control. If this last resort fails, the function exits gracefully but
740 ' with a warnlog (causing some other functions to fail with warnings
741 ' as well). Beware of possible problems with screen resolutions.
742 ' This function has been tested for 1024x768 and 1280x1024 pixels.
743 ' Method 4 is dangerous because it might accidentially select the
744 ' background window which is the reason why this is not the default.
746 ' New: Method 5 is troublesome as well because #i79126 does not enable the
747 ' OpenProperties-button on the Macro Controls Float. Currently it is just used
748 ' to see what happens if we hack alog using keystrokes. Experimental.
750 '///+<li>Try four different ways of selecting the control before giving up</li>
752 '///+<li>Mouse-Click in the middle</li>
753 '///+<li>Mouse-Click on upper left corner</li>
754 '///+<li>Mouse-Click on lower right corner</li>
755 '///+<li>Rubberband around the control (Mouse movement)</li>
756 '///+<li>Deselct everything and use <TAB> to activate the control</li>
764 xPos = hGetControlPosXM( iControl )
765 yPos = hGetControlPosYM( iControl )
766 DialogWindow.MouseMove( xPos, yPos )
767 DialogWindow.MouseDown( xPos, yPos )
768 DialogWindow.MouseUp ( xPos, yPos )
770 xPos = hGetControlPosXO( iControl )
771 yPos = hGetControlPosYO( iControl )
772 DialogWindow.MouseMove( xPos, yPos )
773 DialogWindow.MouseDown( xPos, yPos )
774 DialogWindow.MouseUp ( xPos, yPos )
776 xPos = hGetControlPosXE( iControl )
777 yPos = hGetControlPosYE( iControl )
778 DialogWindow.MouseMove( xPos, yPos )
779 DialogWindow.MouseDown( xPos, yPos )
780 DialogWindow.MouseUp ( xPos, yPos )
782 xPos = hGetControlPosXO( iControl ) - 2
783 yPos = hGetControlPosYO( iControl ) - 2
784 DialogWindow.MouseMove( xPos, yPos )
785 DialogWindow.MouseDown( xPos, yPos )
786 DialogWindow.MouseUp ( xPos, yPos )
788 xPos = hGetControlPosXE( iControl ) + 2
789 yPos = hGetControlPosYE( iControl ) + 2
790 DialogWindow.MouseMove( xPos, yPos )
791 DialogWindow.MouseUp ( xPos, yPos )
793 qaerrorlog( "#i79126# - OpenProperties disabled when selecting control via tab" )
796 'DialogWindow.MouseDown( xPos, yPos )
797 'DialogWindow.MouseUp ( xPos, yPos )
798 'for iTab = 1 to iControl + 1
799 ' DialogWindow.typeKeys( "<TAB>" )
805 '///+<li>Check that the ToolsCollectionBar is open</li>
806 kontext "ToolsCollectionBar"
807 if ( ToolsCollectionBar.exists() ) then
809 if ( OpenProperties.isEnabled() ) then
810 hSelectControl() = true