PDA

View Full Version : Constrain Window to Container



sjzaluk
14 May 2009, 12:43 PM
I am not able to constrain a window to a container. I know this was brought up in the past with GXT 1.x (http://www.extjs.com/forum/showthread.php?t=63487) but I believe this was going to be a part of 2.X but I could be mistaken. I thought Window.setConstrain(true) would do it but that's not working.

Thanks,
Steve

sjzaluk
18 May 2009, 7:49 PM
Any info on this? This functionality is critical to making my application meet requirements. I will implement a work around if need be but I believe this should be part of 2.0.

Thanks,
Steve

takayser
26 May 2009, 5:27 AM
@gxt devlopers, any updates on that? Can we expect this functionality in 2.0?

calicoder
26 May 2009, 9:25 PM
try this


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

// confine dragging to container element bounds
getDraggable().setContainer( (Component) getParent() );
}

sjzaluk
27 May 2009, 8:17 AM
Thanks. I did implement a solution but it's not perfect. I am having issues when a user repositions a separator when using BorderLayout so I am still working out some kinks. I think something like this should be part of the framework. By the way, what is Window.setContrain() used for if not to constrain that window to a Viewport?

Thanks,
Steve

calicoder
27 May 2009, 10:30 AM
that's used if you're creating a dashboard style application so that the Window will stay inside the dashboard interface