private Command afterShowEvent;
private boolean fixedLocation = false;
public DefaultWindow(String title) {
DockLayoutPanel layout = new DockLayoutPanel(Style.Unit.PX);
setStyleName("default-window");
final PopupTitleBar header = new PopupTitleBar(title, this);
// dnd
header.addMouseDownHandler( new MouseDownHandler() {
public void onMouseDown(MouseDownEvent event) {
dragged = true;
dragStartX = event.getRelativeX( getElement() );
dragStartY = event.getRelativeY( getElement() );
DOM.setCapture(header.getElement());
}
} );
header.addMouseMoveHandler( new MouseMoveHandler() {
public void onMouseMove(MouseMoveEvent event) {
if ( dragged ) {
setPopupPosition( event.getClientX() - dragStartX,
event.getClientY() - dragStartY );
}
}
} );
header.addMouseUpHandler( new MouseUpHandler() {
public void onMouseUp(MouseUpEvent event) {
dragged = false;
DOM.releaseCapture( header.getElement() );
}
} );
layout.addNorth(header, 40);
HorizontalPanel footer = new HorizontalPanel();
footer.setStyleName("default-window-footer");
HTML footerLabel = new HTML(" ");
footer.add(footerLabel);
footerLabel.getElement().getParentElement().setAttribute("width", "100%");
layout.addSouth(footer, 16);
content = new LayoutPanel();
content.setStyleName("default-window-content");
layout.add(content);
super.setWidget(layout);
// default width(height
int winWidth = (int)(Window.getClientWidth()*0.9);