HIG, right click issue

Richard Gaskin ambassador at fourthworld.com
Mon Aug 20 10:33:21 EDT 2012


Mark Wieder wrote:

> Pete-
>
> Sunday, August 19, 2012, 4:32:02 PM, you wrote:
>
>> Let's say I:
>
>> - click on line 4 of the scrolling list field
>> - command click on line 6 of the scrolling list field
>
>> Now lines 4 and 6 are hilited and the hilitedlines contain 4,6
>
>> Now I right-click on line 10.  Line 10 does not get hilited and the
>> hilitedlines still contains 4,6.  Is that what happens on your test?
>
> Yes, and that's what I'd expect, HIGwise. The right mouse click is on
> the field itself, not on a line in the field. You could force the
> issue in the mouseDown handler by highlighting the selected line, but
> I think that would cause more user angst than the current situation.

Maybe.  It seems that the target object is a matter of design objective, 
and varies from implementation to implementation.

For example, in OS X's Finder list view, right-clicking preserves the 
original selection while also providing a context menu for the specific 
item in the list being right-clicked on, rather than for the list as a 
whole.  It's kind of a weird implementation, actually, since they use a 
different hilite indication for things right-clicked as opposed to 
left-clicked, and I've seen some cases where the right-click doesn't 
indicate its selection at all, even though the item-specific menu 
appears as expected.

In one of the apps I manage we also had a similarly legitimate need to 
apply right-click to a specific item in a list, but in our case it made 
the most sense to take it all the way and actually select the item being 
clicked on.  For that we had to resort to the workaround to check the 
clickLine to set the hilitedLines appropriately, but be careful once you 
start down that road, as some actions which set the hilitedLines may not 
set that property properly from a right-click, which would then throw 
off arrowkey traversal of the list requiring you to write your own 
arrowKey handler as well.

It might be ideal if there were a property for list fields for this, 
something like the "rightClickSetsSelection" property.

In the meantime, just be sure to test your arrowKey navigation and be 
prepared to write another handler if needed, and with a little extra 
work you can get exactly what you're looking for.

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  Follow me on Twitter:  http://twitter.com/FourthWorldSys




More information about the use-livecode mailing list