Selecting (and hiliting) across two fields
Posted: Wed Jul 22, 2015 4:01 am
I am trying to work out whether it is possible to begin a text selection in one field and continue it to a second field both programatically as well as visually.
The text fields are both locked and non scrollable (contents will always fit fully within) and thus allow text selection and hiliting.
They are side by side on a card and I want to begin a text selection operation by clicking in one field and then dragging to the other field before releasing the mouse.
I have attached a digram below to illustrate what I want to see and accomplish. The image shows the two fields and a dividing line which I thought I could use as a trigger point (it would be not visible in the final form).
I begin the text selection at point "A" and drag towards point "B" crossing the divider at point "X".
In the left hand image I have dragged to a point just before the diving line and the blue area shows the expected hilite of the text in field 1.
After crossing the dividing line the hilted text in field 1 changes in recognition that rather than continue to a place higher in the field, I am actually continuing to the next field and am thus selecting the text on the bottom of the first field.
The second image shows the desired hilited text (and thus the selected text) after I finish the drag at point "B" and release the mouse.
Those on a Mac can see this behaviour in iBooks when viewing two pages and making a similar selection.
To do this in LC requires faking the text selection in one of the fields once the selection is made as only a single field can display hilited text at any one time. (bummer)
I have spent a good few hours in trying to get my head around what I need to do and keep ending up at the impasse of detecting when the mouse is dragged across the diving line (point "X") to make the behind the scenes transition to fake the correct hilite in field 1 and begin the fake hilite in field 2.
Unless there is another approach it seems I need to be able to detect during the mousedown/drag moving over an object (the divider line) and running another handler to do the work while the drag is still in progress.
Can this be done?
Can another handler run during the drag of the mouse?
If not, can I force the end of the mousedown (at point "X" say) and begin a new one (simulating the text selection starting at the top of field 2) to complete the task?
So, any ideas on how I can proceed?
Is this something that may have to wait until LC8 (I noticed some discussion on really breaking up the mouse messaging which may offer some intercession)?
BTW I could just grab a click in field 1 and respond to a subsequent shift-click in field 2 to select the text between the two clicks.
The problem with doing this is that there is no visual feedback during the selection process (indeed, given the fields are locked there isn't even an indication of the first click.)
James
The text fields are both locked and non scrollable (contents will always fit fully within) and thus allow text selection and hiliting.
They are side by side on a card and I want to begin a text selection operation by clicking in one field and then dragging to the other field before releasing the mouse.
I have attached a digram below to illustrate what I want to see and accomplish. The image shows the two fields and a dividing line which I thought I could use as a trigger point (it would be not visible in the final form).
I begin the text selection at point "A" and drag towards point "B" crossing the divider at point "X".
In the left hand image I have dragged to a point just before the diving line and the blue area shows the expected hilite of the text in field 1.
After crossing the dividing line the hilted text in field 1 changes in recognition that rather than continue to a place higher in the field, I am actually continuing to the next field and am thus selecting the text on the bottom of the first field.
The second image shows the desired hilited text (and thus the selected text) after I finish the drag at point "B" and release the mouse.
Those on a Mac can see this behaviour in iBooks when viewing two pages and making a similar selection.
To do this in LC requires faking the text selection in one of the fields once the selection is made as only a single field can display hilited text at any one time. (bummer)
I have spent a good few hours in trying to get my head around what I need to do and keep ending up at the impasse of detecting when the mouse is dragged across the diving line (point "X") to make the behind the scenes transition to fake the correct hilite in field 1 and begin the fake hilite in field 2.
Unless there is another approach it seems I need to be able to detect during the mousedown/drag moving over an object (the divider line) and running another handler to do the work while the drag is still in progress.
Can this be done?
Can another handler run during the drag of the mouse?
If not, can I force the end of the mousedown (at point "X" say) and begin a new one (simulating the text selection starting at the top of field 2) to complete the task?
So, any ideas on how I can proceed?
Is this something that may have to wait until LC8 (I noticed some discussion on really breaking up the mouse messaging which may offer some intercession)?
BTW I could just grab a click in field 1 and respond to a subsequent shift-click in field 2 to select the text between the two clicks.
The problem with doing this is that there is no visual feedback during the selection process (indeed, given the fields are locked there isn't even an indication of the first click.)
James