Prevent drag of text
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Prevent drag of text
What property of a text field is it that allows you to select a chunk of text and drag it to a new position. I want to stop it from happening but can't seem to find the property. All of a sudden I am experiencing this but I don't remember it from the past. I'm using Live Code 5.2.2
Larry
Larry
Re: Prevent drag of text
It's the default action of field objects. To disable it, add this to the script of the field:
Code: Select all
on dragStart
end dragStart
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: Prevent drag of text
Thanks mwieder,
That stopped the drag just fine. It turns out that the dragging was only a symptom of a bigger problem that I was having. I'll start by asking the question I should have asked in the first place. What can cause a field, which has a section of its text selected, to turn into a state where you can no longer click it to cancel out the selection and put an insertion point in a new place. In this state you can double click a word in a new place which selects it but you still can't single click and get anything to happen.
I have a large chunk of text in a field in my application and I select a contiguous portion of it and process it line by line for the information I want. Then I select another portion of it and process that. Occasionally after having processed a section, the field gets into a state where I cannot select a new part. Any clues as to what might be done to get the field back to normal?
Larry
That stopped the drag just fine. It turns out that the dragging was only a symptom of a bigger problem that I was having. I'll start by asking the question I should have asked in the first place. What can cause a field, which has a section of its text selected, to turn into a state where you can no longer click it to cancel out the selection and put an insertion point in a new place. In this state you can double click a word in a new place which selects it but you still can't single click and get anything to happen.
I have a large chunk of text in a field in my application and I select a contiguous portion of it and process it line by line for the information I want. Then I select another portion of it and process that. Occasionally after having processed a section, the field gets into a state where I cannot select a new part. Any clues as to what might be done to get the field back to normal?
Larry
Re: Prevent drag of text
Thanks mwieder,
That stopped the drag just fine. It turns out that the dragging was only a symptom of a bigger problem that I was having. I'll start by asking the question I should have asked in the first place. What can cause a field, which has a section of its text selected, to turn into a state where you can no longer click it to cancel out the selection and put an insertion point in a new place. In this state you can double click a word in a new place which selects it but you still can't single click and get anything to happen.
I have a large chunk of text in a field in my application and I select a contiguous portion of it and process it line by line for the information I want. Then I select another portion of it and process that. Occasionally after having processed a section, the field gets into a state where I cannot select a new part. Any clues as to what might be done to get the field back to normal?
Larry
That stopped the drag just fine. It turns out that the dragging was only a symptom of a bigger problem that I was having. I'll start by asking the question I should have asked in the first place. What can cause a field, which has a section of its text selected, to turn into a state where you can no longer click it to cancel out the selection and put an insertion point in a new place. In this state you can double click a word in a new place which selects it but you still can't single click and get anything to happen.
I have a large chunk of text in a field in my application and I select a contiguous portion of it and process it line by line for the information I want. Then I select another portion of it and process that. Occasionally after having processed a section, the field gets into a state where I cannot select a new part. Any clues as to what might be done to get the field back to normal?
Larry
Re: Prevent drag of text
Do you have any mouseX (moueDown, mouseUp) handlers in the field script that might be interfering? Sounds like the mouseUp events are being consumed and not passed on.
Make sure you're passing the event when you quit the handler, i.e.,
Make sure you're passing the event when you quit the handler, i.e.,
Code: Select all
on mouseUp
-- code here
pass mouseUp
end mouseUp
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: Prevent drag of text
My formatting for the data in the field is not done with a mouseUp but rather with a menu item that executes a script on the card. Would a 'pass mouseup' be effective there?
Larry
Larry
Re: Prevent drag of text
No, that won't work. You can only pass the same handler you're executing.
So (let's see if I've got this right)... you select a section of text, then select a menuItem to format it, and then you can't select in the field any more?
So (let's see if I've got this right)... you select a section of text, then select a menuItem to format it, and then you can't select in the field any more?
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: Prevent drag of text
mwieder,
Larry
Yes. But it had never happened before last week and with repeated tries in seems to be happening only with a particular section of text I format. Once it happens I have a hard time getting it to 'release' so I can work on the next section. That is where I discovered the 'dragging' problem.So (let's see if I've got this right)... you select a section of text, then select a menuItem to format it, and then you can't select in the field any more?
Larry