<< Click to Display Table of Contents >> Navigation: 3. Script Language > Window Operations > SCW. - Search-Child-Window > Window Operations * SCW. |
MiniRobotLanguage (MRL)
"f"-Flag "disabled"
Search Child Window
Intention
The picture shows an enabled button (Install) and a disabled button (Next).
To ignore disabled child-windows (button, controls etc.) is the default behavior of the SCW. command. While the robot can work with disabled controls as well as with enabled controls.
What can you do with disabled controls (Buttons, etc.)?
You can do nearly everything with them, that you can do with enabled controls. But the most important thing is, that you can enable them, using the SWS.e - command.
It can however make sense, to override the default behavior by using the "f"-flag which will make SCW. to ignore enabled child-windows and just look for disabled child-windows. This could be an button that is disabled, for example.
If you want to catch both, enabled and disabled child-windows, the "a"-flag is what you need. However the "a"->Flag will automatically also enable the search for invisible child-windows.
If you do not want that, just add a prototype "v" after the "a". As the prototype on the right has a higher priority, you get exactly what you want this way.
In the same way, you can use the "f" - flag together with the "a" to search only child-windows that are disabled. No matter if they are visible or not.
For example. This will search only for disabled child-windows.
STW.c|WindowClass
SCW.fct|button|ok
MMV.
Now we would like to search for child-windows which are enabled, as well for disabled. We can do that in two ways.The first way is like this:
STW.c|WindowClass
SCW.efct|button|ok
MMV.
If we give all two prototypes, the robot understands that we want enabled and disabled child-windows. But there is another way to do it. We can do this:
STW.c|WindowClass
SCW.afct|button|ok
MMV.
The "a" Flag says "search all child-windows", enabled, disabled, visible and invisible. Now we just need to tell the robot that we do not want to get the enabled child-windows. We do this by adding the "f"-Flag after the "a". In this case the "f"-Flag will override the "a"-Flag. And tell the robot "we just want disabled child-windows.".
Short Examples:
' You can try yourself to enable an disabled button
' Use this script and the "BCS-Testform"
' from the Sample Application
' use this example script
STW.ct|PBWindowClass:0|BCS - Testform
SCW.nctf|1|Button|next
SWS.e
Example
'**********************************************
' SCW-Sample
'**********************************************
' Start TestApp only, if it's is not yet running.
'
STW.wtUXg|0|TestApp|found
EXE.?exepfad\Sample Apps\TestApp_01.exe
:found
STW.t|testapp
SCW.to|button 1|ero
SWS.i
GCT.
SCW.tuo|button 1|ero
SWS.vd
GCT.
SCW.tfo|button 1|ero
SWS.id
GCT.
SCW.tufo|button 1|ero
SWS.
ENR.
:ero
MBX.Window not found!
ENR.
Remarks
You can disable buttons, immediately after they appear using the SWS.d -command. This way you can prevent the user from clicking buttons, he should not click.
Limitations:
See also: