[jawsscripts] Re: Changing and Saving / Restoring Cursors

  • From: "James Panes" <jimpanes@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Tue, 2 Dec 2008 17:59:41 -0500

Yes, the cursors do save on a stack. Another very important thing to 
remember is that JAWS does not save the position of the PC Cursor when it is 
saved. There are valid scripting reasons why this is the case.

To save and restore the PC cursor, I do the following:
InvisibleCursor ()
SaveCursor ()    ; This saves the original position of the invisible cursor
Move InvisibleToPC ()
SaveCursor ()    ; This uses the invisible cursor to save the position of 
the PC cursor.

Code that changes positions here

RestoreCursor ()    ; This moves the invisible cursor to the original 
position of the PC Cursor.
RoutePCToInvisible () ; Places PC cursor back at its original position.
RestoreCursor ()    ; Places Invisible cursor back to its original position.
PCCursor ()    ; Activates PC cursor.

This places the PC cursor and the invisible cursor back to where they were 
and activates the PC cursor. The other thing is to make sure that the PC 
cursor is active before going to all this trouble.

Some scripters do not bother to save and restore the invisible cursor.

Regards,
James
jimpanes@xxxxxxxxx
jimpanes@xxxxxxxxxxxx
"Everything is easy when you know how."

----- Original Message ----- 
From: "Doug Lee" <doug.lee@xxxxxxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Tuesday, December 02, 2008 4:39 PM
Subject: [jawsscripts] Re: Changing and Saving / Restoring Cursors


My standard idiom is saveCursor() invisibleCursor() saveCursor():  The
first saveCursor keeps track of which cursor was active to begin with,
and the second saves the position of the invisible cursor before I
move it.

On Tue, Dec 02, 2008 at 04:32:27PM -0500, Donald Marang wrote:
In the examples I have seen for using the SaveCursor and RestoreCursor 
functions, they use the following order:
InvisibleCursor ()
SaveCursor ()
perform statements that move the focus...
RestoreCursor ()

If the save and restore functions work like a stack, wouldn't the SaveCursor 
function need to be called first, and then change cursors?  I am a little 
confused here.  I am finding my application being continually with the 
InvisibleCursor active, and I am not sure why!

Don Marang


__________?
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts

-- 
Doug Lee, Senior Accessibility Programmer
SSB BART Group - Accessibility-on-Demand
mailto:doug.lee@xxxxxxxxxxxxxxxx  http://www.ssbbartgroup.com
"While they were saying among themselves it cannot be done,
it was done." --Helen Keller
__________
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts

__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

Other related posts: