I want to use popuppanel to set a contextmenu for treeitem?the code is blow:
/***********************************************
private void createContextMenu(TreeItem currentSelectedItem){
int x=currentSelectedItem.getAbsolutedLeft();
int y=currentSelectedItem.getAbsolutedTop();
PopupPanel contextmenu=new PopupPanel(true);
Grid menus=Grid(1,1);
menus.setText(0,0,currentSelectedItem.getText());
contextmenu.add(menus);
contextmenu.setPopupPosition(x,y);
contextmenu.show();
}
The problem is PopupPanel will overried the TreeItem,because x is
absolute left of treeitem,so I try to set x=int
x=currentSelectedItem.getAbsolutedLeft()+currentSelectedItem.getOffsetWidth();,but
just right,currentSelectedItem.getOffsetWidth() will not get the
offsetWidth of treeitem but tree,that is the problem how can I get
the absolute right of treeitem?
Maybe popup panel is not best solution,I find 1.5.2 begins to support
oncontectmenu,but I did not get any further info about how to use,maybe
it is incomplete support,I do not know how to construct a
contextmenu.any suggestion is appreciated?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---