[COTDC] 42 - ExpanderMorphContracted

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

[COTDC] 42 - ExpanderMorphContracted

laurent laffont
Today:  ExpanderMorphContracted


Comment Of The Day Contest - One Day One Comment
Rules: 
#1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s).
#2: If you cannot comment it, deprecate it.
Laurent
Reply | Threaded
Open this post in threaded view
|

Re: [COTDC] 42 - ExpanderMorphContracted

Gary Chambers-4

"I am an Announcement that occurs when an ExpanderMorph is contracted (rolled-up).
 
Example where visibility of another UI component depends on the expanded/contracted state of Expander 2
 
|builder expanders ex1 ex2 text list row|
builder := UITheme builder.
expanders := builder newColumn: {
 ex1 := builder newExpander: 'Expander 1'.
 ex2 := builder newExpander: 'Expander 2'}.
expanders
 width: 100;
 hResizing: #rigid.
text := builder
 newTextEditorFor: (ValueHolder new contents: 'Some text')
 getText: #contents setText: #contents:.
list := (builder
 newListFor: (ListModel new list: #('One' 'Two' 'Three' 'Four'); selectionIndex: 3)
 list: #list selected: #selectionIndex changeSelected: #selectionIndex:
 help: 'This is a list')
  minWidth: 120;
  visible: false;
  disableTableLayout: true.
ex2 announcer
 when: ExpanderMorphContracted do: [list hide; disableTableLayout: true];
 when: ExpanderMorphExpanded do: [list show; disableTableLayout: false].
row := builder newRow: {
 expanders.
 (builder newRow: {text. list})
  vResizing: #spaceFill}.
(row openInWindowLabeled: 'Expander Announcements Example') extent: [hidden email]
 
"

Regards, Gary
----- Original Message -----
Sent: Tuesday, April 05, 2011 7:32 PM
Subject: [Pharo-project] [COTDC] 42 - ExpanderMorphContracted

Today:  ExpanderMorphContracted


Comment Of The Day Contest - One Day One Comment
Rules: 
#1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s).
#2: If you cannot comment it, deprecate it.
Laurent
Reply | Threaded
Open this post in threaded view
|

Re: [COTDC] 42 - ExpanderMorphContracted

laurent laffont
Yeah coooool !

Laurent

On Wed, Apr 6, 2011 at 10:46 AM, Gary Chambers <[hidden email]> wrote:
"I am an Announcement that occurs when an ExpanderMorph is contracted (rolled-up).
 
Example where visibility of another UI component depends on the expanded/contracted state of Expander 2
 
|builder expanders ex1 ex2 text list row|
builder := UITheme builder.
expanders := builder newColumn: {
 ex1 := builder newExpander: 'Expander 1'.
 ex2 := builder newExpander: 'Expander 2'}.
expanders
 width: 100;
 hResizing: #rigid.
text := builder
 newTextEditorFor: (ValueHolder new contents: 'Some text')
 getText: #contents setText: #contents:.
list := (builder
 newListFor: (ListModel new list: #('One' 'Two' 'Three' 'Four'); selectionIndex: 3)
 list: #list selected: #selectionIndex changeSelected: #selectionIndex:
 help: 'This is a list')
  minWidth: 120;
  visible: false;
  disableTableLayout: true.
ex2 announcer
 when: ExpanderMorphContracted do: [list hide; disableTableLayout: true];
 when: ExpanderMorphExpanded do: [list show; disableTableLayout: false].
row := builder newRow: {
 expanders.
 (builder newRow: {text. list})
  vResizing: #spaceFill}.
(row openInWindowLabeled: 'Expander Announcements Example') extent: [hidden email]
 
"

Regards, Gary
----- Original Message -----
Sent: Tuesday, April 05, 2011 7:32 PM
Subject: [Pharo-project] [COTDC] 42 - ExpanderMorphContracted

Today:  ExpanderMorphContracted


Comment Of The Day Contest - One Day One Comment
Rules: 
#1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s).
#2: If you cannot comment it, deprecate it.
Laurent