Skip to content

Commit

Permalink
+ ToListSelectionRepresentationOption
Browse files Browse the repository at this point in the history
  • Loading branch information
plantec committed Jan 24, 2025
1 parent b5a19b1 commit 6cae78e
Show file tree
Hide file tree
Showing 15 changed files with 547 additions and 261 deletions.
42 changes: 34 additions & 8 deletions src/Toplo-Examples/ToSandBox.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2126,7 +2126,7 @@ ToSandBox class >> example_SelectMonoNotFiltrable [
select placeholderText:
('Select a state' asRopedText foreground: Color red).
innerWindow := ToInnerWindow new.
select windowManager anchorRoot: innerWindow root.
select manager anchorRoot: innerWindow root.
select popupListElement withRowNumbers.
select width: 300.
select position: 50 @ 50.
Expand Down Expand Up @@ -2278,7 +2278,7 @@ ToSandBox class >> example_SelectMultiFiltrableNoWrappingKeepPickOrder [
select placeholderText:
('Select states' asRopedText foreground: Color red).
innerWindow := ToInnerWindow new.
select windowManager anchorRoot: innerWindow root.
select manager anchorRoot: innerWindow root.
select hMatchParent.
innerWindow pane addChild: select.
innerWindow height: 600.
Expand All @@ -2299,7 +2299,7 @@ ToSandBox class >> example_SelectMultiFiltrableNotWrappingAutoDistribution [
select placeholderText:
('Select states' asRopedText foreground: Color red).
innerWindow := ToInnerWindow new.
select windowManager anchorRoot: innerWindow root.
select manager anchorRoot: innerWindow root.
select hMatchParent.
innerWindow pane addChild: select.
innerWindow height: 600.
Expand Down Expand Up @@ -2333,7 +2333,7 @@ ToSandBox class >> example_SelectMultiFiltrableWithHideSelected [
| select innerWindow |
select := ToMultiSelectElement new.
select withCloseButton: true.
select popupListElement primarySelectionMode selectionOption masked:
select popupListElement selectionOption masked:
true.
select hideSelected: true.
select popupListElement dataAccessor updateAllWith:
Expand Down Expand Up @@ -2395,7 +2395,7 @@ ToSandBox class >> example_SelectMultiFiltrableWrappingAutoDistribution [
select placeholderText:
('Select states' asRopedText foreground: Color red).
innerWindow := ToInnerWindow new.
select windowManager anchorRoot: innerWindow root.
select manager anchorRoot: innerWindow root.
select hMatchParent.
innerWindow pane addChild: select.
innerWindow height: 600.
Expand Down Expand Up @@ -3194,6 +3194,18 @@ ToSandBox class >> example_TripletElementWithIconAndText_flexible_Interspace [
^ but
]

{ #category : #triplet }
ToSandBox class >> example_TripletElementWithIconAndText_startAlignment [

| but |
but := self example_TripletElementWithIconAndText.
but startAlignment: 50.
but border: Color red.
but vFitContent.
but hFitContent.
^ but
]

{ #category : #triplet }
ToSandBox class >> example_TripletElementWithIconAndText_startFlexible [

Expand Down Expand Up @@ -6940,6 +6952,19 @@ ToSandBox class >> listWithEditableAndContextMenu [
whenClickedDo: [ :event |
target hiddenSelecter deselectAll ];
yourself).
target primarySelectionMode selectionOption isMasked
ifTrue: [
menu addItem: (ToMenuItem new
labelText: 'stop primary selection masking';
whenClickedDo: [ :event |
target selectionOption masked: false ];
yourself) ]
ifFalse: [
menu addItem: (ToMenuItem new
labelText: 'start primary selection masking';
whenClickedDo: [ :event |
target selectionOption masked: true ];
yourself) ].
target primarySelectionMode selectionOption
isAnimated
ifTrue: [
Expand Down Expand Up @@ -6991,9 +7016,10 @@ ToSandBox class >> listWithEditableAndContextMenu [
selectionMenu addItem: (ToMenuItem new
labelText: 'Enable/Disable';
whenClickedDo: [ :event |
indexes do: [ :idx | | di |
di := (l nodeAt: idx) isDisabled.
(l nodeAt: idx) disabled: di not ] ];
indexes do: [ :idx |
| di |
di := (l nodeAt: idx) isDisabled.
(l nodeAt: idx) disabled: di not ] ];
yourself).
selectionMenu addItem: (ToMenuItem new
labelText: 'Set unselectable';
Expand Down
10 changes: 2 additions & 8 deletions src/Toplo-Widget-List/TToItem.trait.st
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ TToItem >> barOwner: anItemContainer [
self userData at: #barOwner put: anItemContainer
]

{ #category : #'t - item' }
TToItem >> barOwnerDo: aBlock [

self barOwner ifNotNil: [ :bo | aBlock value: bo ]
]

{ #category : #'t - item' }
TToItem >> ensuredItemConstraints [

Expand All @@ -62,7 +56,7 @@ TToItem >> flagAsDisabled: aBoolean [
TToItem >> hidden: aBoolean [

self storeHidden: aBoolean.
self barOwnerDo: [ :l |
self barElementDo: [ :l |
aBoolean
ifTrue: [ l hiddenItem: self ]
ifFalse: [ l visibleItem: self ] ]
Expand Down Expand Up @@ -115,7 +109,7 @@ TToItem >> storeUnselectable: aBoolean [
TToItem >> unselectable: aBoolean [

self storeUnselectable: aBoolean.
self barOwnerDo: [ :l |
self barElementDo: [ :l |
aBoolean
ifTrue: [ l unselectableItem: self ]
ifFalse: [ l selectableItem: self ] ]
Expand Down
Loading

0 comments on commit 6cae78e

Please sign in to comment.