LayoutManagers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

LayoutManagers

Shaping-3
I want to arrange linear banks of rectangular objects--static rectangles and
buttons mostly.  I don't see that the #arrange attribute is universally
available in VC.  How do I make it so?  How do I specify any layout manager
for any subview?  I want constant-ratios for all parts' positions, widths,
and lengths.  What is the best approach?

I'm wondering whether this wouldn't be easier to do programmatically.

Shaping


Reply | Threaded
Open this post in threaded view
|

Re: LayoutManagers

Schwab,Wilhelm K
> I want to arrange linear banks of rectangular objects--static rectangles and
> buttons mostly.  

Proportional and grid layouts should be able to do that.


 > I don't see that the #arrange attribute is universally
> available in VC.  How do I make it so?  

You probably should not try.  It is available when it makes sense.  Some
views require certain types of layout managers.  Of course, if OA missed
a place where it should be exposed, I am confident they will fix it if
you call it to their attention.


 > How do I specify any layout manager
> for any subview?  

Look for the #layoutManager aspect in the VC.


 > I want constant-ratios for all parts' positions, widths,
> and lengths.  What is the best approach?

If I understand you, that will be a small problem, because it requires
feedback between the parent and child views.  Most layout situations
assume that the parent's location is fixed and the children "fight over
what is left".  Look at #preferredExtent and #usePreferredExtent.


> I'm wondering whether this wouldn't be easier to do programmatically.

Indeed it can be, and there at least a couple of approaches to it.
Given that you appear to be concerned about VC operations, you might
want to look at my ViewGenerator, but it generally makes the most sense
for big jobs driven by some type of meta data.  Chris offers a tool that
generates code based on view resources.  You might also find that Ian
has a helpful IDE extension for the VC, or you could simply build your own.

Have a good one,

Bill


--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: LayoutManagers

Schwab,Wilhelm K
> You probably should not try.  It is available when it makes sense.  Some
> views require certain types of layout managers.  

... and some types of layout managers require subviews to have specific
types of arrangement values.  For example, change a proportional layout
to a framing layout and look at the subviews' arrangements.


Have a good one,

Bill


--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: LayoutManagers

Shaping-3
In reply to this post by Schwab,Wilhelm K
>
> > I want constant-ratios for all parts' positions, widths,
>> and lengths.  What is the best approach?
>
> If I understand you, that will be a small problem, because it requires
> feedback between the parent and child views.  Most layout situations
> assume that the parent's location is fixed and the children "fight over
> what is left".  Look at #preferredExtent and #usePreferredExtent.

This means that the view is elastic:  all siblings remain at constant size
ratios inside the parent shell or view.  Actually, there would be one
exception.  At the top level I might want a fixed distance from the frame of
the shell; othewise, all ratios would remain the same as the shell is
resized.

Shaping


Reply | Threaded
Open this post in threaded view
|

Re: LayoutManagers

Blair McGlashan-3
"Shaping" <[hidden email]> wrote in message
news:420a07ea$[hidden email]...

> >
>> > I want constant-ratios for all parts' positions, widths,
>>> and lengths.  What is the best approach?
>>
>> If I understand you, that will be a small problem, because it requires
>> feedback between the parent and child views.  Most layout situations
>> assume that the parent's location is fixed and the children "fight over
>> what is left".  Look at #preferredExtent and #usePreferredExtent.
>
> This means that the view is elastic:  all siblings remain at constant size
> ratios inside the parent shell or view.  Actually, there would be one
> exception.  At the top level I might want a fixed distance from the frame
> of the shell; othewise, all ratios would remain the same as the shell is
> resized.

You can achieve most layouts using some combination of the existing layout
managers and appropriate container views. Experiment, and if you really
can't do the layout you want it is not at all difficult to introduce your
own LayoutManager (although it may of course be difficult to write the
layout algorithm).

Regards

Blair