-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #189 from pharo-graphics/dev
Updating Master from Dev
- Loading branch information
Showing
182 changed files
with
3,630 additions
and
2,278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
Class { | ||
#name : #ToPaneNodeExampleSkin, | ||
#superclass : #ToRawSkin, | ||
#instVars : [ | ||
'nodeButton' | ||
], | ||
#category : #'Toplo-Examples' | ||
} | ||
|
||
{ #category : #'event handling' } | ||
ToPaneNodeExampleSkin >> createNodeButton [ | ||
|
||
| label | | ||
label := ToLabel text: 'Do something'. | ||
" ensure that the button label skin will not receive selected skin event " | ||
label addStamp: #unselectable. | ||
nodeButton := ToButton new | ||
label: label; | ||
yourself. | ||
nodeButton whenClickedDo: [ :event | | ||
event consume. | ||
self inform: 'CLICK' ]. | ||
nodeButton constraintsDo: [ :c | | ||
c ignoreByLayout. | ||
c ignored horizontal alignRight ]. | ||
nodeButton position: 0 @ -5 | ||
] | ||
|
||
{ #category : #'event handling' } | ||
ToPaneNodeExampleSkin >> hoveredSkinEvent: anEvent [ | ||
|
||
super hoveredSkinEvent: anEvent. | ||
anEvent elementDo: [ :e | | ||
" hovered skin can be dispatched whereas no leaved look event has been dispatched | ||
(in case of click event as an example)" | ||
nodeButton ifNil: [ | ||
self createNodeButton. | ||
e addChild: nodeButton ] ] | ||
] | ||
|
||
{ #category : #'event handling' } | ||
ToPaneNodeExampleSkin >> installSkinEvent: anEvent [ | ||
|
||
super installSkinEvent: anEvent. | ||
anEvent elementDo: [ :e | | ||
| p1 p2 p3 | | ||
e beHorizontal. | ||
e | ||
clipChildren: false; | ||
outskirts: BlOutskirts outside; | ||
geometry: (BlRoundedRectangleGeometry cornerRadius: 4); | ||
margin: (BlInsets all: 6); | ||
padding: (BlInsets all: 6). | ||
|
||
p1 := ToPane vertical | ||
background: Color blue; | ||
width: 50; | ||
yourself. | ||
p2 := ToPane vertical | ||
background: (Color blue alpha: 0.6); | ||
width: 100; | ||
yourself. | ||
p3 := ToPane vertical | ||
background: (Color blue alpha: 0.3); | ||
hMatchParent; | ||
yourself. | ||
e addChildren: { | ||
p1. | ||
p2. | ||
p3 }. | ||
e height: 60. | ||
e hMatchParent ] | ||
] | ||
|
||
{ #category : #'event handling' } | ||
ToPaneNodeExampleSkin >> leavedSkinEvent: anEvent [ | ||
|
||
super leavedSkinEvent: anEvent. | ||
nodeButton ifNotNil: [ | ||
nodeButton removeFromParent. | ||
nodeButton := nil ] | ||
] |
Oops, something went wrong.