Hi Adam
I did something and it works partly. The text will not be selected as
before but when I press the mouse and go out of the widget the full
text will be selected again.
Any idea?
Regards,
Ewald
package g26v01.client;
import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.dom.client.MouseMoveEvent;
import com.google.gwt.event.dom.client.MouseMoveHandler;
import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
import com.google.gwt.user.client.ui.HTML;
public class MyHTML extends HTML {
public MyHTML() {
super();
// TODO Auto-generated constructor stub
}
public MyHTML(Element element) {
super(element);
// TODO Auto-generated constructor stub
}
public MyHTML(String html, boolean wordWrap) {
super(html, wordWrap);
// TODO Auto-generated constructor stub
}
public MyHTML(String html) {
super(html);
// TODO Auto-generated constructor stub
MyMouseDownHandler ha = new MyMouseDownHandler();
this.addMouseDownHandler(ha);
MyMouseMoveHandler ha2 = new MyMouseMoveHandler();
this.addMouseMoveHandler(ha2);
MyMouseOutHandler ha3 = new MyMouseOutHandler();
this.addMouseOutHandler(ha3);
}
class MyMouseOutHandler implements MouseOutHandler {
@Override
public void onMouseOut(MouseOutEvent event) {
// TODO Auto-generated method stub
event.preventDefault();
}
}
class MyMouseDownHandler implements MouseDownHandler {
@Override
public void onMouseDown(MouseDownEvent event) {
// TODO Auto-generated method stub
event.preventDefault();
}
}
class MyMouseMoveHandler implements MouseMoveHandler {
@Override
public void onMouseMove(MouseMoveEvent event) {
// TODO Auto-generated method stub
event.preventDefault();
}
}
}
On 23 Jul., 07:56, Adam T <[email protected]> wrote:
> Hi Ewald,
>
> Sounds like you want to prevent the default event handling of the
> browser. You'll need to add some event handlers to your HTML widget
> and the call the preventDefault() method in them. For example:
>
> HTML widget = new HTML();
> widget.addMouseDownHandler(new MouseDownHandler(){
> public void onMouseDown(MouseDownEvent event) {
> event.preventDefault();
> }
> });
>
> (you might get away with just handling the mouse down event, you might
> have to also handle mouse move - I can't remember without building a
> full example myself, but you get the point, hopefully).
>
> Regards,
>
> Adam
>
> On 22 Juli, 22:37, Ewald Pankratz <[email protected]> wrote:
>
>
>
> > Hi
> > When I create a widget e.g. a HTML widget and go with the mouse over
> > the widget and press the left mouse button and move the mouse
> > somewhere else the widget or part of the widget will be selected. How
> > can I get rid of this selection. I don't want any selection instead I
> > want to draw a line from the widget to my current mouse pointer. Any
> > ideas how to do that? I am a newbie.
> > Thanks!!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---