resize question

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

resize question

Gary Overgard
Does Dolphin have a simple way to get the subviews to resize when the
primary view is resized?  Or should I be picking off the #onPositionChanged:
method, and then doing calculations based on the container size?
Thanks in advance
 --Gary Overgard


Reply | Threaded
Open this post in threaded view
|

Re: resize question

Stefan Schmiedl
On Sun, 27 Jan 2002 18:26:35 -0800,
Gary Overgard <[hidden email]> wrote:
> Does Dolphin have a simple way to get the subviews to resize when the
> primary view is resized?  Or should I be picking off the #onPositionChanged:
> method, and then doing calculations based on the container size?

you could/should use layoutmanagers in the top level shell view
and let them do the work.

there are some really nifty ones available in 4.0.1 ....

s.
--
Stefan Schmiedl
EDV-Beratung, Programmierung, Schulung
Loreleystr. 5, 94315 Straubing, Germany
Tel. (0 94 21) 74 01 06
Public Key: http://xss.de/stefan.public

shhhh ... I can't hear my code!


Reply | Threaded
Open this post in threaded view
|

Re: resize question

Ian Bartholomew-6
In reply to this post by Gary Overgard
Gary,

> Does Dolphin have a simple way to get the subviews to resize when the
> primary view is resized?

As Stefan mentions you use LayoutManagers for this.

The WIKI contains a page ("UsingLayoutManagers") describing the common ones
but note that it is a bit out of date now (I think Kai wrote it for D2)

Their use can be slightly confusing until you get used to it, so a quick
guide.

- You set up LayoutManagers in the ViewComposer while you are composing your
views - no code is (usually) needed.
- In the parent view, the one containing the subviews that need to be
automatically repositioned/resized, you set the #layoutManager aspect.
Double click on the aspect to see the list of available managers.
- In each of the child view you will now find an extra aspect called
#arrangement. The value of this is set according to the chosen layout
manager. For example, if you select a ProportionalLayout for the parent the
the arrangement aspect in each child represents the proportion of the parent
that the child should occupy. If you select BorderLayout in the parent then
the child #arrangement aspect lets you chose from a list of border
positions.
- You build up composite views with different resizing behaviours by using
ContainerViews. Each container view can be either a parent (having a
separate layout manager for it's children) or a child, allowing complex
views to be constructed with different part being laid out in different
ways.
- The most flexible but most complicated LayoutManager is FramingLayout. For
a parent that has lots of sub views, buttons and the like, it is probably
the best manager to use.
- ProportionalLayout views are nearly always separated with a Splitter
resource. This is just positioned between the views, no code or Presenter is
needed for it, and it provides the normal behaviour for changing proportions
using the mouse.

Hope this helps

Ian


Reply | Threaded
Open this post in threaded view
|

Re: resize question

Ian Bartholomew-6
In reply to this post by Gary Overgard
[apologies if this appears twice - news server problems]

Gary,

> Does Dolphin have a simple way to get the subviews to resize when the
> primary view is resized?

As Stefan mentions you use LayoutManagers for this.

The WIKI contains a page ("UsingLayoutManagers") describing the common ones
but note that it is a bit out of date now (I think Kai wrote it for D2)

Their use can be slightly confusing until you get used to it, so a quick
guide.

- You set up LayoutManagers in the ViewComposer while you are composing your
views - no code is (usually) needed.
- In the parent view, the one containing the subviews that need to be
automatically repositioned/resized, you set the #layoutManager aspect.
Double click on the aspect to see the list of available managers.
- In each of the child view you will now find an extra aspect called
#arrangement. The value of this is set according to the chosen layout
manager. For example, if you select a ProportionalLayout for the parent the
the arrangement aspect in each child represents the proportion of the parent
that the child should occupy. If you select BorderLayout in the parent then
the child #arrangement aspect lets you chose from a list of border
positions.
- You build up composite views with different resizing behaviours by using
ContainerViews. Each container view can be either a parent (having a
separate layout manager for it's children) or a child, allowing complex
views to be constructed with different part being laid out in different
ways.
- The most flexible but most complicated LayoutManager is FramingLayout. For
a parent that has lots of sub views, buttons and the like, it is probably
the best manager to use.
- ProportionalLayout views are nearly always separated with a Splitter
resource. This is just positioned between the views, no code or Presenter is
needed for it, and it provides the normal behaviour for changing proportions
using the mouse.

Hope this helps

Ian


Reply | Threaded
Open this post in threaded view
|

Re: resize question

Gary Overgard
In reply to this post by Stefan Schmiedl
--Thanks, this is exactly what I was looking for.
For anyone else interested, searching on "Dolphin LayoutManager" gives a
nice tutorial on this at:
http://www.mindspring.com/~lsumberg/PersonalMoney/Part3.htm
Regards,
  Gary Overgard

"Stefan Schmiedl" <[hidden email]> wrote in message
news:a32c5d$14ovh9$[hidden email]...
> On Sun, 27 Jan 2002 18:26:35 -0800,
> Gary Overgard <[hidden email]> wrote:
> > Does Dolphin have a simple way to get the subviews to resize when the
> > primary view is resized?  Or should I be picking off the
#onPositionChanged:

> > method, and then doing calculations based on the container size?
>
> you could/should use layoutmanagers in the top level shell view
> and let them do the work.
>
> there are some really nifty ones available in 4.0.1 ....
>
> s.
> --
> Stefan Schmiedl
> EDV-Beratung, Programmierung, Schulung
> Loreleystr. 5, 94315 Straubing, Germany
> Tel. (0 94 21) 74 01 06
> Public Key: http://xss.de/stefan.public
>
> shhhh ... I can't hear my code!