Re: DropDown Button

2012-05-07 Thread Magallo
Ok, sorry. I figured it out. One last question. style.settingsPopup 
contains some particular values? Could you possibly paste it also? Thank 
you.

On Monday, May 7, 2012 10:15:09 AM UTC+2, Magallo wrote:
>
> I'm trying to use your code. What is 
>
>   Element eventTarget = event.getNativeEvent().getEventTarget().cast(); 
> ???
>
> On Monday, March 14, 2011 9:30:29 PM UTC+1, Gal Dolber wrote:
>>
>> that looks pretty ugly in the email, here is the pastebin 
>> http://pastebin.com/rqgZk9D0
>>
>> On Mon, Mar 14, 2011 at 5:28 PM, Gal Dolber  wrote:
>>
>>> This is what I am using, you can put anything inside the PopupButton and 
>>> it will be the popup content.
>>>
>>>
>>> /**
>>>
>>>  * How to use:
>>>
>>>  *  
>>>
>>>  
>>>
>>>  Settings
>>>
>>>  Logout
>>>
>>>  
>>>
>>> 
>>>
>>>  */
>>>
>>> public class PopupButton extends Composite implements HasWidgets {
>>>
>>>
>>>  private final Button button = new Button();
>>>
>>>
>>>  private Element target;
>>>
>>>
>>>  private boolean targetVisible = false;
>>>
>>>  protected HandlerRegistration registration;
>>>
>>>
>>>  private final NativePreviewHandler handler = newNativePreviewHandler() {
>>>
>>>  @Override
>>>
>>>  public void onPreviewNativeEvent(NativePreviewEvent event) {
>>>
>>>  if (event.getTypeInt() == Event.ONMOUSEDOWN) {
>>>
>>>   Element eventTarget = event.getNativeEvent().getEventTarget()
>>>
>>>.cast();
>>>
>>>   if (!target.isOrHasChild(eventTarget)) {
>>>
>>>   hide();
>>>
>>>   }
>>>
>>>  }
>>>
>>>  }
>>>
>>> };
>>>
>>>  public void setText(String text) {
>>>
>>>  button.setText(text);
>>>
>>> }
>>>
>>>
>>>  public PopupButton() {
>>>
>>>  initWidget(button);
>>>
>>>  button.addClickHandler(new ClickHandler() {
>>>
>>>  @Override
>>>
>>>  public void onClick(ClickEvent event) {
>>>
>>>   if (targetVisible) {
>>>
>>>   targetVisible = !targetVisible;
>>>
>>>   target.getStyle().clearDisplay();
>>>
>>>   registration = Event.addNativePreviewHandler(handler);
>>>
>>>   } else {
>>>
>>>   hide();
>>>
>>>   }
>>>
>>>  }
>>>
>>>  });
>>>
>>> }
>>>
>>>
>>>  private void hide() {
>>>
>>>  targetVisible = !targetVisible;
>>>
>>>  target.getStyle().setDisplay(Display.NONE);
>>>
>>>  if (registration != null) {
>>>
>>>  registration.removeHandler();
>>>
>>>  }
>>>
>>> }
>>>
>>>
>>>  @Override
>>>
>>> public void add(Widget w) {
>>>
>>>  if (target != null) {
>>>
>>>  throw new RuntimeException("You can only add one widget");
>>>
>>>  }
>>>
>>>  RootPanel.get().add(w);
>>>
>>>  target = w.getElement();
>>>
>>>  hide();
>>>
>>> }
>>>
>>>
>>>  @Override
>>>
>>> public void clear() {
>>>
>>>  throw new RuntimeException();
>>>
>>> }
>>>
>>>
>>>  @Override
>>>
>>> public Iterator iterator() {
>>>
>>>  throw new RuntimeException();
>>>
>>> }
>>>
>>>
>>>  @Override
>>>
>>> public boolean remove(Widget w) {
>>>
>>>  throw new RuntimeException();
>>>
>>> }
>>>
>>>  @Override
>>>
>>> protected void onLoad() {
>>>
>>>  Scheduler.get().scheduleDeferred(new ScheduledCommand() {
>>>
>>>  @Override
>>>
>>>  public void execute() {
>>>
>>>   target.getStyle().setTop(button.getOffsetHeight() + 
>>> button.getAbsoluteTop(), 
>>> Unit.PX);
>>>
>>>   target.getStyle().setLeft(button.getAbsoluteLeft(), Unit.PX);
>>>
>>>   target.getStyle().setZIndex(1);
>>>
>>>   target.getStyle().setPosition(Position.ABSOLUTE);
>>>
>>>  }
>>>
>>>  });
>>>
>>> }
>>>
>>> }
>>>
>>> On Mon, Mar 14, 2011 at 5:15 PM, Marco Gadaleta <
>>> gadaleta.ma...@gmail.com> wrote:
>>>
 ?


 On Mon, Mar 14, 2011 at 9:12 PM, Juan Pablo Gardella <
 gardellajuanpa...@gmail.com> wrote:

> +1
>
> 2011/3/14 Marco Gadaleta 
>
>> Nothing???
>>
>> On Wed, Mar 9, 2011 at 1:53 PM, gadaleta.marco <
>> gadaleta.ma...@gmail.com> wrote:
>>
>>> hello everyone,
>>> there a way to create a button in gwt like "gmail more actions" 
>>> button
>>> without using external library?
>>> Thx, hope you can help me.
>>>
>>
>>
>>
>> -- 
>> Marco
>>
>> -- 
>> You received this message because you are subscribed to the Google 
>> Groups "Google Web Toolkit" group.
>> To post to this group, send email to 
>> google-web-toolkit@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> google-web-toolkit+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>
>
>  -- 
> You received this message because you are subscribed to the Google 
> Groups "Google Web Toolkit" group.
> To post to this group, send email to 
> google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-web-toolkit?hl=en.
>



 -- 
 Marco

 -- 
 You received this message because you are subscrib

Re: DropDown Button

2012-05-07 Thread Magallo
I'm trying to use your code. What is 

  Element eventTarget = event.getNativeEvent().getEventTarget().cast(); ???

On Monday, March 14, 2011 9:30:29 PM UTC+1, Gal Dolber wrote:
>
> that looks pretty ugly in the email, here is the pastebin 
> http://pastebin.com/rqgZk9D0
>
> On Mon, Mar 14, 2011 at 5:28 PM, Gal Dolber  wrote:
>
>> This is what I am using, you can put anything inside the PopupButton and 
>> it will be the popup content.
>>
>>
>> /**
>>
>>  * How to use:
>>
>>  *  
>>
>>  
>>
>>  Settings
>>
>>  Logout
>>
>>  
>>
>> 
>>
>>  */
>>
>> public class PopupButton extends Composite implements HasWidgets {
>>
>>
>>  private final Button button = new Button();
>>
>>
>>  private Element target;
>>
>>
>>  private boolean targetVisible = false;
>>
>>  protected HandlerRegistration registration;
>>
>>
>>  private final NativePreviewHandler handler = new NativePreviewHandler() 
>> {
>>
>>  @Override
>>
>>  public void onPreviewNativeEvent(NativePreviewEvent event) {
>>
>>  if (event.getTypeInt() == Event.ONMOUSEDOWN) {
>>
>>   Element eventTarget = event.getNativeEvent().getEventTarget()
>>
>>.cast();
>>
>>   if (!target.isOrHasChild(eventTarget)) {
>>
>>   hide();
>>
>>   }
>>
>>  }
>>
>>  }
>>
>> };
>>
>>  public void setText(String text) {
>>
>>  button.setText(text);
>>
>> }
>>
>>
>>  public PopupButton() {
>>
>>  initWidget(button);
>>
>>  button.addClickHandler(new ClickHandler() {
>>
>>  @Override
>>
>>  public void onClick(ClickEvent event) {
>>
>>   if (targetVisible) {
>>
>>   targetVisible = !targetVisible;
>>
>>   target.getStyle().clearDisplay();
>>
>>   registration = Event.addNativePreviewHandler(handler);
>>
>>   } else {
>>
>>   hide();
>>
>>   }
>>
>>  }
>>
>>  });
>>
>> }
>>
>>
>>  private void hide() {
>>
>>  targetVisible = !targetVisible;
>>
>>  target.getStyle().setDisplay(Display.NONE);
>>
>>  if (registration != null) {
>>
>>  registration.removeHandler();
>>
>>  }
>>
>> }
>>
>>
>>  @Override
>>
>> public void add(Widget w) {
>>
>>  if (target != null) {
>>
>>  throw new RuntimeException("You can only add one widget");
>>
>>  }
>>
>>  RootPanel.get().add(w);
>>
>>  target = w.getElement();
>>
>>  hide();
>>
>> }
>>
>>
>>  @Override
>>
>> public void clear() {
>>
>>  throw new RuntimeException();
>>
>> }
>>
>>
>>  @Override
>>
>> public Iterator iterator() {
>>
>>  throw new RuntimeException();
>>
>> }
>>
>>
>>  @Override
>>
>> public boolean remove(Widget w) {
>>
>>  throw new RuntimeException();
>>
>> }
>>
>>  @Override
>>
>> protected void onLoad() {
>>
>>  Scheduler.get().scheduleDeferred(new ScheduledCommand() {
>>
>>  @Override
>>
>>  public void execute() {
>>
>>   target.getStyle().setTop(button.getOffsetHeight() + 
>> button.getAbsoluteTop(), 
>> Unit.PX);
>>
>>   target.getStyle().setLeft(button.getAbsoluteLeft(), Unit.PX);
>>
>>   target.getStyle().setZIndex(1);
>>
>>   target.getStyle().setPosition(Position.ABSOLUTE);
>>
>>  }
>>
>>  });
>>
>> }
>>
>> }
>>
>> On Mon, Mar 14, 2011 at 5:15 PM, Marco Gadaleta > > wrote:
>>
>>> ?
>>>
>>>
>>> On Mon, Mar 14, 2011 at 9:12 PM, Juan Pablo Gardella <
>>> gardellajuanpa...@gmail.com> wrote:
>>>
 +1

 2011/3/14 Marco Gadaleta 

> Nothing???
>
> On Wed, Mar 9, 2011 at 1:53 PM, gadaleta.marco <
> gadaleta.ma...@gmail.com> wrote:
>
>> hello everyone,
>> there a way to create a button in gwt like "gmail more actions" button
>> without using external library?
>> Thx, hope you can help me.
>>
>
>
>
> -- 
> Marco
>
> -- 
> You received this message because you are subscribed to the Google 
> Groups "Google Web Toolkit" group.
> To post to this group, send email to 
> google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-web-toolkit?hl=en.
>

  -- 
 You received this message because you are subscribed to the Google 
 Groups "Google Web Toolkit" group.
 To post to this group, send email to 
 google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-web-toolkit?hl=en.

>>>
>>>
>>>
>>> -- 
>>> Marco
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Google Web Toolkit" group.
>>> To post to this group, send email to google-web-toolkit@googlegroups.com
>>> .
>>> To unsubscribe from this group, send email to 
>>> google-web-toolkit+unsubscr...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>>
>>
>>
>>
>> -- 
>> Guit: Elegant, beautiful, modular and *production ready* gwt applications.
>>
>> http://code.google.com/p/guit/
>>
>>
>>
>>
>>
>

Re: DropDown Button

2011-03-15 Thread Jim Douglas
http://google-web-toolkit.googlecode.com/svn/javadoc/2.2/com/google/gwt/user/client/ui/PushButton.html#PushButton(com.google.gwt.user.client.ui.Image)

http://google-web-toolkit.googlecode.com/svn/javadoc/2.2/com/google/gwt/user/client/ui/Button.html#Button(com.google.gwt.safehtml.shared.SafeHtml)

On Mar 15, 2:09 am, Marco Gadaleta  wrote:
> Hi Jim,
> I've yet done as you have say to me.
> But can you tell me the instruction to insert an arrow on th "face"?
>
> Thx you,
> Marco
>
>
>
>
>
> On Mon, Mar 14, 2011 at 9:34 PM, Jim Douglas  wrote:
> > Make a button with text and a dropdown arrow on the face, react to the
> > button click by showing an autohide popup panel containing a menubar
> > at the appropriate location.
>
> > Implementation details left an an exercise for the student.
>
> > On Mar 14, 1:12 pm, Juan Pablo Gardella 
> > wrote:
> > > +1
>
> > > 2011/3/14 Marco Gadaleta 
>
> > > > Nothing???
>
> > > > On Wed, Mar 9, 2011 at 1:53 PM, gadaleta.marco <
> > gadaleta.ma...@gmail.com>wrote:
>
> > > >> hello everyone,
> > > >> there a way to create a button in gwt like "gmail more actions" button
> > > >> without using external library?
> > > >> Thx, hope you can help me.
>
> > > > --
> > > > Marco
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Google Web Toolkit" group.
> > > > To post to this group, send email to
> > google-web-toolkit@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > google-web-toolkit+unsubscr...@googlegroups.com.
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-web-toolkit@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-web-toolkit+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> --
> Marco

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: DropDown Button

2011-03-15 Thread Marco Gadaleta
Hi Jim,
I've yet done as you have say to me.
But can you tell me the instruction to insert an arrow on th "face"?

Thx you,
Marco

On Mon, Mar 14, 2011 at 9:34 PM, Jim Douglas  wrote:

> Make a button with text and a dropdown arrow on the face, react to the
> button click by showing an autohide popup panel containing a menubar
> at the appropriate location.
>
> Implementation details left an an exercise for the student.
>
> On Mar 14, 1:12 pm, Juan Pablo Gardella 
> wrote:
> > +1
> >
> > 2011/3/14 Marco Gadaleta 
> >
> >
> >
> > > Nothing???
> >
> > > On Wed, Mar 9, 2011 at 1:53 PM, gadaleta.marco <
> gadaleta.ma...@gmail.com>wrote:
> >
> > >> hello everyone,
> > >> there a way to create a button in gwt like "gmail more actions" button
> > >> without using external library?
> > >> Thx, hope you can help me.
> >
> > > --
> > > Marco
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Google Web Toolkit" group.
> > > To post to this group, send email to
> google-web-toolkit@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-web-toolkit+unsubscr...@googlegroups.com.
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>


-- 
Marco

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: DropDown Button

2011-03-14 Thread Jim Douglas
Make a button with text and a dropdown arrow on the face, react to the
button click by showing an autohide popup panel containing a menubar
at the appropriate location.

Implementation details left an an exercise for the student.

On Mar 14, 1:12 pm, Juan Pablo Gardella 
wrote:
> +1
>
> 2011/3/14 Marco Gadaleta 
>
>
>
> > Nothing???
>
> > On Wed, Mar 9, 2011 at 1:53 PM, gadaleta.marco 
> > wrote:
>
> >> hello everyone,
> >> there a way to create a button in gwt like "gmail more actions" button
> >> without using external library?
> >> Thx, hope you can help me.
>
> > --
> > Marco
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-web-toolkit@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-web-toolkit+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: DropDown Button

2011-03-14 Thread Gal Dolber
that looks pretty ugly in the email, here is the pastebin
http://pastebin.com/rqgZk9D0

On Mon, Mar 14, 2011 at 5:28 PM, Gal Dolber  wrote:

> This is what I am using, you can put anything inside the PopupButton and it
> will be the popup content.
>
>
> /**
>
>  * How to use:
>
>  *  
>
>  
>
>  Settings
>
>  Logout
>
>  
>
> 
>
>  */
>
> public class PopupButton extends Composite implements HasWidgets {
>
>
>  private final Button button = new Button();
>
>
>  private Element target;
>
>
>  private boolean targetVisible = false;
>
>  protected HandlerRegistration registration;
>
>
>  private final NativePreviewHandler handler = new NativePreviewHandler() {
>
>  @Override
>
>  public void onPreviewNativeEvent(NativePreviewEvent event) {
>
>  if (event.getTypeInt() == Event.ONMOUSEDOWN) {
>
>   Element eventTarget = event.getNativeEvent().getEventTarget()
>
>.cast();
>
>   if (!target.isOrHasChild(eventTarget)) {
>
>   hide();
>
>   }
>
>  }
>
>  }
>
> };
>
>  public void setText(String text) {
>
>  button.setText(text);
>
> }
>
>
>  public PopupButton() {
>
>  initWidget(button);
>
>  button.addClickHandler(new ClickHandler() {
>
>  @Override
>
>  public void onClick(ClickEvent event) {
>
>   if (targetVisible) {
>
>   targetVisible = !targetVisible;
>
>   target.getStyle().clearDisplay();
>
>   registration = Event.addNativePreviewHandler(handler);
>
>   } else {
>
>   hide();
>
>   }
>
>  }
>
>  });
>
> }
>
>
>  private void hide() {
>
>  targetVisible = !targetVisible;
>
>  target.getStyle().setDisplay(Display.NONE);
>
>  if (registration != null) {
>
>  registration.removeHandler();
>
>  }
>
> }
>
>
>  @Override
>
> public void add(Widget w) {
>
>  if (target != null) {
>
>  throw new RuntimeException("You can only add one widget");
>
>  }
>
>  RootPanel.get().add(w);
>
>  target = w.getElement();
>
>  hide();
>
> }
>
>
>  @Override
>
> public void clear() {
>
>  throw new RuntimeException();
>
> }
>
>
>  @Override
>
> public Iterator iterator() {
>
>  throw new RuntimeException();
>
> }
>
>
>  @Override
>
> public boolean remove(Widget w) {
>
>  throw new RuntimeException();
>
> }
>
>  @Override
>
> protected void onLoad() {
>
>  Scheduler.get().scheduleDeferred(new ScheduledCommand() {
>
>  @Override
>
>  public void execute() {
>
>   target.getStyle().setTop(button.getOffsetHeight() + button.getAbsoluteTop(),
> Unit.PX);
>
>   target.getStyle().setLeft(button.getAbsoluteLeft(), Unit.PX);
>
>   target.getStyle().setZIndex(1);
>
>   target.getStyle().setPosition(Position.ABSOLUTE);
>
>  }
>
>  });
>
> }
>
> }
>
> On Mon, Mar 14, 2011 at 5:15 PM, Marco Gadaleta 
> wrote:
>
>> ?
>>
>>
>> On Mon, Mar 14, 2011 at 9:12 PM, Juan Pablo Gardella <
>> gardellajuanpa...@gmail.com> wrote:
>>
>>> +1
>>>
>>> 2011/3/14 Marco Gadaleta 
>>>
 Nothing???

 On Wed, Mar 9, 2011 at 1:53 PM, gadaleta.marco <
 gadaleta.ma...@gmail.com> wrote:

> hello everyone,
> there a way to create a button in gwt like "gmail more actions" button
> without using external library?
> Thx, hope you can help me.
>



 --
 Marco

 --
 You received this message because you are subscribed to the Google
 Groups "Google Web Toolkit" group.
 To post to this group, send email to
 google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Google Web Toolkit" group.
>>> To post to this group, send email to google-web-toolkit@googlegroups.com
>>> .
>>> To unsubscribe from this group, send email to
>>> google-web-toolkit+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>>
>>
>>
>>
>> --
>> Marco
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Web Toolkit" group.
>> To post to this group, send email to google-web-toolkit@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-web-toolkit+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>
>
>
>
> --
> Guit: Elegant, beautiful, modular and *production ready* gwt applications.
>
> http://code.google.com/p/guit/
>
>
>
>
>


-- 
Guit: Elegant, beautiful, modular and *production ready* gwt applications.

http://code.google.com/p/guit/

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=e

Re: DropDown Button

2011-03-14 Thread Gal Dolber
This is what I am using, you can put anything inside the PopupButton and it
will be the popup content.


/**

 * How to use:

 *  

 

 Settings

 Logout

 



 */

public class PopupButton extends Composite implements HasWidgets {


 private final Button button = new Button();


 private Element target;


 private boolean targetVisible = false;

 protected HandlerRegistration registration;


 private final NativePreviewHandler handler = new NativePreviewHandler() {

 @Override

 public void onPreviewNativeEvent(NativePreviewEvent event) {

 if (event.getTypeInt() == Event.ONMOUSEDOWN) {

  Element eventTarget = event.getNativeEvent().getEventTarget()

   .cast();

  if (!target.isOrHasChild(eventTarget)) {

  hide();

  }

 }

 }

};

 public void setText(String text) {

 button.setText(text);

}


 public PopupButton() {

 initWidget(button);

 button.addClickHandler(new ClickHandler() {

 @Override

 public void onClick(ClickEvent event) {

  if (targetVisible) {

  targetVisible = !targetVisible;

  target.getStyle().clearDisplay();

  registration = Event.addNativePreviewHandler(handler);

  } else {

  hide();

  }

 }

 });

}


 private void hide() {

 targetVisible = !targetVisible;

 target.getStyle().setDisplay(Display.NONE);

 if (registration != null) {

 registration.removeHandler();

 }

}


 @Override

public void add(Widget w) {

 if (target != null) {

 throw new RuntimeException("You can only add one widget");

 }

 RootPanel.get().add(w);

 target = w.getElement();

 hide();

}


 @Override

public void clear() {

 throw new RuntimeException();

}


 @Override

public Iterator iterator() {

 throw new RuntimeException();

}


 @Override

public boolean remove(Widget w) {

 throw new RuntimeException();

}

 @Override

protected void onLoad() {

 Scheduler.get().scheduleDeferred(new ScheduledCommand() {

 @Override

 public void execute() {

  target.getStyle().setTop(button.getOffsetHeight() + button.getAbsoluteTop(),
Unit.PX);

  target.getStyle().setLeft(button.getAbsoluteLeft(), Unit.PX);

  target.getStyle().setZIndex(1);

  target.getStyle().setPosition(Position.ABSOLUTE);

 }

 });

}

}

On Mon, Mar 14, 2011 at 5:15 PM, Marco Gadaleta wrote:

> ?
>
>
> On Mon, Mar 14, 2011 at 9:12 PM, Juan Pablo Gardella <
> gardellajuanpa...@gmail.com> wrote:
>
>> +1
>>
>> 2011/3/14 Marco Gadaleta 
>>
>>> Nothing???
>>>
>>> On Wed, Mar 9, 2011 at 1:53 PM, gadaleta.marco >> > wrote:
>>>
 hello everyone,
 there a way to create a button in gwt like "gmail more actions" button
 without using external library?
 Thx, hope you can help me.

>>>
>>>
>>>
>>> --
>>> Marco
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Google Web Toolkit" group.
>>> To post to this group, send email to google-web-toolkit@googlegroups.com
>>> .
>>> To unsubscribe from this group, send email to
>>> google-web-toolkit+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Google Web Toolkit" group.
>> To post to this group, send email to google-web-toolkit@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-web-toolkit+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>
>
>
>
> --
> Marco
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>



-- 
Guit: Elegant, beautiful, modular and *production ready* gwt applications.

http://code.google.com/p/guit/

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: DropDown Button

2011-03-14 Thread Marco Gadaleta
?

On Mon, Mar 14, 2011 at 9:12 PM, Juan Pablo Gardella <
gardellajuanpa...@gmail.com> wrote:

> +1
>
> 2011/3/14 Marco Gadaleta 
>
>> Nothing???
>>
>> On Wed, Mar 9, 2011 at 1:53 PM, gadaleta.marco 
>> wrote:
>>
>>> hello everyone,
>>> there a way to create a button in gwt like "gmail more actions" button
>>> without using external library?
>>> Thx, hope you can help me.
>>>
>>
>>
>>
>> --
>> Marco
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Web Toolkit" group.
>> To post to this group, send email to google-web-toolkit@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-web-toolkit+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>



-- 
Marco

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: DropDown Button

2011-03-14 Thread Juan Pablo Gardella
+1

2011/3/14 Marco Gadaleta 

> Nothing???
>
> On Wed, Mar 9, 2011 at 1:53 PM, gadaleta.marco 
> wrote:
>
>> hello everyone,
>> there a way to create a button in gwt like "gmail more actions" button
>> without using external library?
>> Thx, hope you can help me.
>>
>
>
>
> --
> Marco
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: DropDown Button

2011-03-14 Thread Marco Gadaleta
Nothing???

On Wed, Mar 9, 2011 at 1:53 PM, gadaleta.marco wrote:

> hello everyone,
> there a way to create a button in gwt like "gmail more actions" button
> without using external library?
> Thx, hope you can help me.
>



-- 
Marco

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



DropDown Button

2011-03-09 Thread gadaleta.marco
hello everyone,
there a way to create a button in gwt like "gmail more actions" button
without using external library?
Thx, hope you can help me.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.