Chris Muller uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-cmm.84.mcz
==================== Summary ====================
Name: SUnit-cmm.84
Author: cmm
Time: 5 March 2011, 1:59:04.122 pm
UUID: b2b539ec-f6aa-4312-9195-37f733103435
Ancestors: SUnit-ul.83
- Added TestSuite>>#debug to allow debugging test-suites from a workspace:
MyTestCase suite debug
=============== Diff against SUnit-ul.83 ===============
Item was added:
+ ----- Method: TestSuite>>debug (in category 'running') -----
+ debug
+ self tests do:
+ [ : each | self changed: each.
+ each debug ]!
Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.523.mcz
==================== Summary ====================
Name: Morphic-cmm.523
Author: cmm
Time: 5 March 2011, 1:56:18.722 pm
UUID: b7b0e4f4-5789-4ce8-85ba-4b58529dea75
Ancestors: Morphic-dtl.522
- Set HandMorph class>>'DragThreshold' back to 10 pixels.
- Allow LazyListMorphs to be populated with first-class Objects rather than just Strings.
=============== Diff against Morphic-dtl.522 ===============
Item was changed:
----- Method: HandMorph class>>initialize (in category 'class initialization') -----
initialize
"HandMorph initialize"
-
PasteBuffer := nil.
+ DoubleClickTime := 350 "milliseconds".
+ DragThreshold := 10 "pixels".
+ NormalCursor := CursorWithMask normal asCursorForm!
- DoubleClickTime := 350.
- DragThreshold := 0.
- NormalCursor := CursorWithMask normal asCursorForm.
- !
Item was changed:
----- Method: LazyListMorph>>drawOn: (in category 'drawing') -----
drawOn: aCanvas
| |
listItems size = 0 ifTrue: [ ^self ].
self drawSelectionOn: aCanvas.
(self topVisibleRowForCanvas: aCanvas) to: (self bottomVisibleRowForCanvas: aCanvas) do: [ :row |
(listSource itemSelectedAmongMultiple: row) ifTrue: [
self drawBackgroundForMulti: row on: aCanvas. ].
+ self display: (self item: row) asStringOrText atRow: row on: aCanvas.
- self display: (self item: row) atRow: row on: aCanvas.
].
listSource potentialDropRow > 0 ifTrue: [
self highlightPotentialDropRow: listSource potentialDropRow on: aCanvas ].!
Item was changed:
----- Method: LazyListMorph>>hUnadjustedScrollRange (in category 'scroll range') -----
hUnadjustedScrollRange
"Ok, this is a bit messed up. We need to return the width of the widest item in the list. If we grab every item in the list, it defeats the purpose of LazyListMorph. If we don't, then we don't know the size.
This is a compromise -- find the widest of the first 30 items, then double it, This width will be updated as new items are installed, so it will always be correct for the visible items. If you know a better way, please chime in."
| itemsToCheck item index |
"Check for a cached value"
maxWidth ifNotNil:[^maxWidth].
"Compute from scratch"
itemsToCheck := 30 min: (listItems size).
maxWidth := 0.
"Check the first few items to get a representative sample of the rest of the list."
index := 1.
[index < itemsToCheck] whileTrue:
[ item := self getListItem: index. "Be careful not to actually install this item"
+ maxWidth := maxWidth max: (self widthToDisplayItem: item asStringOrText contents).
- maxWidth := maxWidth max: (self widthToDisplayItem: item contents).
index:= index + 1.
].
"Add some initial fudge if we didn't check all the items."
(itemsToCheck < listItems size) ifTrue:[maxWidth := maxWidth*2].
^maxWidth
!
Item was changed:
----- Method: LazyListMorph>>item: (in category 'list access') -----
item: index
"return the index-th item, using the 'listItems' cache"
| newItem itemWidth |
(index between: 1 and: listItems size)
ifFalse: [ "there should have been an update, but there wasn't!!" ^self getListItem: index].
(listItems at: index) ifNil: [
newItem := self getListItem: index.
"Update the width cache."
maxWidth ifNotNil:[
+ itemWidth := self widthToDisplayItem: newItem asStringOrText contents.
- itemWidth := self widthToDisplayItem: newItem contents.
itemWidth > maxWidth ifTrue:[
maxWidth := itemWidth.
self adjustWidth.
]].
listItems at: index put: newItem ].
^listItems at: index!
Item was changed:
----- Method: LazyListMorph>>widthToDisplayItem: (in category 'scroll range') -----
+ widthToDisplayItem: item
+ ^ self font widthOfStringOrText: item asStringOrText!
- widthToDisplayItem: item
- ^self font widthOfStringOrText: item
- !
Item was changed:
----- Method: PluggableListMorph>>getList (in category 'model access') -----
getList
"Answer the list to be displayed. Caches the returned list in the 'list' ivar"
+ getListSelector == nil ifTrue: [ ^ #() ].
- getListSelector == nil ifTrue: [^ #()].
list := model perform: getListSelector.
+ ^ list ifNil: [ Array empty ]!
- list == nil ifTrue: [^ #()].
- list := list collect: [ :item | item asStringOrText ].
- ^ list!
Item was changed:
----- Method: PluggableListMorph>>getListSelector: (in category 'initialization') -----
+ getListSelector: sel
- getListSelector: sel
"Set the receiver's getListSelector as indicated, and trigger a recomputation of the list"
+ self
+ setGetListSelector: sel ;
+ changed ;
+ updateList!
-
- getListSelector := sel.
- self changed.
- self updateList.!
Item was changed:
----- Method: PluggableListMorph>>list: (in category 'initialization') -----
list: listOfStrings
"lex doesn't think this is used any longer, but is not yet brave enough to remove it. It should be removed eventually"
"Set the receiver's list as specified"
| morphList h index converter aSelector textColor font loc |
+ self isThisEverCalled.
scroller removeAllMorphs.
list := listOfStrings ifNil: [Array new].
list isEmpty ifTrue: [self setScrollDeltas. ^ self selectedMorph: nil].
"NOTE: we will want a quick StringMorph init message, possibly even
combined with event install and positioning"
font ifNil: [font := Preferences standardListFont].
converter := self valueOfProperty: #itemConversionMethod.
converter ifNil: [converter := #asStringOrText].
textColor := self valueOfProperty: #textColor.
morphList := list collect: [:each | | stringMorph item |
item := each.
item := item perform: converter.
stringMorph := item isText
ifTrue: [StringMorph contents: item font: font emphasis: (item emphasisAt: 1)]
ifFalse: [StringMorph contents: item font: font].
textColor ifNotNil: [ stringMorph color: textColor ].
stringMorph
].
(aSelector := self valueOfProperty: #balloonTextSelectorForSubMorphs)
ifNotNil:
[morphList do: [:m | m balloonTextSelector: aSelector]].
self highlightSelector ifNotNil:
[model perform: self highlightSelector with: list with: morphList].
"Lay items out vertically and install them in the scroller"
h := morphList first height "self listItemHeight".
loc := 0@0.
morphList do: [:m | m bounds: (loc extent: 9999@h). loc := loc + (0@h)].
scroller addAllMorphs: morphList.
index := self getCurrentSelectionIndex.
self selectedMorph: ((index = 0 or: [index > morphList size]) ifTrue: [nil] ifFalse: [morphList at: index]).
self setScrollDeltas.
scrollBar setValue: 0.0!
On Sat, 5 Mar 2011, commits(a)source.squeak.org wrote:
> David T. Lewis uploaded a new version of ToolBuilder-Morphic to project The Trunk:
> http://source.squeak.org/trunk/ToolBuilder-Morphic-dtl.72.mcz
This won't work, because both dtl.71 and dtl.72 have the same ancestor, so
the update process will try to merge the two.
Levente
>
> ==================== Summary ====================
>
> Name: ToolBuilder-Morphic-dtl.72
> Author: dtl
> Time: 5 March 2011, 10:29:07.343 am
> UUID: 3e543824-efc3-48c3-8f87-8656c3eeb6f2
> Ancestors: ToolBuilder-Morphic-mtf.70
>
> Revert to ToolBuilder-Morphic-mtf
>
> =============== Diff against ToolBuilder-Morphic-mtf.70 ===============
>
>
>
David T. Lewis uploaded a new version of ToolBuilder-Morphic to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Morphic-dtl.74.mcz
==================== Summary ====================
Name: ToolBuilder-Morphic-dtl.74
Author: dtl
Time: 5 March 2011, 1:06:32.608 pm
UUID: a2104017-0edb-49d9-9abd-666f26b3af08
Ancestors: ToolBuilder-Morphic-dtl.73
Initialize new MVCUIManager with an MVCToolBuilder
=============== Diff against ToolBuilder-Morphic-dtl.73 ===============
Item was added:
+ ----- Method: MorphicUIManager>>initialize (in category 'initialize-release') -----
+ initialize
+ toolBuilder := MorphicToolBuilder new!
David T. Lewis uploaded a new version of ToolBuilder-MVC to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-MVC-dtl.26.mcz
==================== Summary ====================
Name: ToolBuilder-MVC-dtl.26
Author: dtl
Time: 5 March 2011, 1:06:04.446 pm
UUID: 6a50f59e-9232-4c98-96e0-42be6929b9c6
Ancestors: ToolBuilder-MVC-dtl.25
Initialize new MVCUIManager with an MVCToolBuilder
=============== Diff against ToolBuilder-MVC-dtl.25 ===============
Item was added:
+ ----- Method: MVCUIManager>>initialize (in category 'initialize-release') -----
+ initialize
+ toolBuilder := MVCToolBuilder new!
David T. Lewis uploaded a new version of ToolBuilder-Kernel to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Kernel-dtl.46.mcz
==================== Summary ====================
Name: ToolBuilder-Kernel-dtl.46
Author: dtl
Time: 5 March 2011, 1:05:35.352 pm
UUID: 5a2e8628-078c-4aed-a441-b9f9fb844e32
Ancestors: ToolBuilder-Kernel-dtl.45
A Project has a UIManager, and a UIManager has a ToolBuilder, so add #toolBuilder ivar to UIManager and initialize accordingly. This facilitates setting up the appropriate UIManager and ToolBuilder to allow SMxMorphicProject to host a SimpleMorphic world.
Change Toolbuilder class>>default to always ask the default UI manager for its tool builder. Remove class var Default (this was provided in the ToolBuilder package but never used in Squeak). Deprecate ToolBuilder class>>default:
Background: In previous Squeak usage, ToolBuilder class>>default always invoked a search for the appropriate ToolBuilder subclass, and class var Default was unused (this is awkward if more than one kind of ToolBuilder could be used in a project that #isMorphic). This change makes the default tool builder an explicit attibute of the active UI manager.
=============== Diff against ToolBuilder-Kernel-dtl.45 ===============
Item was changed:
Object subclass: #ToolBuilder
instanceVariableNames: 'parent'
+ classVariableNames: ''
- classVariableNames: 'Default'
poolDictionaries: ''
category: 'ToolBuilder-Kernel'!
!ToolBuilder commentStamp: '<historical>' prior: 0!
I am a tool builder, that is an object which knows how to create concrete widgets from abstract specifications. Those specifications are used by tools which want to be able to function in diverse user interface paradigms, such as MVC, Morphic, Tweak, wxWidgets etc.
The following five specs must be supported by all implementations:
* PluggableButton
* PluggableList
* PluggableText
* PluggablePanel
* PluggableWindow
The following specs are optional:
* PluggableTree: If not supported, the tool builder must answer nil when asked for a pluggableTreeSpec. Substitution will require client support so clients must be aware that some tool builders may not support trees (MVC for example, or Seaside). See examples in FileListPlus or TestRunnerPlus.
* PluggableMultiSelectionList: If multi-selection lists are not supported, tool builder will silently support regular single selection lists.
* PluggableInputField: Intended as a HINT for the builder that this widget will be used as a single line input field. Unless explicitly supported it will be automatically substituted by PluggableText.
* PluggableActionButton: Intended as a HINT for the builder that this widget will be used as push (action) button. Unless explicitly supported it will be automatically substituted by PluggableButton.
* PluggableRadioButton: Intended as a HINT for the builder that this widget will be used as radio button. Unless explicitly supported it will be automatically substituted by PluggableButton.
* PluggableCheckBox: Intended as a HINT for the builder that this widget will be used as check box. Unless explicitly supported it will be automatically substituted by PluggableButton.
!
Item was changed:
----- Method: ToolBuilder class>>default (in category 'accessing') -----
default
"Answer the default tool builder"
+ ^ Project current uiManager toolBuilder
+ ifNil: [self findDefault]!
- | builderClass |
- ^Default ifNil:[
- "Note: The way the following is phrased ensures that you can always make 'more specific' builders merely by subclassing a tool builder and implementing a more specific way of reacting to #isActiveBuilder. For example, a BobsUIToolBuilder can subclass MorphicToolBuilder and (if enabled, say Preferences useBobsUITools) will be considered before the parent (generic MorphicToolBuilder)."
- builderClass := self allSubclasses
- detect:[:any| any isActiveBuilder and:[
- any subclasses noneSatisfy:[:sub| sub isActiveBuilder]]] ifNone:[nil].
- builderClass ifNotNil:[builderClass new]]!
Item was changed:
----- Method: ToolBuilder class>>default: (in category 'accessing') -----
default: aToolBuilder
"Set a new default tool builder"
+ self deprecated: 'The default ToolBuilder is an attribute of the UIManager'
+ !
- Default := aToolBuilder.!
Item was added:
+ ----- Method: ToolBuilder class>>findDefault (in category 'accessing') -----
+ findDefault
+ "Answer a default tool builder"
+ | builderClass |
+ "Note: The way the following is phrased ensures that you can always make 'more specific' builders merely by subclassing a tool builder and implementing a more specific way of reacting to #isActiveBuilder. For example, a BobsUIToolBuilder can subclass MorphicToolBuilder and (if enabled, say Preferences useBobsUITools) will be considered before the parent (generic MorphicToolBuilder)."
+ builderClass := self allSubclasses
+ detect:[:any| any isActiveBuilder and:[
+ any subclasses noneSatisfy:[:sub| sub isActiveBuilder]]] ifNone:[nil].
+ builderClass ifNotNil: [^builderClass new].
+ ^self error: 'ToolBuilder not found'!
Item was changed:
Object subclass: #UIManager
+ instanceVariableNames: 'toolBuilder'
- instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'ToolBuilder-Kernel'!
!UIManager commentStamp: 'dtl 5/2/2010 16:06' prior: 0!
UIManager is a dispatcher for various user interface requests, such as menu and dialog interactions. An instance of UIManager is associated with each Project to implement the appropriate functions for Morphic, MVC or other user interfaces.!
Item was added:
+ ----- Method: UIManager>>toolBuilder (in category 'accessing') -----
+ toolBuilder
+ ^toolBuilder!
David T. Lewis uploaded a new version of ToolBuilder-Kernel to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Kernel-dtl.45.mcz
==================== Summary ====================
Name: ToolBuilder-Kernel-dtl.45
Author: dtl
Time: 5 March 2011, 11:06:48.05 am
UUID: e818b263-f3cf-4da2-a087-1c6543b891f6
Ancestors: ToolBuilder-Kernel-dtl.44
Resubmit for update stream
=============== Diff against ToolBuilder-Kernel-dtl.44 ===============