Absolute Positioning

Hi,

I created a page in which i popup (make visible) a ROWAREA using absolute positioning. Everything works fine, i even use another absolute positioned VDIST with a lower z-order to make the rest of the screen opaque shaded. Good stuff, except that it doesn’t seem to work in SWT. The map demo does not seem to work either. Is this a known bug or is there something else i’m missing?

To avoid the issue i was going to use a normal popup in SWT instead. Except that Adapter.getIsDisplaySWT always returns false.

Thanks,

Boris

I jsut made some quick testin: “ROWABSAREA” is/should be fully supported in SWT. The following example works without problems in 1.4.1:

Long time ago (…) we supported ASB*-controls to be directly plugged below the PAGE-tag. This is still the case in the map-demo in our examples - and is ignored in SWT. The example “Moving icon” in the demo area works without problems…

Please use ROWABSAREA to place your ABS* controls.

There is one difference between SWT and HTML: the transparency of colours. In SWT the z-Index determines the sequence of drawing of the controls - which is “quite” correct for most cases but sometimes produces different results than the z-Index in HTML.

I hope this helps…

Bjoern

Hi…

Yes, thanks that seems to work better… the absolute positioned elements are showing up… but it seems that the SWT client behaves differently from the web based client.

For instance, the layout below in the web browser positions the button completely to the right. I see that the rowabsarea is covering the whole rowarea (by the white background) but the SWT client does not seem to respect the keepfullwidth/height elements with absolute positioning so the button shows up completely to the left. How would i do this without specifying pixels?

    <rowarea name="Rowarea" height="300">
        <itr takefullwidth="true" height="100%">
            <coltable0 width="100%" takefullheight="true">
                <rowabsarea width="100%" height="100%">
                    <abstable0 x="0" y="0" height="100%" width="100%" takefullheight="true">
                        <itr takefullwidth="true" height="100%">
                            <hdist width="100%">
                            </hdist>
                            <button>
                            </button>
                        </itr>
                    </abstable0>
                </rowabsarea>
            </coltable0>
        </itr>
    </rowarea>

Thanks for any help,

Boris

Hi Boris,

you “make it difficult” (do not mis-understand me…) by assigning the ABTABLE0 a width and height of 100%. In principal there is no reference for the 100%: there is an area to position elements (the ROWABSAREA), on a special coordinate(in your case 0,0) you position a table and assign a width in percents - as consequence the rendering systems (browser,SWT) try their best to find out what 100% means: the browser seems to look on the ROWABSAREA, the SWT client says: nothing to refer to ==> 100% of 0 is 0…

I changed your example so that the ABSTABLE0 has a width which is defined as pixel value (and also moved it from “0,0” - you do not need ABS* controls if only positioning them to 0,0 ;-)…).

    <rowarea name="Rowarea" height="300">
        <itr takefullwidth="true" height="100%">
            <coltable0 width="100%" takefullheight="true">
                <rowabsarea width="100%" height="100%">
                    <abstable0 x="100" y="100" height="200" width="200" takefullheight="true">
                        <itr takefullwidth="true" height="100%">
                            <hdist width="100%">
                            </hdist>
                            <button name="Hello">
                            </button>
                        </itr>
                    </abstable0>
                </rowabsarea>
            </coltable0>
        </itr>
    </rowarea>

…and the results are comparable… (you will see little differences because of background colouring the ITR in SWT compared to the browser, but the positioning is OK.).

We recommend to use ABS* controls for the purpose of “hard positioning”: e.g. we have customers using this to layout controls on top of a backgroud image (the background image is representing a production line, the controls on top of the production line show the status of engines etc.). For normal layouting and arranging of controls we prefer our standard way (which bases on table based rendering).

Bjoern