Hi,
I don't think the layouts can be merged, as such, as they have very different
approaches.

With the TableLayout, it is possible to assign "weights" to each spaceFill
section to get what you want, I think. (see #spaceFillWeight:)

Regards, Gary

----- Original Message ----- From: "Tudor Girba" <[email protected]>
To: <[email protected]>
Sent: Monday, January 24, 2011 2:32 PM
Subject: Re: [Pharo-project] collapsing panes


Thanks a lot, Gary! I gave it a try and it does go in the wanted direction.

Now, the next question. I see that you are using a TableLayout. Is there a way to specify a proportion (like in the proportional layout?) for the initial extent of the inner panes?

If yes, then I suppose we could merge the two layouts into one.

Cheers,
Doru


On 24 Jan 2011, at 14:51, Benjamin wrote:

I love that :)
It could be very useful ^^


Ben

On Jan 24, 2011, at 2:36 PM, Gary Chambers wrote:

Tricky...
Just an experiment, but try the following after filing in attached change set. Can make the re-proportioning explicit and maybe fix things to constrain to
the owner morph if interested...


| container morph1 morph2 morph3 ex1 ex2 ex3 sp1 sp2|
morph1 := (PanelMorph new fillStyle: (SolidFillStyle color: Color red))
hResizing: #spaceFill;
vResizing: #spaceFill.
morph2 := (PanelMorph new fillStyle: (SolidFillStyle color: Color blue))
hResizing: #spaceFill;
vResizing: #spaceFill.
morph3 := (PanelMorph new fillStyle: (SolidFillStyle color: Color yellow))
hResizing: #spaceFill;
vResizing: #spaceFill.
ex1 := (UITheme builder newExpander: 'Red' for: morph1)
expanded: true.
ex2 := (UITheme builder newExpander: 'Blue'  for: morph2)
expanded: true.
ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3)
expanded: true.
sp1 := EdgeGripMorph new
target: ex1;
edgeName: #bottom;
vResizing: #rigid;
extent: 24 @ ProportionalSplitterMorph splitterWidth;
on: #mouseDown send: #expandedSizingRigid to: ex1.
sp2 := EdgeGripMorph new
target: ex2;
edgeName: #bottom;
vResizing: #rigid;
extent: 24 @ ProportionalSplitterMorph splitterWidth;
on: #mouseDown send: #expandedSizingRigid to: ex2.
container := UITheme builder newColumn: {
ex1.
sp1.
ex2.
sp2.
ex3}.
container cellInset: 0.
container extent: 400@400.
container openInWindow.



Have a play/fun.

Regards, Gary

----- Original Message ----- From: "Tudor Girba" <[email protected]>
To: "[email protected] Development" <[email protected]>
Sent: Friday, January 21, 2011 11:18 PM
Subject: [Pharo-project] collapsing panes


Hi,

I have a question about how to obtain an effect similar to minimizing a pane in Eclipse. Let's consider the example from below. I have a ProportionalLayout because I want to fill the entire space and be able to resize the inside panes. Now, I would also like to have some way of collapsing one of the panes and have the rest resize to fill the rest of the space. It's a bit like I would need some part of a behavior from the TableLayout.

Can anyone provide me with some hints in this direction? Do I need to create a new Layout?

| container morph1 morph2 morph3 window |
container := PanelMorph new.
morph1 := PanelMorph new fillStyle: (SolidFillStyle color: Color red).
morph2 := PanelMorph new fillStyle: (SolidFillStyle color: Color blue).
morph3 := PanelMorph new fillStyle: (SolidFillStyle color: Color yellow).
container changeProportionalLayout.
container addMorph: morph1 fullFrame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 0.33)). container addMorph: morph2 fullFrame: (LayoutFrame fractions: (0 @ 0.33 corner: 1 @ 0.66)). container addMorph: morph3 fullFrame: (LayoutFrame fractions: (0 @ 0.66 corner: 1 @ 1)).
container addPaneSplitters.
container fillStyle: (SolidFillStyle color: Color yellow).
container extent: 400@400.
container openInWindow.

Cheers,
Doru


--
www.tudorgirba.com

"Be rather willing to give than demanding to get."



<ExpanderTweak.1.cs>



--
www.tudorgirba.com

"Every now and then stop and ask yourself if the war you're fighting is the right one."





Reply via email to