[jawsscripts] Re: clicking a column header in a listview

  • From: Scott Huey <shuey@xxxxxxxxx>
  • To: "jawsscripts@xxxxxxxxxxxxx" <jawsscripts@xxxxxxxxxxxxx>
  • Date: Thu, 26 Jul 2012 21:56:39 +0000

Depends largely on the program the list is in. ClickObjectByName() might work. 
It may also be possible, if that doesn't work, to set the active cursor 
restriction to the list object's window (or a frame) using GetWindowRect() and  
passing those values to SetRestrictionToRect(), activate the JAWS cursor, and 
perform a JawsPageUp() call followed by a LeftMouseButton(). If all else fails, 
using FindString() and hunting for the header name would work, but obviously 
that can be error prone depending on the window if the list titles are very 
simple and common words.

Personally, if I couldn't attach to the object directly, I'd do the cursor 
restrictions. Assuming the list has its own window element (or parent object, 
since GetObjectRect() would work here too), the meat of a script function I'd 
make would look like this:

Var handle hwnd, int ileft, int iRight, int iTop, int iBottom
GetWindowRect(hwnd, iLeft, iRight, iTop, iBottom)
JawsCursor()
SaveCursor()
RouteJawstoPC()
SetRestrictionToRect(iLeft, iTop, iRight, iBottom)
JawsPageUp()
LeftMouseButton()
SetRestriction(RestrictNone)
RestoreCursor()
PCCursor()

The only real hitch you get there is HOW you get hwnd, since it probably needs 
to be a parent above the level of the list objects. If the List Contents is a 
window its own, you can't just use GetCurrentWindow() or GetFocus(), because 
the restriction will wind up stopping the cursor right underneath the headers. 

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx 
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Tony Hernandez
Sent: Thursday, July 26, 2012 5:23 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] clicking a column header in a listview

Hi.
I've been looking around some and can't find a function that will let me click 
the column header in a list view to sort the list by that  column.  Is there a 
quick and dirty way to do this?  JAWS 13, XP Pro SP3.

Tony
__________�

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


__________�

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

Other related posts: