tabris icon indicating copy to clipboard operation
tabris copied to clipboard

Allow TabrisUI users to have access to the Display during configuration time

Open mpost opened this issue 12 years ago • 3 comments

mpost avatar Jun 13 '13 08:06 mpost

During configuration time no display exist. We can add an alternative way to configure via a callback. Maybe this would be a solution.

hstaudacher avatar Dec 02 '13 10:12 hstaudacher

Did anything ever get done for this? I'm trying to get the TabrisUI parent Composite's clientRect during createContent, but it is always {0,0,0,0}. Is there a way to get the size at this time? Display is available, but no measurements of the parent...?

In fact, what I really want is for the composite to always take up the whole of the display (apart from the action bars of course), which I thought it did, but when I create another composite within that parent, and do a FormLayout/FormData to use the whole space, it doesn't seem to get resized to the parent size:

            fd = new FormData();
            fd.left = new FormAttachment(0, 0);
            fd.top = new FormAttachment(0, 0);
            fd.right = new FormAttachment(100, 0);
            fd.bottom = new FormAttachment(100, 0);
            parent.setLayoutData(fd);

What layouting is set in the Composite of the TabrisUI client area by default? Anything?

Thx, John

JohnGymer avatar Apr 09 '14 12:04 JohnGymer

At the end of CreateContent, I observe the parent structure as Composite (parent) within another Composite (middle) within a maximized Shell. These are the various sizes and layout properties of these 3 TabrisUI-provided objects at that time:

parent: Composite {} parent style: 33554432 parent bounds: Rectangle {0, 0, 0, 0} parent clientArea: Rectangle {0, 0, 0, 0} parent layout: FormLayout {marginLeft=10 marginRight=10 marginTop=10 marginBottom=10} parent layoutData: FormData {left={y = (0/100)x + 10} right={y = (100/100)x - 10} top={y = (0/100)x + 10} bottom={y = (100/100)x - 10}} parent shellParent: Composite {} parent size: Point {0, 0}

middle: Composite {} middle: style: 33554432 middle bounds: Rectangle {0, 0, 0, 0} middle clientArea: Rectangle {0, 0, 0, 0} middle layout: com.eclipsesource.tabris.internal.ZIndexStackLayout@1da2737 middle layoutData: GridData {horizontalAlignment=SWT.FILL grabExcessHorizontalSpace=true verticalAlignment=SWT.FILL grabExcessVerticalSpace=true} middle shellParent: Shell {} middle size: Point {0, 0}

topParent: Shell {} Shell fullScreen: false Shell style: 33554440 Shell text: Shell bounds: Rectangle {0, 0, 1285, 679} Shell clientArea: Rectangle {0, 0, 1285, 679} Shell layout: GridLayout {horizontalSpacing=5} Shell layoutData: null Shell maximized: true Shell shellParent: null Shell size: Point {1285, 679}

The FormLayout and FormData of the parent provided to CreateContent are something I'm setting, and perhaps I shouldn't be doing this?

I expected that Composite to simply always take up the remainder of the space on the display, but it appears to be using a "ZIndexStackLayout" (whatever that is) which I suspect is trying to automatically size things based on the content, similar to a GridLayout or some sort?

In any case, it would be useful to get an explanation of the layouting involved in TabrisUI to understand what is happening, and how to make calculations about sizes.

Thx

JohnGymer avatar Apr 09 '14 13:04 JohnGymer