I am creating a interface that will allow drag and drop but
only within the application no outside data.
On the bottom I will have a large box that can hold available
tools. This storage area will constrain the drop
To allow sorting and such but the tool images are of different
sizes and therein is the question. Eg implementing
This concept.
How do I design this area. I was thinking just of a large nsview
subclass.
So it doesn't overlap objects, go out of bounds
and can place the object in a specific location.
On init
create a 2d array matrix that holds if
the block is empty or not.
Create object array.
Load objects populate matrix &
object array
Create a 2d array that contains all
the sizes of the tools.
On drag
Send
message object id
on drop
compare object size to matrix grid
at mousepoint
if full or out of bounds --snap back
else drop & update matrix update
this item
Now that I have kinda explained what I want. Am I even close. Is there
a better way.
Thanks