expand/reduce control

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
lbtony
Posts: 35
Joined: Tue Apr 11, 2006 9:01 am

expand/reduce control

Post by lbtony »

In development mode, when we click on an object a square with dots appear on its boarder then we can expand/reduce the size of it. How can I apply this to my controls in run mode? what are the key properties/hanlders/functions to acheive this?
Cheers.
malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte »

Hi ibTony,

I'm afraid, that is not too easy. I ended up mimicin the behaviour.

A simple script to get you started. In the card script:

Code: Select all

on mouseDown
  select the target
end mouseDown

on mouseUp
  select empty
end mouseUp

on mouseRelease
  mouseUp
end mouseRelease

on mouseMove
  if the target is not me then
    if the selected of the target then
      set the rect of the target to the topLeft of the target,the mouseLoc
    end if
  end if
end mouseMove
lbtony
Posts: 35
Joined: Tue Apr 11, 2006 9:01 am

Post by lbtony »

Hi Malte,
Thank you, I get your idea now. My question is, how can I tell, which dot on the boarder line the mouse pointer is on? Because I think each dot on the boarder has different bahaviours in terms of the direction to expanding/reducing a control, which in turn will result the use of different properties e.g. topLeft, bottomRight
Hope I made myself clear. Cheers.
malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte »

Hi ibtony,

as I said this is a tad complicated. I would need to rip off the code of an existing project. Actually I have mimiced the complete behaviour with the help of another coder (thanks again kWeed!) including the ability to drag and even the select handles were scripted. I am afraid I do not have the time to tear the stack apart at the moment. I'll update you as soon as I can.

All the best,

Malte
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Post by FourthWorld »

choose pointer tool
lbtony
Posts: 35
Joined: Tue Apr 11, 2006 9:01 am

Post by lbtony »

I need to be able to resize controls especially image objects in run mode. So I don't think choose pointer tool will work for me:)
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Post by FourthWorld »

lbtony wrote:I need to be able to resize controls especially image objects in run mode. So I don't think choose pointer tool will work for me:)
Transcript provides a variety of tools, all of which are available at runtime. See the Dictionary entry for the choose command for details.
Post Reply