[jawsscripts] Re: connecting accelerators in new DLGSelectItemInList?

  • From: "Geoff Chapman" <gch@xxxxxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Thu, 22 Jul 2010 05:35:25 +1000

hahahahaha. sorry dean I only laugh because, the only incredibly brief 
reference you'll get that I know about, is in the good old fsdn.  you have 
this I take it?

that's how I ran across this anywayz.  it's very groovy! except that I now 
wish they'd include a thinggy in that dialog where one could provide some 
helper text that might auto read when one tabbed to each button, should one 
desire this. now, that would be sweet!

And, to effectively utilize it, you'll need also to read/understand the very 
helpful explanations I got from

many people up here, including James Homme, and a guy called Gordon Luke, or 
perhaps Luke Gordon, unsure which, "sorry about my confusion there," which I 
rePaste below for your education. it was excellent and really helped me get 
a handle, as it were, on this.

My sincerest and heart felt thanks to Gordon for this invaluable 
explanation!

punctuation only slightly edited for increased clairty.


From: <Gordon.Luke@xxxxxxxxxxxxxxxx>


Hi Geoff

In many languages elements of arrays are 0 based i.e. the first element in
the array is at index 0, the second at index 1, the third at index 2 and so
on.  In Jaws scripting, for certain occurances, a 1 based system is used
i.e. the first element is at index 1, the second is at index 2, the third
is at index 3 and so on.  Although at first glance your string list of
elements is not an array it can be thought of as such by using the | symbol
to separate the elements out.  Thus button1 would be the first element,
button2 the second, button3 the third and so on.

Now moving onto your byRef question.
I think I need to explain a little
about passing information to and from functions.  Basically information can
be passed in either of two ways, - either byVal or byRef.  When you pass
information to a function byVal, you are really just telling that function
this is the value I want you to start with for this variable.  The variable
you are using to pass the information in, does not care what the function
does with that value as the value is never sent back from that function to
that variable.  In fact you don't even need to have a variable set up in
order to pass into the function. e.g. in the messageBox function you just
tell it the absolute message string in quotation marks, you wish to display.

ByRef on the other hand does care what happens to its variable value inside
the function, as when the function is completed the value of the variable is
reassigned back to the original calling value.  Variables must always be
used for byRef passing.
GC: that's important dean, I missed that first time round. so in param 6 of 
DLG selectItem in list for example, you need to make this a variable, not an 
absolute or literal value,
, for of course, it's going to hold the index number, of the custom button 
the user selected. I used, iButton, as mine, but of course you can use 
anything that's an integer type variable, which will hold this value.
Gordon goes on:

i.e. constants like in our messageBox example won't
work.  An example might help explain better.

void function AddByVal(int i)
   let i = i + 1
endfunction

void function AddByRef(int byRef i)
   let i = i + 1
endfunction

Both of the above functions basically do the same thing i.e. increment the
variable i by 1.  Now suppose we want to use them in another function.  So
we declare an integer x, and assign it a value of 5. e.g.

var
   int x

   let x = 5

   SayInteger(x)

   AddByVal(x)

   SayInteger(x)

   AddVyRef(x)

   SayInteger(x)

So after the first function call, AddByVal variable x is not changed. but
after the call to AddByRef, variable x has increased by one.  Thus ByRef
makes things change on the variable that's passed in, byVal does not.

So coming back to your dlg question, parameter 6 must be a variable of type
int, as it will contain the index of the button that was pressed. e.g. it
will be 1 if button1 was pressed, 2 if button2 was pressed, 3 if button3
was pressed etc etc.


Hope this help you dean.

Also be aware, that Ok and Cancel, always seem to end up first in the tab 
order? which is a bit of a shame, such that I suggest to my user in the 
title of the dlgSelectItemInList, that they might wana shiftTab, to most 
quickly get to the buttons.  it'd be nice if fs would reverse this, and make 
ok and cancel turn up as the last two buttons in the forward tabbing order, 
but, until then, yeah. or, as Jackie has now revealed to all of us,
you can place the shifted7, and, sign, before the letter in the vertical bar 
separated button labels, that you want, to become the shortCut accellerator 
key for that button, and pressing alt+that letter, will execute that button 
immediately. which is very sweet!

I would only exhort you however, to watch it if you've got any scripts 
attached to any of the plain alt+letter keys, as I did, else of course, 
without any conditional logic in the scripts for those keys, they will 
override any DLGSelectItemInList, button execution functionality.

hth.

\---- Original Message ----- 
From: "Dean Masters" <dwmasters@xxxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Thursday, July 22, 2010 5:04 AM
Subject: [jawsscripts] Re: connecting accelerators in new 
DLGSelectItemInList?


> Where can I find more out about the custom button DLGSelectItemInList?
>
> --------------------------------------------------
> From: "Geoff Chapman" <gch@xxxxxxxxxxxxxxxx>
> Sent: Wednesday, July 21, 2010 2:10 AM
> To: <jawsscripts@xxxxxxxxxxxxx>
> Subject: [jawsscripts] Re: connecting accelerators in new
> DLGSelectItemInList?
>
>> far out! your right! your totally right!
>> I've never ever heard that before.
>> Jaws even speaks the underlined letter now as one tabs about the buttons.
>>
>> thank you thank you. that's fabulous!
>> I hope this encouragement to your amazing abilities to remember even 
>> under
>> yucky health duress, improves your wellBeing/HeadAche tonight. and I will
>> also Ask our friend if he might intervene in that department also.
>>
>> Thanks again.
>>
>>
>> ----- Original Message ----- 
>> From: "Jackie McBride" <abletec@xxxxxxxxx>
>> To: <jawsscripts@xxxxxxxxxxxxx>
>> Sent: Wednesday, July 21, 2010 3:59 PM
>> Subject: [jawsscripts] Re: connecting accelerators in new
>> DLGSelectItemInList?
>>
>>
>>> I'll have to check, as this is all pretty new, & u might wanna check
>>> now, cuz it's late here & I'm wallopped. But I believe that can be
>>> done by putting an & (ampersand) sign in front of the letter u wish to
>>> underline, e.g. e&xit would underline the x & thus make alt-x the
>>> hotkey. I could be hallucinating, though, as I've done plenty of
>>> programming study over these past few weeks, & sometimes it all gets
>>> mixed up, especially when I'm hammered, like now. It's what I get for
>>> trying to alleviate a sinus headache w/antihistamine type drugs which
>>> I don't normally take.
>>>
>>> Explaining what you're trying to accomplish when asking questions
>>> about a script you're writing is always a good thing. Try to be
>>> concise about it & try to divide what you're trying to accomplish into
>>> small increments. Surprisingly, that gives u a lot more clarity
>>> sometimes as well as us.
>>>
>>> On 7/20/10, Geoff Chapman <gch@xxxxxxxxxxxxxxxx> wrote:
>>>> Hi Jackie,
>>>> but, hee hee, oh goodness! here I was thinking for once I was being
>>>> clear,
>>>> really concise, and non-verbose, and ... now
>>>> I'm asked for more detail!  grrrr! hhahahahaha, lol.
>>>>
>>>> ok well, you asked for it, hahhaha,
>>>> basically I wanna use the DLGSelectItemInList dialog, with the new
>>>> Custom
>>>> buttons feature in jaws11, which I've done, to execue various actions 
>>>> on
>>>> whichever given trunk or station number they first select in the main
>>>> listbox.
>>>> but Idealy I'd like to be able to make
>>>> ShortCut, alt+Letter keys, I thought they were called accellerators, 
>>>> but
>>>> this might be quite wrong, <grin,>
>>>> to activate them.  and in addition, choosing what letters I'd like, to
>>>> assign to  each button, which when pressed with alt, would execute them
>>>> rather than having to tab around to them and press spaceBar/Enter.
>>>>
>>>> I knew that the letters in these labels of fields in dialogs, are
>>>> usually
>>>> underlined, to indicate to the sightling and to jaws, which letter it
>>>> is,
>>>> within it's name that will execute it when pressed with alt, and I
>>>> thought
>>>> maybe if I could make that happen in the label for the Custom Buttons 
>>>> in
>>>> jaws, that this might activate such a feature by default within 
>>>> windows?
>>>> but, I didn't know how/if we could do that within the script manager?
>>>>
>>>>
>>>> ----- Original Message -----
>>>> From: "Jackie McBride" <abletec@xxxxxxxxx>
>>>> To: <jawsscripts@xxxxxxxxxxxxx>
>>>> Sent: Wednesday, July 21, 2010 2:54 PM
>>>> Subject: [jawsscripts] Re: connecting accelerators in new
>>>> DLGSelectItemInList?
>>>>
>>>>
>>>>> Wanna be more specific & tell us what u need to do?
>>>>>
>>>>> On 7/20/10, Geoff Chapman <gch@xxxxxxxxxxxxxxxx> wrote:
>>>>>> anyone know how/if we can connect accelerator keys in the new jaws11
>>>>>> custom
>>>>>> button version of DLGSelectItemInList?
>>>>>>
>>>>>>
>>>>>> it would be very cool if this were possible? if not BuiltIn, which it
>>>>>> appears not to be, would there be any way of me building this
>>>>>> functionality
>>>>>> with current functions?
>>>>>>
>>>>>>
>>>>>>
>>>>>> thanks.
>>>>>>
>>>>>>
>>>>>>
>>>>>> geoff c.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> __________�
>>>>>>
>>>>>> View the list's information and change your settings at
>>>>>> http://www.freelists.org/list/jawsscripts
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Change the world--1 deed at a time
>>>>> Jackie McBride
>>>>> Scripting Classes: http://jawsscripting.lonsdalemedia.org
>>>>> homePage: www.abletec.serverheaven.net
>>>>> For technophobes: www.technophoeb.com
>>>>> __________�
>>>>>
>>>>> View the list's information and change your settings at
>>>>> http://www.freelists.org/list/jawsscripts
>>>>>
>>>>
>>>> __________�
>>>>
>>>> View the list's information and change your settings at
>>>> http://www.freelists.org/list/jawsscripts
>>>>
>>>>
>>>
>>>
>>> -- 
>>> Change the world--1 deed at a time
>>> Jackie McBride
>>> Scripting Classes: http://jawsscripting.lonsdalemedia.org
>>> homePage: www.abletec.serverheaven.net
>>> For technophobes: www.technophoeb.com
>>> __________�
>>>
>>> View the list's information and change your settings at
>>> http://www.freelists.org/list/jawsscripts
>>>
>>
>> __________�
>>
>> View the list's information and change your settings at
>> http://www.freelists.org/list/jawsscripts
>>
> __________�
>
> View the list's information and change your settings at
> http://www.freelists.org/list/jawsscripts
> 

__________�

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

Other related posts: