[SOLVED] Using scale factor, I cannot drag and drop items

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
karmacomposer
Posts: 256
Joined: Wed Apr 27, 2011 2:12 pm

[SOLVED] Using scale factor, I cannot drag and drop items

Post by karmacomposer » Tue Jul 10, 2018 9:30 pm

I put a scale factor of .5 and now I can bring all the items I need in, but when I try to drag and drop any button (like for submit or clear), they do not drag and drop - they just disappear.

Is there a listing of all controls in a stack? Where is it?

Has anyone encountered this? How do I make it work? If I put the scale factor back to 1, it is enormous and goes off the screen so I cannot move the card around.

Thanks.

Mike
Last edited by karmacomposer on Wed Jul 11, 2018 4:52 pm, edited 1 time in total.

karmacomposer
Posts: 256
Joined: Wed Apr 27, 2011 2:12 pm

Re: Using scale factor, I cannot drag and drop items

Post by karmacomposer » Tue Jul 10, 2018 9:32 pm

I was able to scale to 1, drag and drop said buttons and then scale back down to .5 to move it - but that's a tedious way to design the form? I have tons of stuff to add.

*** Correction - I cannot drag and drop a rectangle or other stuff now. Even scaled up now anything I try to drag and drop (controls) don't stick.

Yeah. I need some kind of a history or listing so I know what controls are actually in the card - I may have twenty buttons and ten rectangles.

Any way to drag and drop while scaled down?

Thanks.

Mike

Klaus
Posts: 10427
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Using scale factor, I cannot drag and drop items

Post by Klaus » Tue Jul 10, 2018 9:54 pm

Hi Mike,

yep, drag'n'drop does not work in scaled stacks but a doubleclick on the tool in the tool palette does in fact work!

Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5582
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Using scale factor, I cannot drag and drop items

Post by dunbarx » Tue Jul 10, 2018 9:59 pm

Hi.

If you have a stack with scale factor set to "1", and drag a button from the tool palette, it will drop where you leave it.

But if you do that with a smaller (or larger) scaleFactor, it will not. LC does not seem to take this property into account when dragging controls from outside, at least in terms of the visual location of the dragged object. I bet if you played around a bit, you would be able to figure out what the engine is up to.

Craig Newman

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5582
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Using scale factor, I cannot drag and drop items

Post by dunbarx » Tue Jul 10, 2018 10:00 pm

@ Mike.

It does work, it just does not track the visual location of the drop point. The control is on the card; the question is where.

Craig

Klaus
Posts: 10427
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Using scale factor, I cannot drag and drop items

Post by Klaus » Tue Jul 10, 2018 10:06 pm

And/or add this script to your stack or card, so you can drag the window around freely while working on it:

Code: Select all

local maydrag

on mouseDown
  put mouseH() & "," & mouseV() into maydrag
end mouseDown

on mouseMove
  if maydrag is not empty then
    set the topLeft of this stack to item 1 of the screenMouseLoc - item 1 of maydrag,item 2 of the screenMouseLoc - item 2 of maydrag
  end if
end mouseMove

on mouseUp
  put empty into maydrag
end mouseUp

on mouserelease
  mouseup
end mouserelease
Comment it out when you are done with editing.

karmacomposer
Posts: 256
Joined: Wed Apr 27, 2011 2:12 pm

Re: Using scale factor, I cannot drag and drop items

Post by karmacomposer » Tue Jul 10, 2018 10:29 pm

Nice one Klaus.

That really helps and i'll try the double click method.

In the meantime, copying and pasting is working a treat.

Mike

quailcreek
Posts: 729
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: [SOLVED] Using scale factor, I cannot drag and drop items

Post by quailcreek » Thu Jul 12, 2018 9:47 pm

Interesting... I just posted a bug report on this. If the scale factor is higher than 1.8 the object is not added to the stack.

https://quality.livecode.com/show_bug.cgi?id=21416
Tom
MacBook Pro OS Mojave 10.14

Post Reply

Return to “Talking LiveCode”