Which draggable widgets and usable panels?

21 views
Skip to first unread message

Kodara

unread,
Sep 19, 2007, 6:17:42 AM9/19/07
to gwt-dnd
Hello,

I might have missed some documentation but I'm looking for answers to
the following questions:

1. For each widget out of this list: button, checkbox, composite,
frame, listbox, radiobutton, textbox and textarea; I need to know: Is
the widget draggable and if so, how? I tried making a button draggable
but it did not work.. Would it be possible?
2. Which panels can be used for dragging and dropping? All?

Greetings,
Jip

Fred Sauer

unread,
Sep 19, 2007, 12:51:38 PM9/19/07
to gwt...@googlegroups.com
Jip,

Technically any Widget that implements SourcesMouseEvents can be made directly draggable. However, form widgets like buttons and text fields pose problems in various browser due to the lack of events they allow GWT to hook into, or due to limited pixel areas by which you can grab such a widget. There are, however, a couple of workaround I can recommend:
  1. You can make these widgets draggable by 'drag handle'. You might have a little textured image to the left of each widget or a bounding box around the widget by which you can pickup the widget and drag it around
  2. You can introduce a 'design mode' during which the user cannot interact with the widgets (e.g. they cannot push a button, or enter text in a text field), but they can drag the widgets. You overlay a transparent FocusPanel on each widget and make the focus panel the drag handle for the widget. The user can't see the transparent DIV, but any mouse events get captured by the DIV.
For widgets that do no implement SourcesMouseEvents, you can either extend the widget class to sink and handle mouse events yourself, or you can build a Composite widget that includes a drag handle by which the entire composite can be dragged.

Almost any widget can be used as a drop target. It's just a matter of creating your own DropController for it.

Hope that helps
Fred

Kodara

unread,
Sep 21, 2007, 4:21:16 AM9/21/07
to gwt-dnd
Fred,

Thanks, your reply is very clear and helps me a lot :-)

The second workaround seemed good for my application's purposes and it
works perfectly! It's quite a simple solution (in terms of coding),
but you just have to know those kind of things.. Thanks for helping me
out! And your library really rocks, man :-)

Greetings,
Jip

On 19 sep, 18:51, "Fred Sauer" <f...@allen-sauer.com> wrote:
> Jip,
>
> Technically any Widget that implements SourcesMouseEvents can be made
> directly draggable. However, form widgets like buttons and text fields pose
> problems in various browser due to the lack of events they allow GWT to hook
> into, or due to limited pixel areas by which you can grab such a widget.
> There are, however, a couple of workaround I can recommend:
>

> 1. You can make these widgets draggable by 'drag handle'. You might


> have a little textured image to the left of each widget or a bounding box
> around the widget by which you can pickup the widget and drag it around

> 2. You can introduce a 'design mode' during which the user cannot


> interact with the widgets (e.g. they cannot push a button, or enter
> text in a text field), but they can drag the widgets. You overlay a
> transparent FocusPanel on each widget and make the focus panel the drag
> handle for the widget. The user can't see the transparent DIV, but any mouse
> events get captured by the DIV.
>
> For widgets that do no implement SourcesMouseEvents, you can either extend
> the widget class to sink and handle mouse events yourself, or you can build
> a Composite widget that includes a drag handle by which the entire composite
> can be dragged.
>
> Almost any widget can be used as a drop target. It's just a matter of
> creating your own DropController for it.
>
> Hope that helps
> Fred
>

> On 9/19/07, Kodara <jipschwer...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > I might have missed some documentation but I'm looking for answers to
> > the following questions:
>
> > 1. For each widget out of this list: button, checkbox, composite,
> > frame, listbox, radiobutton, textbox and textarea; I need to know: Is
> > the widget draggable and if so, how? I tried making a button draggable
> > but it did not work.. Would it be possible?
> > 2. Which panels can be used for dragging and dropping? All?
>
> > Greetings,
> > Jip
>

> --
> Fred Sauer
> f...@allen-sauer.com- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

Reply all
Reply to author
Forward
0 new messages