PDA

View Full Version : [FIXED] new Window reposition bug



gslender
31 May 2008, 10:14 PM
In explorer demo - current and version on website (ie6 hosted or FF2)
http://extjs.com/explorer/#window

Repeated click on each alternating button to see odd respositioning behaviour in demo. Shows windows fine on first click/open, but subsequent clicks place window in new locations?

gslender
2 Jun 2008, 10:13 PM
This implementation of the window page, IMO is better - it allows the user to click on the button and new windows are created for each click. I've seen some users suggest that this concept of creating a new window does not work - but it does for me... go figure? Example like this might help to show proper implementation of using new objects etc...

The original reposition on subsequent show() bug still exists.



public void onModuleLoad() {
RootPanel.get().add(this);
}

@Override
protected void onRender(Element parent, int pos) {
super.onRender(parent, pos);

final Window simple = new Window();
simple.setHeading("Simple Window");
simple.setWidth(250);
simple.addText(TestData.DUMMY_TEXT_SHORT);
simple.setScrollMode(Scroll.AUTO);



ButtonBar buttons = new ButtonBar();

buttons.add(new Button("Simple", new SelectionListener() {
public void componentSelected(ComponentEvent ce) {
simple.show();
}
}));

buttons.add(new Button("Complex", new SelectionListener() {
public void componentSelected(ComponentEvent ce) {
newComplexWindow().show();
}
}));

add(buttons);
setLayout(new FlowLayout(4));
layout();
}

private TreeItem newItem(String text, String iconStyle) {
TreeItem item = new TreeItem(text);
item.setIconStyle(iconStyle);
return item;
}

private Window newComplexWindow()
{

Window complex = new Window();
complex.setMaximizable(true);
complex.setHeading("Accordion Window");
complex.setWidth(200);
complex.setHeight(350);

ToolBar toolBar = new ToolBar();
TextToolItem item = new TextToolItem();
item.setIconStyle("icon-connect");
toolBar.add(item);

toolBar.add(new SeparatorToolItem());
complex.setTopComponent(toolBar);

item = new TextToolItem();
item.setIconStyle("icon-user-add");
toolBar.add(item);

item = new TextToolItem();
item.setIconStyle("icon-user-delete");
toolBar.add(item);

complex.setIconStyle("icon-accordion");
complex.setLayout(new AccordionLayout());

ContentPanel cp = new ContentPanel();
cp.setHeading("Online Users");
cp.setScrollMode(Scroll.AUTO);
cp.getHeader().addTool(new ToolButton("x-tool-refresh"));

complex.add(cp);

Tree tree = new Tree();
TreeItem family = new TreeItem("Family");
tree.getRootItem().add(family);
family.add(newItem("Darrell", "user"));
family.add(newItem("Maro", "user-girl"));
family.add(newItem("Lia", "user-kid"));
family.add(newItem("Alec", "user-kid"));
family.setExpanded(true);

TreeItem friends = new TreeItem("Friends");
tree.getRootItem().add(friends);
friends.add(newItem("Bob", "user"));
friends.add(newItem("Mary", "user-girl"));
friends.add(newItem("Sally", "user-girl"));
friends.add(newItem("Jack", "user"));
friends.setExpanded(true);

cp.add(tree);

cp = new ContentPanel();
cp.setHeading("Settings");
cp.addText(TestData.DUMMY_TEXT_SHORT);
complex.add(cp);

cp = new ContentPanel();
cp.setHeading("Stuff");
cp.addText(TestData.DUMMY_TEXT_SHORT);
complex.add(cp);

cp = new ContentPanel();
cp.setHeading("More Stuff");
cp.addText(TestData.DUMMY_TEXT_SHORT);
complex.add(cp);

complex.layout();
return complex;
}

ashleywong
3 Jun 2008, 7:32 PM
I don't know anyone have reported this bug and is it relevant to the above case.

When dragging the window, the position of window is inaccurate using FireFox.

ashleywong
5 Jun 2008, 4:04 AM
It's work fine in Safari.

darrellmeyer
5 Jun 2008, 9:29 AM
There is a issues with the GWT RC1 code I believe. Incorrect values are being returned for x and y mouse position from an event in Firefox. The latest build has a workaround that works ok. I am still looking into this.

gslender
5 Jun 2008, 11:37 PM
thanks darrell

ashleywong
12 Jun 2008, 2:28 AM
I've just tried beta5. The problem in FF has been resolved.