[jawsscripts] Re: Changing and Saving / Restoring Cursors

  • From: "Donald Marang" <donald.marang@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Sat, 20 Dec 2008 14:53:58 -0500

Great, if it helps!  I would not place too much credibility to that code 
yet.  I have made many changes and still have some bugs left.  When I get 
the core functionality finished, I will post the scripts to the web.  I will 
also  post a link here for anyone's use and comments.  This list is 
invaluable for learning some of the quirks and working details of the JAWS 
scripting language!

Don Marang


----- Original Message ----- 
From: "Geoff Chapman" <gch@xxxxxxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Saturday, December 20, 2008 12:08 AM
Subject: [jawsscripts] Re: Changing and Saving / Restoring Cursors


> Wow donald, this is some cool code here i wanna examine for my own 
> learning
> if only i get some decent headspace learning time to do it in!
> <grin.>
> thanks heaps for posting all this and what it's kinda doing etc.
>
> ----- Original Message ----- 
> From: "Donald Marang" <donald.marang@xxxxxxxxx>
> To: <jawsscripts@xxxxxxxxxxxxx>
> Sent: Thursday, December 04, 2008 7:07 PM
> Subject: [jawsscripts] Re: Changing and Saving / Restoring Cursors
>
>
>> Actually, I am certainly a novice at scripting.I had written minor 
>> scripts
>> for many years, but nothing like this.  It is a great learning 
>> experience!
>> I have never used many features in JAWS, like Custom Highlight Assign. 
>> As
>> far as I could tell, it did not seem to handle this situation.
>>
>> The unruly application is Verizon Call Assistant.  It is a totally free
>> software and web service for Verizon customers who still have a home, 
>> land
>> line phone.  It is most usefull if you have Caller ID and Voice Mail on
> that
>> line.  This is exciting to me since I have all of these!  I realize that
>> most people have moved on and replaced these relics with newer more
> flexible
>> technology, like VoIP!  Once you create an account at
>> verizon.com/callassistant and you link it to your phone number and voice
>> mail service, you get many new capabilities.  You can view your call log,
>> listen and save voice mails, receive emails for selecctive calls and
> email,
>> and maintain a contact list.  If you download the PC software, you can
> have
>> all this available all the time and get apop up, "Toast" notification 
>> with
>> the Caller ID info for calls and voice mails!  It pops up down near the
>> clock area like a large HelpBalloon.  It even beats the phonne ringing by
> at
>> least a second.  I also like to know if someone is trying to call and 
>> left
> a
>> voice mail while my son is on the phone with his girlfriend.  I can see
> who
>> is trying to get through and even listen to the voice mail.  Verizon
>> promises to bring many new features in the near future including advanced
>> selective forwarding.
>>
>> The results show up in a nonstandard dialog below the small main window
> with
>> three buttons and a search edit box.  The results dialog is primarily a
>> nonstandard list view, surounded by a title and controls to go to the 
>> next
>> and previous pages.  The list shows up to 10 items at a time.  All of the
>> options and settings are managed omn the wevsite.  The only set up on the
> PC
>> is the login, which can be set to be done automatically when the computer
>> starts up.
>>
>> The list only has two columns, even though most of the time there is at
>> least three things associated with that item that are inportant!  The
> phone
>> of the incoming call is not shown in the call log.  To get this
> information,
>> you must hover the mouse over the item.  A two line "ToolTip" appears 
>> with
>> name and number.  New calls are shown in bold.  I also currently say 
>> "item
>> x" before each item to let me know the ActiveItemChangedEvent occoured.
>> When the "ToolTip appears, I say the phone number and capture these items
> in
>> global variables for later use.  Below is my ActiveItemChanged function
> and
>> part of my WindowActivatedEventt.
>>
>> My WindowActivatedEvent function first checks if the window class =
> "#32770"
>> (used by the results dialog, the "HelpBalloon" Toast dialogs and various)
>> "ToolTip" windows).  Then I check the Control ID of the first child to
>> identify which action should be taken.  The Control ID of this window is
>> 282.
>>
>>
>> Void Function ActiveItemChangedEvent (handle hWnd, int iCurrentID, Int
>> iCurrentChild, handle hWndPrevious, Int iPreviousID, Int iPreviousChild)
>>
>> If hWnd == ghWndListView Then
>>  SayString ("Item " + IntToString (iCurrentChild))
>>  If GetCharacterAttributes () & ATTRIB_BOLD Then SayString ("new ") EndIf
>>  ; SayString ("Selection state = " + IntToString (lvGetItemState (hWnd,
>> iCurrentChild) ))
>>
>>  JAWSCursor ()
>>  RouteJAWSToPc ()
>>  LeftMouseButton ()
>>  PCCursor ()
>> Else
>>  SayString ("Call to item changed and not in list view!  Item = " +
>> IntToString (iCurrentChild))
>> EndIf
>>
>> ActiveItemChangedEvent (hWnd, iCurrentID, iCurrentChild, hWndPrevious,
>> iPreviousID, iPreviousChild)
>>
>> EndFunction
>>
>>
>> Void Function WindowActivatedEvent (handle hWnd)
>> Var
>>  Handle hWndFirstChild,
>>  Int iFirstID,
>>  Handle hWndLastChild,
>>  Int iLastID,
>>  String sTip
>>
>> Let hWndFirstChild = GetFirstChild (hWnd)
>> Let iFirstID = GetControlID (hWndFirstChild)
>>
>> Let hWndLastChild = GetLastWindow (hWndFirstChild)
>> Let iLastID = GetControlID (hWndLastChild)
>> If GetWindowClass (hWnd) == WND_POPUP_CLASS Then
>>     If ...; handle other windows
>>  ELIf iFirstID == WCID_LIST_NAME Then
>>   ; SayString ("Name and phone pop up")
>>   Let gsListName = GetWindowName (hWndFirstChild)
>>   ; SayString ("Caller was: " + gsListName)
>>
>>   If IsWindowVisible (hWndLastChild) Then
>>    Let gsListNumber = GetWindowName (hWndLastChild)
>>    SayString ("number: " + gsListNumber)
>>   Else
>>    ;The ToolTip in the Search rersulrts list view only displays the name
>>    Let gsListNumber = Null ()
>>   EndIf
>>  ElIf iFirstID == WCID_VIEW_CONTACT_NAME Then
>> ... process other dialogs
>>  EndIf
>>
>> EndIf
>>
>> WindowActivatedEvent (hWnd)
>>
>> EndFunction
>>
>>
>> Don Marang
>>
>>
>> ----- Original Message ----- 
>> From: "Geoff Chapman" <gch@xxxxxxxxxxxxxxxx>
>> To: <jawsscripts@xxxxxxxxxxxxx>
>> Sent: Wednesday, December 03, 2008 9:44 AM
>> Subject: [jawsscripts] Re: Changing and Saving / Restoring Cursors
>>
>>
>> > p.s.
>> > like wen you say, switching whole scripts through
> activeItemChangedEvent,
>> > that sounds to me like
>> > a pretty sledge hammer approach to be trying as a solution?
>> > again, from a total novice perspective?
>> > You presumably know all about custom highlight colors and things of 
>> > that
>> > nature too, right? the simple stuff?
>> >
>> >
>> > ----- Original Message ----- 
>> > From: "Donald Marang" <donald.marang@xxxxxxxxx>
>> > To: <jawsscripts@xxxxxxxxxxxxx>
>> > Sent: Wednesday, December 03, 2008 3:03 PM
>> > Subject: [jawsscripts] Re: Changing and Saving / Restoring Cursors
>> >
>> >
>> >> Thanks, this seemed to help some.  It has not fixed all my problems,
> vut
>> > it
>> >> is vetter.  I will save this for future reference as well.  It is a
>> >> little
>> >> hard to debug with so many events.Today I tried to remove the need for
>> >> frames and switch scripts that get called from my own
>> >> WindowActivatedEvent
>> >> function.  If I get this working properly, I want to put part of this
>> > script
>> >> in a similar function in the default script file, so I will get
> notified
>> > by
>> >> itscustom "HelpBaloon".
>> >>
>> >> Right now, I have to press the KeyPad + to force the PCCursor back on
>> > after
>> >> each time I use the down arrow in a custom list view I am trying to
> tame.
>> >> If I don't, it seems to have the JAWSCursor active, and does not get
>> > events
>> >> from ActiveItemChangedEvent.  There must be something funky I am doing
>> >> within my ActiveItemChanggedEvent.  I had no idea that my application
>> >> woulduse MSAA at all, buut I followed a previous suggestion on this
> list
>> > and
>> >> it worked!  I have not investigated how to use MSAA any further at 
>> >> this
>> >> point.
>> >>
>> >> Bless the list for its help.
>> >>
>> >> Don Marang
>> >>
>> >>
>> >> ----- Original Message ----- 
>> >> From: "James Panes" <jimpanes@xxxxxxxxx>
>> >> To: <jawsscripts@xxxxxxxxxxxxx>
>> >> Sent: Tuesday, December 02, 2008 5:59 PM
>> >> Subject: [jawsscripts] Re: Changing and Saving / Restoring Cursors
>> >>
>> >>
>> >> > 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
>> >> >
>> >>
>> >> __________
>> >> 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
>> >
>>
>> __________
>> 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
> 

__________ 
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: