[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [platform-ui-dev] Perspective Layout
|
Dani,
Please post questions about the use of Eclipse UI (rather than its
development) to the newsgroup so that others can participate in and
benefit from the discussion.
The way it is intended to work is that the space currently assigned to the
specified relative is split, giving the specified ratio of its current
space to the new view.
Other views are not affected.
So, if you want to have a one thirds / two thirds vertical split beween
your views and the editor area, and then have the four views have equal
width, the following should work.
layout.addView(VIEW_A_ID, IPageLayout.TOP, (float)0.33, IPageLayout.ID_EDITOR_AREA); // 1/3 of the height, full width
layout.addView(VIEW_B_ID, IPageLayout.RIGHT, (float)0.75, VIEW_A_ID); // 3/4 of the width but the next two will take 2/4 away
layout.addView(VIEW_C_ID, IPageLayout.RIGHT, (float)0.66, VIEW_B_ID); // 3/4 * 2/3 = 1/2
layout.addView(VIEW_D_ID, IPageLayout.RIGHT, (float)0.50, VIEW_C_ID); // split the remaining half evenly
Nick
Daniel_Megert@xxxxxxx
Sent by: platform-ui-dev-admin@xxxxxxxxxxx
01/31/02 07:21 AM
Please respond to platform-ui-dev
To: platform-ui-dev@xxxxxxxxxxx
cc:
Subject: [platform-ui-dev] Perspective Layout
I'm trying to create a perspective wit n views arranged horizontally, each
view _same_ horizontal size. I did not understand the API documentation:
* @param ratio the amount of space donated to the new part, in the range
* <code>0.05f</code> to <code>0.95f</code>; values outside this range
To which view/space is this ratio related? Can I only control one
dimension?
Having 4 views I tried the following approach which does not give the
desired result (it is more or less what I want but horizontal sizes are
not equal).
Assuming ratio is per page
layout.addView(VIEW_A_ID, IPageLayout.TOP, (float)0.25, IPageLayout.ID_EDITOR_AREA);
layout.addView(VIEW_B_ID, IPageLayout.RIGHT, (float)0.25, VIEW_A_ID);
layout.addView(VIEW_C_ID, IPageLayout.RIGHT, (float)0.25, VIEW_B_ID);
layout.addView(VIEW_D_ID, IPageLayout.RIGHT, (float)0.25, VIEW_C_ID);
Dani