Login Register

absolute position

set a widget in the right position ( sharing code )

Probably this is not the right place but I worked hard on this and I think this could help someone else.

I read many posts and none of them set a widget in the right position ( coord ) so I figured out this could be a way. I set a new widget where I click.

I create my widget with 2 attributes more ( left and top ) that will be parameters when I call the new statement. My template uses those two parameters to set the left and top attributes and I set them in the postCreate function.

Here is the code:

Template:

[patch] DnD extension: 2D (i.e. non-linear) Container using absolute positioning

I extended the DnD module to support inserting items at the position where they are dropped. It is done by absolute positioning within the Container.
I created a simple demo at http://mikula.ic.cz/dnddemo/
Basically, when Manager publishes the "/dnd/drop" topic, it passes an additional argument -- mouse event that caused the drop.
Container constructor accepts an additional Boolean parameter absolutePositioning -- when true, the items are positioned absolutely within the container at the position calculated from the passed mouse event.
I provide the diff below.

Syndicate content