List Field Not receiving Mouse messages unless a line is clicked?

Mike Bonner bonnmike at gmail.com
Tue Apr 26 11:50:04 EDT 2016


I think there is a phrasing issue when reading "You use the hilitedLine
property to determine which line the user clicked.”

Especially when using toggle and multiple hilites.. Perhaps changing it to:
"You use the hilitedLine property to determine which lines are currently
hilited.”

mouseup doesn't return the hilitedlines it just changes which lines are
currently hilited,
Don't get me started on the selectedline when used to with multiple
non-contiguous hilites. (it always returns the very first hilited line in
the field, if more than 1 line is selected contiguously in a group at the
beginning of the field, all lines in that bunch are returned..)

Since mouserelease only fires if empty area has been selected,you can use
it to decide what you want to do.  (For example, if multiple hilites are
possible, especially in a non-contiguous manner, ask the user of they want
to clear hliites.)

If your list has a finite number of lines, and guaranteed empty space,and
you want to force the behavior, you can of course do so, but if there is a
chance that the field will be full to the scrolling point with no empty
space,then there must be another way for the user to clear the selections
if needed. If you wish to clear selections by clicking outside the field in
an empty area, then the field not receiving mouseup is a moot issue and you
still must script the behavior you wish.

This will clear the hilites when clicking empty space.  It also checks
mouse location so that if the user clicks empty, then drags off the field
(thus changing their mind?) it will remove hilites, or not, depending on if
the mouse is still within the rect of the field.

on mouseup
   put the hilitedlines of me
end mouseup

on mouserelease
   if the mouseloc is within the rect of me then
      set the hilitedlines of me to empty
      select empty -- remove the dotted selection line
   end if
end mouserelease

>
>



More information about the use-livecode mailing list