[squeak-dev] The Trunk: ToolBuilder-Morphic-ct.285.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Jan 3 22:54:07 UTC 2022
Christoph Thiede uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-ct.285.mcz
==================== Summary ====================
Name: ToolBuilder-Morphic-ct.285
Author: ct
Time: 3 January 2022, 11:54:06.309397 pm
UUID: 6e4aa81c-9483-3a4e-843a-98df1c30189d
Ancestors: ToolBuilder-Morphic-mt.284
Improved multilingual support and recategorizations for the entire package.
=============== Diff against ToolBuilder-Morphic-mt.284 ===============
Item was changed:
----- Method: DirectoryChooserDialog>>userMessage (in category 'ui details') -----
userMessage
"return the string to present to the user in order to explain the purpose of this dialog appearing"
+ ^message ifNil: ['Choose a directory name' translated]!
- ^message ifNil:['Choose a directory name']!
Item was changed:
----- Method: DirectoryChooserDialog>>windowTitle (in category 'ui details') -----
windowTitle
+ ^ 'Choose Directory' translated!
- ^ 'Choose Directory'!
Item was changed:
----- Method: FileAbstractSelectionDialog>>buildButtonsWith: (in category 'toolbuilder') -----
buildButtonsWith: builder
^ {
builder pluggableButtonSpec new
model: self;
label: 'Accept' translated;
color: (self userInterfaceTheme get: #okColor for: #DialogWindow);
action: #acceptFileName.
builder pluggableButtonSpec new
model: self;
+ label: 'Cancel' translated;
- label: 'Cancel';
color: (self userInterfaceTheme get: #cancelColor for: #DialogWindow);
action: #cancelFileChooser}!
Item was changed:
----- Method: FileChooserDialog>>userMessage (in category 'ui details') -----
userMessage
"return the string to present to the user in order to explain the purpose of this dialog appearing"
+ ^message ifNil: ['Choose a file name' translated]!
- ^message ifNil:['Choose a file name']!
Item was changed:
----- Method: FileChooserDialog>>windowTitle (in category 'ui details') -----
windowTitle
"return the window label; would be some application dependent string but I suspect we will want to make the outer morph a dialogue box with no label anyway"
+ ^ 'Choose File' translated!
- ^ 'Choose File'!
Item was changed:
----- Method: FileSaverDialog>>selectFilename: (in category 'filename') -----
selectFilename: aText
"The user has entered a potential filename in the text field. Check it against the current pattern; if it is ok we can accept it and then if it is a file in the current list, highlight it. If it would not match the pattern, alert the user."
fileName := aText asString.
^ self selectExistingFilename
ifTrue:
[ self changed: #fileListIndex.
true ]
ifFalse:
[ suffixList size = 1
ifTrue:
[ | suffix |
((suffix := '.' , suffixList anyOne)
compare: (fileName last: (suffix size min: fileName size))
caseSensitive: FileDirectory default isCaseSensitive) = 2 ifFalse: [ fileName := fileName , suffix ].
true ]
ifFalse:
[ suffixList
at:
(UIManager default
chooseFrom: suffixList
+ title: 'Please choose the type of file to save.' translated)
- title: 'Please choose the type of file to save.')
ifPresent:
[ : choice | fileName := fileName , '.' , choice.
true ]
ifAbsent:
[ suffixList isEmpty or:
+ [ self inform: ('WARNING: File not saved!! A filename matching one of {1} patterns is required.' translated format: {patternList asArray}).
- [ UIManager default inform: 'WARNING: File not saved!! A filename matching one of ' , patternList asArray asString , ' patterns is required.'.
false ] ] ] ]!
Item was changed:
----- Method: FileSaverDialog>>userMessage (in category 'ui details') -----
userMessage
"return the string to present to the user in order to explain the purpose of this dialog appearing"
+ ^message ifNil: ['Choose a file name; you can also edit the name below to create a new file name' translated]!
- ^message ifNil:['Choose a file name; you can also edit the name below to create a new file name']!
Item was changed:
----- Method: FileSaverDialog>>windowTitle (in category 'ui details') -----
windowTitle
"return the window label; would be some application dependent string but I suspect we will want to make the outer morph a dialogue box with no label anyway"
+ ^ 'Save As File' translated!
- ^ 'Save As File'!
Item was changed:
----- Method: ListChooser>>buildWith: (in category 'building') -----
buildWith: builder
| dialogSpec searchBarHeight listSpec fieldSpec |
searchBarHeight := self searchBarHeight.
dialogSpec := builder pluggableDialogSpec new
model: self;
title: #title;
closeAction: #closed;
extent: self initialExtent;
autoCancel: true; "Behave like a pop-up menu. Historical reasons."
children: OrderedCollection new;
buttons: OrderedCollection new;
yourself.
listSpec := builder pluggableListSpec new.
listSpec
model: self;
list: #items;
getIndex: #selectedIndex;
setIndex: #selectedIndex:;
doubleClick: #accept;
"keystrokePreview: #keyStrokeFromList:;"
autoDeselect: false;
filterableList: true;
clearFilterAutomatically: false;
name: #list;
frame: (LayoutFrame fractions: (0 at 0 corner: 1 at 1) offsets: (0 at searchBarHeight corner: 0 at 0)).
dialogSpec children add: listSpec.
fieldSpec := builder pluggableInputFieldSpec new.
fieldSpec
model: self;
name: #searchText ;
getText: #searchText;
editText: #searchText:;
setText: #acceptText:;
selection: #textSelection;
menu: nil;
indicateUnacceptedChanges: false;
askBeforeDiscardingEdits: false;
help: (self addAllowed ifTrue: ['Type new or filter existing...' translated] ifFalse: ['Type to filter existing...' translated]);
frame: (LayoutFrame fractions: (0 at 0 corner: 1 at 0) offsets: (0 at 0 corner: 0 at searchBarHeight)).
dialogSpec children add: fieldSpec.
"Buttons"
dialogSpec buttons add: (
builder pluggableButtonSpec new
model: self;
label: #acceptLabel;
action: #accept;
enabled: #canAcceptOrAdd;
color: #acceptColor).
dialogSpec buttons add: (
builder pluggableButtonSpec new
model: self;
+ label: 'Cancel' translated;
- label: 'Cancel';
action: #cancel;
color: #cancelColor).
dialogMorph := builder build: dialogSpec.
dialogMorph addKeyboardCaptureFilter: self ; positionOverWidgetNamed: #searchText.
listMorph := builder widgetAt: #list.
listMorph allowEmptyFilterResult: true.
^ dialogMorph!
Item was changed:
----- Method: ListChooser>>title (in category 'accessing') -----
title
+ ^ title ifNil: [ title := 'Please choose' translated ]!
- ^ title ifNil: [ title := 'Please choose' ]!
Item was changed:
----- Method: MorphicUIManager>>chooseFrom:lines:title: (in category 'ui requests') -----
chooseFrom: aList lines: linesArray title: aString
"Choose an item from the given list. Answer the index of the selected item. Cancel value is 0.
There are several (historical) reasons for building a button dialog instead of a list chooser for small lists:
1) Unfortunately, there is existing code that uses this call to create simple confirmation dialogs with a list of #(yes no cancel).
2) Unfortunately, there is existing code that uses this call to mimick a drop-down menu with a (compact) pop-up menu."
self askForProvidedAnswerTo: aString ifSupplied: [:answer |
(answer = #cancel or: [answer isNil]) ifTrue: [^ 0].
^ aList indexOf: answer].
aList ifEmpty: [^ 0].
aList size <= 7 ifTrue: [
| dialog |
dialog := DialogWindow new
+ title: 'Please Choose' translated;
- title: 'Please Choose';
message: aString;
filterEnabled: true;
autoCancel: true; "Like a pop-up menu, click anywhere to dismiss."
yourself.
aList withIndexDo: [:ea :index |
dialog createButton: ea value: index].
dialog selectedButtonIndex: 1.
^ dialog getUserResponseAtHand ifNil: [0]].
^ ListChooser chooseFrom: aList title: aString!
Item was changed:
----- Method: PluggableButtonMorphPlus>>debugAction (in category 'debug menu') -----
debugAction
action ifNil: [^ super debugAction].
(Process
forBlock: [self performAction]
runUntil: [:context | context closure = action])
+ debugWithTitle: ('Debug button action "{1}" in model "{2}"' translated format: {self label. self target printString}).!
- debugWithTitle: ('Debug button action "{1}" in model "{2}"' format: {self label. self target printString}).!
Item was changed:
+ ----- Method: PluggableCheckBoxMorph class>>on:getState:action:label: (in category 'instance creation') -----
- ----- Method: PluggableCheckBoxMorph class>>on:getState:action:label: (in category 'as yet unclassified') -----
on: anObject getState: getStateSel action: actionSel label: labelSel
^ self new
on: anObject
getState: getStateSel
action: actionSel
label: labelSel
menu: nil
!
Item was changed:
+ ----- Method: PluggableTreeItemNode>>refresh (in category 'private') -----
- ----- Method: PluggableTreeItemNode>>refresh (in category 'as yet unclassified') -----
refresh
self parent ifNil: [^ self].
self setItem: (self parent contents
at: self index
ifAbsent: [self error: 'No support for changed child count yet!!'])
item.!
More information about the Squeak-dev
mailing list
|