collapsing panes

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

collapsing panes

Tudor Girba
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."




Reply | Threaded
Open this post in threaded view
|

Re: collapsing panes

Gary Chambers-4
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" <[hidden email]>
To: "[hidden email] Development"
<[hidden email]>
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 (841 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: collapsing panes

Benjamin Van Ryseghem (Pharo)
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" <[hidden email]>
> To: "[hidden email] Development" <[hidden email]>
> 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>


Reply | Threaded
Open this post in threaded view
|

Re: collapsing panes

Tudor Girba
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" <[hidden email]>
>> To: "[hidden email] Development" <[hidden email]>
>> 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 | Threaded
Open this post in threaded view
|

Re: collapsing panes

Gary Chambers-4
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" <[hidden email]>
To: <[hidden email]>
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" <[hidden email]>
>> To: "[hidden email] Development"
>> <[hidden email]>
>> 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 | Threaded
Open this post in threaded view
|

Re: collapsing panes

Stéphane Ducasse
In reply to this post by Benjamin Van Ryseghem (Pharo)
Yes we want more and a class to encapsulate that logic.

Stef

On Jan 24, 2011, at 2:51 PM, 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" <[hidden email]>
>> To: "[hidden email] Development" <[hidden email]>
>> 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>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: collapsing panes

Tudor Girba
In reply to this post by Gary Chambers-4
Hi Gary,

On 24 Jan 2011, at 16:16, Gary Chambers wrote:

> 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:)

I tried to use it, but I get no effect when I use it in your example.

Below is one of my trouts (added spaceFillWeight: 10 to morph2). What am I doing wrong?

| 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;
        spaceFillWeight: 10.
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.

Cheers,
Doru



> Regards, Gary
>
> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
> To: <[hidden email]>
> 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" <[hidden email]>
>>> To: "[hidden email] Development" <[hidden email]>
>>> 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."
>
>
>
>
>

--
www.tudorgirba.com

"Problem solving efficiency grows with the abstractness level of problem understanding."




Reply | Threaded
Open this post in threaded view
|

Re: collapsing panes

Gary Chambers-4
Hi Doru,

The weight should be applied to the expanders themselves...


ex1 := (UITheme builder newExpander: 'Red' for: morph1)
 spaceFillWeight: 1;
 expanded: true.
ex2 := (UITheme builder newExpander: 'Blue'  for: morph2)
 spaceFillWeight: 2;
 expanded: true.
ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3)
 spaceFillWeight: 3;
 expanded: true.

Regards, Gary

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


Hi Gary,

On 24 Jan 2011, at 16:16, Gary Chambers wrote:

> 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:)

I tried to use it, but I get no effect when I use it in your example.

Below is one of my trouts (added spaceFillWeight: 10 to morph2). What am I
doing wrong?

| 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;
spaceFillWeight: 10.
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.

Cheers,
Doru



> Regards, Gary
>
> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
> To: <[hidden email]>
> 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" <[hidden email]>
>>> To: "[hidden email] Development"
>>> <[hidden email]>
>>> 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."
>
>
>
>
>

--
www.tudorgirba.com

"Problem solving efficiency grows with the abstractness level of problem
understanding."





Reply | Threaded
Open this post in threaded view
|

Re: collapsing panes

Tudor Girba
Ahh, indeed! My bad. Thanks Gary.

The main issue that seems to be left is the resizing. Currently, resizing propagates the changes to all the following morphs. This is great when the table layout is inside a GeneralScrollPane, but it leads to a bit of an odd behavior when stretching inside a bounded morph. Is there an easy option to change the behavior of the resizer?

Cheers,
Doru



On 25 Jan 2011, at 12:07, Gary Chambers wrote:

> Hi Doru,
>
> The weight should be applied to the expanders themselves...
>
>
> ex1 := (UITheme builder newExpander: 'Red' for: morph1)
> spaceFillWeight: 1;
> expanded: true.
> ex2 := (UITheme builder newExpander: 'Blue'  for: morph2)
> spaceFillWeight: 2;
> expanded: true.
> ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3)
> spaceFillWeight: 3;
> expanded: true.
>
> Regards, Gary
>
> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, January 24, 2011 9:14 PM
> Subject: Re: [Pharo-project] collapsing panes
>
>
> Hi Gary,
>
> On 24 Jan 2011, at 16:16, Gary Chambers wrote:
>
>> 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:)
>
> I tried to use it, but I get no effect when I use it in your example.
>
> Below is one of my trouts (added spaceFillWeight: 10 to morph2). What am I doing wrong?
>
> | 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;
> spaceFillWeight: 10.
> 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.
>
> Cheers,
> Doru
>
>
>
>> Regards, Gary
>>
>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>> To: <[hidden email]>
>> 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" <[hidden email]>
>>>> To: "[hidden email] Development" <[hidden email]>
>>>> 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."
>>
>>
>>
>>
>>
>
> --
> www.tudorgirba.com
>
> "Problem solving efficiency grows with the abstractness level of problem understanding."
>
>
>
>
>

--
www.tudorgirba.com

"There are no old things, there are only old ways of looking at them."




Reply | Threaded
Open this post in threaded view
|

Re: collapsing panes

Gary Chambers-4
I'm working on it... changeset soon...

Regards, Gary

----- Original Message -----
From: "Tudor Girba" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, January 25, 2011 2:15 PM
Subject: Re: [Pharo-project] collapsing panes


Ahh, indeed! My bad. Thanks Gary.

The main issue that seems to be left is the resizing. Currently, resizing
propagates the changes to all the following morphs. This is great when the
table layout is inside a GeneralScrollPane, but it leads to a bit of an odd
behavior when stretching inside a bounded morph. Is there an easy option to
change the behavior of the resizer?

Cheers,
Doru



On 25 Jan 2011, at 12:07, Gary Chambers wrote:

> Hi Doru,
>
> The weight should be applied to the expanders themselves...
>
>
> ex1 := (UITheme builder newExpander: 'Red' for: morph1)
> spaceFillWeight: 1;
> expanded: true.
> ex2 := (UITheme builder newExpander: 'Blue'  for: morph2)
> spaceFillWeight: 2;
> expanded: true.
> ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3)
> spaceFillWeight: 3;
> expanded: true.
>
> Regards, Gary
>
> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, January 24, 2011 9:14 PM
> Subject: Re: [Pharo-project] collapsing panes
>
>
> Hi Gary,
>
> On 24 Jan 2011, at 16:16, Gary Chambers wrote:
>
>> 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:)
>
> I tried to use it, but I get no effect when I use it in your example.
>
> Below is one of my trouts (added spaceFillWeight: 10 to morph2). What am I
> doing wrong?
>
> | 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;
> spaceFillWeight: 10.
> 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.
>
> Cheers,
> Doru
>
>
>
>> Regards, Gary
>>
>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>> To: <[hidden email]>
>> 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"
>>>> <[hidden email]>
>>>> To: "[hidden email] Development"
>>>> <[hidden email]>
>>>> 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."
>>
>>
>>
>>
>>
>
> --
> www.tudorgirba.com
>
> "Problem solving efficiency grows with the abstractness level of problem
> understanding."
>
>
>
>
>

--
www.tudorgirba.com

"There are no old things, there are only old ways of looking at them."





Reply | Threaded
Open this post in threaded view
|

Re: collapsing panes

Gary Chambers-4
OK, try the following, after filing in attached change set,
I've had a dabble with announcements too ;-) ...


| container morph1 morph2 morph3 morph4 ex1 ex2 ex3 ex4 sp1 sp2 sp3|
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.
morph4 := (PanelMorph new fillStyle: (SolidFillStyle color: Color green))
hResizing: #spaceFill; vResizing: #spaceFill.
ex1 := (UITheme builder newExpander: 'Red' for: morph1) spaceFillWeight: 1;
expanded: true.
ex2 := (UITheme builder newExpander: 'Blue'  for: morph2) spaceFillWeight:
2; expanded: true.
ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3) spaceFillWeight:
3; expanded: true.
ex4 := (UITheme builder newExpander: 'Green'  for: morph4) spaceFillWeight:
4; expanded: true.
sp1 := EdgeGripMorph new
 target: ex1;
 edgeName: #bottom;
 fitTargetOwner: true;
 on: #mouseDown send: #expandedSizingRigid to: ex1.
sp2 := EdgeGripMorph new
 target: ex2;
 edgeName: #bottom;
 fitTargetOwner: true;
 on: #mouseDown send: #expandedSizingRigid to: ex2.
sp3 := EdgeGripMorph new
 target: ex3;
 edgeName: #bottom;
 fitTargetOwner: true;
 on: #mouseDown send: #expandedSizingRigid to: ex3.
ex1 announcer on: ExpanderMorphAnnouncement do: [:ann |
 sp1
  visible: ann expanderMorph expanded;
  disableTableLayout: ann expanderMorph expanded not].
ex2 announcer on: ExpanderMorphAnnouncement do: [:ann |
 sp2
  visible: ann expanderMorph expanded;
  disableTableLayout: ann expanderMorph expanded not].
ex3 announcer on: ExpanderMorphAnnouncement do: [:ann |
 sp3
  visible: ann expanderMorph expanded;
  disableTableLayout: ann expanderMorph expanded not].
container := UITheme builder newColumn: {
 ex1.
 sp1.
 ex2.
 sp2.
 ex3.
 sp3.
 ex4}.
container cellInset: 0.
container extent: 400@400.
container openInWindow.




Once people are happy with it I'll wrap thing up into a new morph that
takes the burdensome details away (ExpanderGroupMorph or something like
that).
Later, like tabs, ability to add/remove sections dynamically etc.

Regards, Gary

----- Original Message -----
From: "Gary Chambers" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, January 25, 2011 3:07 PM
Subject: Re: [Pharo-project] collapsing panes


> I'm working on it... changeset soon...
>
> Regards, Gary
>
> ----- Original Message -----
> From: "Tudor Girba" <[hidden email]>
> To: <[hidden email]>
> Sent: Tuesday, January 25, 2011 2:15 PM
> Subject: Re: [Pharo-project] collapsing panes
>
>
> Ahh, indeed! My bad. Thanks Gary.
>
> The main issue that seems to be left is the resizing. Currently, resizing
> propagates the changes to all the following morphs. This is great when the
> table layout is inside a GeneralScrollPane, but it leads to a bit of an
> odd behavior when stretching inside a bounded morph. Is there an easy
> option to change the behavior of the resizer?
>
> Cheers,
> Doru
>
>
>
> On 25 Jan 2011, at 12:07, Gary Chambers wrote:
>
>> Hi Doru,
>>
>> The weight should be applied to the expanders themselves...
>>
>>
>> ex1 := (UITheme builder newExpander: 'Red' for: morph1)
>> spaceFillWeight: 1;
>> expanded: true.
>> ex2 := (UITheme builder newExpander: 'Blue'  for: morph2)
>> spaceFillWeight: 2;
>> expanded: true.
>> ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3)
>> spaceFillWeight: 3;
>> expanded: true.
>>
>> Regards, Gary
>>
>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Monday, January 24, 2011 9:14 PM
>> Subject: Re: [Pharo-project] collapsing panes
>>
>>
>> Hi Gary,
>>
>> On 24 Jan 2011, at 16:16, Gary Chambers wrote:
>>
>>> 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:)
>>
>> I tried to use it, but I get no effect when I use it in your example.
>>
>> Below is one of my trouts (added spaceFillWeight: 10 to morph2). What am
>> I doing wrong?
>>
>> | 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;
>> spaceFillWeight: 10.
>> 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.
>>
>> Cheers,
>> Doru
>>
>>
>>
>>> Regards, Gary
>>>
>>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>>> To: <[hidden email]>
>>> 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"
>>>>> <[hidden email]>
>>>>> To: "[hidden email] Development"
>>>>> <[hidden email]>
>>>>> 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."
>>>
>>>
>>>
>>>
>>>
>>
>> --
>> www.tudorgirba.com
>>
>> "Problem solving efficiency grows with the abstractness level of problem
>> understanding."
>>
>>
>>
>>
>>
>
> --
> www.tudorgirba.com
>
> "There are no old things, there are only old ways of looking at them."
>
>
>
>
>

ExpanderTweak.2.cs (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: collapsing panes

Tudor Girba
In reply to this post by Gary Chambers-4
It's really great working with you :)

Cheers,
Doru


On 25 Jan 2011, at 16:07, Gary Chambers wrote:

> I'm working on it... changeset soon...
>
> Regards, Gary
>
> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
> To: <[hidden email]>
> Sent: Tuesday, January 25, 2011 2:15 PM
> Subject: Re: [Pharo-project] collapsing panes
>
>
> Ahh, indeed! My bad. Thanks Gary.
>
> The main issue that seems to be left is the resizing. Currently, resizing propagates the changes to all the following morphs. This is great when the table layout is inside a GeneralScrollPane, but it leads to a bit of an odd behavior when stretching inside a bounded morph. Is there an easy option to change the behavior of the resizer?
>
> Cheers,
> Doru
>
>
>
> On 25 Jan 2011, at 12:07, Gary Chambers wrote:
>
>> Hi Doru,
>>
>> The weight should be applied to the expanders themselves...
>>
>>
>> ex1 := (UITheme builder newExpander: 'Red' for: morph1)
>> spaceFillWeight: 1;
>> expanded: true.
>> ex2 := (UITheme builder newExpander: 'Blue'  for: morph2)
>> spaceFillWeight: 2;
>> expanded: true.
>> ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3)
>> spaceFillWeight: 3;
>> expanded: true.
>>
>> Regards, Gary
>>
>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Monday, January 24, 2011 9:14 PM
>> Subject: Re: [Pharo-project] collapsing panes
>>
>>
>> Hi Gary,
>>
>> On 24 Jan 2011, at 16:16, Gary Chambers wrote:
>>
>>> 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:)
>>
>> I tried to use it, but I get no effect when I use it in your example.
>>
>> Below is one of my trouts (added spaceFillWeight: 10 to morph2). What am I doing wrong?
>>
>> | 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;
>> spaceFillWeight: 10.
>> 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.
>>
>> Cheers,
>> Doru
>>
>>
>>
>>> Regards, Gary
>>>
>>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>>> To: <[hidden email]>
>>> 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" <[hidden email]>
>>>>> To: "[hidden email] Development" <[hidden email]>
>>>>> 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."
>>>
>>>
>>>
>>>
>>>
>>
>> --
>> www.tudorgirba.com
>>
>> "Problem solving efficiency grows with the abstractness level of problem understanding."
>>
>>
>>
>>
>>
>
> --
> www.tudorgirba.com
>
> "There are no old things, there are only old ways of looking at them."
>
>
>
>
>

--
www.tudorgirba.com

"Sometimes the best solution is not the best solution."


Reply | Threaded
Open this post in threaded view
|

Re: collapsing panes

Gary Chambers-4
Ta, no problem!

Not quite perfect though... expanding after manual resize of an upper one
won't fill properly.
Unfortunately that's the limit with Morphic as it stands.
There's no concept of "desired extent" (which would normally be like extent
when rigid but slightly flexible)...

It would be nice to have layout etc. totally redone, perhaps based on the
Xwindows model... a big job
though that would probably benefit from a new (lowish level)  UI
framework... along with
Cairo/Rome etc.

Regards, Gary

----- Original Message -----
From: "Tudor Girba" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, January 25, 2011 3:33 PM
Subject: Re: [Pharo-project] collapsing panes


It's really great working with you :)

Cheers,
Doru


On 25 Jan 2011, at 16:07, Gary Chambers wrote:

> I'm working on it... changeset soon...
>
> Regards, Gary
>
> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
> To: <[hidden email]>
> Sent: Tuesday, January 25, 2011 2:15 PM
> Subject: Re: [Pharo-project] collapsing panes
>
>
> Ahh, indeed! My bad. Thanks Gary.
>
> The main issue that seems to be left is the resizing. Currently, resizing
> propagates the changes to all the following morphs. This is great when the
> table layout is inside a GeneralScrollPane, but it leads to a bit of an
> odd behavior when stretching inside a bounded morph. Is there an easy
> option to change the behavior of the resizer?
>
> Cheers,
> Doru
>
>
>
> On 25 Jan 2011, at 12:07, Gary Chambers wrote:
>
>> Hi Doru,
>>
>> The weight should be applied to the expanders themselves...
>>
>>
>> ex1 := (UITheme builder newExpander: 'Red' for: morph1)
>> spaceFillWeight: 1;
>> expanded: true.
>> ex2 := (UITheme builder newExpander: 'Blue'  for: morph2)
>> spaceFillWeight: 2;
>> expanded: true.
>> ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3)
>> spaceFillWeight: 3;
>> expanded: true.
>>
>> Regards, Gary
>>
>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Monday, January 24, 2011 9:14 PM
>> Subject: Re: [Pharo-project] collapsing panes
>>
>>
>> Hi Gary,
>>
>> On 24 Jan 2011, at 16:16, Gary Chambers wrote:
>>
>>> 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:)
>>
>> I tried to use it, but I get no effect when I use it in your example.
>>
>> Below is one of my trouts (added spaceFillWeight: 10 to morph2). What am
>> I doing wrong?
>>
>> | 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;
>> spaceFillWeight: 10.
>> 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.
>>
>> Cheers,
>> Doru
>>
>>
>>
>>> Regards, Gary
>>>
>>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>>> To: <[hidden email]>
>>> 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"
>>>>> <[hidden email]>
>>>>> To: "[hidden email] Development"
>>>>> <[hidden email]>
>>>>> 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."
>>>
>>>
>>>
>>>
>>>
>>
>> --
>> www.tudorgirba.com
>>
>> "Problem solving efficiency grows with the abstractness level of problem
>> understanding."
>>
>>
>>
>>
>>
>
> --
> www.tudorgirba.com
>
> "There are no old things, there are only old ways of looking at them."
>
>
>
>
>

--
www.tudorgirba.com

"Sometimes the best solution is not the best solution."



Reply | Threaded
Open this post in threaded view
|

Re: collapsing panes

Tudor Girba
In reply to this post by Gary Chambers-4
Hi Gary,

I tried it but there does not seem to be any difference. Resizing the red morph leads to resizing all other panes. Resizing the yellow pane, affects only yellow and green.

Am I looking at the wrong thing?

In any case, going towards Announcements in Morphic is really cool.


Cheers,
Doru


On 25 Jan 2011, at 16:31, Gary Chambers wrote:

> OK, try the following, after filing in attached change set,
> I've had a dabble with announcements too ;-) ...
>
>
> | container morph1 morph2 morph3 morph4 ex1 ex2 ex3 ex4 sp1 sp2 sp3|
> 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.
> morph4 := (PanelMorph new fillStyle: (SolidFillStyle color: Color green)) hResizing: #spaceFill; vResizing: #spaceFill.
> ex1 := (UITheme builder newExpander: 'Red' for: morph1) spaceFillWeight: 1; expanded: true.
> ex2 := (UITheme builder newExpander: 'Blue'  for: morph2) spaceFillWeight: 2; expanded: true.
> ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3) spaceFillWeight: 3; expanded: true.
> ex4 := (UITheme builder newExpander: 'Green'  for: morph4) spaceFillWeight: 4; expanded: true.
> sp1 := EdgeGripMorph new
> target: ex1;
> edgeName: #bottom;
> fitTargetOwner: true;
> on: #mouseDown send: #expandedSizingRigid to: ex1.
> sp2 := EdgeGripMorph new
> target: ex2;
> edgeName: #bottom;
> fitTargetOwner: true;
> on: #mouseDown send: #expandedSizingRigid to: ex2.
> sp3 := EdgeGripMorph new
> target: ex3;
> edgeName: #bottom;
> fitTargetOwner: true;
> on: #mouseDown send: #expandedSizingRigid to: ex3.
> ex1 announcer on: ExpanderMorphAnnouncement do: [:ann |
> sp1
> visible: ann expanderMorph expanded;
> disableTableLayout: ann expanderMorph expanded not].
> ex2 announcer on: ExpanderMorphAnnouncement do: [:ann |
> sp2
> visible: ann expanderMorph expanded;
> disableTableLayout: ann expanderMorph expanded not].
> ex3 announcer on: ExpanderMorphAnnouncement do: [:ann |
> sp3
> visible: ann expanderMorph expanded;
> disableTableLayout: ann expanderMorph expanded not].
> container := UITheme builder newColumn: {
> ex1.
> sp1.
> ex2.
> sp2.
> ex3.
> sp3.
> ex4}.
> container cellInset: 0.
> container extent: 400@400.
> container openInWindow.
>
>
>
>
> Once people are happy with it I'll wrap thing up into a new morph that
> takes the burdensome details away (ExpanderGroupMorph or something like that).
> Later, like tabs, ability to add/remove sections dynamically etc.
>
> Regards, Gary
>
> ----- Original Message ----- From: "Gary Chambers" <[hidden email]>
> To: <[hidden email]>
> Sent: Tuesday, January 25, 2011 3:07 PM
> Subject: Re: [Pharo-project] collapsing panes
>
>
>> I'm working on it... changeset soon...
>>
>> Regards, Gary
>>
>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Tuesday, January 25, 2011 2:15 PM
>> Subject: Re: [Pharo-project] collapsing panes
>>
>>
>> Ahh, indeed! My bad. Thanks Gary.
>>
>> The main issue that seems to be left is the resizing. Currently, resizing propagates the changes to all the following morphs. This is great when the table layout is inside a GeneralScrollPane, but it leads to a bit of an odd behavior when stretching inside a bounded morph. Is there an easy option to change the behavior of the resizer?
>>
>> Cheers,
>> Doru
>>
>>
>>
>> On 25 Jan 2011, at 12:07, Gary Chambers wrote:
>>
>>> Hi Doru,
>>>
>>> The weight should be applied to the expanders themselves...
>>>
>>>
>>> ex1 := (UITheme builder newExpander: 'Red' for: morph1)
>>> spaceFillWeight: 1;
>>> expanded: true.
>>> ex2 := (UITheme builder newExpander: 'Blue'  for: morph2)
>>> spaceFillWeight: 2;
>>> expanded: true.
>>> ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3)
>>> spaceFillWeight: 3;
>>> expanded: true.
>>>
>>> Regards, Gary
>>>
>>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>>> To: <[hidden email]>
>>> Sent: Monday, January 24, 2011 9:14 PM
>>> Subject: Re: [Pharo-project] collapsing panes
>>>
>>>
>>> Hi Gary,
>>>
>>> On 24 Jan 2011, at 16:16, Gary Chambers wrote:
>>>
>>>> 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:)
>>>
>>> I tried to use it, but I get no effect when I use it in your example.
>>>
>>> Below is one of my trouts (added spaceFillWeight: 10 to morph2). What am I doing wrong?
>>>
>>> | 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;
>>> spaceFillWeight: 10.
>>> 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.
>>>
>>> Cheers,
>>> Doru
>>>
>>>
>>>
>>>> Regards, Gary
>>>>
>>>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>>>> To: <[hidden email]>
>>>> 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" <[hidden email]>
>>>>>> To: "[hidden email] Development" <[hidden email]>
>>>>>> 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."
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>> www.tudorgirba.com
>>>
>>> "Problem solving efficiency grows with the abstractness level of problem understanding."
>>>
>>>
>>>
>>>
>>>
>>
>> --
>> www.tudorgirba.com
>>
>> "There are no old things, there are only old ways of looking at them."
>>
>>
>>
>>
> <ExpanderTweak.2.cs>

--
www.tudorgirba.com

"One cannot do more than one can do."




Reply | Threaded
Open this post in threaded view
|

Re: collapsing panes

Gary Chambers-4
Indeed, the point being that when resizing, the lower panes running outside
the container is
prevented.

Initially, all panes are in spaceFill mode, weight accounted for.
Upon manual resizing the affected pane becomes rigid.
Contracting an expander will reset the the associated pane to spaceFill
such that, when re-expanded it scales again..

Regards, Gary

----- Original Message -----
From: "Tudor Girba" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, January 25, 2011 3:40 PM
Subject: Re: [Pharo-project] collapsing panes


Hi Gary,

I tried it but there does not seem to be any difference. Resizing the red
morph leads to resizing all other panes. Resizing the yellow pane, affects
only yellow and green.

Am I looking at the wrong thing?

In any case, going towards Announcements in Morphic is really cool.


Cheers,
Doru


On 25 Jan 2011, at 16:31, Gary Chambers wrote:

> OK, try the following, after filing in attached change set,
> I've had a dabble with announcements too ;-) ...
>
>
> | container morph1 morph2 morph3 morph4 ex1 ex2 ex3 ex4 sp1 sp2 sp3|
> 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.
> morph4 := (PanelMorph new fillStyle: (SolidFillStyle color: Color green))
> hResizing: #spaceFill; vResizing: #spaceFill.
> ex1 := (UITheme builder newExpander: 'Red' for: morph1) spaceFillWeight:
> 1; expanded: true.
> ex2 := (UITheme builder newExpander: 'Blue'  for: morph2) spaceFillWeight:
> 2; expanded: true.
> ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3)
> spaceFillWeight: 3; expanded: true.
> ex4 := (UITheme builder newExpander: 'Green'  for: morph4)
> spaceFillWeight: 4; expanded: true.
> sp1 := EdgeGripMorph new
> target: ex1;
> edgeName: #bottom;
> fitTargetOwner: true;
> on: #mouseDown send: #expandedSizingRigid to: ex1.
> sp2 := EdgeGripMorph new
> target: ex2;
> edgeName: #bottom;
> fitTargetOwner: true;
> on: #mouseDown send: #expandedSizingRigid to: ex2.
> sp3 := EdgeGripMorph new
> target: ex3;
> edgeName: #bottom;
> fitTargetOwner: true;
> on: #mouseDown send: #expandedSizingRigid to: ex3.
> ex1 announcer on: ExpanderMorphAnnouncement do: [:ann |
> sp1
> visible: ann expanderMorph expanded;
> disableTableLayout: ann expanderMorph expanded not].
> ex2 announcer on: ExpanderMorphAnnouncement do: [:ann |
> sp2
> visible: ann expanderMorph expanded;
> disableTableLayout: ann expanderMorph expanded not].
> ex3 announcer on: ExpanderMorphAnnouncement do: [:ann |
> sp3
> visible: ann expanderMorph expanded;
> disableTableLayout: ann expanderMorph expanded not].
> container := UITheme builder newColumn: {
> ex1.
> sp1.
> ex2.
> sp2.
> ex3.
> sp3.
> ex4}.
> container cellInset: 0.
> container extent: 400@400.
> container openInWindow.
>
>
>
>
> Once people are happy with it I'll wrap thing up into a new morph that
> takes the burdensome details away (ExpanderGroupMorph or something like
> that).
> Later, like tabs, ability to add/remove sections dynamically etc.
>
> Regards, Gary
>
> ----- Original Message ----- From: "Gary Chambers"
> <[hidden email]>
> To: <[hidden email]>
> Sent: Tuesday, January 25, 2011 3:07 PM
> Subject: Re: [Pharo-project] collapsing panes
>
>
>> I'm working on it... changeset soon...
>>
>> Regards, Gary
>>
>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Tuesday, January 25, 2011 2:15 PM
>> Subject: Re: [Pharo-project] collapsing panes
>>
>>
>> Ahh, indeed! My bad. Thanks Gary.
>>
>> The main issue that seems to be left is the resizing. Currently, resizing
>> propagates the changes to all the following morphs. This is great when
>> the table layout is inside a GeneralScrollPane, but it leads to a bit of
>> an odd behavior when stretching inside a bounded morph. Is there an easy
>> option to change the behavior of the resizer?
>>
>> Cheers,
>> Doru
>>
>>
>>
>> On 25 Jan 2011, at 12:07, Gary Chambers wrote:
>>
>>> Hi Doru,
>>>
>>> The weight should be applied to the expanders themselves...
>>>
>>>
>>> ex1 := (UITheme builder newExpander: 'Red' for: morph1)
>>> spaceFillWeight: 1;
>>> expanded: true.
>>> ex2 := (UITheme builder newExpander: 'Blue'  for: morph2)
>>> spaceFillWeight: 2;
>>> expanded: true.
>>> ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3)
>>> spaceFillWeight: 3;
>>> expanded: true.
>>>
>>> Regards, Gary
>>>
>>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>>> To: <[hidden email]>
>>> Sent: Monday, January 24, 2011 9:14 PM
>>> Subject: Re: [Pharo-project] collapsing panes
>>>
>>>
>>> Hi Gary,
>>>
>>> On 24 Jan 2011, at 16:16, Gary Chambers wrote:
>>>
>>>> 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:)
>>>
>>> I tried to use it, but I get no effect when I use it in your example.
>>>
>>> Below is one of my trouts (added spaceFillWeight: 10 to morph2). What am
>>> I doing wrong?
>>>
>>> | 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;
>>> spaceFillWeight: 10.
>>> 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.
>>>
>>> Cheers,
>>> Doru
>>>
>>>
>>>
>>>> Regards, Gary
>>>>
>>>> ----- Original Message ----- From: "Tudor Girba"
>>>> <[hidden email]>
>>>> To: <[hidden email]>
>>>> 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"
>>>>>> <[hidden email]>
>>>>>> To: "[hidden email] Development"
>>>>>> <[hidden email]>
>>>>>> 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."
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>> www.tudorgirba.com
>>>
>>> "Problem solving efficiency grows with the abstractness level of problem
>>> understanding."
>>>
>>>
>>>
>>>
>>>
>>
>> --
>> www.tudorgirba.com
>>
>> "There are no old things, there are only old ways of looking at them."
>>
>>
>>
>>
> <ExpanderTweak.2.cs>

--
www.tudorgirba.com

"One cannot do more than one can do."





Reply | Threaded
Open this post in threaded view
|

Re: collapsing panes

Gary Chambers-4
In reply to this post by Gary Chambers-4
Once wrapped in a more specific class, a workaround will be possible to
maintain
the integrity of the layout.

Regards, Gary

----- Original Message -----
From: "Gary Chambers" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, January 25, 2011 3:40 PM
Subject: Re: [Pharo-project] collapsing panes


> Ta, no problem!
>
> Not quite perfect though... expanding after manual resize of an upper one
> won't fill properly.
> Unfortunately that's the limit with Morphic as it stands.
> There's no concept of "desired extent" (which would normally be like
> extent when rigid but slightly flexible)...
>
> It would be nice to have layout etc. totally redone, perhaps based on the
> Xwindows model... a big job
> though that would probably benefit from a new (lowish level)  UI
> framework... along with
> Cairo/Rome etc.
>
> Regards, Gary
>
> ----- Original Message -----
> From: "Tudor Girba" <[hidden email]>
> To: <[hidden email]>
> Sent: Tuesday, January 25, 2011 3:33 PM
> Subject: Re: [Pharo-project] collapsing panes
>
>
> It's really great working with you :)
>
> Cheers,
> Doru
>
>
> On 25 Jan 2011, at 16:07, Gary Chambers wrote:
>
>> I'm working on it... changeset soon...
>>
>> Regards, Gary
>>
>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Tuesday, January 25, 2011 2:15 PM
>> Subject: Re: [Pharo-project] collapsing panes
>>
>>
>> Ahh, indeed! My bad. Thanks Gary.
>>
>> The main issue that seems to be left is the resizing. Currently, resizing
>> propagates the changes to all the following morphs. This is great when
>> the table layout is inside a GeneralScrollPane, but it leads to a bit of
>> an odd behavior when stretching inside a bounded morph. Is there an easy
>> option to change the behavior of the resizer?
>>
>> Cheers,
>> Doru
>>
>>
>>
>> On 25 Jan 2011, at 12:07, Gary Chambers wrote:
>>
>>> Hi Doru,
>>>
>>> The weight should be applied to the expanders themselves...
>>>
>>>
>>> ex1 := (UITheme builder newExpander: 'Red' for: morph1)
>>> spaceFillWeight: 1;
>>> expanded: true.
>>> ex2 := (UITheme builder newExpander: 'Blue'  for: morph2)
>>> spaceFillWeight: 2;
>>> expanded: true.
>>> ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3)
>>> spaceFillWeight: 3;
>>> expanded: true.
>>>
>>> Regards, Gary
>>>
>>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>>> To: <[hidden email]>
>>> Sent: Monday, January 24, 2011 9:14 PM
>>> Subject: Re: [Pharo-project] collapsing panes
>>>
>>>
>>> Hi Gary,
>>>
>>> On 24 Jan 2011, at 16:16, Gary Chambers wrote:
>>>
>>>> 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:)
>>>
>>> I tried to use it, but I get no effect when I use it in your example.
>>>
>>> Below is one of my trouts (added spaceFillWeight: 10 to morph2). What am
>>> I doing wrong?
>>>
>>> | 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;
>>> spaceFillWeight: 10.
>>> 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.
>>>
>>> Cheers,
>>> Doru
>>>
>>>
>>>
>>>> Regards, Gary
>>>>
>>>> ----- Original Message ----- From: "Tudor Girba"
>>>> <[hidden email]>
>>>> To: <[hidden email]>
>>>> 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"
>>>>>> <[hidden email]>
>>>>>> To: "[hidden email] Development"
>>>>>> <[hidden email]>
>>>>>> 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."
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>> www.tudorgirba.com
>>>
>>> "Problem solving efficiency grows with the abstractness level of problem
>>> understanding."
>>>
>>>
>>>
>>>
>>>
>>
>> --
>> www.tudorgirba.com
>>
>> "There are no old things, there are only old ways of looking at them."
>>
>>
>>
>>
>>
>
> --
> www.tudorgirba.com
>
> "Sometimes the best solution is not the best solution."
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: collapsing panes

Gary Chambers-4
Once wrapped, we could have the panes that are not being resized reverted to
their spaceFill mode...

Regards, Gary

----- Original Message -----
From: "Gary Chambers" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, January 25, 2011 3:52 PM
Subject: Re: [Pharo-project] collapsing panes


> Once wrapped in a more specific class, a workaround will be possible to
> maintain
> the integrity of the layout.
>
> Regards, Gary
>
> ----- Original Message -----
> From: "Gary Chambers" <[hidden email]>
> To: <[hidden email]>
> Sent: Tuesday, January 25, 2011 3:40 PM
> Subject: Re: [Pharo-project] collapsing panes
>
>
>> Ta, no problem!
>>
>> Not quite perfect though... expanding after manual resize of an upper one
>> won't fill properly.
>> Unfortunately that's the limit with Morphic as it stands.
>> There's no concept of "desired extent" (which would normally be like
>> extent when rigid but slightly flexible)...
>>
>> It would be nice to have layout etc. totally redone, perhaps based on the
>> Xwindows model... a big job
>> though that would probably benefit from a new (lowish level)  UI
>> framework... along with
>> Cairo/Rome etc.
>>
>> Regards, Gary
>>
>> ----- Original Message -----
>> From: "Tudor Girba" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Tuesday, January 25, 2011 3:33 PM
>> Subject: Re: [Pharo-project] collapsing panes
>>
>>
>> It's really great working with you :)
>>
>> Cheers,
>> Doru
>>
>>
>> On 25 Jan 2011, at 16:07, Gary Chambers wrote:
>>
>>> I'm working on it... changeset soon...
>>>
>>> Regards, Gary
>>>
>>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>>> To: <[hidden email]>
>>> Sent: Tuesday, January 25, 2011 2:15 PM
>>> Subject: Re: [Pharo-project] collapsing panes
>>>
>>>
>>> Ahh, indeed! My bad. Thanks Gary.
>>>
>>> The main issue that seems to be left is the resizing. Currently,
>>> resizing propagates the changes to all the following morphs. This is
>>> great when the table layout is inside a GeneralScrollPane, but it leads
>>> to a bit of an odd behavior when stretching inside a bounded morph. Is
>>> there an easy option to change the behavior of the resizer?
>>>
>>> Cheers,
>>> Doru
>>>
>>>
>>>
>>> On 25 Jan 2011, at 12:07, Gary Chambers wrote:
>>>
>>>> Hi Doru,
>>>>
>>>> The weight should be applied to the expanders themselves...
>>>>
>>>>
>>>> ex1 := (UITheme builder newExpander: 'Red' for: morph1)
>>>> spaceFillWeight: 1;
>>>> expanded: true.
>>>> ex2 := (UITheme builder newExpander: 'Blue'  for: morph2)
>>>> spaceFillWeight: 2;
>>>> expanded: true.
>>>> ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3)
>>>> spaceFillWeight: 3;
>>>> expanded: true.
>>>>
>>>> Regards, Gary
>>>>
>>>> ----- Original Message ----- From: "Tudor Girba"
>>>> <[hidden email]>
>>>> To: <[hidden email]>
>>>> Sent: Monday, January 24, 2011 9:14 PM
>>>> Subject: Re: [Pharo-project] collapsing panes
>>>>
>>>>
>>>> Hi Gary,
>>>>
>>>> On 24 Jan 2011, at 16:16, Gary Chambers wrote:
>>>>
>>>>> 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:)
>>>>
>>>> I tried to use it, but I get no effect when I use it in your example.
>>>>
>>>> Below is one of my trouts (added spaceFillWeight: 10 to morph2). What
>>>> am I doing wrong?
>>>>
>>>> | 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;
>>>> spaceFillWeight: 10.
>>>> 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.
>>>>
>>>> Cheers,
>>>> Doru
>>>>
>>>>
>>>>
>>>>> Regards, Gary
>>>>>
>>>>> ----- Original Message ----- From: "Tudor Girba"
>>>>> <[hidden email]>
>>>>> To: <[hidden email]>
>>>>> 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"
>>>>>>> <[hidden email]>
>>>>>>> To: "[hidden email] Development"
>>>>>>> <[hidden email]>
>>>>>>> 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."
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> www.tudorgirba.com
>>>>
>>>> "Problem solving efficiency grows with the abstractness level of
>>>> problem understanding."
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>> www.tudorgirba.com
>>>
>>> "There are no old things, there are only old ways of looking at them."
>>>
>>>
>>>
>>>
>>>
>>
>> --
>> www.tudorgirba.com
>>
>> "Sometimes the best solution is not the best solution."
>>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: collapsing panes

Stéphane Ducasse
In reply to this post by Gary Chambers-4
I love to hear that kind of news.
In addition, I think that we should really get rid of toolBuilder because it will not support new ui elements.

Stef

On Jan 25, 2011, at 4:31 PM, Gary Chambers wrote:

> OK, try the following, after filing in attached change set,
> I've had a dabble with announcements too ;-) ...
>
>
> | container morph1 morph2 morph3 morph4 ex1 ex2 ex3 ex4 sp1 sp2 sp3|
> 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.
> morph4 := (PanelMorph new fillStyle: (SolidFillStyle color: Color green)) hResizing: #spaceFill; vResizing: #spaceFill.
> ex1 := (UITheme builder newExpander: 'Red' for: morph1) spaceFillWeight: 1; expanded: true.
> ex2 := (UITheme builder newExpander: 'Blue'  for: morph2) spaceFillWeight: 2; expanded: true.
> ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3) spaceFillWeight: 3; expanded: true.
> ex4 := (UITheme builder newExpander: 'Green'  for: morph4) spaceFillWeight: 4; expanded: true.
> sp1 := EdgeGripMorph new
> target: ex1;
> edgeName: #bottom;
> fitTargetOwner: true;
> on: #mouseDown send: #expandedSizingRigid to: ex1.
> sp2 := EdgeGripMorph new
> target: ex2;
> edgeName: #bottom;
> fitTargetOwner: true;
> on: #mouseDown send: #expandedSizingRigid to: ex2.
> sp3 := EdgeGripMorph new
> target: ex3;
> edgeName: #bottom;
> fitTargetOwner: true;
> on: #mouseDown send: #expandedSizingRigid to: ex3.
> ex1 announcer on: ExpanderMorphAnnouncement do: [:ann |
> sp1
> visible: ann expanderMorph expanded;
> disableTableLayout: ann expanderMorph expanded not].
> ex2 announcer on: ExpanderMorphAnnouncement do: [:ann |
> sp2
> visible: ann expanderMorph expanded;
> disableTableLayout: ann expanderMorph expanded not].
> ex3 announcer on: ExpanderMorphAnnouncement do: [:ann |
> sp3
> visible: ann expanderMorph expanded;
> disableTableLayout: ann expanderMorph expanded not].
> container := UITheme builder newColumn: {
> ex1.
> sp1.
> ex2.
> sp2.
> ex3.
> sp3.
> ex4}.
> container cellInset: 0.
> container extent: 400@400.
> container openInWindow.
>
>
>
>
> Once people are happy with it I'll wrap thing up into a new morph that
> takes the burdensome details away (ExpanderGroupMorph or something like that).
> Later, like tabs, ability to add/remove sections dynamically etc.
>
> Regards, Gary
>
> ----- Original Message ----- From: "Gary Chambers" <[hidden email]>
> To: <[hidden email]>
> Sent: Tuesday, January 25, 2011 3:07 PM
> Subject: Re: [Pharo-project] collapsing panes
>
>
>> I'm working on it... changeset soon...
>>
>> Regards, Gary
>>
>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Tuesday, January 25, 2011 2:15 PM
>> Subject: Re: [Pharo-project] collapsing panes
>>
>>
>> Ahh, indeed! My bad. Thanks Gary.
>>
>> The main issue that seems to be left is the resizing. Currently, resizing propagates the changes to all the following morphs. This is great when the table layout is inside a GeneralScrollPane, but it leads to a bit of an odd behavior when stretching inside a bounded morph. Is there an easy option to change the behavior of the resizer?
>>
>> Cheers,
>> Doru
>>
>>
>>
>> On 25 Jan 2011, at 12:07, Gary Chambers wrote:
>>
>>> Hi Doru,
>>>
>>> The weight should be applied to the expanders themselves...
>>>
>>>
>>> ex1 := (UITheme builder newExpander: 'Red' for: morph1)
>>> spaceFillWeight: 1;
>>> expanded: true.
>>> ex2 := (UITheme builder newExpander: 'Blue'  for: morph2)
>>> spaceFillWeight: 2;
>>> expanded: true.
>>> ex3 := (UITheme builder newExpander: 'Yellow'  for: morph3)
>>> spaceFillWeight: 3;
>>> expanded: true.
>>>
>>> Regards, Gary
>>>
>>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>>> To: <[hidden email]>
>>> Sent: Monday, January 24, 2011 9:14 PM
>>> Subject: Re: [Pharo-project] collapsing panes
>>>
>>>
>>> Hi Gary,
>>>
>>> On 24 Jan 2011, at 16:16, Gary Chambers wrote:
>>>
>>>> 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:)
>>>
>>> I tried to use it, but I get no effect when I use it in your example.
>>>
>>> Below is one of my trouts (added spaceFillWeight: 10 to morph2). What am I doing wrong?
>>>
>>> | 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;
>>> spaceFillWeight: 10.
>>> 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.
>>>
>>> Cheers,
>>> Doru
>>>
>>>
>>>
>>>> Regards, Gary
>>>>
>>>> ----- Original Message ----- From: "Tudor Girba" <[hidden email]>
>>>> To: <[hidden email]>
>>>> 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" <[hidden email]>
>>>>>> To: "[hidden email] Development" <[hidden email]>
>>>>>> 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."
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>> www.tudorgirba.com
>>>
>>> "Problem solving efficiency grows with the abstractness level of problem understanding."
>>>
>>>
>>>
>>>
>>>
>>
>> --
>> www.tudorgirba.com
>>
>> "There are no old things, there are only old ways of looking at them."
>>
>>
>>
>>
> <ExpanderTweak.2.cs>