Minor Enhancement Request

2 views
Skip to first unread message

adamhamel

unread,
Sep 3, 2008, 5:47:18 PM9/3/08
to gwt-dnd
I need the ability to setBehaviorConstrainedToBoundaryPanel, but
allow for a fudge factor. For example I would like to restrict the
widget to the bounding panel, but I would like to specify in pixels
the what I call Fudge factor. So the widget is constrained to the
bounding box, however it is allowed to extend past the bounding box,
by the number of pixels specified by the fudge factory. That way the
user can't drag it completely off the stage, but the widget could be
clipped and allowed to extend the bounding area by a small margin.

I'm sure this wouldn't be much to add to the calculation section of
the mousemove, and if you can send me a SVN changeset I can test it
out as well. I have your Source pulled and building. I just figured it
would be faster for the creator to make this change since you are more
intimate with the code.

If this sounds reasonable let me know and I'll add it to the bug/
enhancement list

Thanks
Adam

Fred Sauer

unread,
Sep 3, 2008, 9:25:31 PM9/3/08
to gwt...@googlegroups.com
Calculation wise its probably not a lot, but allowing a widget to slightly stick outside of a container panel would be quite tricky to do generally.

What about just wrapping the boundary panel around a drop target that is slightly smaller: smaller by the number of pixels of your fudge factor?

adamhamel

unread,
Sep 4, 2008, 8:29:26 PM9/4/08
to gwt-dnd
Fred thanks for the reply. I don't think I explained what I am after
correctly. I'll try again

------------------------------
| A |
| ------------------- |
| | B | |
| | | |
| |-----------------| |
| |
|----------------------------|

-----------
| C |
| |
|----------|

B is what I want to be the drop target. Think of it as looking in a
window.

Assume C is a box you can drop onto B.

I want to be able to move C around within B. However Instead of B
being the bounding constraint. I want to use A as the constraint.

So if C was dragged around within B it would appear to be Clipped if
it extended beyond B's Bounds, however A would provide a reasonable
constraint so you would never clip your entire C object entirely.

All it really does is provide you some extra room to move C around
within B. If C is moves slightly outside of B's bounds then it appears
clipped.

That is what I mean by fudge factor. just a little buffer.

If A was the drop target then the C would not appear Clipped. I want B
to be a Window

Hope this help clear up what I am asking for. Maybe there is a way to
achieve this already.

Adam

On Sep 3, 9:25 pm, "Fred Sauer" <f...@allen-sauer.com> wrote:
> Calculation wise its probably not a lot, but allowing a widget to slightly
> stick outside of a container panel would be quite tricky to do generally.
> What about just wrapping the boundary panel around a drop target that is
> slightly smaller: smaller by the number of pixels of your fudge factor?
>
> Fred Sauer
> f...@allen-sauer.com

adamhamel

unread,
Sep 4, 2008, 8:34:41 PM9/4/08
to gwt-dnd
Lol. The boxes didn't post quite right. Anyway you can picture Nested
boxes at the top and just a box for C.

Fred Sauer

unread,
Sep 4, 2008, 9:05:06 PM9/4/08
to gwt...@googlegroups.com
Boxes came out fine in Gmail :)

I think you can achieve what you're looking for by:
  • Making A an absolute panel that is a drop target
  • Wrapping A in a scroll panel, B
  • Sizing B slightly smaller than A to achieve the fuzz factor
The result should be that you can drop anywhere on A (inside the house), while only seeing the the exposed part (through the window).

Reply all
Reply to author
Forward
0 new messages