Skip to content

Commit

Permalink
40521
Browse files Browse the repository at this point in the history
14420 What to do with Polymorph-Geometry
	https://pharo.fogbugz.com/f/cases/14420

14950 Spec help added to the Help Browser
	https://pharo.fogbugz.com/f/cases/14950

15013 enable recompile on run:with:in:
	https://pharo.fogbugz.com/f/cases/15013

15015 GradientFillStyle color selection broken
	https://pharo.fogbugz.com/f/cases/15015

http://files.pharo.org/image/40/40521.zip
  • Loading branch information
Jenkins Build Server authored and ci committed Feb 27, 2015
1 parent f4d7ae1 commit 4834e88
Show file tree
Hide file tree
Showing 66 changed files with 424 additions and 41 deletions.
Expand Up @@ -2,4 +2,4 @@ Shape subclass: #PathShape
instanceVariableNames: 'bounds vertices'
classVariableNames: ''
poolDictionaries: ''
category: 'Polymorph-Geometry'
category: 'Graphics-Shapes'
Expand Up @@ -2,4 +2,4 @@ PathShape subclass: #Polygon
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Polymorph-Geometry'
category: 'Graphics-Shapes'
Expand Up @@ -2,4 +2,4 @@ Object subclass: #Shape
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Polymorph-Geometry'
category: 'Graphics-Shapes'
@@ -1,6 +1,7 @@
changeColorOf: aMorph rampIndex: rampIndex
| originalColor |
originalColor := (colorRamp at: rampIndex) value.
UIManager default chooseColor: originalColor for: [:color |
UIManager default theme
chooseColorIn: World title: 'Color' color: originalColor for: [:color |
self changeColorAt: rampIndex to: color.
aMorph changed]
aMorph changed]
Expand Up @@ -10,6 +10,6 @@ testCreateReflectiveMethodAndInvalidate
self assert: (ReflectivityExamples>>#exampleMethod) class = ReflectiveMethod.
self assert: ReflectivityExamples new exampleMethod = 5.
self assert: (ReflectivityExamples>>#exampleMethod) class = CompiledMethod.
self assert: (ReflectivityExamples>>#exampleMethod) reflectiveMethod isNil.
(ReflectivityExamples>>#exampleMethod) reflectiveMethod: nil.


Expand Up @@ -4,6 +4,6 @@ testInvalidate
self assert: (ReflectivityExamples>>#exampleMethod) class = ReflectiveMethod.
self assert: ReflectivityExamples new exampleMethod = 5.
self assert: (ReflectivityExamples>>#exampleMethod) class = CompiledMethod.
self assert: (ReflectivityExamples>>#exampleMethod) reflectiveMethod isNil.
(ReflectivityExamples>>#exampleMethod) reflectiveMethod: nil.


@@ -1,4 +1,4 @@
testInvalidateWithLinCount
testInvalidateWithLinkCount
(ReflectivityExamples>>#exampleMethod) createTwin.
(ReflectivityExamples>>#exampleMethod) invalidate.
(ReflectivityExamples>>#exampleMethod) linkCount: 1.
Expand Down
@@ -1,2 +1,3 @@
recompileAST
self flag: #TBD. "compile the AST"
self flag: #TBD. "Here we need to use the transforming compiler pluging in the fututer"
compiledMethod := self ast generate: compiledMethod trailer.
@@ -1,7 +1,5 @@
run: aSelector with: anArray in: aReceiver
"we install the old one as the compiler might need it"
self methodClass basicAddSelector: self selector withMethod: compiledMethod.
self hasLinks
ifTrue: [self recompileAST. ]
ifFalse: [self destroyTwin].
self installCompiledMethod.
self recompileAST.
^compiledMethod valueWithReceiver: aReceiver arguments: anArray
@@ -1,3 +1,3 @@
destroyTwin
self methodClass basicAddSelector: self selector withMethod: compiledMethod.
self installCompiledMethod.
compiledMethod reflectiveMethod: nil.
@@ -0,0 +1,2 @@
installCompiledMethod
self methodClass basicAddSelector: self selector withMethod: compiledMethod.
@@ -1,4 +1,4 @@
script520
script521

^ 'AST-Core-TheIntegrator.268.mcz
AST-Interpreter-Core-TheIntegrator.137.mcz
Expand Down Expand Up @@ -68,28 +68,28 @@ FuelCommandLineHandler-TheIntegrator.27.mcz
FuelSystem-FileRegistry-EstebanLorenzano.3.mcz
FuelTests-TheIntegrator.384.mcz
FuelTools-Debugger-StephaneDucasse.12.mcz
GT-Inspector-AndreiChis.290.mcz
GT-InspectorExtensions-Core-TudorGirba.98.mcz
GT-Playground-AndreiChis.63.mcz
GT-Spotter-AliakseiSyrel.136.mcz
GT-SpotterExtensions-Core-NicolaiHess.54.mcz
GT-Tests-Inspector-TommasoDalSasso.25.mcz
GT-Inspector-TudorGirba.292.mcz
GT-InspectorExtensions-Core-TudorGirba.104.mcz
GT-Playground-TudorGirba.64.mcz
GT-Spotter-StefanReichhart.190.mcz
GT-SpotterExtensions-Core-StefanReichhart.78.mcz
GT-Tests-Inspector-TudorGirba.29.mcz
GTPharo4Extensions-TheIntegrator.2.mcz
Generated-code-non-existing-package-EstebanLorenzano.2.mcz
Glamour-Announcements-AndreiChis.8.mcz
Glamour-Browsers-AndreiChis.108.mcz
Glamour-Core-ChristopheDemarey.290.mcz
Glamour-Examples-TudorGirba.290.mcz
Glamour-Helpers-AndreiChis.37.mcz
Glamour-Morphic-Brick-AliakseiSyrel.198.mcz
Glamour-Morphic-Pager-AliakseiSyrel.85.mcz
Glamour-Morphic-Renderer-AndreiChis.307.mcz
Glamour-Morphic-Theme-AndreiChis.199.mcz
Glamour-Morphic-Widgets-AndreiChis.162.mcz
Glamour-Presentations-AndreiChis.170.mcz
Glamour-Morphic-Brick-AliakseiSyrel.270.mcz
Glamour-Morphic-Pager-AliakseiSyrel.102.mcz
Glamour-Morphic-Renderer-YuriyTymchuk.310.mcz
Glamour-Morphic-Theme-TudorGirba.203.mcz
Glamour-Morphic-Widgets-AliakseiSyrel.164.mcz
Glamour-Presentations-YuriyTymchuk.171.mcz
Glamour-Rubric-Presentations-AndreiChis.38.mcz
Glamour-Tests-Core-ChristopheDemarey.103.mcz
Glamour-Tests-Morphic-AndreiChis.120.mcz
Glamour-Tests-Core-AliakseiSyrel.104.mcz
Glamour-Tests-Morphic-AliakseiSyrel.121.mcz
Glamour-Tests-Resources-AndreiChis.3.mcz
Glamour-Tests-Rubric-AndreiChis.14.mcz
Gofer-Core-TheIntegrator.228.mcz
Expand All @@ -101,6 +101,7 @@ Graphics-Fonts-EstebanLorenzano.96.mcz
Graphics-Fonts-Tests-EstebanLorenzano.3.mcz
Graphics-Primitives-TheIntegrator.150.mcz
Graphics-Resources-EstebanLorenzano.22.mcz
Graphics-Shapes-TheIntegrator.2.mcz
Graphics-Tests-TheIntegrator.72.mcz
Graphics-Transformations-TheIntegrator.12.mcz
GroupManager-TheIntegrator.72.mcz
Expand Down Expand Up @@ -150,7 +151,7 @@ MonticelloFileTree-Core-TheIntegrator.176.mcz
MonticelloFileTree-FileSystem-Utilities-MarcusDenker.32.mcz
MonticelloGUI-TheIntegrator.322.mcz
MonticelloMocks-EstebanLorenzano.2.mcz
Morphic-Base-TheIntegrator.435.mcz
Morphic-Base-TheIntegrator.437.mcz
Morphic-Core-TheIntegrator.153.mcz
Morphic-Examples-TheIntegrator.40.mcz
Morphic-Widgets-Basic-TheIntegrator.41.mcz
Expand Down Expand Up @@ -202,7 +203,6 @@ OpalCompiler-Tests-TheIntegrator.273.mcz
OpalDecompiler-TheIntegrator.31.mcz
OpalTools-TheIntegrator.14.mcz
Pharo-Help-MarcusDenker.11.mcz
Polymorph-Geometry-TheIntegrator.15.mcz
Polymorph-TaskbarIcons-MarcusDenker.40.mcz
Polymorph-Widgets-TheIntegrator.1203.mcz
PragmaCollector-TheIntegrator.3.mcz
Expand All @@ -221,8 +221,8 @@ Refactoring-Tests-Changes-MarcusDenker.38.mcz
Refactoring-Tests-Core-TheIntegrator.118.mcz
Refactoring-Tests-Critics-MarcusDenker.25.mcz
Refactoring-Tests-Environment-StephaneDucasse.11.mcz
Reflectivity-TheIntegrator.5.mcz
Reflectivity-Tests-TheIntegrator.2.mcz
Reflectivity-TheIntegrator.7.mcz
Reflectivity-Tests-TheIntegrator.4.mcz
Regex-Core-MarcusDenker.33.mcz
Regex-Help-MarcusDenker.5.mcz
Regex-Tests-Core-MarcusDenker.9.mcz
Expand Down Expand Up @@ -255,6 +255,7 @@ SmartSuggestions-Tests-TheIntegrator.2.mcz
Spec-Core-StephaneDucasse.368.mcz
Spec-Debugger-TheIntegrator.236.mcz
Spec-Examples-TheIntegrator.86.mcz
Spec-Help-TheIntegrator.8.mcz
Spec-Inspector-TheIntegrator.230.mcz
Spec-Layout-TheIntegrator.67.mcz
Spec-MorphicAdapters-StephaneDucasse.203.mcz
Expand Down

This file was deleted.

@@ -0,0 +1,15 @@
update40521
"self new update40521"
self withUpdateLog: '14420 What to do with Polymorph-Geometry
https://pharo.fogbugz.com/f/cases/14420
14950 Spec help added to the Help Browser
https://pharo.fogbugz.com/f/cases/14950
15013 enable recompile on run:with:in:
https://pharo.fogbugz.com/f/cases/15013
15015 GradientFillStyle color selection broken
https://pharo.fogbugz.com/f/cases/15015'.
self loadTogether: self script521 merge: false.
self flushCaches.
@@ -1,3 +1,12 @@
commentForCurrentUpdate
^ '14993 Integrate GTools
https://pharo.fogbugz.com/f/cases/14993'
^ '14420 What to do with Polymorph-Geometry
https://pharo.fogbugz.com/f/cases/14420
14950 Spec help added to the Help Browser
https://pharo.fogbugz.com/f/cases/14950
15013 enable recompile on run:with:in:
https://pharo.fogbugz.com/f/cases/15013
15015 GradientFillStyle color selection broken
https://pharo.fogbugz.com/f/cases/15015'
1 change: 1 addition & 0 deletions Spec-Help.package/SpecExamples.class/README.md
@@ -0,0 +1 @@
A SpecExamples is the first sub-book of SpecHelpTopics. It contains examples of using Spec.See class side for selectors.
Expand Down
@@ -0,0 +1,2 @@
bookName
^ 'Examples'
2 changes: 2 additions & 0 deletions Spec-Help.package/SpecExamples.class/class/accessing/pages.st
@@ -0,0 +1,2 @@
pages
^#(firstExample secondExample moreExamples)
49 changes: 49 additions & 0 deletions Spec-Help.package/SpecExamples.class/class/pages/firstExample.st
@@ -0,0 +1,49 @@
firstExample
^HelpTopic
title: 'A first example: ModelList'
contents: 'Creating a specific UI always starts with the subclassing of Composable-Model. Each sub widget is stored into an instance variable of the newly created class. All the code presented here is already in the image so you can simply do:
ModelList browse
And follow the tutorial while browsing the code. So let''s subclass ComposableModel.
ComposableModel subclass: #ModelList
instanceVariableNames: ''list''
classVariableNames: ''
category: ''Spec-Examples''
The first required step then is to instantiate and define the sub widgets. This step is done in the method initializeWidgets. It creates the list and populates it with the required classes, in alphabetical order.
ModelList>>initializeWidgets
list := self newList.
list items: (AbstractWidgetModel allSubclasses
sorted: [:a :b | a name < b name ]).
self focusOrder add: list
The second required step is to define a layout, which is done on the class side. Since there is here only one sub widget, the layout is quite simple. It simply returns a layout that contains only the list:
ModelList class>>#defaultSpec
<spec: #default>
^ SpecLayout composed
add: #list;
yourself
The three last methods to define on ModelList are a getter, a method to display the UI title and a method to register to list selection changes.
"accessing"
ModelList>>list
^ list
"protocol"
ModelList>>title
^ ''Widgets''
"protocol-events"
ModelList>>whenSelectedItemChanged: aBlock
list whenSelectedItemChanged: aBlock
The first UI is now done. The result can be seen by executing the following snippet of code:
ModelList new openWithSpec.
'
34 changes: 34 additions & 0 deletions Spec-Help.package/SpecExamples.class/class/pages/moreExamples.st
@@ -0,0 +1,34 @@
moreExamples
^HelpTopic
title: 'More Examples'
contents: 'If you browse the Spec-Examples package you will find a lot more examples that will help you understand Spec a little more.
ApplicationWithToolbar new openWithSpec
CheckBoxExample new openWithSpec
ClassMethodBrowser new openWithSpec
DropListExample new openWithSpec
DynamicWidgetChange new openWithSpec
ListSelectionModel new openWithSpec
MethodBrowser new openWithSpec
ModelList new openWithSpec
ProtocolBrowser new openWithSpec
ProtocolList new openWithSpec
ProtocolViewer new openWithSpec
RadioButtonGroupExample new openWithSpec
ScrollSyncExample new openWithSpec
TabsExample new openWithSpec
TextFieldExample new openWithSpec'
71 changes: 71 additions & 0 deletions Spec-Help.package/SpecExamples.class/class/pages/secondExample.st
@@ -0,0 +1,71 @@
secondExample
^HelpTopic
title: 'A second example: Protocol List'
contents: 'The next user interface is the protocol list. This UI combines two sub widgets:
a list
a label.
So again, we start by subclassing ComposableModel:
ComposableModel subclass: #ProtocolList
instanceVariableNames: ''label protocols''
classVariableNames: ''
category: ''Spec-Examples''
The initializeWidgets method for this UI is quite similar to the method in ModelList:
ProtocolList>>initializeWidgets
protocols := self newList.
label := self newLabel.
label text: ''Protocol''.
protocols displayBlock: [ :m | m selector ].
self focusOrder add: protocols
The layout method is quite different though. Now the sub widgets need to be placed more specifically than in the previous example, we have to build a layout that has a column with the label on top and the list taking all the space that is left.
ProtocolList class>>defaultSpec
<spec: #default>
^ SpecLayout composed
newColumn: [ :column |
column
add: #label
height: self toolbarHeight;
add: #protocols ];
yourself
The remaining methods are getters, sub widget delegation methods, a method to display the title, and a method to register to list selection changes:
"accessing"
ProtocolList>>label
^ label
"accessing"
ProtocolList>>protocols
^ protocols
"protocol"
ProtocolList>>items: aCollection
protocols items: aCollection
"protocol"
ProtocolList>>label: aText
label text: aText
"protocol"
ProtocolList>>resetSelection
protocols resetSelection
"protocol"
ProtocolList>>title
^ ''Protocol widget''
"protocol-events"
ProtocolList>>whenSelectedItemChanged: aBlock
protocols whenSelectedItemChanged: aBlock
The ProtocolList UI can be seen by evaluating:
ProtocolList new openWithSpec.
'
5 changes: 5 additions & 0 deletions Spec-Help.package/SpecExamples.class/definition.st
@@ -0,0 +1,5 @@
SpecHelpTopics subclass: #SpecExamples
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Spec-Help'

0 comments on commit 4834e88

Please sign in to comment.