Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Perspective Layout

Probably better to ask this question in the newsgroup...mailing list is
more for discussing current design plans...

To answer your question, the ratio is related to the view you are attaching
to. For example, assume there is a nav view 100 pixel wide and 100 pixel
high. If you attach the outline view to the right of it with a ratio of
0.5, then both have a height of 100 pixel and a width of 50 pixel.

So in your case, you would use 3/4, 2/3, and 1/2 as ratios for the last
three views added. Or you could do something like:
        layout.addView(VIEW_A_ID, IPageLayout.TOP,   (float)0.25,
IPageLayout.ID_EDITOR_AREA);
        layout.addView(VIEW_C_ID, IPageLayout.RIGHT, (float)0.50,
VIEW_A_ID);
        layout.addView(VIEW_B_ID, IPageLayout.RIGHT, (float)0.50,
VIEW_A_ID);
        layout.addView(VIEW_D_ID, IPageLayout.RIGHT, (float)0.50,
VIEW_C_ID);

Simon :-)



                                                                                                                         
                      Daniel_Megert@xxxxxxx                                                                              
                      Sent by:                       To:      platform-ui-dev@xxxxxxxxxxx                                
                      platform-ui-dev-admin@         cc:                                                                 
                      eclipse.org                    Subject: [platform-ui-dev] Perspective Layout                       
                                                                                                                         
                                                                                                                         
                      01/31/2002 07:21 AM                                                                                
                      Please respond to                                                                                  
                      platform-ui-dev                                                                                    
                                                                                                                         
                                                                                                                         




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





Back to the top