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 : gregor.hartmann@oracle.com
30 ' ** short description : Tools to draw and select form controls in basic-ide
32 '\******************************************************************************
34 private const ICONTROLCOUNT = 22
36 '*******************************************************************************
38 function hGetControlParams( cParam as string ) as integer
40 '///<h3>Retrieve basic parameters to draw formcontrols to a dialog</h3>
41 '///<i>All values are in percent relative to the window size.
42 '///+ All values are optimized for 1024x768 pixels screen resolution but
43 '///+ have been tested successfully with 1280x1024 and 800x600</i><br>
44 '///<i>In most cases it is desired to place multiple controls on a single
45 '///+ dialog pane. To prevent the controls from overlapping each other
46 '///+ they are arranged in rows and columns. Each control is identified
47 '///+ by a unique number (see description for hInsertControl(...)). The
48 '///+ dimensions are defined in hGetControlParams(...). The coordinates
49 '///+ returned by this function can be used to draw and to select a control.</i><br>
52 '///+<li>Name of the coordinate (string). Valid options are:</li>
54 '///+<li>"XOREGO" (Upper left corner)</li>
55 '///+<li>"YOREGO" (Upper left corner)</li>
56 '///+<li>"XDIST" (Distance between the upper left corners of neighbor controls)</li>
57 '///+<li>"YDIST" (Distance between the upper left corners of neighbor controls)</li>
58 '///+<li>"XSIZE" (Width of control)</li>
59 '///+<li>"YSIZE" (Heighth of the control)</li>
64 '///+<li>Coordinate/Distance/Size in percent of window size (integer)</li>
66 '///+<li>A number between 1 and 100</li>
67 '///+<li>0 on error (invalid function parameter)</li>
70 '///<u>Description</u>:
73 cParam = ucase( cParam )
75 '///+<li>Currently following values are defined:</li>
77 select case ( cParam )
78 '///+<li>XOREGO = 31</li>
79 case "XOREGO" : hGetControlParams() = 31
80 '///+<li>XDIST = 8</li>
81 case "XDIST" : hGetControlParams() = 8
82 '///+<li>XSIZE = 6</li>
83 case "XSIZE" : hGetControlParams() = 6
84 '///+<li>YOREGO = 30</li>
85 case "YOREGO" : hGetControlParams() = 30
86 '///+<li>YDIST = 7</li>
87 case "YDIST" : hGetControlParams() = 7
88 '///+<li>YSIZE = 5</li>
89 case "YSIZE" : hGetControlParams() = 5
90 '///+<li>Incorrect function parameter = 0</li>
91 case else : hGetControlParams() = 0
98 '*******************************************************************************
100 function hGetControlName( iControl as integer ) as string
102 '///<h3>A function to deliver a speaking name for all form controls</h3>
103 '///<i>Note that the numbers of the controls are unique</i><br>
104 '///<i>In most cases it is desired to place multiple controls on a single
105 '///+ dialog pane. To prevent the controls from overlapping each other
106 '///+ they are arranged in rows and columns. Each control is identified
107 '///+ by a unique number (see description for hInsertControl(...)). The
108 '///+ dimensions are defined in hGetControlParams(...). The coordinates
109 '///+ returned by this function can be used to draw and to select a control.</i><br>
112 '///+<li>Number of the control (integer)</li>
114 '///+<li>Any number between 1 and 22, see description below</li>
119 '///+<li>Name for a control (string)</li>
121 '///+<li>Name for a control (may contain whitespaces)</li>
122 '///+<li>An empty string in case of an invalid function parameter</li>
125 '///<u>Description</u>:
128 '///+<li>Currently following control are defined:</li>
131 '///+<li>Push Button</li>
132 case 1 : hGetControlName() = "Push Button"
133 '///+<li>Image Control</li>
134 case 2 : hGetControlName() = "Image Control"
135 '///+<li>Check Box</li>
136 case 3 : hGetControlName() = "Check Box"
137 '///+<li>Radio Button</li>
138 case 4 : hGetControlName() = "Radio Button"
139 '///+<li>Fixed Text</li>
140 case 5 : hGetControlName() = "Fixed Text"
141 '///+<li>Edit Field</li>
142 case 6 : hGetControlName() = "Edit Field"
143 '///+<li>List Box</li>
144 case 7 : hGetControlName() = "List Box"
145 '///+<li>Combo Box</li>
146 case 8 : hGetControlName() = "Combo Box"
147 '///+<li>Vertical ScrollBar</li>
148 case 9 : hGetControlName() = "Vertical ScrollBar"
149 '///+<li>Horizontal ScrollBar</li>
150 case 10 : hGetControlName() = "Horizontal ScrollBar"
152 case 11 : hGetControlName() = "Frame"
153 '///+<li>Progress Bar</li>
154 case 12 : hGetControlName() = "Progress Bar"
155 '///+<li>Vertical Fixed Line</li>
156 case 13 : hGetControlName() = "Vertical Fixed Line"
157 '///+<li>Horizontal Fixed Line</li>
158 case 14 : hGetControlName() = "Horizontal Fixed Line"
159 '///+<li>Date Field</li>
160 case 15 : hGetControlName() = "Date Field"
161 '///+<li>Time Field</li>
162 case 16 : hGetControlName() = "Time Field"
163 '///+<li>Numeric Field</li>
164 case 17 : hGetControlName() = "Numeric Field"
165 '///+<li>Currency Field</li>
166 case 18 : hGetControlName() = "Currency Field"
167 '///+<li>Form Field</li>
168 case 19 : hGetControlName() = "Form Field"
169 '///+<li>Pattern Field</li>
170 case 20 : hGetControlName() = "Pattern Field"
171 '///+<li>File Control</li>
172 case 21 : hGetControlName() = "File Control"
173 '///+<li>Tree Control</li>
174 case 22 : hGetControlName() = "Tree Control"
176 '///+<li>"" for function parameter < 1 or > 22 </li>
177 case else : sControl = ""
183 '*******************************************************************************
185 function hInsertControl( iControl as integer ) as string
187 '///<h3>Function to insert one of the BASIC formcontrols by index</h3>
188 '///<i>Note that the numbers of the controls are unique</i><br>
189 '///<i>In most cases it is desired to place multiple controls on a single
190 '///+ dialog pane. To prevent the controls from overlapping each other
191 '///+ they are arranged in rows and columns. Each control is identified
192 '///+ by a unique number (see description for hInsertControl(...)). The
193 '///+ dimensions are defined in hGetControlParams(...). The coordinates
194 '///+ returned by this function can be used to draw and to select a control.</i><br>
197 '///+<li>Number of the control (integer)</li>
199 '///+<li>Any number between 1 and 22, see description below</li>
204 '///+<li>Name for a control (string)</li>
206 '///+<li>Name for a control (may contain whitespaces)</li>
207 '///+<li>An empty string in case of an invalid function parameter</li>
210 '///<u>Description</u>:
213 const CFN = "hInsertControl::"
215 Kontext "ToolsCollectionBar"
217 '///+<li>Click on the requested button on the ToolsCollectionBar:</li>
220 '///+<li>Push Button</li>
221 case 1 : InsPushButton.click()
222 '///+<li>Image Control</li>
223 case 2 : InsImgCtrl.click()
224 '///+<li>Check Box</li>
225 case 3 : InsCheckbox.click()
226 '///+<li>Radio Button</li>
227 case 4 : InsRadioButton.click()
228 '///+<li>Fixed Text</li>
229 case 5 : InsFixedText.click()
230 '///+<li>Edit Field</li>
231 case 6 : InsEditField.click()
232 '///+<li>List Box</li>
233 case 7 : InsListbox.click()
234 '///+<li>Combo Box</li>
235 case 8 : InsComboBox.click()
236 '///+<li>Vertical ScrollBar</li>
237 case 9 : InsScrollBarV.click()
238 '///+<li>Horizontal ScrollBar</li>
239 case 10 : InsScrollBarH.click()
241 case 11 : InsFrame.click()
242 '///+<li>Progress Bar</li>
243 case 12 : InsProgressbar.click()
244 '///+<li>Vertical Fixed Line</li>
245 case 13 : InsFixedLineV.click()
246 '///+<li>Horizontal Fixed Line</li>
247 case 14 : InsFixedLineH.click()
248 '///+<li>Date Field</li>
249 case 15 : InsDateField.click()
250 '///+<li>Time Field</li>
251 case 16 : InsTimeField.click()
252 '///+<li>Numeric Field</li>
253 case 17 : InsNumField.click()
254 '///+<li>Currency Field</li>
255 case 18 : InsCurrencyField.click()
256 '///+<li>Form Field</li>
257 case 19 : InsFormField.click()
258 '///+<li>Pattern Field</li>
259 case 20 : InsPatternField.click()
260 '///+<li>File Control</li>
261 case 22 : InsFileCtrl.click()
262 '///+<li>Tree Control</li>
263 case 22 : InsTreeControl.click()
266 '///+<li>"" for function parameter < 1 or > 22 </li>
268 hInsertControl() = hGetControlName( iControl )
273 '*******************************************************************************
275 function hDrawControlOnDialog( iControl as integer ) as string
277 '///<h3>Draw a control on a dialog at a fixed position</h3>
278 '///<i>Note that the numbers of the controls are unique</i><br>
279 '///<i>In most cases it is desired to place multiple controls on a single
280 '///+ dialog pane. To prevent the controls from overlapping each other
281 '///+ they are arranged in rows and columns. Each control is identified
282 '///+ by a unique number (see description for hInsertControl(...)). The
283 '///+ dimensions are defined in hGetControlParams(...). The coordinates
284 '///+ returned by this function can be used to draw and to select a control.</i><br>
287 '///+<li>Number of the control (integer)</li>
289 '///+<li>Any number between 1 and 22, see description for hInsertControl()</li>
294 '///+<li>Name for a control (string)</li>
296 '///+<li>Name for a control (may contain whitespaces)</li>
297 '///+<li>An empty string in case of an invalid function parameter</li>
300 '///<u>Description</u>:
303 const CFN = "hDrawControlOnDialog::"
305 dim sControl as string ' The name of the current control
306 dim brc as boolean ' some returnvalue
308 ' coordinates of the controls on the dialog in the dialog-editor
314 '///+<li>determine where the control is to be painted (hGetControlPos...)</li>
315 iXO = hGetControlPosXO( iControl )
316 iYO = hGetControlPosYO( iControl )
317 iXE = hGetControlPosXE( iControl )
318 iYE = hGetControlPosYE( iControl )
320 '///+<li>click the desired control</li>
321 sControl = hInsertControl( iControl )
322 printlog( CFN & " Index=" & iControl & _
329 '///+<li>Draw the control (using hDrawControl(...))</li>
330 brc = hDrawControl( iXO, iYO, iXE, iYE )
331 hDrawControlOnDialog() = sControl
336 '*******************************************************************************
338 function hDrawControl( xPos as integer, _
341 yEnd as integer ) as boolean
343 '///<h3>Draw a control on the dialog pane in the dialog editor</h3>
344 '///<i>Starting point: Basic IDE/Dialog editor</i><br>
345 '///<i>In most cases it is desired to place multiple controls on a single
346 '///+ dialog pane. To prevent the controls from overlapping each other
347 '///+ they are arranged in rows and columns. Each control is identified
348 '///+ by a unique number (see description for hInsertControl(...)). The
349 '///+ dimensions are defined in hGetControlParams(...). The coordinates
350 '///+ returned by this function can be used to draw and to select a control.</i><br>
351 '///<i>Note: All units are in percent of the relative to the current window size</i><br>
354 '///+<li>X-Orego (Upper left corner) (integer)</li>
356 '///+<li>Min = 0</li>
357 '///+<li>Max = 100 (allowed but not useful)</li>
359 '///+<li>Y-Orego (Upper left corner) (integer)</li>
361 '///+<li>Min = 0</li>
362 '///+<li>Max = 100 (allowed but not useful)</li>
364 '///+<li>X-End (Lower right corner) (integer)</li>
366 '///+<li>Min = 0</li>
367 '///+<li>Max = 100 (allowed but not useful)</li>
369 '///+<li>Y-End (Lower right corner) (integer)</li>
371 '///+<li>Min = 0</li>
372 '///+<li>Max = 100 (allowed but not useful)</li>
377 '///+<li>Errorstatus (boolean)</li>
379 '///+<li>TRUE on success</li>
380 '///+<li>FALSE on failure</li>
383 '///<u>Description</u>:
386 const CFN = "hDrawControl::"
388 '///+<li>Set context to Basic IDE</li>
391 '///+<li>Draw the control using mouse actions</li>
393 '///+<li>Mouse down on pos X/Y-Orego</li>
394 '///+<li>Mouse move to pos X/Y-End</li>
395 '///+<li>Mouse up on pos X/Y-End</li>
400 DialogWindow.MouseUp( 20 , 20 ) : wait 100
403 DialogWindow.MouseMove ( xPos, yPos ) : wait 100
404 DialogWindow.MouseDown ( xPos, yPos ) : wait 100
405 DialogWindow.MouseMove ( xEnd, yEnd ) : wait 100
406 DialogWindow.MouseUp ( xEnd, yEnd ) : wait 100
407 hDrawControl() = true
409 warnlog( "#i39852# " & CFN & "Unable to complete mouseactions on dialog" )
410 hDrawControl() = false
416 '*******************************************************************************
418 function hGetControlPosXO( iControl as integer ) as integer
420 '///<h3>Retrieve the upper left X-coordinate for a control</h3>
421 '///<i>In most cases it is desired to place multiple controls on a single
422 '///+ dialog pane. To prevent the controls from overlapping each other
423 '///+ they are arranged in rows and columns. Each control is identified
424 '///+ by a unique number (see description for hInsertControl(...)). The
425 '///+ dimensions are defined in hGetControlParams(...). The coordinates
426 '///+ returned by this function can be used to draw and to select a control.</i><br>
429 '///+<li>Number of the control (integer)</li>
431 '///+<li>Any number between 1 and 22, see description for hInsertControl()</li>
436 '///+<li>X-Orego in percent of window size (integer)</li>
438 '///<u>Description</u>:
441 dim xOffset as integer
442 xOffset = hGetControlParams( "xorego" )
444 dim xDistance as integer
445 xDistance = hGetControlParams( "xdist" )
447 '///+<li>Define an offset for the control depending on its ID</li>
449 '///+<li>< 7 : Column one</li>
450 '///+<li>7 ... 12 : Column two</li>
451 '///+<li>13 ... 18 : Column three</li>
452 '///+<li>> 18 : Column four</li>
456 select case ( iControl )
457 case 1, 2, 3, 4, 5, 6 : hGetControlPosXO() = xOffset
458 case 7, 8, 9, 10, 11, 12 : hGetControlPosXO() = xOffset + 1 * xDistance
459 case 13, 14, 15, 16, 17, 18 : hGetControlPosXO() = xOffset + 2 * xDistance
460 case 19, 20, 21, 22, 23, 24 : hGetControlPosXO() = xOffset + 3 * xDistance
465 '*******************************************************************************
467 function hGetControlPosYO( iControl as integer ) as integer
469 '///<h3>Retrieve the upper left Y-coordinate for a control</h3>
470 '///<i>In most cases it is desired to place multiple controls on a single
471 '///+ dialog pane. To prevent the controls from overlapping each other
472 '///+ they are arranged in rows and columns. Each control is identified
473 '///+ by a unique number (see description for hInsertControl(...)). The
474 '///+ dimensions are defined in hGetControlParams(...). The coordinates
475 '///+ returned by this function can be used to draw and to select a control.</i><br>
478 '///+<li>Number of the control (integer)</li>
480 '///+<li>Any number between 1 and 21, see description for hInsertControl()</li>
485 '///+<li>Y-Orego in percent of window size (integer)</li>
487 '///<u>Description</u>:
489 dim yOffset as integer
490 yOffset = hGetControlParams( "yorego" )
492 dim yDistance as integer
493 yDistance = hGetControlParams( "ydist" )
495 '///+<li>Define an offset for the control depending on its ID</li>
497 '///+<li>1 , 7 , 13 , 19 : Row one</li>
498 '///+<li>2 , 8 , 14 , 20 : Row two</li>
499 '///+<li>3 , 9 , 15 , 21 : Row three</li>
500 '///+<li>4 , 10 , 16 , 22 : Row four</li>
501 '///+<li>5 , 11 , 17 : Row five</li>
502 '///+<li>6 , 12 , 18 : Row six</li>
506 select case ( iControl )
507 case 1, 7, 13, 19 : hGetControlPosYO() = yOffset
508 case 2, 8, 14, 20 : hGetControlPosYO() = yOffset + 1 * yDistance
509 case 3, 9, 15, 21 : hGetControlPosYO() = yOffset + 2 * yDistance
510 case 4, 10, 16, 22 : hGetControlPosYO() = yOffset + 3 * yDistance
511 case 5, 11, 17, 23 : hGetControlPosYO() = yOffset + 4 * yDistance
512 case 6, 12, 18, 24 : hGetControlPosYO() = yOffset + 5 * yDistance
517 '*******************************************************************************
519 function hGetControlPosXE( iControl as integer ) as integer
521 '///<h3>Retrieve the lower right X-coordinate for a control</h3>
522 '///<i>In most cases it is desired to place multiple controls on a single
523 '///+ dialog pane. To prevent the controls from overlapping each other
524 '///+ they are arranged in rows and columns. Each control is identified
525 '///+ by a unique number (see description for hInsertControl(...)). The
526 '///+ dimensions are defined in hGetControlParams(...). The coordinates
527 '///+ returned by this function can be used to draw and to select a control.</i><br>
530 '///+<li>Number of the control (integer)</li>
532 '///+<li>Any number between 1 and 22, see description for hInsertControl()</li>
537 '///+<li>X-End in percent of window size (integer)</li>
539 '///<u>Description</u>:
542 '///+<li>Get pos for X-Orego, add "XSIZE"</li>
543 hGetControlPosXE() = hGetControlPosXO( iControl ) + _
544 hGetControlParams( "xsize" )
549 '*******************************************************************************
551 function hGetControlPosYE( iControl as integer ) as integer
553 '///<h3>Retrieve the lower right Y-coordinate for a control</h3>
554 '///<i>In most cases it is desired to place multiple controls on a single
555 '///+ dialog pane. To prevent the controls from overlapping each other
556 '///+ they are arranged in rows and columns. Each control is identified
557 '///+ by a unique number (see description for hInsertControl(...)). The
558 '///+ dimensions are defined in hGetControlParams(...). The coordinates
559 '///+ returned by this function can be used to draw and to select a control.</i><br>
562 '///+<li>Number of the control (integer)</li>
564 '///+<li>Any number between 1 and 22, see description for hInsertControl()</li>
569 '///+<li>Y-End in percent of window size (integer)</li>
571 '///<u>Description</u>:
574 '///+<li>Get pos for Y-Orego, add "YSIZE"</li>
575 hGetControlPosYE() = hGetControlPosYO( iControl ) + _
576 hGetControlParams( "ysize" )
581 '*******************************************************************************
583 function hGetControlPosXM( iControl as integer ) as integer
585 '///<h3>Retrieve the center (X) of a control</h3>
586 '///<i>In most cases it is desired to place multiple controls on a single
587 '///+ dialog pane. To prevent the controls from overlapping each other
588 '///+ they are arranged in rows and columns. Each control is identified
589 '///+ by a unique number (see description for hInsertControl(...)). The
590 '///+ dimensions are defined in hGetControlParams(...). The coordinates
591 '///+ returned by this function can be used to draw and to select a control.</i><br>
594 '///+<li>Number of the control (integer)</li>
596 '///+<li>Any number between 1 and 22, see description for hInsertControl()</li>
601 '///+<li>X-Center in percent of window size (integer)</li>
603 '///<u>Description</u>:
609 '///+<li>Find X-Orego</li>
610 XO = hGetControlPosXO( iControl )
612 '///+<li>Find X-End</li>
613 XE = hGetControlPosXE( iControl )
615 '///+<li>Calculate the distance, find the middle between the two</li>
616 hGetControlPosXM() = XO + 0.5 * ( XE - XO )
621 '*******************************************************************************
623 function hGetControlPosYM( iControl as integer ) as integer
625 '///<h3>Retrieve the center (Y) of a control</h3>
626 '///<i>In most cases it is desired to place multiple controls on a single
627 '///+ dialog pane. To prevent the controls from overlapping each other
628 '///+ they are arranged in rows and columns. Each control is identified
629 '///+ by a unique number (see description for hInsertControl(...)). The
630 '///+ dimensions are defined in hGetControlParams(...). The coordinates
631 '///+ returned by this function can be used to draw and to select a control.</i><br>
634 '///+<li>Number of the control (integer)</li>
636 '///+<li>Any number between 1 and 22, see description for hInsertControl()</li>
641 '///+<li>Y-Center in percent of window size (integer)</li>
643 '///<u>Description</u>:
649 '///+<li>Find Y-Orego</li>
650 YO = hGetControlPosYO( iControl )
652 '///+<li>Find Y-End</li>
653 YE = hGetControlPosYE( iControl )
655 '///+<li>Calculate the distance, find the middle between the two</li>
656 hGetControlPosYM() = YO + 0.5 * ( YE - YO )
661 '*******************************************************************************
663 function hSelectControl( iControl as integer ) as boolean
665 '///<h3>Function to select one of the BASIC formcontrols by index</h3>
666 '///<i>Note: Refer to the inline documentation for implementation details</i><br>
667 '///<i>In most cases it is desired to place multiple controls on a single
668 '///+ dialog pane. To prevent the controls from overlapping each other
669 '///+ they are arranged in rows and columns. Each control is identified
670 '///+ by a unique number (see description for hInsertControl(...)). The
671 '///+ dimensions are defined in hGetControlParams(...).</i><br>
674 '///+<li>Number of the control (integer)</li>
676 '///+<li>Any number between 1 and 22, see description for hInsertControl()</li>
681 '///+<li>Errorstatus (boolean)</li>
683 '///+<li>TRUE if the properties-button on ToolsCollectionBar is enabled</li>
684 '///+<li>FALSE in any other case</li>
687 '///<u>Description</u>:
692 dim iCurrentSelectionMethod as integer
694 const SELECT_MIDDLE = 1 ' click into the middle of the control
695 const SELECT_UPPER_LEFT = 2 ' click the upper left corner of the control
696 const SELECT_LOWER_RIGHT = 3 ' click the lower right corner of the control
697 const SELECT_FRAME_AROUND = 4 ' select by drawing a frame around the control
699 const EXTRA_FRAME_SIZE = 1 ' one percent in-/outside the border of the control
700 const SELECTION_METHODS = 4 ' this function sports four ways of seleting a control
701 const REPEAT_COUNT = 5 ' number of times to send a keystroke to the dialog window
703 hSelectControl() = false
705 '///+<li>Verify that the ToolsCollectionBar is visible. if not: Abort</li>
706 kontext "ToolsCollectionBar"
707 if ( not ToolsCollectionBar.exists() ) then
708 warnlog( "The ToolsCollectionBar is not visible, open it first" )
712 '///+<li>Enable the selection mode on ToolsCollectionBar</li>
715 ' Note: The controls have areas where they ignore a mouseclick. E.g. the
716 ' framecontrol can only be grabbed at the border, you won't be able to
717 ' select it by clicking in the middle. Furthermore - even if the Dialog-
718 ' editor-window is maximized - we might still miss the upper left corner.
719 ' So what happens in this loop is that we try to click in the middle of the
720 ' control. This works in 21 out of 22 cases. If it fails, we try to grab the
721 ' border, first upper left corner then lower right. If this still fails,
722 ' we try to select the control by using a rectangle selection around the
723 ' control. If this last resort fails, the function exits gracefully but
724 ' with a warnlog (causing some other functions to fail with warnings
725 ' as well). Beware of possible problems with screen resolutions.
726 ' This function has been tested for 1024x768 and 1280x1024 pixels.
727 ' Method 4 is dangerous because it might accidentially select the
728 ' background window which is the reason why this is not the default.
730 '///+<li>Try four different ways of selecting the control before giving up</li>
732 '///+<li>Mouse-Click in the middle</li>
733 '///+<li>Mouse-Click on upper left corner</li>
734 '///+<li>Mouse-Click on lower right corner</li>
735 '///+<li>Rubberband around the control (Mouse movement)</li>
736 '///+<li>Deselct everything and use <TAB> to activate the control</li>
740 for iCurrentSelectionMethod = 1 to SELECTION_METHODS
743 DialogWindow.typeKeys( "<UP><LEFT>" , REPEAT_COUNT )
744 select case ( iCurrentSelectionMethod )
747 xPos = hGetControlPosXM( iControl )
748 yPos = hGetControlPosYM( iControl )
749 DialogWindow.MouseMove( xPos, yPos )
750 DialogWindow.MouseDown( xPos, yPos )
751 DialogWindow.MouseUp ( xPos, yPos )
753 case SELECT_UPPER_LEFT
755 xPos = hGetControlPosXO( iControl ) + EXTRA_FRAME_SIZE
756 yPos = hGetControlPosYO( iControl ) + EXTRA_FRAME_SIZE
757 DialogWindow.MouseMove( xPos, yPos )
758 DialogWindow.MouseDown( xPos, yPos )
759 DialogWindow.MouseUp ( xPos, yPos )
761 case SELECT_LOWER_RIGHT
763 xPos = hGetControlPosXE( iControl ) - EXTRA_FRAME_SIZE
764 yPos = hGetControlPosYE( iControl ) - EXTRA_FRAME_SIZE
765 DialogWindow.MouseMove( xPos, yPos )
766 DialogWindow.MouseDown( xPos, yPos )
767 DialogWindow.MouseUp ( xPos, yPos )
769 case SELECT_FRAME_AROUND
771 xPos = hGetControlPosXO( iControl ) - EXTRA_FRAME_SIZE
772 yPos = hGetControlPosYO( iControl ) - EXTRA_FRAME_SIZE
773 DialogWindow.MouseMove( xPos, yPos )
774 DialogWindow.MouseDown( xPos, yPos )
776 xPos = hGetControlPosXE( iControl ) + EXTRA_FRAME_SIZE
777 yPos = hGetControlPosYE( iControl ) + EXTRA_FRAME_SIZE
778 DialogWindow.MouseMove( xPos, yPos )
779 DialogWindow.MouseUp ( xPos, yPos )
784 if ( iControl = 11 ) then
786 printlog( "tried method: " & iCurrentSelectionMethod )
789 hSelectControl() = true
794 next iCurrentSelectionMethod