Silverfrost Forums

Welcome to our forums

Record and Playback - How to use this?

17 Dec 2016 5:06 #18554

I have a section of code that I need an automated way to 'run' the selection and processing buttons. ClearWin provides both record and playback functionality. I'm having some trouble getting it to work properly.

To get the file required, I start the record function immediately prior to the window being created, then close the recording when the window closes. The listing below is what is in the recording file.

<AWAIT,MAIN/5>
<LEFT_MOUSE_DOWN,LS001/5,6,42,1>
<LEFT_MOUSE_UP,LS001/5,6,42,0>
<LEFT_MOUSE_DOWN,LS002/5,30,72,1>
<LEFT_MOUSE_UP,LS002/5,31,71,0>
<LEFT_MOUSE_DOWN,LS003/5,27,24,1>
<LEFT_MOUSE_UP,LS003/5,27,24,0>
<LEFT_MOUSE_DOWN,BT001/5,59,13,1>
<LEFT_MOUSE_UP,BT001/5,59,13,0>
<MENUSELECT,MAIN/5,300>

To then use this data, the code runs up to the point at which the window will be created, opens this file for playback, and proceeds to build the window.

Three list selections are certainly made from the playback file, then the final button to process the selected data is 'pressed'. But the final button 'press' doesn't occur, although the button is selected. Looking at this window, I can see all the selections are properly made. But I have to click this button to get the window to close.

Is the ordering of the opening of the window and/or the creation of the window the playback file is targeting critical? I can find no examples on the Forum on how to use this/these features, and can really use your help.

Thanks, Bill

17 Dec 2016 8:25 #18555

The first thing that I would check is that the window position at record time is the same as that at play back time.

17 Dec 2016 2:29 #18557

Thanks, Paul. I very carefully re-created the recording file, making sure no windows were moved.

When I played the file back, the results were the same. And, the window was precisely in the same position as when it was created a few moments prior.

I am not explicitly using %ww to set the window initial parameters. The code snippet is: [code] k = winio@('%ca[Quadrangle Selection]&') K = winio@('%^6bt[Apply] Use the quad you selected below&',QUAD_SPECIAL_DONE) ! returns 4 k = winio@('%ff%nl%6.1ob[invisible]&') k = winio@('%rjState %cb%^6.4ls%cb&', $ STATE_NAME_EXTRACTED,MAX_STATE_EXTRACTED, $ ISEL_STATE,QUAD_SPECIAL_STATE_SELECT) k = winio@('%rjQuadrangle Name %cb%^20.10ls%cb&', $ QUAD_NAME_IN_STATE_EXTRACTED,max_in_state, $ ISEL_QUAD,QUAD_SPECIAL_QUAD_SELECT) k = winio@('%rjMap Scale %cb%^20.10ls%cb&', $ MAP_SCALE_IN_QUAD_EXTRACTED,max_in_state, $ ISEL_SCALES,QUAD_SPECIAL_SCALE_SELECT) K = WINIO@('%ff%nl%^6bt[New] Add a new quad&',QUAD_SPECIAL_NEW) ! returns 1; DEFINE A NEW quad, ADD TO FILE AND EXIT k = winio@('%ff%nl%`6bt[Cancel] Quit with no selection&') ! returns 3 k = winio@(' ')

This section is being called from another, active window, if that were to make a difference.

17 Dec 2016 5:34 #18558

Bill

If you can send me your code then I will take a look at it when I can.

17 Dec 2016 5:56 #18559

Thanks, Paul. I'll put something together (much shorter than the original) and post a link here.

17 Dec 2016 7:44 #18560

Here is the link to the Project file.

https://drive.google.com/file/d/0B5fbkRqVCqoMYnVPdHAxVDg1N00/view?usp=sharing

It's about as trimmed down as I could make it. It exhibits the same behavior as I see in my full code.

Thanks for taking a look.

Please login to reply.