Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Window Resizing problems while changing resolutions of resizing

    public class TestPanel
    extends Window{

    private VLayout content = null;


    public TestPanel() {

    super();
    initPanel();
    setWidth("100%");
    }



    private void initPanel() {

    setTitle(panelHeading);
    //setAutoSize(true);
    setAutoHeight();
    //setShowCloseButton(false);
    setVPolicy(LayoutPolicy.NONE);
    setOverflow(Overflow.VISIBLE);
    setShowShadow(false);
    setKeepInParentRect(true);

    content = new VLayout();
    content.setWidth("100%");
    content.setHeight("100%");
    addMember(content);

    }



    Now the problem is that when I create panels from this class,the panels does not resize automatically when I resize the main window.This works fine when I extend this class with VLayout in place of Window.But I want a collapse button in the end in the header which I cannot add while extending VLayout.Is there any property in Window or any workaround to make the panels resize automatically when I resize the main window or when the screen resolution is changed.

    #2
    Just remove your calls to setVPolicy and setOverflow and everything works fine (as in the samples).

    You might be confused about the Window itself vs the body. To add members to the interior area of the Window (it's body), use addItem(), not addMember().

    The Window inherits from Layout and uses it's behaviors and APIs, then provides addItem to place things in the interior of the Window. When you directly change Layout settings, you're potentially interfering with the Window's use of the superclass' Layout's facilities. Use these APIs only to customize the behavior of the Window-as-such (eg it's header) not for managing widgets you merely mean to place in it's body - use addItem() for those.

    Comment

    Working...
    X