Hi Joe, I'm looking for a simple way to create windows without resorting to a large toolkit or framework like gwt-mosaic. This code is interesting but looks like most of the interesting stuff is in WindowPanelHandler. I'd love to get a look at the source for that if possible?
Thanks, Adrian On Dec 11, 9:44 pm, Joe <[email protected]> wrote: > Hi, here's how you implement the WindowPanel in your code: > > package joe.google.gwt.helloworld.client; > > import com.google.gwt.core.client.EntryPoint; > import com.google.gwt.user.client.ui.HTML; > import com.google.gwt.user.client.ui.PopupPanel.PositionCallback; > > public class HelloWorld implements EntryPoint { > > public void onModuleLoad() { > final WindowPanel window1 = new WindowPanel("Fund > Management"); > window1.setPopupPositionAndShow(new PositionCallback() { > > @Override > public void setPosition(int offsetWidth, int > offsetHeight) { > int left = 100; > int top = 100; > window1.setPopupPosition(left, top); > window1.show(); > } > }); > window1.setWidget(new Label("This is a test widget")); > final WindowPanel window2 = new WindowPanel(); > window2.setPopupPositionAndShow(new PositionCallback() { > > @Override > public void setPosition(int offsetWidth, int > offsetHeight) { > int left = 750; > int top = 100; > window2.setPopupPosition(left, top); > window2.show(); > } > }); > window2.setCaption("Property Management"); > window2.setWidget(new Label("This is a test widget")); > } > > } > > As for the code of the WindowPanel widget itself, here it is: > > public class WindowPanel extends PopupPanel { > private final WindowPanelHandler handler = new > WindowPanelHandler(this); > > private FlowPanel windowPanel, windowContents, footerPanel; > private FocusPanel closeDiv, headerPanel, resizeDiv; > private ScrollPanel contentScroller; > private HTML title; > private String caption > > public WindowPanel() { > closeDiv = new FocusPanel(); > closeDiv.addMouseUpHandler(handler); > > // and so on you create all the widgets defined above > > setWidget(windowPanel); > } > > } > > On Dec 10, 8:01 pm, mwaschkowski <[email protected]> wrote: > > > > > Looks interesting, wheres the code? > > > On Dec 10, 12:07 pm, Joe <[email protected]> wrote: > > > > Hello everyone, > > > > Please check out this link to test the version 2 of the window panel > > > widget. > > > >http://property-leb.appspot.com/ > > > > Drag, close, and resize are the only features now available. > > > > Minimize, maximize, and restore will be available in the upcoming > > > version. > > > > The interesting part in the WindowPanel widget, is the use of DIV and > > > Css in the architecture of it. > > > > Any inspector tool will show you this. No tables, faster startup, > > > smoother drag and resize. > > > > A big still exist in IE, the size of the wrapper div is not set to the > > > size of the content widget size automatically. > > > > But i guess few tricks of css, if applied, will help. > > > > Any comments are welcome, enjoy! > > > > Joe -- 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.
