PDA

View Full Version : Stringfields with multilinespacing



Sorcerer
August 31st, 2011, 16:18
I've been wondering for quite a while if this is a "design feature" or a bug, but it seems that Stringfields with multiline spacing are not dragable.

Is this the way it's supposed to be?

If so, is there another way to emulate multiline spacing without using the tag - and thus [hopefully!] leave the drag and drop enabled.

Ikael
August 31st, 2011, 16:40
I believe this is feature. Think that if you have lots of text in your multilined stringfield and want to select one whole paragraphs inside it, you could not do it if it would start dragging the text, instead of selecting it. So I think by default multilined stringfields' and controls are meant to be non-draggable. However you can always implement dragging to any control yourself, for example:



<script>
function onDragStart(button, x, y, draginfo)
draginfo.setType("string")
draginfo.setStringData(getValue())
return true
end
</script>

I would recommand that if you need text selecting feature, you probably should apply in your custom onDragStart function some way how to declare if user is trying to drag the text, or if he's trying to select text. Say if you press ALT down, then it would drag the text, otherwise it would select the text.

Sorcerer
August 31st, 2011, 17:17
thanks for that Ikael. I suppose I should have thought of that myself..

I guess I can set up some sort of template to cover this when the need arises. in the future.

The other part of the problem is that stringfields with multiline spacing don't accept drops either.

Where required I have infact added what could be considered the mirror image of the code you have above.


function onDrop(x,y ,draginfo)
if draginfo.isType("string") then
setValue(draginfo.getStringData());
return true;
end
end