The Trunk: MorphicExtras-mt.269.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: MorphicExtras-mt.269.mcz

commits-2
Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-mt.269.mcz

==================== Summary ====================

Name: MorphicExtras-mt.269
Author: mt
Time: 14 February 2020, 3:07:58.332667 pm
UUID: 825d4289-5a5b-3e4e-8828-f518d1a1a8c3
Ancestors: MorphicExtras-mt.268

Some fixes in scrap book and book morph in support of Etoys.

=============== Diff against MorphicExtras-mt.268 ===============

Item was changed:
  ----- Method: BookMorph>>insertPageLabel:morphs: (in category 'insert and delete') -----
  insertPageLabel: labelString morphs: morphList
 
  | m c labelAllowance |
  self insertPage.
  labelString ifNotNil:
+ [m := labelString asMorph.
- [m := (TextMorph new extent: currentPage width@20; contents: labelString).
  m lock.
  m position: currentPage position + (((currentPage width - m width) // 2) @ 5).
  currentPage addMorph: m.
  labelAllowance := 40]
  ifNil:
  [labelAllowance := 0].
 
  "use a column to align the given morphs, then add them to the page"
  c := AlignmentMorph newColumn wrapCentering: #center; cellPositioning: #topCenter.
  c addAllMorphs: morphList.
  c position: currentPage position + (0 @ labelAllowance).
  currentPage addAllMorphs: morphList.
  ^ currentPage
  !

Item was changed:
  ----- Method: BooklikeMorph>>fullControlSpecs (in category 'page controls') -----
  fullControlSpecs
 
  ^ {
  #spacer.
  #variableSpacer.
  {'-'. #deletePage. 'Delete this page' translated}.
  #spacer.
  {'«'. #firstPage. 'First page' translated}.
  #spacer.
  {'<'. #previousPage. 'Previous page' translated}.
  #spacer.
  {'·'. #invokeBookMenu. 'Click here to get a menu of options for this book.' translated}.
  #spacer.
  {'>'. #nextPage. 'Next page' translated}.
  #spacer.
  { '»'. #lastPage. 'Final page' translated}.
  #spacer.
  {'+'. #insertPage. 'Add a new page after this one' translated}.
  #variableSpacer.
+ {'o'. #fewerPageControls. 'Fewer controls' translated}
- {'³'. #fewerPageControls. 'Fewer controls' translated}
  }
  !

Item was changed:
  ----- Method: BooklikeMorph>>makePageControlsFrom: (in category 'page controls') -----
  makePageControlsFrom: controlSpecs
  "From the controlSpecs, create a set of page control and return them -- this method does *not* add the controls to the receiver."
 
  | c col row |
+ c := (color saturation > 0.4) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
- c := (color saturation > 0.1) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
  col := AlignmentMorph newColumn.
  col color: c; borderWidth: 0; layoutInset: 0.
  col hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
 
  row := AlignmentMorph newRow.
  row color: c; borderWidth: 0; layoutInset: 0.
  row hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
  controlSpecs do: [:spec | | lastGuy b |
  spec == #showDescription ifTrue: [row addMorphBack: self makeDescriptionViewer].
  spec == #pageNumber ifTrue: [row addMorphBack: self makePageNumberItem].
  spec == #spacer ifTrue: [row addTransparentSpacerOfSize: (10 @ 0)].
  spec == #variableSpacer ifTrue: [
  row addMorphBack: AlignmentMorph newVariableTransparentSpacer].
  spec class == Array ifTrue: [
  spec first isSymbol
  ifTrue: [b := ThreePhaseButtonMorph labelSymbol: spec first]
  ifFalse: [b := SimpleButtonMorph new borderWidth: 2;
+ borderColor: Color black; color: Color white.
- borderColor: Color black; color: Color veryLightGray.
  b label: spec first font: Preferences standardMenuFont].
  b target: self;  actionSelector: spec second;  setBalloonText: spec third.
  (spec atPin: 4) = #border
  ifTrue: [b actWhen: #buttonDown]
  ifFalse: [b borderWidth: 0]. "default is none"
  row addMorphBack: b.
  (((lastGuy := spec last asLowercase) includesSubstring: 'menu') or:
  [lastGuy includesSubstring: 'designations'])
  ifTrue: [b actWhen: #buttonDown]]].  "pop up menu on mouseDown"
  col addMorphBack: row.
  ^ col!

Item was changed:
  ----- Method: BooklikeMorph>>shortControlSpecs (in category 'page controls') -----
  shortControlSpecs
  "Answer  specs defining the widgets in the short form of the control panel."
 
  ^ {
+ {#MenuIcon. #invokeShortBookMenu. 'Click here to get a menu of options for this book.' translated}.
- #spacer.
  #variableSpacer.
+ {#PrevPage. #previousPage. 'Previous page' translated}.
- {'<'. #previousPage. 'Previous page' translated}.
  #spacer.
+ #pageNumber.
- {#MenuIcon. #invokeShortBookMenu. 'Click here to get a menu of options for this book.' translated}.
  #spacer.
+ {#NextPage. #nextPage. 'Next page' translated}.
- {'>'. #nextPage. 'Next page' translated}.
  #spacer.
  #variableSpacer.
+ {'...'. #showMoreControls. 'More controls' translated}
- {#RightCaret. #showMoreControls. 'More controls' translated}
  }
  !

Item was changed:
  ----- Method: ScrapBook>>addToTrash: (in category 'scraps') -----
  addToTrash: aMorph
  "Paste the object onto a page of the system Trash book, unless the preference is set to empty the trash immediately."
 
  | aPage |
  TrashCanMorph preserveTrash ifFalse: [^ self].
 
  aMorph position: book pages first position + (0@40).
  book pages do: [:pp |
  (pp submorphs size = 1 and: [pp hasProperty: #trash]) ifTrue:  "perhaps remove that property here"
  ["page is blank"
  ^ pp addMorph: aMorph]].
+ aPage := book insertPageLabel: ('{1} {2}' format: Time dateAndTimeNow)
- aPage := book insertPageLabel: Time dateAndTimeNow printString
  morphs: (Array with: aMorph).
  aPage setProperty: #trash toValue: true!

Item was changed:
  ----- Method: ScrapBook>>scrapBook (in category 'scraps') -----
  scrapBook
  | header aButton label |
  ^ book ifNil: [
+ book := BookMorph new pageSize: 300@300; setNameTo: 'scraps' translated.
+ book addCornerGrips.
- book := BookMorph new pageSize: 200@300; setNameTo: 'scraps' translated.
  book color: Color yellow muchLighter.
  book borderColor: Color darkGray; borderWidth: 2.
  book removeEverything; showPageControls; insertPage.
+
  header := AlignmentMorph newRow wrapCentering: #center; cellPositioning: #leftCenter.
  header setProperty: #header toValue: true.
+ header addMorph: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Collapse').
- header addMorph: (aButton := SimpleButtonMorph new label: 'O' font: Preferences standardButtonFont).
  aButton target: book;
- color:  Color tan;
  actionSelector: #delete;
  setBalloonText: 'Close the trashcan.\(to view again later, click on any trashcan).' withCRs translated.
-
  header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
  header addMorphBack: (label := UpdatingStringMorph new target: self) beSticky.
  label getSelector: #trashTitle; useStringFormat; step.
  header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
+ header addMorphBack: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Dismiss').
+ aButton target: self;
+ actionSelector: #maybeEmptyTrash;
- header addMorphBack: (aButton := SimpleButtonMorph new label: 'E' translated font: Preferences standardButtonFont).
- aButton target: self; color:  Color veryLightGray; actionSelector: #maybeEmptyTrash;
  setBalloonText: 'Click here to empty the trash.' translated.
+ book currentPage
+ layoutPolicy: TableLayout new;
+ addMorph: (TextMorph new
+ contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later.  To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the "-" control (behind "..."). You can empty out all the objects in the trash can by hitting the "X" button at top right.' withCRs translated;
+ hResizing: #spaceFill).
- book currentPage addMorph: (TextMorph new contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later.  To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the - control, and you can empty out all the objects in the trash can by hitting the "E" button at top right.' withCRs translated
- wrappedTo: 190).
 
  book addMorphFront: header.
  book setProperty: #scraps toValue: true].!

Item was changed:
  ----- Method: ScrapBook>>trashTitle (in category 'scraps') -----
  trashTitle
+
+ ^ 'T R A S H' translated!
- | label pgs |
- label := 'T R A S H' translated.
- ^ (pgs := book pages size) < 2
- ifTrue:
- [label]
- ifFalse:
- [label, ('  ({1} pages)' translated format:{pgs})]!

Item was changed:
+ ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'dropping/grabbing') -----
- ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'layout') -----
  acceptDroppingMorph: aMorph event: evt
  SoundService soundEnabled
  ifTrue: [TrashCanMorph preserveTrash
  ifTrue: [self class playDeleteSound]
  ifFalse: [self playSoundNamed: 'scratch']].
  evt hand visible: true.
  self state: #off.
  aMorph delete.
  aMorph == ScrapBook default scrapBook
  ifFalse: [ScrapBook default addToTrash: aMorph removeHalo]!



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: MorphicExtras-mt.269.mcz

marcel.taeumel

Am 14.02.2020 15:09:00 schrieb [hidden email] <[hidden email]>:

Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-mt.269.mcz

==================== Summary ====================

Name: MorphicExtras-mt.269
Author: mt
Time: 14 February 2020, 3:07:58.332667 pm
UUID: 825d4289-5a5b-3e4e-8828-f518d1a1a8c3
Ancestors: MorphicExtras-mt.268

Some fixes in scrap book and book morph in support of Etoys.

=============== Diff against MorphicExtras-mt.268 ===============

Item was changed:
----- Method: BookMorph>>insertPageLabel:morphs: (in category 'insert and delete') -----
insertPageLabel: labelString morphs: morphList

| m c labelAllowance |
self insertPage.
labelString ifNotNil:
+ [m := labelString asMorph.
- [m := (TextMorph new extent: currentPage width@20; contents: labelString).
m lock.
m position: currentPage position + (((currentPage width - m width) // 2) @ 5).
currentPage addMorph: m.
labelAllowance := 40]
ifNil:
[labelAllowance := 0].

"use a column to align the given morphs, then add them to the page"
c := AlignmentMorph newColumn wrapCentering: #center; cellPositioning: #topCenter.
c addAllMorphs: morphList.
c position: currentPage position + (0 @ labelAllowance).
currentPage addAllMorphs: morphList.
^ currentPage
!

Item was changed:
----- Method: BooklikeMorph>>fullControlSpecs (in category 'page controls') -----
fullControlSpecs

^ {
#spacer.
#variableSpacer.
{'-'. #deletePage. 'Delete this page' translated}.
#spacer.
{'«'. #firstPage. 'First page' translated}.
#spacer.
{'<'. #previouspage.="" 'previous="" page'="" translated}.="">
#spacer.
{'·'. #invokeBookMenu. 'Click here to get a menu of options for this book.' translated}.
#spacer.
{'>'. #nextPage. 'Next page' translated}.
#spacer.
{ '»'. #lastPage. 'Final page' translated}.
#spacer.
{'+'. #insertPage. 'Add a new page after this one' translated}.
#variableSpacer.
+ {'o'. #fewerPageControls. 'Fewer controls' translated}
- {'³'. #fewerPageControls. 'Fewer controls' translated}
}
!

Item was changed:
----- Method: BooklikeMorph>>makePageControlsFrom: (in category 'page controls') -----
makePageControlsFrom: controlSpecs
"From the controlSpecs, create a set of page control and return them -- this method does *not* add the controls to the receiver."

| c col row |
+ c := (color saturation > 0.4) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
- c := (color saturation > 0.1) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
col := AlignmentMorph newColumn.
col color: c; borderWidth: 0; layoutInset: 0.
col hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.

row := AlignmentMorph newRow.
row color: c; borderWidth: 0; layoutInset: 0.
row hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
controlSpecs do: [:spec | | lastGuy b |
spec == #showDescription ifTrue: [row addMorphBack: self makeDescriptionViewer].
spec == #pageNumber ifTrue: [row addMorphBack: self makePageNumberItem].
spec == #spacer ifTrue: [row addTransparentSpacerOfSize: (10 @ 0)].
spec == #variableSpacer ifTrue: [
row addMorphBack: AlignmentMorph newVariableTransparentSpacer].
spec class == Array ifTrue: [
spec first isSymbol
ifTrue: [b := ThreePhaseButtonMorph labelSymbol: spec first]
ifFalse: [b := SimpleButtonMorph new borderWidth: 2;
+ borderColor: Color black; color: Color white.
- borderColor: Color black; color: Color veryLightGray.
b label: spec first font: Preferences standardMenuFont].
b target: self; actionSelector: spec second; setBalloonText: spec third.
(spec atPin: 4) = #border
ifTrue: [b actWhen: #buttonDown]
ifFalse: [b borderWidth: 0]. "default is none"
row addMorphBack: b.
(((lastGuy := spec last asLowercase) includesSubstring: 'menu') or:
[lastGuy includesSubstring: 'designations'])
ifTrue: [b actWhen: #buttonDown]]]. "pop up menu on mouseDown"
col addMorphBack: row.
^ col!

Item was changed:
----- Method: BooklikeMorph>>shortControlSpecs (in category 'page controls') -----
shortControlSpecs
"Answer specs defining the widgets in the short form of the control panel."

^ {
+ {#MenuIcon. #invokeShortBookMenu. 'Click here to get a menu of options for this book.' translated}.
- #spacer.
#variableSpacer.
+ {#PrevPage. #previousPage. 'Previous page' translated}.
- {'<'. #previouspage.="" 'previous="" page'="" translated}.="">
#spacer.
+ #pageNumber.
- {#MenuIcon. #invokeShortBookMenu. 'Click here to get a menu of options for this book.' translated}.
#spacer.
+ {#NextPage. #nextPage. 'Next page' translated}.
- {'>'. #nextPage. 'Next page' translated}.
#spacer.
#variableSpacer.
+ {'...'. #showMoreControls. 'More controls' translated}
- {#RightCaret. #showMoreControls. 'More controls' translated}
}
!

Item was changed:
----- Method: ScrapBook>>addToTrash: (in category 'scraps') -----
addToTrash: aMorph
"Paste the object onto a page of the system Trash book, unless the preference is set to empty the trash immediately."

| aPage |
TrashCanMorph preserveTrash ifFalse: [^ self].

aMorph position: book pages first position + (0@40).
book pages do: [:pp |
(pp submorphs size = 1 and: [pp hasProperty: #trash]) ifTrue: "perhaps remove that property here"
["page is blank"
^ pp addMorph: aMorph]].
+ aPage := book insertPageLabel: ('{1} {2}' format: Time dateAndTimeNow)
- aPage := book insertPageLabel: Time dateAndTimeNow printString
morphs: (Array with: aMorph).
aPage setProperty: #trash toValue: true!

Item was changed:
----- Method: ScrapBook>>scrapBook (in category 'scraps') -----
scrapBook
| header aButton label |
^ book ifNil: [
+ book := BookMorph new pageSize: 300@300; setNameTo: 'scraps' translated.
+ book addCornerGrips.
- book := BookMorph new pageSize: 200@300; setNameTo: 'scraps' translated.
book color: Color yellow muchLighter.
book borderColor: Color darkGray; borderWidth: 2.
book removeEverything; showPageControls; insertPage.
+
header := AlignmentMorph newRow wrapCentering: #center; cellPositioning: #leftCenter.
header setProperty: #header toValue: true.
+ header addMorph: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Collapse').
- header addMorph: (aButton := SimpleButtonMorph new label: 'O' font: Preferences standardButtonFont).
aButton target: book;
- color: Color tan;
actionSelector: #delete;
setBalloonText: 'Close the trashcan.\(to view again later, click on any trashcan).' withCRs translated.
-
header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
header addMorphBack: (label := UpdatingStringMorph new target: self) beSticky.
label getSelector: #trashTitle; useStringFormat; step.
header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
+ header addMorphBack: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Dismiss').
+ aButton target: self;
+ actionSelector: #maybeEmptyTrash;
- header addMorphBack: (aButton := SimpleButtonMorph new label: 'E' translated font: Preferences standardButtonFont).
- aButton target: self; color: Color veryLightGray; actionSelector: #maybeEmptyTrash;
setBalloonText: 'Click here to empty the trash.' translated.
+ book currentPage
+ layoutPolicy: TableLayout new;
+ addMorph: (TextMorph new
+ contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later. To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the "-" control (behind "..."). You can empty out all the objects in the trash can by hitting the "X" button at top right.' withCRs translated;
+ hResizing: #spaceFill).
- book currentPage addMorph: (TextMorph new contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later. To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the - control, and you can empty out all the objects in the trash can by hitting the "E" button at top right.' withCRs translated
- wrappedTo: 190).

book addMorphFront: header.
book setProperty: #scraps toValue: true].!

Item was changed:
----- Method: ScrapBook>>trashTitle (in category 'scraps') -----
trashTitle
+
+ ^ 'T R A S H' translated!
- | label pgs |
- label := 'T R A S H' translated.
- ^ (pgs := book pages size) < 2="">
- ifTrue:
- [label]
- ifFalse:
- [label, (' ({1} pages)' translated format:{pgs})]!

Item was changed:
+ ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'dropping/grabbing') -----
- ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'layout') -----
acceptDroppingMorph: aMorph event: evt
SoundService soundEnabled
ifTrue: [TrashCanMorph preserveTrash
ifTrue: [self class playDeleteSound]
ifFalse: [self playSoundNamed: 'scratch']].
evt hand visible: true.
self state: #off.
aMorph delete.
aMorph == ScrapBook default scrapBook
ifFalse: [ScrapBook default addToTrash: aMorph removeHalo]!





image.png (16K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: MorphicExtras-mt.269.mcz

Christoph Thiede
In reply to this post by commits-2

> +        ^ 'T R A S H' translated

If we finally will have an intelligent translation service, it will have to be *really* clever :-)

'trash' translated asUppercase joinSeparatedBy: ' '?

Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Freitag, 14. Februar 2020 15:08:46
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: MorphicExtras-mt.269.mcz
 
Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-mt.269.mcz

==================== Summary ====================

Name: MorphicExtras-mt.269
Author: mt
Time: 14 February 2020, 3:07:58.332667 pm
UUID: 825d4289-5a5b-3e4e-8828-f518d1a1a8c3
Ancestors: MorphicExtras-mt.268

Some fixes in scrap book and book morph in support of Etoys.

=============== Diff against MorphicExtras-mt.268 ===============

Item was changed:
  ----- Method: BookMorph>>insertPageLabel:morphs: (in category 'insert and delete') -----
  insertPageLabel: labelString morphs: morphList
 
         | m c labelAllowance |
         self insertPage.
         labelString ifNotNil:
+                        [m := labelString asMorph.
-                        [m := (TextMorph new extent: currentPage width@20; contents: labelString).
                 m lock.
                 m position: currentPage position + (((currentPage width - m width) // 2) @ 5).
                 currentPage addMorph: m.
                 labelAllowance := 40]
                 ifNil:
                         [labelAllowance := 0].
 
         "use a column to align the given morphs, then add them to the page"
         c := AlignmentMorph newColumn wrapCentering: #center; cellPositioning: #topCenter.
         c addAllMorphs: morphList.
         c position: currentPage position + (0 @ labelAllowance).
         currentPage addAllMorphs: morphList.
         ^ currentPage
  !

Item was changed:
  ----- Method: BooklikeMorph>>fullControlSpecs (in category 'page controls') -----
  fullControlSpecs
 
         ^ {
                 #spacer.
                 #variableSpacer.
                 {'-'.           #deletePage.                            'Delete this page' translated}.
                 #spacer.
                 {'«'.           #firstPage.                             'First page' translated}.
                 #spacer.
                 {'<'.            #previousPage.                  'Previous page' translated}.
                 #spacer.
                 {'·'.           #invokeBookMenu.                 'Click here to get a menu of options for this book.' translated}.
                 #spacer.
                 {'>'.           #nextPage.                              'Next page' translated}.
                 #spacer.
                 { '»'.          #lastPage.                              'Final page' translated}.
                 #spacer.
                 {'+'.           #insertPage.                            'Add a new page after this one' translated}.
                 #variableSpacer.
+                {'o'.           #fewerPageControls.     'Fewer controls' translated}
-                {'³'.           #fewerPageControls.     'Fewer controls' translated}
  }
  !

Item was changed:
  ----- Method: BooklikeMorph>>makePageControlsFrom: (in category 'page controls') -----
  makePageControlsFrom: controlSpecs
         "From the controlSpecs, create a set of page control and return them -- this method does *not* add the controls to the receiver."
 
         | c col row |
+        c := (color saturation > 0.4) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
-        c := (color saturation > 0.1) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
         col := AlignmentMorph newColumn.
         col color: c; borderWidth: 0; layoutInset: 0.
         col hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
 
         row := AlignmentMorph newRow.
         row color: c; borderWidth: 0; layoutInset: 0.
         row hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
         controlSpecs do: [:spec | | lastGuy b |
                 spec == #showDescription ifTrue: [row addMorphBack: self makeDescriptionViewer].
                 spec == #pageNumber ifTrue: [row addMorphBack: self makePageNumberItem].
                 spec == #spacer ifTrue: [row addTransparentSpacerOfSize: (10 @ 0)].
                 spec == #variableSpacer ifTrue: [
                         row addMorphBack: AlignmentMorph newVariableTransparentSpacer].
                 spec class == Array ifTrue: [
                         spec first isSymbol
                                 ifTrue: [b := ThreePhaseButtonMorph labelSymbol: spec first]
                                 ifFalse: [b := SimpleButtonMorph new borderWidth: 2;
+                                                        borderColor: Color black; color: Color white.
-                                                        borderColor: Color black; color: Color veryLightGray.
                                                         b label: spec first font: Preferences standardMenuFont].
                                 b target: self;  actionSelector: spec second;  setBalloonText: spec third.
                                 (spec atPin: 4) = #border
                                         ifTrue: [b actWhen: #buttonDown]
                                         ifFalse: [b borderWidth: 0].    "default is none"
                                 row addMorphBack: b.
                                 (((lastGuy := spec last asLowercase) includesSubstring: 'menu') or:
                                                 [lastGuy includesSubstring: 'designations'])
                                         ifTrue: [b actWhen: #buttonDown]]].  "pop up menu on mouseDown"
                 col addMorphBack: row.
         ^ col!

Item was changed:
  ----- Method: BooklikeMorph>>shortControlSpecs (in category 'page controls') -----
  shortControlSpecs
         "Answer  specs defining the widgets in the short form of the control panel."
 
  ^ {
+                {#MenuIcon.             #invokeShortBookMenu.            'Click here to get a menu of options for this book.' translated}.
-                #spacer.
                 #variableSpacer.
+                {#PrevPage.              #previousPage.                  'Previous page' translated}.
-                {'<'.            #previousPage.                  'Previous page' translated}.
                 #spacer.
+                #pageNumber.
-                {#MenuIcon.             #invokeShortBookMenu.            'Click here to get a menu of options for this book.' translated}.
                 #spacer.
+                {#NextPage.             #nextPage.                              'Next page' translated}.
-                {'>'.           #nextPage.                              'Next page' translated}.
                 #spacer.
                 #variableSpacer.
+                {'...'.         #showMoreControls.              'More controls' translated}
-                {#RightCaret.           #showMoreControls.              'More controls' translated}
  }
  !

Item was changed:
  ----- Method: ScrapBook>>addToTrash: (in category 'scraps') -----
  addToTrash: aMorph
         "Paste the object onto a page of the system Trash book, unless the preference is set to empty the trash immediately."
 
         | aPage |
         TrashCanMorph preserveTrash ifFalse: [^ self].
 
         aMorph position: book pages first position + (0@40).
         book pages do: [:pp |
                 (pp submorphs size = 1 and: [pp hasProperty: #trash]) ifTrue:  "perhaps remove that property here"
                         ["page is blank"
                         ^ pp addMorph: aMorph]].
+        aPage := book insertPageLabel: ('{1} {2}' format: Time dateAndTimeNow)
-        aPage := book insertPageLabel: Time dateAndTimeNow printString
                 morphs: (Array with: aMorph).
         aPage setProperty: #trash toValue: true!

Item was changed:
  ----- Method: ScrapBook>>scrapBook (in category 'scraps') -----
  scrapBook
         | header aButton label |
         ^ book ifNil: [
+                book := BookMorph new pageSize: 300@300; setNameTo: 'scraps' translated.
+                book addCornerGrips.
-                book := BookMorph new pageSize: 200@300; setNameTo: 'scraps' translated.
                 book color: Color yellow muchLighter.
                 book borderColor: Color darkGray; borderWidth: 2.
                 book removeEverything; showPageControls; insertPage.
+
                 header := AlignmentMorph newRow wrapCentering: #center; cellPositioning: #leftCenter.
                 header setProperty: #header toValue: true.
+                header addMorph: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Collapse').
-                header addMorph: (aButton := SimpleButtonMorph new label: 'O' font: Preferences standardButtonFont).
                 aButton target: book;
-                        color:  Color tan;
                         actionSelector: #delete;
                         setBalloonText: 'Close the trashcan.\(to view again later, click on any trashcan).' withCRs translated.
-
                 header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
                 header addMorphBack:     (label := UpdatingStringMorph new target: self) beSticky.
                 label getSelector: #trashTitle; useStringFormat; step.
                 header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
+                header addMorphBack: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Dismiss').
+                aButton target: self;
+                        actionSelector: #maybeEmptyTrash;
-                header addMorphBack: (aButton := SimpleButtonMorph new label: 'E' translated font: Preferences standardButtonFont).
-                aButton target: self; color:  Color veryLightGray; actionSelector: #maybeEmptyTrash;
                         setBalloonText: 'Click here to empty the trash.' translated.
+                book currentPage
+                        layoutPolicy: TableLayout new;
+                        addMorph: (TextMorph new
+                                contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later.  To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the "-" control (behind "..."). You can empty out all the objects in the trash can by hitting the "X" button at top right.' withCRs translated;
+                                hResizing: #spaceFill).
-                book currentPage addMorph: (TextMorph new contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later.  To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the - control, and you can empty out all the objects in the trash can by hitting the "E" button at top right.' withCRs translated
-                wrappedTo: 190).
 
                 book addMorphFront: header.
                 book setProperty: #scraps toValue: true].!

Item was changed:
  ----- Method: ScrapBook>>trashTitle (in category 'scraps') -----
  trashTitle
+
+        ^ 'T R A S H' translated!
-        | label pgs |
-        label := 'T R A S H' translated.
-        ^ (pgs := book pages size) < 2
-                ifTrue:
-                        [label]
-                ifFalse:
-                        [label, ('  ({1} pages)' translated format:{pgs})]!

Item was changed:
+ ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'dropping/grabbing') -----
- ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'layout') -----
  acceptDroppingMorph: aMorph event: evt
         SoundService soundEnabled
                 ifTrue: [TrashCanMorph preserveTrash
                                 ifTrue: [self class playDeleteSound]
                                 ifFalse: [self playSoundNamed: 'scratch']].
         evt hand visible: true.
         self state: #off.
         aMorph delete.
         aMorph == ScrapBook default scrapBook
                 ifFalse: [ScrapBook default addToTrash: aMorph removeHalo]!



Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: MorphicExtras-mt.269.mcz

Christoph Thiede

'trash' translated asUppercase joinSeparatedBy: ' '?


Or even better, using TextKernel ...


Von: Thiede, Christoph
Gesendet: Freitag, 14. Februar 2020 15:12:24
An: [hidden email]; [hidden email]
Betreff: AW: [squeak-dev] The Trunk: MorphicExtras-mt.269.mcz
 

> +        ^ 'T R A S H' translated

If we finally will have an intelligent translation service, it will have to be *really* clever :-)

'trash' translated asUppercase joinSeparatedBy: ' '?

Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Freitag, 14. Februar 2020 15:08:46
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: MorphicExtras-mt.269.mcz
 
Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-mt.269.mcz

==================== Summary ====================

Name: MorphicExtras-mt.269
Author: mt
Time: 14 February 2020, 3:07:58.332667 pm
UUID: 825d4289-5a5b-3e4e-8828-f518d1a1a8c3
Ancestors: MorphicExtras-mt.268

Some fixes in scrap book and book morph in support of Etoys.

=============== Diff against MorphicExtras-mt.268 ===============

Item was changed:
  ----- Method: BookMorph>>insertPageLabel:morphs: (in category 'insert and delete') -----
  insertPageLabel: labelString morphs: morphList
 
         | m c labelAllowance |
         self insertPage.
         labelString ifNotNil:
+                        [m := labelString asMorph.
-                        [m := (TextMorph new extent: currentPage width@20; contents: labelString).
                 m lock.
                 m position: currentPage position + (((currentPage width - m width) // 2) @ 5).
                 currentPage addMorph: m.
                 labelAllowance := 40]
                 ifNil:
                         [labelAllowance := 0].
 
         "use a column to align the given morphs, then add them to the page"
         c := AlignmentMorph newColumn wrapCentering: #center; cellPositioning: #topCenter.
         c addAllMorphs: morphList.
         c position: currentPage position + (0 @ labelAllowance).
         currentPage addAllMorphs: morphList.
         ^ currentPage
  !

Item was changed:
  ----- Method: BooklikeMorph>>fullControlSpecs (in category 'page controls') -----
  fullControlSpecs
 
         ^ {
                 #spacer.
                 #variableSpacer.
                 {'-'.           #deletePage.                            'Delete this page' translated}.
                 #spacer.
                 {'«'.           #firstPage.                             'First page' translated}.
                 #spacer.
                 {'<'.            #previousPage.                  'Previous page' translated}.
                 #spacer.
                 {'·'.           #invokeBookMenu.                 'Click here to get a menu of options for this book.' translated}.
                 #spacer.
                 {'>'.           #nextPage.                              'Next page' translated}.
                 #spacer.
                 { '»'.          #lastPage.                              'Final page' translated}.
                 #spacer.
                 {'+'.           #insertPage.                            'Add a new page after this one' translated}.
                 #variableSpacer.
+                {'o'.           #fewerPageControls.     'Fewer controls' translated}
-                {'³'.           #fewerPageControls.     'Fewer controls' translated}
  }
  !

Item was changed:
  ----- Method: BooklikeMorph>>makePageControlsFrom: (in category 'page controls') -----
  makePageControlsFrom: controlSpecs
         "From the controlSpecs, create a set of page control and return them -- this method does *not* add the controls to the receiver."
 
         | c col row |
+        c := (color saturation > 0.4) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
-        c := (color saturation > 0.1) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
         col := AlignmentMorph newColumn.
         col color: c; borderWidth: 0; layoutInset: 0.
         col hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
 
         row := AlignmentMorph newRow.
         row color: c; borderWidth: 0; layoutInset: 0.
         row hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
         controlSpecs do: [:spec | | lastGuy b |
                 spec == #showDescription ifTrue: [row addMorphBack: self makeDescriptionViewer].
                 spec == #pageNumber ifTrue: [row addMorphBack: self makePageNumberItem].
                 spec == #spacer ifTrue: [row addTransparentSpacerOfSize: (10 @ 0)].
                 spec == #variableSpacer ifTrue: [
                         row addMorphBack: AlignmentMorph newVariableTransparentSpacer].
                 spec class == Array ifTrue: [
                         spec first isSymbol
                                 ifTrue: [b := ThreePhaseButtonMorph labelSymbol: spec first]
                                 ifFalse: [b := SimpleButtonMorph new borderWidth: 2;
+                                                        borderColor: Color black; color: Color white.
-                                                        borderColor: Color black; color: Color veryLightGray.
                                                         b label: spec first font: Preferences standardMenuFont].
                                 b target: self;  actionSelector: spec second;  setBalloonText: spec third.
                                 (spec atPin: 4) = #border
                                         ifTrue: [b actWhen: #buttonDown]
                                         ifFalse: [b borderWidth: 0].    "default is none"
                                 row addMorphBack: b.
                                 (((lastGuy := spec last asLowercase) includesSubstring: 'menu') or:
                                                 [lastGuy includesSubstring: 'designations'])
                                         ifTrue: [b actWhen: #buttonDown]]].  "pop up menu on mouseDown"
                 col addMorphBack: row.
         ^ col!

Item was changed:
  ----- Method: BooklikeMorph>>shortControlSpecs (in category 'page controls') -----
  shortControlSpecs
         "Answer  specs defining the widgets in the short form of the control panel."
 
  ^ {
+                {#MenuIcon.             #invokeShortBookMenu.            'Click here to get a menu of options for this book.' translated}.
-                #spacer.
                 #variableSpacer.
+                {#PrevPage.              #previousPage.                  'Previous page' translated}.
-                {'<'.            #previousPage.                  'Previous page' translated}.
                 #spacer.
+                #pageNumber.
-                {#MenuIcon.             #invokeShortBookMenu.            'Click here to get a menu of options for this book.' translated}.
                 #spacer.
+                {#NextPage.             #nextPage.                              'Next page' translated}.
-                {'>'.           #nextPage.                              'Next page' translated}.
                 #spacer.
                 #variableSpacer.
+                {'...'.         #showMoreControls.              'More controls' translated}
-                {#RightCaret.           #showMoreControls.              'More controls' translated}
  }
  !

Item was changed:
  ----- Method: ScrapBook>>addToTrash: (in category 'scraps') -----
  addToTrash: aMorph
         "Paste the object onto a page of the system Trash book, unless the preference is set to empty the trash immediately."
 
         | aPage |
         TrashCanMorph preserveTrash ifFalse: [^ self].
 
         aMorph position: book pages first position + (0@40).
         book pages do: [:pp |
                 (pp submorphs size = 1 and: [pp hasProperty: #trash]) ifTrue:  "perhaps remove that property here"
                         ["page is blank"
                         ^ pp addMorph: aMorph]].
+        aPage := book insertPageLabel: ('{1} {2}' format: Time dateAndTimeNow)
-        aPage := book insertPageLabel: Time dateAndTimeNow printString
                 morphs: (Array with: aMorph).
         aPage setProperty: #trash toValue: true!

Item was changed:
  ----- Method: ScrapBook>>scrapBook (in category 'scraps') -----
  scrapBook
         | header aButton label |
         ^ book ifNil: [
+                book := BookMorph new pageSize: 300@300; setNameTo: 'scraps' translated.
+                book addCornerGrips.
-                book := BookMorph new pageSize: 200@300; setNameTo: 'scraps' translated.
                 book color: Color yellow muchLighter.
                 book borderColor: Color darkGray; borderWidth: 2.
                 book removeEverything; showPageControls; insertPage.
+
                 header := AlignmentMorph newRow wrapCentering: #center; cellPositioning: #leftCenter.
                 header setProperty: #header toValue: true.
+                header addMorph: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Collapse').
-                header addMorph: (aButton := SimpleButtonMorph new label: 'O' font: Preferences standardButtonFont).
                 aButton target: book;
-                        color:  Color tan;
                         actionSelector: #delete;
                         setBalloonText: 'Close the trashcan.\(to view again later, click on any trashcan).' withCRs translated.
-
                 header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
                 header addMorphBack:     (label := UpdatingStringMorph new target: self) beSticky.
                 label getSelector: #trashTitle; useStringFormat; step.
                 header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
+                header addMorphBack: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Dismiss').
+                aButton target: self;
+                        actionSelector: #maybeEmptyTrash;
-                header addMorphBack: (aButton := SimpleButtonMorph new label: 'E' translated font: Preferences standardButtonFont).
-                aButton target: self; color:  Color veryLightGray; actionSelector: #maybeEmptyTrash;
                         setBalloonText: 'Click here to empty the trash.' translated.
+                book currentPage
+                        layoutPolicy: TableLayout new;
+                        addMorph: (TextMorph new
+                                contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later.  To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the "-" control (behind "..."). You can empty out all the objects in the trash can by hitting the "X" button at top right.' withCRs translated;
+                                hResizing: #spaceFill).
-                book currentPage addMorph: (TextMorph new contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later.  To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the - control, and you can empty out all the objects in the trash can by hitting the "E" button at top right.' withCRs translated
-                wrappedTo: 190).
 
                 book addMorphFront: header.
                 book setProperty: #scraps toValue: true].!

Item was changed:
  ----- Method: ScrapBook>>trashTitle (in category 'scraps') -----
  trashTitle
+
+        ^ 'T R A S H' translated!
-        | label pgs |
-        label := 'T R A S H' translated.
-        ^ (pgs := book pages size) < 2
-                ifTrue:
-                        [label]
-                ifFalse:
-                        [label, ('  ({1} pages)' translated format:{pgs})]!

Item was changed:
+ ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'dropping/grabbing') -----
- ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'layout') -----
  acceptDroppingMorph: aMorph event: evt
         SoundService soundEnabled
                 ifTrue: [TrashCanMorph preserveTrash
                                 ifTrue: [self class playDeleteSound]
                                 ifFalse: [self playSoundNamed: 'scratch']].
         evt hand visible: true.
         self state: #off.
         aMorph delete.
         aMorph == ScrapBook default scrapBook
                 ifFalse: [ScrapBook default addToTrash: aMorph removeHalo]!



Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: MorphicExtras-mt.269.mcz

marcel.taeumel
If we finally will have an intelligent translation service, it will have to be *really* clever :-)

What do you mean? That string can just be translated through GetText like all other strings. The database has an entry for "T R A S H" and somebody can translate it to "M Ü L L" or whatever. No need to convert the spacing later on. It worked in the past.

Best,
Marcel

Am 14.02.2020 15:13:06 schrieb Thiede, Christoph <[hidden email]>:

'trash' translated asUppercase joinSeparatedBy: ' '?


Or even better, using TextKernel ...


Von: Thiede, Christoph
Gesendet: Freitag, 14. Februar 2020 15:12:24
An: [hidden email]; [hidden email]
Betreff: AW: [squeak-dev] The Trunk: MorphicExtras-mt.269.mcz
 

> +        ^ 'T R A S H' translated

If we finally will have an intelligent translation service, it will have to be *really* clever :-)

'trash' translated asUppercase joinSeparatedBy: ' '?

Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Freitag, 14. Februar 2020 15:08:46
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: MorphicExtras-mt.269.mcz
 
Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-mt.269.mcz

==================== Summary ====================

Name: MorphicExtras-mt.269
Author: mt
Time: 14 February 2020, 3:07:58.332667 pm
UUID: 825d4289-5a5b-3e4e-8828-f518d1a1a8c3
Ancestors: MorphicExtras-mt.268

Some fixes in scrap book and book morph in support of Etoys.

=============== Diff against MorphicExtras-mt.268 ===============

Item was changed:
  ----- Method: BookMorph>>insertPageLabel:morphs: (in category 'insert and delete') -----
  insertPageLabel: labelString morphs: morphList
 
         | m c labelAllowance |
         self insertPage.
         labelString ifNotNil:
+                        [m := labelString asMorph.
-                        [m := (TextMorph new extent: currentPage width@20; contents: labelString).
                 m lock.
                 m position: currentPage position + (((currentPage width - m width) // 2) @ 5).
                 currentPage addMorph: m.
                 labelAllowance := 40]
                 ifNil:
                         [labelAllowance := 0].
 
         "use a column to align the given morphs, then add them to the page"
         c := AlignmentMorph newColumn wrapCentering: #center; cellPositioning: #topCenter.
         c addAllMorphs: morphList.
         c position: currentPage position + (0 @ labelAllowance).
         currentPage addAllMorphs: morphList.
         ^ currentPage
  !

Item was changed:
  ----- Method: BooklikeMorph>>fullControlSpecs (in category 'page controls') -----
  fullControlSpecs
 
         ^ {
                 #spacer.
                 #variableSpacer.
                 {'-'.           #deletePage.                            'Delete this page' translated}.
                 #spacer.
                 {'«'.           #firstPage.                             'First page' translated}.
                 #spacer.
                 {'<'.            #previousPage.                  'Previous page' translated}.
                 #spacer.
                 {'·'.           #invokeBookMenu.                 'Click here to get a menu of options for this book.' translated}.
                 #spacer.
                 {'>'.           #nextPage.                              'Next page' translated}.
                 #spacer.
                 { '»'.          #lastPage.                              'Final page' translated}.
                 #spacer.
                 {'+'.           #insertPage.                            'Add a new page after this one' translated}.
                 #variableSpacer.
+                {'o'.           #fewerPageControls.     'Fewer controls' translated}
-                {'³'.           #fewerPageControls.     'Fewer controls' translated}
  }
  !

Item was changed:
  ----- Method: BooklikeMorph>>makePageControlsFrom: (in category 'page controls') -----
  makePageControlsFrom: controlSpecs
         "From the controlSpecs, create a set of page control and return them -- this method does *not* add the controls to the receiver."
 
         | c col row |
+        c := (color saturation > 0.4) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
-        c := (color saturation > 0.1) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
         col := AlignmentMorph newColumn.
         col color: c; borderWidth: 0; layoutInset: 0.
         col hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
 
         row := AlignmentMorph newRow.
         row color: c; borderWidth: 0; layoutInset: 0.
         row hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
         controlSpecs do: [:spec | | lastGuy b |
                 spec == #showDescription ifTrue: [row addMorphBack: self makeDescriptionViewer].
                 spec == #pageNumber ifTrue: [row addMorphBack: self makePageNumberItem].
                 spec == #spacer ifTrue: [row addTransparentSpacerOfSize: (10 @ 0)].
                 spec == #variableSpacer ifTrue: [
                         row addMorphBack: AlignmentMorph newVariableTransparentSpacer].
                 spec class == Array ifTrue: [
                         spec first isSymbol
                                 ifTrue: [b := ThreePhaseButtonMorph labelSymbol: spec first]
                                 ifFalse: [b := SimpleButtonMorph new borderWidth: 2;
+                                                        borderColor: Color black; color: Color white.
-                                                        borderColor: Color black; color: Color veryLightGray.
                                                         b label: spec first font: Preferences standardMenuFont].
                                 b target: self;  actionSelector: spec second;  setBalloonText: spec third.
                                 (spec atPin: 4) = #border
                                         ifTrue: [b actWhen: #buttonDown]
                                         ifFalse: [b borderWidth: 0].    "default is none"
                                 row addMorphBack: b.
                                 (((lastGuy := spec last asLowercase) includesSubstring: 'menu') or:
                                                 [lastGuy includesSubstring: 'designations'])
                                         ifTrue: [b actWhen: #buttonDown]]].  "pop up menu on mouseDown"
                 col addMorphBack: row.
         ^ col!

Item was changed:
  ----- Method: BooklikeMorph>>shortControlSpecs (in category 'page controls') -----
  shortControlSpecs
         "Answer  specs defining the widgets in the short form of the control panel."
 
  ^ {
+                {#MenuIcon.             #invokeShortBookMenu.            'Click here to get a menu of options for this book.' translated}.
-                #spacer.
                 #variableSpacer.
+                {#PrevPage.              #previousPage.                  'Previous page' translated}.
-                {'<'.            #previousPage.                  'Previous page' translated}.
                 #spacer.
+                #pageNumber.
-                {#MenuIcon.             #invokeShortBookMenu.            'Click here to get a menu of options for this book.' translated}.
                 #spacer.
+                {#NextPage.             #nextPage.                              'Next page' translated}.
-                {'>'.           #nextPage.                              'Next page' translated}.
                 #spacer.
                 #variableSpacer.
+                {'...'.         #showMoreControls.              'More controls' translated}
-                {#RightCaret.           #showMoreControls.              'More controls' translated}
  }
  !

Item was changed:
  ----- Method: ScrapBook>>addToTrash: (in category 'scraps') -----
  addToTrash: aMorph
         "Paste the object onto a page of the system Trash book, unless the preference is set to empty the trash immediately."
 
         | aPage |
         TrashCanMorph preserveTrash ifFalse: [^ self].
 
         aMorph position: book pages first position + (0@40).
         book pages do: [:pp |
                 (pp submorphs size = 1 and: [pp hasProperty: #trash]) ifTrue:  "perhaps remove that property here"
                         ["page is blank"
                         ^ pp addMorph: aMorph]].
+        aPage := book insertPageLabel: ('{1} {2}' format: Time dateAndTimeNow)
-        aPage := book insertPageLabel: Time dateAndTimeNow printString
                 morphs: (Array with: aMorph).
         aPage setProperty: #trash toValue: true!

Item was changed:
  ----- Method: ScrapBook>>scrapBook (in category 'scraps') -----
  scrapBook
         | header aButton label |
         ^ book ifNil: [
+                book := BookMorph new pageSize: 300@300; setNameTo: 'scraps' translated.
+                book addCornerGrips.
-                book := BookMorph new pageSize: 200@300; setNameTo: 'scraps' translated.
                 book color: Color yellow muchLighter.
                 book borderColor: Color darkGray; borderWidth: 2.
                 book removeEverything; showPageControls; insertPage.
+
                 header := AlignmentMorph newRow wrapCentering: #center; cellPositioning: #leftCenter.
                 header setProperty: #header toValue: true.
+                header addMorph: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Collapse').
-                header addMorph: (aButton := SimpleButtonMorph new label: 'O' font: Preferences standardButtonFont).
                 aButton target: book;
-                        color:  Color tan;
                         actionSelector: #delete;
                         setBalloonText: 'Close the trashcan.\(to view again later, click on any trashcan).' withCRs translated.
-
                 header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
                 header addMorphBack:     (label := UpdatingStringMorph new target: self) beSticky.
                 label getSelector: #trashTitle; useStringFormat; step.
                 header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
+                header addMorphBack: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Dismiss').
+                aButton target: self;
+                        actionSelector: #maybeEmptyTrash;
-                header addMorphBack: (aButton := SimpleButtonMorph new label: 'E' translated font: Preferences standardButtonFont).
-                aButton target: self; color:  Color veryLightGray; actionSelector: #maybeEmptyTrash;
                         setBalloonText: 'Click here to empty the trash.' translated.
+                book currentPage
+                        layoutPolicy: TableLayout new;
+                        addMorph: (TextMorph new
+                                contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later.  To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the "-" control (behind "..."). You can empty out all the objects in the trash can by hitting the "X" button at top right.' withCRs translated;
+                                hResizing: #spaceFill).
-                book currentPage addMorph: (TextMorph new contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later.  To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the - control, and you can empty out all the objects in the trash can by hitting the "E" button at top right.' withCRs translated
-                wrappedTo: 190).
 
                 book addMorphFront: header.
                 book setProperty: #scraps toValue: true].!

Item was changed:
  ----- Method: ScrapBook>>trashTitle (in category 'scraps') -----
  trashTitle
+
+        ^ 'T R A S H' translated!
-        | label pgs |
-        label := 'T R A S H' translated.
-        ^ (pgs := book pages size) < 2
-                ifTrue:
-                        [label]
-                ifFalse:
-                        [label, ('  ({1} pages)' translated format:{pgs})]!

Item was changed:
+ ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'dropping/grabbing') -----
- ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'layout') -----
  acceptDroppingMorph: aMorph event: evt
         SoundService soundEnabled
                 ifTrue: [TrashCanMorph preserveTrash
                                 ifTrue: [self class playDeleteSound]
                                 ifFalse: [self playSoundNamed: 'scratch']].
         evt hand visible: true.
         self state: #off.
         aMorph delete.
         aMorph == ScrapBook default scrapBook
                 ifFalse: [ScrapBook default addToTrash: aMorph removeHalo]!



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: MorphicExtras-mt.269.mcz

Christoph Thiede

I mean, do we really want to have such - literal - trash in the multilingual database? Wouldn't it be better if the database only contained "trash - Müll" and all special formattings were applied after translating? Otherwise, we are eventually ending up with something like


"trash" - "Müll" - "purgamenta"
"(trash)" - "(Müll)" - "(purgamenta)"
"T R A S H" - "M Ü L L" - "P U R G A M E N T A"
"trash: " - "Müll: " - "purgamenta: "

Which is hard to create and hard to maintain. Also, automatic translation services might have problems detecting "T R A S H" as "trash".

Best,
Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Freitag, 14. Februar 2020 18:11 Uhr
An: Javier Diaz-Reinoso via Squeak-dev; [hidden email]
Betreff: Re: [squeak-dev] The Trunk: MorphicExtras-mt.269.mcz
 
If we finally will have an intelligent translation service, it will have to be *really* clever :-)

What do you mean? That string can just be translated through GetText like all other strings. The database has an entry for "T R A S H" and somebody can translate it to "M Ü L L" or whatever. No need to convert the spacing later on. It worked in the past.

Best,
Marcel

Am 14.02.2020 15:13:06 schrieb Thiede, Christoph <[hidden email]>:

'trash' translated asUppercase joinSeparatedBy: ' '?


Or even better, using TextKernel ...


Von: Thiede, Christoph
Gesendet: Freitag, 14. Februar 2020 15:12:24
An: [hidden email]; [hidden email]
Betreff: AW: [squeak-dev] The Trunk: MorphicExtras-mt.269.mcz
 

> +        ^ 'T R A S H' translated

If we finally will have an intelligent translation service, it will have to be *really* clever :-)

'trash' translated asUppercase joinSeparatedBy: ' '?

Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Freitag, 14. Februar 2020 15:08:46
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: MorphicExtras-mt.269.mcz
 
Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-mt.269.mcz

==================== Summary ====================

Name: MorphicExtras-mt.269
Author: mt
Time: 14 February 2020, 3:07:58.332667 pm
UUID: 825d4289-5a5b-3e4e-8828-f518d1a1a8c3
Ancestors: MorphicExtras-mt.268

Some fixes in scrap book and book morph in support of Etoys.

=============== Diff against MorphicExtras-mt.268 ===============

Item was changed:
  ----- Method: BookMorph>>insertPageLabel:morphs: (in category 'insert and delete') -----
  insertPageLabel: labelString morphs: morphList
 
         | m c labelAllowance |
         self insertPage.
         labelString ifNotNil:
+                        [m := labelString asMorph.
-                        [m := (TextMorph new extent: currentPage width@20; contents: labelString).
                 m lock.
                 m position: currentPage position + (((currentPage width - m width) // 2) @ 5).
                 currentPage addMorph: m.
                 labelAllowance := 40]
                 ifNil:
                         [labelAllowance := 0].
 
         "use a column to align the given morphs, then add them to the page"
         c := AlignmentMorph newColumn wrapCentering: #center; cellPositioning: #topCenter.
         c addAllMorphs: morphList.
         c position: currentPage position + (0 @ labelAllowance).
         currentPage addAllMorphs: morphList.
         ^ currentPage
  !

Item was changed:
  ----- Method: BooklikeMorph>>fullControlSpecs (in category 'page controls') -----
  fullControlSpecs
 
         ^ {
                 #spacer.
                 #variableSpacer.
                 {'-'.           #deletePage.                            'Delete this page' translated}.
                 #spacer.
                 {'«'.           #firstPage.                             'First page' translated}.
                 #spacer.
                 {'<'.            #previousPage.                  'Previous page' translated}.
                 #spacer.
                 {'·'.           #invokeBookMenu.                 'Click here to get a menu of options for this book.' translated}.
                 #spacer.
                 {'>'.           #nextPage.                              'Next page' translated}.
                 #spacer.
                 { '»'.          #lastPage.                              'Final page' translated}.
                 #spacer.
                 {'+'.           #insertPage.                            'Add a new page after this one' translated}.
                 #variableSpacer.
+                {'o'.           #fewerPageControls.     'Fewer controls' translated}
-                {'³'.           #fewerPageControls.     'Fewer controls' translated}
  }
  !

Item was changed:
  ----- Method: BooklikeMorph>>makePageControlsFrom: (in category 'page controls') -----
  makePageControlsFrom: controlSpecs
         "From the controlSpecs, create a set of page control and return them -- this method does *not* add the controls to the receiver."
 
         | c col row |
+        c := (color saturation > 0.4) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
-        c := (color saturation > 0.1) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
         col := AlignmentMorph newColumn.
         col color: c; borderWidth: 0; layoutInset: 0.
         col hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
 
         row := AlignmentMorph newRow.
         row color: c; borderWidth: 0; layoutInset: 0.
         row hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
         controlSpecs do: [:spec | | lastGuy b |
                 spec == #showDescription ifTrue: [row addMorphBack: self makeDescriptionViewer].
                 spec == #pageNumber ifTrue: [row addMorphBack: self makePageNumberItem].
                 spec == #spacer ifTrue: [row addTransparentSpacerOfSize: (10 @ 0)].
                 spec == #variableSpacer ifTrue: [
                         row addMorphBack: AlignmentMorph newVariableTransparentSpacer].
                 spec class == Array ifTrue: [
                         spec first isSymbol
                                 ifTrue: [b := ThreePhaseButtonMorph labelSymbol: spec first]
                                 ifFalse: [b := SimpleButtonMorph new borderWidth: 2;
+                                                        borderColor: Color black; color: Color white.
-                                                        borderColor: Color black; color: Color veryLightGray.
                                                         b label: spec first font: Preferences standardMenuFont].
                                 b target: self;  actionSelector: spec second;  setBalloonText: spec third.
                                 (spec atPin: 4) = #border
                                         ifTrue: [b actWhen: #buttonDown]
                                         ifFalse: [b borderWidth: 0].    "default is none"
                                 row addMorphBack: b.
                                 (((lastGuy := spec last asLowercase) includesSubstring: 'menu') or:
                                                 [lastGuy includesSubstring: 'designations'])
                                         ifTrue: [b actWhen: #buttonDown]]].  "pop up menu on mouseDown"
                 col addMorphBack: row.
         ^ col!

Item was changed:
  ----- Method: BooklikeMorph>>shortControlSpecs (in category 'page controls') -----
  shortControlSpecs
         "Answer  specs defining the widgets in the short form of the control panel."
 
  ^ {
+                {#MenuIcon.             #invokeShortBookMenu.            'Click here to get a menu of options for this book.' translated}.
-                #spacer.
                 #variableSpacer.
+                {#PrevPage.              #previousPage.                  'Previous page' translated}.
-                {'<'.            #previousPage.                  'Previous page' translated}.
                 #spacer.
+                #pageNumber.
-                {#MenuIcon.             #invokeShortBookMenu.            'Click here to get a menu of options for this book.' translated}.
                 #spacer.
+                {#NextPage.             #nextPage.                              'Next page' translated}.
-                {'>'.           #nextPage.                              'Next page' translated}.
                 #spacer.
                 #variableSpacer.
+                {'...'.         #showMoreControls.              'More controls' translated}
-                {#RightCaret.           #showMoreControls.              'More controls' translated}
  }
  !

Item was changed:
  ----- Method: ScrapBook>>addToTrash: (in category 'scraps') -----
  addToTrash: aMorph
         "Paste the object onto a page of the system Trash book, unless the preference is set to empty the trash immediately."
 
         | aPage |
         TrashCanMorph preserveTrash ifFalse: [^ self].
 
         aMorph position: book pages first position + (0@40).
         book pages do: [:pp |
                 (pp submorphs size = 1 and: [pp hasProperty: #trash]) ifTrue:  "perhaps remove that property here"
                         ["page is blank"
                         ^ pp addMorph: aMorph]].
+        aPage := book insertPageLabel: ('{1} {2}' format: Time dateAndTimeNow)
-        aPage := book insertPageLabel: Time dateAndTimeNow printString
                 morphs: (Array with: aMorph).
         aPage setProperty: #trash toValue: true!

Item was changed:
  ----- Method: ScrapBook>>scrapBook (in category 'scraps') -----
  scrapBook
         | header aButton label |
         ^ book ifNil: [
+                book := BookMorph new pageSize: 300@300; setNameTo: 'scraps' translated.
+                book addCornerGrips.
-                book := BookMorph new pageSize: 200@300; setNameTo: 'scraps' translated.
                 book color: Color yellow muchLighter.
                 book borderColor: Color darkGray; borderWidth: 2.
                 book removeEverything; showPageControls; insertPage.
+
                 header := AlignmentMorph newRow wrapCentering: #center; cellPositioning: #leftCenter.
                 header setProperty: #header toValue: true.
+                header addMorph: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Collapse').
-                header addMorph: (aButton := SimpleButtonMorph new label: 'O' font: Preferences standardButtonFont).
                 aButton target: book;
-                        color:  Color tan;
                         actionSelector: #delete;
                         setBalloonText: 'Close the trashcan.\(to view again later, click on any trashcan).' withCRs translated.
-
                 header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
                 header addMorphBack:     (label := UpdatingStringMorph new target: self) beSticky.
                 label getSelector: #trashTitle; useStringFormat; step.
                 header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
+                header addMorphBack: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Dismiss').
+                aButton target: self;
+                        actionSelector: #maybeEmptyTrash;
-                header addMorphBack: (aButton := SimpleButtonMorph new label: 'E' translated font: Preferences standardButtonFont).
-                aButton target: self; color:  Color veryLightGray; actionSelector: #maybeEmptyTrash;
                         setBalloonText: 'Click here to empty the trash.' translated.
+                book currentPage
+                        layoutPolicy: TableLayout new;
+                        addMorph: (TextMorph new
+                                contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later.  To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the "-" control (behind "..."). You can empty out all the objects in the trash can by hitting the "X" button at top right.' withCRs translated;
+                                hResizing: #spaceFill).
-                book currentPage addMorph: (TextMorph new contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later.  To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the - control, and you can empty out all the objects in the trash can by hitting the "E" button at top right.' withCRs translated
-                wrappedTo: 190).
 
                 book addMorphFront: header.
                 book setProperty: #scraps toValue: true].!

Item was changed:
  ----- Method: ScrapBook>>trashTitle (in category 'scraps') -----
  trashTitle
+
+        ^ 'T R A S H' translated!
-        | label pgs |
-        label := 'T R A S H' translated.
-        ^ (pgs := book pages size) < 2
-                ifTrue:
-                        [label]
-                ifFalse:
-                        [label, ('  ({1} pages)' translated format:{pgs})]!

Item was changed:
+ ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'dropping/grabbing') -----
- ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'layout') -----
  acceptDroppingMorph: aMorph event: evt
         SoundService soundEnabled
                 ifTrue: [TrashCanMorph preserveTrash
                                 ifTrue: [self class playDeleteSound]
                                 ifFalse: [self playSoundNamed: 'scratch']].
         evt hand visible: true.
         self state: #off.
         aMorph delete.
         aMorph == ScrapBook default scrapBook
                 ifFalse: [ScrapBook default addToTrash: aMorph removeHalo]!



Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

5.3 [was Re: The Trunk: MorphicExtras-mt.269.mcz]

Eliot Miranda-2
In reply to this post by marcel.taeumel
Hi All,

    I see people committing to trunk again but we haven't got 5.3 out the door yet.  I'm busy until next week but perhaps I could help on Tuesday to try and get 5.3 finished and then we can properly get back to trunk.


On Fri, Feb 14, 2020 at 6:11 AM Marcel Taeumel <[hidden email]> wrote:

Am 14.02.2020 15:09:00 schrieb [hidden email] <[hidden email]>:

Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-mt.269.mcz

==================== Summary ====================

Name: MorphicExtras-mt.269
Author: mt
Time: 14 February 2020, 3:07:58.332667 pm
UUID: 825d4289-5a5b-3e4e-8828-f518d1a1a8c3
Ancestors: MorphicExtras-mt.268

Some fixes in scrap book and book morph in support of Etoys.

=============== Diff against MorphicExtras-mt.268 ===============

Item was changed:
----- Method: BookMorph>>insertPageLabel:morphs: (in category 'insert and delete') -----
insertPageLabel: labelString morphs: morphList

| m c labelAllowance |
self insertPage.
labelString ifNotNil:
+ [m := labelString asMorph.
- [m := (TextMorph new extent: currentPage width@20; contents: labelString).
m lock.
m position: currentPage position + (((currentPage width - m width) // 2) @ 5).
currentPage addMorph: m.
labelAllowance := 40]
ifNil:
[labelAllowance := 0].

"use a column to align the given morphs, then add them to the page"
c := AlignmentMorph newColumn wrapCentering: #center; cellPositioning: #topCenter.
c addAllMorphs: morphList.
c position: currentPage position + (0 @ labelAllowance).
currentPage addAllMorphs: morphList.
^ currentPage
!

Item was changed:
----- Method: BooklikeMorph>>fullControlSpecs (in category 'page controls') -----
fullControlSpecs

^ {
#spacer.
#variableSpacer.
{'-'. #deletePage. 'Delete this page' translated}.
#spacer.
{'«'. #firstPage. 'First page' translated}.
#spacer.
{'<'. #previouspage.="" 'previous="" page'="" translated}.="">
#spacer.
{'·'. #invokeBookMenu. 'Click here to get a menu of options for this book.' translated}.
#spacer.
{'>'. #nextPage. 'Next page' translated}.
#spacer.
{ '»'. #lastPage. 'Final page' translated}.
#spacer.
{'+'. #insertPage. 'Add a new page after this one' translated}.
#variableSpacer.
+ {'o'. #fewerPageControls. 'Fewer controls' translated}
- {'³'. #fewerPageControls. 'Fewer controls' translated}
}
!

Item was changed:
----- Method: BooklikeMorph>>makePageControlsFrom: (in category 'page controls') -----
makePageControlsFrom: controlSpecs
"From the controlSpecs, create a set of page control and return them -- this method does *not* add the controls to the receiver."

| c col row |
+ c := (color saturation > 0.4) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
- c := (color saturation > 0.1) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
col := AlignmentMorph newColumn.
col color: c; borderWidth: 0; layoutInset: 0.
col hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.

row := AlignmentMorph newRow.
row color: c; borderWidth: 0; layoutInset: 0.
row hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
controlSpecs do: [:spec | | lastGuy b |
spec == #showDescription ifTrue: [row addMorphBack: self makeDescriptionViewer].
spec == #pageNumber ifTrue: [row addMorphBack: self makePageNumberItem].
spec == #spacer ifTrue: [row addTransparentSpacerOfSize: (10 @ 0)].
spec == #variableSpacer ifTrue: [
row addMorphBack: AlignmentMorph newVariableTransparentSpacer].
spec class == Array ifTrue: [
spec first isSymbol
ifTrue: [b := ThreePhaseButtonMorph labelSymbol: spec first]
ifFalse: [b := SimpleButtonMorph new borderWidth: 2;
+ borderColor: Color black; color: Color white.
- borderColor: Color black; color: Color veryLightGray.
b label: spec first font: Preferences standardMenuFont].
b target: self; actionSelector: spec second; setBalloonText: spec third.
(spec atPin: 4) = #border
ifTrue: [b actWhen: #buttonDown]
ifFalse: [b borderWidth: 0]. "default is none"
row addMorphBack: b.
(((lastGuy := spec last asLowercase) includesSubstring: 'menu') or:
[lastGuy includesSubstring: 'designations'])
ifTrue: [b actWhen: #buttonDown]]]. "pop up menu on mouseDown"
col addMorphBack: row.
^ col!

Item was changed:
----- Method: BooklikeMorph>>shortControlSpecs (in category 'page controls') -----
shortControlSpecs
"Answer specs defining the widgets in the short form of the control panel."

^ {
+ {#MenuIcon. #invokeShortBookMenu. 'Click here to get a menu of options for this book.' translated}.
- #spacer.
#variableSpacer.
+ {#PrevPage. #previousPage. 'Previous page' translated}.
- {'<'. #previouspage.="" 'previous="" page'="" translated}.="">
#spacer.
+ #pageNumber.
- {#MenuIcon. #invokeShortBookMenu. 'Click here to get a menu of options for this book.' translated}.
#spacer.
+ {#NextPage. #nextPage. 'Next page' translated}.
- {'>'. #nextPage. 'Next page' translated}.
#spacer.
#variableSpacer.
+ {'...'. #showMoreControls. 'More controls' translated}
- {#RightCaret. #showMoreControls. 'More controls' translated}
}
!

Item was changed:
----- Method: ScrapBook>>addToTrash: (in category 'scraps') -----
addToTrash: aMorph
"Paste the object onto a page of the system Trash book, unless the preference is set to empty the trash immediately."

| aPage |
TrashCanMorph preserveTrash ifFalse: [^ self].

aMorph position: book pages first position + (0@40).
book pages do: [:pp |
(pp submorphs size = 1 and: [pp hasProperty: #trash]) ifTrue: "perhaps remove that property here"
["page is blank"
^ pp addMorph: aMorph]].
+ aPage := book insertPageLabel: ('{1} {2}' format: Time dateAndTimeNow)
- aPage := book insertPageLabel: Time dateAndTimeNow printString
morphs: (Array with: aMorph).
aPage setProperty: #trash toValue: true!

Item was changed:
----- Method: ScrapBook>>scrapBook (in category 'scraps') -----
scrapBook
| header aButton label |
^ book ifNil: [
+ book := BookMorph new pageSize: 300@300; setNameTo: 'scraps' translated.
+ book addCornerGrips.
- book := BookMorph new pageSize: 200@300; setNameTo: 'scraps' translated.
book color: Color yellow muchLighter.
book borderColor: Color darkGray; borderWidth: 2.
book removeEverything; showPageControls; insertPage.
+
header := AlignmentMorph newRow wrapCentering: #center; cellPositioning: #leftCenter.
header setProperty: #header toValue: true.
+ header addMorph: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Collapse').
- header addMorph: (aButton := SimpleButtonMorph new label: 'O' font: Preferences standardButtonFont).
aButton target: book;
- color: Color tan;
actionSelector: #delete;
setBalloonText: 'Close the trashcan.\(to view again later, click on any trashcan).' withCRs translated.
-
header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
header addMorphBack: (label := UpdatingStringMorph new target: self) beSticky.
label getSelector: #trashTitle; useStringFormat; step.
header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
+ header addMorphBack: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Dismiss').
+ aButton target: self;
+ actionSelector: #maybeEmptyTrash;
- header addMorphBack: (aButton := SimpleButtonMorph new label: 'E' translated font: Preferences standardButtonFont).
- aButton target: self; color: Color veryLightGray; actionSelector: #maybeEmptyTrash;
setBalloonText: 'Click here to empty the trash.' translated.
+ book currentPage
+ layoutPolicy: TableLayout new;
+ addMorph: (TextMorph new
+ contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later. To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the "-" control (behind "..."). You can empty out all the objects in the trash can by hitting the "X" button at top right.' withCRs translated;
+ hResizing: #spaceFill).
- book currentPage addMorph: (TextMorph new contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later. To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the - control, and you can empty out all the objects in the trash can by hitting the "E" button at top right.' withCRs translated
- wrappedTo: 190).

book addMorphFront: header.
book setProperty: #scraps toValue: true].!

Item was changed:
----- Method: ScrapBook>>trashTitle (in category 'scraps') -----
trashTitle
+
+ ^ 'T R A S H' translated!
- | label pgs |
- label := 'T R A S H' translated.
- ^ (pgs := book pages size) < 2="">
- ifTrue:
- [label]
- ifFalse:
- [label, (' ({1} pages)' translated format:{pgs})]!

Item was changed:
+ ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'dropping/grabbing') -----
- ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'layout') -----
acceptDroppingMorph: aMorph event: evt
SoundService soundEnabled
ifTrue: [TrashCanMorph preserveTrash
ifTrue: [self class playDeleteSound]
ifFalse: [self playSoundNamed: 'scratch']].
evt hand visible: true.
self state: #off.
aMorph delete.
aMorph == ScrapBook default scrapBook
ifFalse: [ScrapBook default addToTrash: aMorph removeHalo]!





--
_,,,^..^,,,_
best, Eliot


Reply | Threaded
Open this post in threaded view
|

Re: 5.3 [was Re: The Trunk: MorphicExtras-mt.269.mcz]

Christoph Thiede

The current update notice states:


FEATURE FREEZE. A new release is being prepared. There will be only bugfixes, but no new features.


So fixes should be okay? Won't you switch the ReleaseBuilder to another state when we come into a critical phase of the release?

Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von Eliot Miranda <[hidden email]>
Gesendet: Freitag, 14. Februar 2020 19:45:31
An: The general-purpose Squeak developers list
Betreff: [squeak-dev] 5.3 [was Re: The Trunk: MorphicExtras-mt.269.mcz]
 
Hi All,

    I see people committing to trunk again but we haven't got 5.3 out the door yet.  I'm busy until next week but perhaps I could help on Tuesday to try and get 5.3 finished and then we can properly get back to trunk.


On Fri, Feb 14, 2020 at 6:11 AM Marcel Taeumel <[hidden email]> wrote:

Am 14.02.2020 15:09:00 schrieb [hidden email] <[hidden email]>:

Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-mt.269.mcz

==================== Summary ====================

Name: MorphicExtras-mt.269
Author: mt
Time: 14 February 2020, 3:07:58.332667 pm
UUID: 825d4289-5a5b-3e4e-8828-f518d1a1a8c3
Ancestors: MorphicExtras-mt.268

Some fixes in scrap book and book morph in support of Etoys.

=============== Diff against MorphicExtras-mt.268 ===============

Item was changed:
----- Method: BookMorph>>insertPageLabel:morphs: (in category 'insert and delete') -----
insertPageLabel: labelString morphs: morphList

| m c labelAllowance |
self insertPage.
labelString ifNotNil:
+ [m := labelString asMorph.
- [m := (TextMorph new extent: currentPage width@20; contents: labelString).
m lock.
m position: currentPage position + (((currentPage width - m width) // 2) @ 5).
currentPage addMorph: m.
labelAllowance := 40]
ifNil:
[labelAllowance := 0].

"use a column to align the given morphs, then add them to the page"
c := AlignmentMorph newColumn wrapCentering: #center; cellPositioning: #topCenter.
c addAllMorphs: morphList.
c position: currentPage position + (0 @ labelAllowance).
currentPage addAllMorphs: morphList.
^ currentPage
!

Item was changed:
----- Method: BooklikeMorph>>fullControlSpecs (in category 'page controls') -----
fullControlSpecs

^ {
#spacer.
#variableSpacer.
{'-'. #deletePage. 'Delete this page' translated}.
#spacer.
{'«'. #firstPage. 'First page' translated}.
#spacer.
{'<'. #previouspage.="" 'previous="" page'="" translated}.="">
#spacer.
{'·'. #invokeBookMenu. 'Click here to get a menu of options for this book.' translated}.
#spacer.
{'>'. #nextPage. 'Next page' translated}.
#spacer.
{ '»'. #lastPage. 'Final page' translated}.
#spacer.
{'+'. #insertPage. 'Add a new page after this one' translated}.
#variableSpacer.
+ {'o'. #fewerPageControls. 'Fewer controls' translated}
- {'³'. #fewerPageControls. 'Fewer controls' translated}
}
!

Item was changed:
----- Method: BooklikeMorph>>makePageControlsFrom: (in category 'page controls') -----
makePageControlsFrom: controlSpecs
"From the controlSpecs, create a set of page control and return them -- this method does *not* add the controls to the receiver."

| c col row |
+ c := (color saturation > 0.4) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
- c := (color saturation > 0.1) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
col := AlignmentMorph newColumn.
col color: c; borderWidth: 0; layoutInset: 0.
col hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.

row := AlignmentMorph newRow.
row color: c; borderWidth: 0; layoutInset: 0.
row hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
controlSpecs do: [:spec | | lastGuy b |
spec == #showDescription ifTrue: [row addMorphBack: self makeDescriptionViewer].
spec == #pageNumber ifTrue: [row addMorphBack: self makePageNumberItem].
spec == #spacer ifTrue: [row addTransparentSpacerOfSize: (10 @ 0)].
spec == #variableSpacer ifTrue: [
row addMorphBack: AlignmentMorph newVariableTransparentSpacer].
spec class == Array ifTrue: [
spec first isSymbol
ifTrue: [b := ThreePhaseButtonMorph labelSymbol: spec first]
ifFalse: [b := SimpleButtonMorph new borderWidth: 2;
+ borderColor: Color black; color: Color white.
- borderColor: Color black; color: Color veryLightGray.
b label: spec first font: Preferences standardMenuFont].
b target: self; actionSelector: spec second; setBalloonText: spec third.
(spec atPin: 4) = #border
ifTrue: [b actWhen: #buttonDown]
ifFalse: [b borderWidth: 0]. "default is none"
row addMorphBack: b.
(((lastGuy := spec last asLowercase) includesSubstring: 'menu') or:
[lastGuy includesSubstring: 'designations'])
ifTrue: [b actWhen: #buttonDown]]]. "pop up menu on mouseDown"
col addMorphBack: row.
^ col!

Item was changed:
----- Method: BooklikeMorph>>shortControlSpecs (in category 'page controls') -----
shortControlSpecs
"Answer specs defining the widgets in the short form of the control panel."

^ {
+ {#MenuIcon. #invokeShortBookMenu. 'Click here to get a menu of options for this book.' translated}.
- #spacer.
#variableSpacer.
+ {#PrevPage. #previousPage. 'Previous page' translated}.
- {'<'. #previouspage.="" 'previous="" page'="" translated}.="">
#spacer.
+ #pageNumber.
- {#MenuIcon. #invokeShortBookMenu. 'Click here to get a menu of options for this book.' translated}.
#spacer.
+ {#NextPage. #nextPage. 'Next page' translated}.
- {'>'. #nextPage. 'Next page' translated}.
#spacer.
#variableSpacer.
+ {'...'. #showMoreControls. 'More controls' translated}
- {#RightCaret. #showMoreControls. 'More controls' translated}
}
!

Item was changed:
----- Method: ScrapBook>>addToTrash: (in category 'scraps') -----
addToTrash: aMorph
"Paste the object onto a page of the system Trash book, unless the preference is set to empty the trash immediately."

| aPage |
TrashCanMorph preserveTrash ifFalse: [^ self].

aMorph position: book pages first position + (0@40).
book pages do: [:pp |
(pp submorphs size = 1 and: [pp hasProperty: #trash]) ifTrue: "perhaps remove that property here"
["page is blank"
^ pp addMorph: aMorph]].
+ aPage := book insertPageLabel: ('{1} {2}' format: Time dateAndTimeNow)
- aPage := book insertPageLabel: Time dateAndTimeNow printString
morphs: (Array with: aMorph).
aPage setProperty: #trash toValue: true!

Item was changed:
----- Method: ScrapBook>>scrapBook (in category 'scraps') -----
scrapBook
| header aButton label |
^ book ifNil: [
+ book := BookMorph new pageSize: 300@300; setNameTo: 'scraps' translated.
+ book addCornerGrips.
- book := BookMorph new pageSize: 200@300; setNameTo: 'scraps' translated.
book color: Color yellow muchLighter.
book borderColor: Color darkGray; borderWidth: 2.
book removeEverything; showPageControls; insertPage.
+
header := AlignmentMorph newRow wrapCentering: #center; cellPositioning: #leftCenter.
header setProperty: #header toValue: true.
+ header addMorph: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Collapse').
- header addMorph: (aButton := SimpleButtonMorph new label: 'O' font: Preferences standardButtonFont).
aButton target: book;
- color: Color tan;
actionSelector: #delete;
setBalloonText: 'Close the trashcan.\(to view again later, click on any trashcan).' withCRs translated.
-
header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
header addMorphBack: (label := UpdatingStringMorph new target: self) beSticky.
label getSelector: #trashTitle; useStringFormat; step.
header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
+ header addMorphBack: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Dismiss').
+ aButton target: self;
+ actionSelector: #maybeEmptyTrash;
- header addMorphBack: (aButton := SimpleButtonMorph new label: 'E' translated font: Preferences standardButtonFont).
- aButton target: self; color: Color veryLightGray; actionSelector: #maybeEmptyTrash;
setBalloonText: 'Click here to empty the trash.' translated.
+ book currentPage
+ layoutPolicy: TableLayout new;
+ addMorph: (TextMorph new
+ contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later. To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the "-" control (behind "..."). You can empty out all the objects in the trash can by hitting the "X" button at top right.' withCRs translated;
+ hResizing: #spaceFill).
- book currentPage addMorph: (TextMorph new contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later. To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the - control, and you can empty out all the objects in the trash can by hitting the "E" button at top right.' withCRs translated
- wrappedTo: 190).

book addMorphFront: header.
book setProperty: #scraps toValue: true].!

Item was changed:
----- Method: ScrapBook>>trashTitle (in category 'scraps') -----
trashTitle
+
+ ^ 'T R A S H' translated!
- | label pgs |
- label := 'T R A S H' translated.
- ^ (pgs := book pages size) < 2="">
- ifTrue:
- [label]
- ifFalse:
- [label, (' ({1} pages)' translated format:{pgs})]!

Item was changed:
+ ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'dropping/grabbing') -----
- ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'layout') -----
acceptDroppingMorph: aMorph event: evt
SoundService soundEnabled
ifTrue: [TrashCanMorph preserveTrash
ifTrue: [self class playDeleteSound]
ifFalse: [self playSoundNamed: 'scratch']].
evt hand visible: true.
self state: #off.
aMorph delete.
aMorph == ScrapBook default scrapBook
ifFalse: [ScrapBook default addToTrash: aMorph removeHalo]!





--
_,,,^..^,,,_
best, Eliot


Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: MorphicExtras-mt.269.mcz

marcel.taeumel
In reply to this post by Christoph Thiede
Hi Christoph.

Wouldn't it be better if the database only contained ...

This is just an instance of the general observation I often call "developer English" :-) The localization process can face many similar challenges of redundancy (or duplication). Depending on the target language, one might see parts of a bigger phrase also as redundant to be optimized. I am not an expert on localization and thus not that familiar with existing tools and best practices in that field.

In the source code, however, I would rather keep it simple. In the case of "T R A S H", I would keep it as before is for the 5.3 release because there is already an entry in the localization database for it. :-) I suppose.

Best,
Marcel

Am 14.02.2020 18:28:20 schrieb Thiede, Christoph <[hidden email]>:

I mean, do we really want to have such - literal - trash in the multilingual database? Wouldn't it be better if the database only contained "trash - Müll" and all special formattings were applied after translating? Otherwise, we are eventually ending up with something like


"trash" - "Müll" - "purgamenta"
"(trash)" - "(Müll)" - "(purgamenta)"
"T R A S H" - "M Ü L L" - "P U R G A M E N T A"
"trash: " - "Müll: " - "purgamenta: "

Which is hard to create and hard to maintain. Also, automatic translation services might have problems detecting "T R A S H" as "trash".

Best,
Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Freitag, 14. Februar 2020 18:11 Uhr
An: Javier Diaz-Reinoso via Squeak-dev; [hidden email]
Betreff: Re: [squeak-dev] The Trunk: MorphicExtras-mt.269.mcz
 
If we finally will have an intelligent translation service, it will have to be *really* clever :-)

What do you mean? That string can just be translated through GetText like all other strings. The database has an entry for "T R A S H" and somebody can translate it to "M Ü L L" or whatever. No need to convert the spacing later on. It worked in the past.

Best,
Marcel

Am 14.02.2020 15:13:06 schrieb Thiede, Christoph <[hidden email]>:

'trash' translated asUppercase joinSeparatedBy: ' '?


Or even better, using TextKernel ...


Von: Thiede, Christoph
Gesendet: Freitag, 14. Februar 2020 15:12:24
An: [hidden email]; [hidden email]
Betreff: AW: [squeak-dev] The Trunk: MorphicExtras-mt.269.mcz
 

> +        ^ 'T R A S H' translated

If we finally will have an intelligent translation service, it will have to be *really* clever :-)

'trash' translated asUppercase joinSeparatedBy: ' '?

Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Freitag, 14. Februar 2020 15:08:46
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: MorphicExtras-mt.269.mcz
 
Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-mt.269.mcz

==================== Summary ====================

Name: MorphicExtras-mt.269
Author: mt
Time: 14 February 2020, 3:07:58.332667 pm
UUID: 825d4289-5a5b-3e4e-8828-f518d1a1a8c3
Ancestors: MorphicExtras-mt.268

Some fixes in scrap book and book morph in support of Etoys.

=============== Diff against MorphicExtras-mt.268 ===============

Item was changed:
  ----- Method: BookMorph>>insertPageLabel:morphs: (in category 'insert and delete') -----
  insertPageLabel: labelString morphs: morphList
 
         | m c labelAllowance |
         self insertPage.
         labelString ifNotNil:
+                        [m := labelString asMorph.
-                        [m := (TextMorph new extent: currentPage width@20; contents: labelString).
                 m lock.
                 m position: currentPage position + (((currentPage width - m width) // 2) @ 5).
                 currentPage addMorph: m.
                 labelAllowance := 40]
                 ifNil:
                         [labelAllowance := 0].
 
         "use a column to align the given morphs, then add them to the page"
         c := AlignmentMorph newColumn wrapCentering: #center; cellPositioning: #topCenter.
         c addAllMorphs: morphList.
         c position: currentPage position + (0 @ labelAllowance).
         currentPage addAllMorphs: morphList.
         ^ currentPage
  !

Item was changed:
  ----- Method: BooklikeMorph>>fullControlSpecs (in category 'page controls') -----
  fullControlSpecs
 
         ^ {
                 #spacer.
                 #variableSpacer.
                 {'-'.           #deletePage.                            'Delete this page' translated}.
                 #spacer.
                 {'«'.           #firstPage.                             'First page' translated}.
                 #spacer.
                 {'<'.            #previousPage.                  'Previous page' translated}.
                 #spacer.
                 {'·'.           #invokeBookMenu.                 'Click here to get a menu of options for this book.' translated}.
                 #spacer.
                 {'>'.           #nextPage.                              'Next page' translated}.
                 #spacer.
                 { '»'.          #lastPage.                              'Final page' translated}.
                 #spacer.
                 {'+'.           #insertPage.                            'Add a new page after this one' translated}.
                 #variableSpacer.
+                {'o'.           #fewerPageControls.     'Fewer controls' translated}
-                {'³'.           #fewerPageControls.     'Fewer controls' translated}
  }
  !

Item was changed:
  ----- Method: BooklikeMorph>>makePageControlsFrom: (in category 'page controls') -----
  makePageControlsFrom: controlSpecs
         "From the controlSpecs, create a set of page control and return them -- this method does *not* add the controls to the receiver."
 
         | c col row |
+        c := (color saturation > 0.4) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
-        c := (color saturation > 0.1) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
         col := AlignmentMorph newColumn.
         col color: c; borderWidth: 0; layoutInset: 0.
         col hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
 
         row := AlignmentMorph newRow.
         row color: c; borderWidth: 0; layoutInset: 0.
         row hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
         controlSpecs do: [:spec | | lastGuy b |
                 spec == #showDescription ifTrue: [row addMorphBack: self makeDescriptionViewer].
                 spec == #pageNumber ifTrue: [row addMorphBack: self makePageNumberItem].
                 spec == #spacer ifTrue: [row addTransparentSpacerOfSize: (10 @ 0)].
                 spec == #variableSpacer ifTrue: [
                         row addMorphBack: AlignmentMorph newVariableTransparentSpacer].
                 spec class == Array ifTrue: [
                         spec first isSymbol
                                 ifTrue: [b := ThreePhaseButtonMorph labelSymbol: spec first]
                                 ifFalse: [b := SimpleButtonMorph new borderWidth: 2;
+                                                        borderColor: Color black; color: Color white.
-                                                        borderColor: Color black; color: Color veryLightGray.
                                                         b label: spec first font: Preferences standardMenuFont].
                                 b target: self;  actionSelector: spec second;  setBalloonText: spec third.
                                 (spec atPin: 4) = #border
                                         ifTrue: [b actWhen: #buttonDown]
                                         ifFalse: [b borderWidth: 0].    "default is none"
                                 row addMorphBack: b.
                                 (((lastGuy := spec last asLowercase) includesSubstring: 'menu') or:
                                                 [lastGuy includesSubstring: 'designations'])
                                         ifTrue: [b actWhen: #buttonDown]]].  "pop up menu on mouseDown"
                 col addMorphBack: row.
         ^ col!

Item was changed:
  ----- Method: BooklikeMorph>>shortControlSpecs (in category 'page controls') -----
  shortControlSpecs
         "Answer  specs defining the widgets in the short form of the control panel."
 
  ^ {
+                {#MenuIcon.             #invokeShortBookMenu.            'Click here to get a menu of options for this book.' translated}.
-                #spacer.
                 #variableSpacer.
+                {#PrevPage.              #previousPage.                  'Previous page' translated}.
-                {'<'.            #previousPage.                  'Previous page' translated}.
                 #spacer.
+                #pageNumber.
-                {#MenuIcon.             #invokeShortBookMenu.            'Click here to get a menu of options for this book.' translated}.
                 #spacer.
+                {#NextPage.             #nextPage.                              'Next page' translated}.
-                {'>'.           #nextPage.                              'Next page' translated}.
                 #spacer.
                 #variableSpacer.
+                {'...'.         #showMoreControls.              'More controls' translated}
-                {#RightCaret.           #showMoreControls.              'More controls' translated}
  }
  !

Item was changed:
  ----- Method: ScrapBook>>addToTrash: (in category 'scraps') -----
  addToTrash: aMorph
         "Paste the object onto a page of the system Trash book, unless the preference is set to empty the trash immediately."
 
         | aPage |
         TrashCanMorph preserveTrash ifFalse: [^ self].
 
         aMorph position: book pages first position + (0@40).
         book pages do: [:pp |
                 (pp submorphs size = 1 and: [pp hasProperty: #trash]) ifTrue:  "perhaps remove that property here"
                         ["page is blank"
                         ^ pp addMorph: aMorph]].
+        aPage := book insertPageLabel: ('{1} {2}' format: Time dateAndTimeNow)
-        aPage := book insertPageLabel: Time dateAndTimeNow printString
                 morphs: (Array with: aMorph).
         aPage setProperty: #trash toValue: true!

Item was changed:
  ----- Method: ScrapBook>>scrapBook (in category 'scraps') -----
  scrapBook
         | header aButton label |
         ^ book ifNil: [
+                book := BookMorph new pageSize: 300@300; setNameTo: 'scraps' translated.
+                book addCornerGrips.
-                book := BookMorph new pageSize: 200@300; setNameTo: 'scraps' translated.
                 book color: Color yellow muchLighter.
                 book borderColor: Color darkGray; borderWidth: 2.
                 book removeEverything; showPageControls; insertPage.
+
                 header := AlignmentMorph newRow wrapCentering: #center; cellPositioning: #leftCenter.
                 header setProperty: #header toValue: true.
+                header addMorph: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Collapse').
-                header addMorph: (aButton := SimpleButtonMorph new label: 'O' font: Preferences standardButtonFont).
                 aButton target: book;
-                        color:  Color tan;
                         actionSelector: #delete;
                         setBalloonText: 'Close the trashcan.\(to view again later, click on any trashcan).' withCRs translated.
-
                 header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
                 header addMorphBack:     (label := UpdatingStringMorph new target: self) beSticky.
                 label getSelector: #trashTitle; useStringFormat; step.
                 header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
+                header addMorphBack: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Dismiss').
+                aButton target: self;
+                        actionSelector: #maybeEmptyTrash;
-                header addMorphBack: (aButton := SimpleButtonMorph new label: 'E' translated font: Preferences standardButtonFont).
-                aButton target: self; color:  Color veryLightGray; actionSelector: #maybeEmptyTrash;
                         setBalloonText: 'Click here to empty the trash.' translated.
+                book currentPage
+                        layoutPolicy: TableLayout new;
+                        addMorph: (TextMorph new
+                                contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later.  To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the "-" control (behind "..."). You can empty out all the objects in the trash can by hitting the "X" button at top right.' withCRs translated;
+                                hResizing: #spaceFill).
-                book currentPage addMorph: (TextMorph new contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later.  To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the - control, and you can empty out all the objects in the trash can by hitting the "E" button at top right.' withCRs translated
-                wrappedTo: 190).
 
                 book addMorphFront: header.
                 book setProperty: #scraps toValue: true].!

Item was changed:
  ----- Method: ScrapBook>>trashTitle (in category 'scraps') -----
  trashTitle
+
+        ^ 'T R A S H' translated!
-        | label pgs |
-        label := 'T R A S H' translated.
-        ^ (pgs := book pages size) < 2
-                ifTrue:
-                        [label]
-                ifFalse:
-                        [label, ('  ({1} pages)' translated format:{pgs})]!

Item was changed:
+ ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'dropping/grabbing') -----
- ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'layout') -----
  acceptDroppingMorph: aMorph event: evt
         SoundService soundEnabled
                 ifTrue: [TrashCanMorph preserveTrash
                                 ifTrue: [self class playDeleteSound]
                                 ifFalse: [self playSoundNamed: 'scratch']].
         evt hand visible: true.
         self state: #off.
         aMorph delete.
         aMorph == ScrapBook default scrapBook
                 ifFalse: [ScrapBook default addToTrash: aMorph removeHalo]!



Reply | Threaded
Open this post in threaded view
|

Re: 5.3 [was Re: The Trunk: MorphicExtras-mt.269.mcz]

marcel.taeumel
In reply to this post by Eliot Miranda-2
Hi Eliot.

I see people committing to trunk again but we haven't got 5.3 out the door yet. 

I am back from a break and try to fix those known bugs for the 5.3 release. Hannes Hirzel suggested to also take a look at some things in Etoys for the 5.3 release. I am basically doing that. I will not overdo it. Just the obvious hick ups. Shouldn't take long.

Best,
Marcel

Am 14.02.2020 19:45:51 schrieb Eliot Miranda <[hidden email]>:

Hi All,

    I see people committing to trunk again but we haven't got 5.3 out the door yet.  I'm busy until next week but perhaps I could help on Tuesday to try and get 5.3 finished and then we can properly get back to trunk.


On Fri, Feb 14, 2020 at 6:11 AM Marcel Taeumel <[hidden email]> wrote:

Am 14.02.2020 15:09:00 schrieb [hidden email] <[hidden email]>:

Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-mt.269.mcz

==================== Summary ====================

Name: MorphicExtras-mt.269
Author: mt
Time: 14 February 2020, 3:07:58.332667 pm
UUID: 825d4289-5a5b-3e4e-8828-f518d1a1a8c3
Ancestors: MorphicExtras-mt.268

Some fixes in scrap book and book morph in support of Etoys.

=============== Diff against MorphicExtras-mt.268 ===============

Item was changed:
----- Method: BookMorph>>insertPageLabel:morphs: (in category 'insert and delete') -----
insertPageLabel: labelString morphs: morphList

| m c labelAllowance |
self insertPage.
labelString ifNotNil:
+ [m := labelString asMorph.
- [m := (TextMorph new extent: currentPage width@20; contents: labelString).
m lock.
m position: currentPage position + (((currentPage width - m width) // 2) @ 5).
currentPage addMorph: m.
labelAllowance := 40]
ifNil:
[labelAllowance := 0].

"use a column to align the given morphs, then add them to the page"
c := AlignmentMorph newColumn wrapCentering: #center; cellPositioning: #topCenter.
c addAllMorphs: morphList.
c position: currentPage position + (0 @ labelAllowance).
currentPage addAllMorphs: morphList.
^ currentPage
!

Item was changed:
----- Method: BooklikeMorph>>fullControlSpecs (in category 'page controls') -----
fullControlSpecs

^ {
#spacer.
#variableSpacer.
{'-'. #deletePage. 'Delete this page' translated}.
#spacer.
{'«'. #firstPage. 'First page' translated}.
#spacer.
{'<'. #previouspage.="" 'previous="" page'="" translated}.="">
#spacer.
{'·'. #invokeBookMenu. 'Click here to get a menu of options for this book.' translated}.
#spacer.
{'>'. #nextPage. 'Next page' translated}.
#spacer.
{ '»'. #lastPage. 'Final page' translated}.
#spacer.
{'+'. #insertPage. 'Add a new page after this one' translated}.
#variableSpacer.
+ {'o'. #fewerPageControls. 'Fewer controls' translated}
- {'³'. #fewerPageControls. 'Fewer controls' translated}
}
!

Item was changed:
----- Method: BooklikeMorph>>makePageControlsFrom: (in category 'page controls') -----
makePageControlsFrom: controlSpecs
"From the controlSpecs, create a set of page control and return them -- this method does *not* add the controls to the receiver."

| c col row |
+ c := (color saturation > 0.4) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
- c := (color saturation > 0.1) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
col := AlignmentMorph newColumn.
col color: c; borderWidth: 0; layoutInset: 0.
col hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.

row := AlignmentMorph newRow.
row color: c; borderWidth: 0; layoutInset: 0.
row hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
controlSpecs do: [:spec | | lastGuy b |
spec == #showDescription ifTrue: [row addMorphBack: self makeDescriptionViewer].
spec == #pageNumber ifTrue: [row addMorphBack: self makePageNumberItem].
spec == #spacer ifTrue: [row addTransparentSpacerOfSize: (10 @ 0)].
spec == #variableSpacer ifTrue: [
row addMorphBack: AlignmentMorph newVariableTransparentSpacer].
spec class == Array ifTrue: [
spec first isSymbol
ifTrue: [b := ThreePhaseButtonMorph labelSymbol: spec first]
ifFalse: [b := SimpleButtonMorph new borderWidth: 2;
+ borderColor: Color black; color: Color white.
- borderColor: Color black; color: Color veryLightGray.
b label: spec first font: Preferences standardMenuFont].
b target: self; actionSelector: spec second; setBalloonText: spec third.
(spec atPin: 4) = #border
ifTrue: [b actWhen: #buttonDown]
ifFalse: [b borderWidth: 0]. "default is none"
row addMorphBack: b.
(((lastGuy := spec last asLowercase) includesSubstring: 'menu') or:
[lastGuy includesSubstring: 'designations'])
ifTrue: [b actWhen: #buttonDown]]]. "pop up menu on mouseDown"
col addMorphBack: row.
^ col!

Item was changed:
----- Method: BooklikeMorph>>shortControlSpecs (in category 'page controls') -----
shortControlSpecs
"Answer specs defining the widgets in the short form of the control panel."

^ {
+ {#MenuIcon. #invokeShortBookMenu. 'Click here to get a menu of options for this book.' translated}.
- #spacer.
#variableSpacer.
+ {#PrevPage. #previousPage. 'Previous page' translated}.
- {'<'. #previouspage.="" 'previous="" page'="" translated}.="">
#spacer.
+ #pageNumber.
- {#MenuIcon. #invokeShortBookMenu. 'Click here to get a menu of options for this book.' translated}.
#spacer.
+ {#NextPage. #nextPage. 'Next page' translated}.
- {'>'. #nextPage. 'Next page' translated}.
#spacer.
#variableSpacer.
+ {'...'. #showMoreControls. 'More controls' translated}
- {#RightCaret. #showMoreControls. 'More controls' translated}
}
!

Item was changed:
----- Method: ScrapBook>>addToTrash: (in category 'scraps') -----
addToTrash: aMorph
"Paste the object onto a page of the system Trash book, unless the preference is set to empty the trash immediately."

| aPage |
TrashCanMorph preserveTrash ifFalse: [^ self].

aMorph position: book pages first position + (0@40).
book pages do: [:pp |
(pp submorphs size = 1 and: [pp hasProperty: #trash]) ifTrue: "perhaps remove that property here"
["page is blank"
^ pp addMorph: aMorph]].
+ aPage := book insertPageLabel: ('{1} {2}' format: Time dateAndTimeNow)
- aPage := book insertPageLabel: Time dateAndTimeNow printString
morphs: (Array with: aMorph).
aPage setProperty: #trash toValue: true!

Item was changed:
----- Method: ScrapBook>>scrapBook (in category 'scraps') -----
scrapBook
| header aButton label |
^ book ifNil: [
+ book := BookMorph new pageSize: 300@300; setNameTo: 'scraps' translated.
+ book addCornerGrips.
- book := BookMorph new pageSize: 200@300; setNameTo: 'scraps' translated.
book color: Color yellow muchLighter.
book borderColor: Color darkGray; borderWidth: 2.
book removeEverything; showPageControls; insertPage.
+
header := AlignmentMorph newRow wrapCentering: #center; cellPositioning: #leftCenter.
header setProperty: #header toValue: true.
+ header addMorph: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Collapse').
- header addMorph: (aButton := SimpleButtonMorph new label: 'O' font: Preferences standardButtonFont).
aButton target: book;
- color: Color tan;
actionSelector: #delete;
setBalloonText: 'Close the trashcan.\(to view again later, click on any trashcan).' withCRs translated.
-
header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
header addMorphBack: (label := UpdatingStringMorph new target: self) beSticky.
label getSelector: #trashTitle; useStringFormat; step.
header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
+ header addMorphBack: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Dismiss').
+ aButton target: self;
+ actionSelector: #maybeEmptyTrash;
- header addMorphBack: (aButton := SimpleButtonMorph new label: 'E' translated font: Preferences standardButtonFont).
- aButton target: self; color: Color veryLightGray; actionSelector: #maybeEmptyTrash;
setBalloonText: 'Click here to empty the trash.' translated.
+ book currentPage
+ layoutPolicy: TableLayout new;
+ addMorph: (TextMorph new
+ contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later. To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the "-" control (behind "..."). You can empty out all the objects in the trash can by hitting the "X" button at top right.' withCRs translated;
+ hResizing: #spaceFill).
- book currentPage addMorph: (TextMorph new contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later. To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the - control, and you can empty out all the objects in the trash can by hitting the "E" button at top right.' withCRs translated
- wrappedTo: 190).

book addMorphFront: header.
book setProperty: #scraps toValue: true].!

Item was changed:
----- Method: ScrapBook>>trashTitle (in category 'scraps') -----
trashTitle
+
+ ^ 'T R A S H' translated!
- | label pgs |
- label := 'T R A S H' translated.
- ^ (pgs := book pages size) < 2="">
- ifTrue:
- [label]
- ifFalse:
- [label, (' ({1} pages)' translated format:{pgs})]!

Item was changed:
+ ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'dropping/grabbing') -----
- ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'layout') -----
acceptDroppingMorph: aMorph event: evt
SoundService soundEnabled
ifTrue: [TrashCanMorph preserveTrash
ifTrue: [self class playDeleteSound]
ifFalse: [self playSoundNamed: 'scratch']].
evt hand visible: true.
self state: #off.
aMorph delete.
aMorph == ScrapBook default scrapBook
ifFalse: [ScrapBook default addToTrash: aMorph removeHalo]!





--
_,,,^..^,,,_
best, Eliot


Reply | Threaded
Open this post in threaded view
|

Re: 5.3 [was Re: The Trunk: MorphicExtras-mt.269.mcz]

marcel.taeumel
In reply to this post by Christoph Thiede
Next step will be to produce release candidates (RC1, RC2, ...). Since we seem to have our final release VM, let's go for RC1 end of next week.

Best,
Marcel

Am 15.02.2020 15:12:00 schrieb Thiede, Christoph <[hidden email]>:

The current update notice states:


FEATURE FREEZE. A new release is being prepared. There will be only bugfixes, but no new features.


So fixes should be okay? Won't you switch the ReleaseBuilder to another state when we come into a critical phase of the release?

Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von Eliot Miranda <[hidden email]>
Gesendet: Freitag, 14. Februar 2020 19:45:31
An: The general-purpose Squeak developers list
Betreff: [squeak-dev] 5.3 [was Re: The Trunk: MorphicExtras-mt.269.mcz]
 
Hi All,

    I see people committing to trunk again but we haven't got 5.3 out the door yet.  I'm busy until next week but perhaps I could help on Tuesday to try and get 5.3 finished and then we can properly get back to trunk.


On Fri, Feb 14, 2020 at 6:11 AM Marcel Taeumel <[hidden email]> wrote:

Am 14.02.2020 15:09:00 schrieb [hidden email] <[hidden email]>:

Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-mt.269.mcz

==================== Summary ====================

Name: MorphicExtras-mt.269
Author: mt
Time: 14 February 2020, 3:07:58.332667 pm
UUID: 825d4289-5a5b-3e4e-8828-f518d1a1a8c3
Ancestors: MorphicExtras-mt.268

Some fixes in scrap book and book morph in support of Etoys.

=============== Diff against MorphicExtras-mt.268 ===============

Item was changed:
----- Method: BookMorph>>insertPageLabel:morphs: (in category 'insert and delete') -----
insertPageLabel: labelString morphs: morphList

| m c labelAllowance |
self insertPage.
labelString ifNotNil:
+ [m := labelString asMorph.
- [m := (TextMorph new extent: currentPage width@20; contents: labelString).
m lock.
m position: currentPage position + (((currentPage width - m width) // 2) @ 5).
currentPage addMorph: m.
labelAllowance := 40]
ifNil:
[labelAllowance := 0].

"use a column to align the given morphs, then add them to the page"
c := AlignmentMorph newColumn wrapCentering: #center; cellPositioning: #topCenter.
c addAllMorphs: morphList.
c position: currentPage position + (0 @ labelAllowance).
currentPage addAllMorphs: morphList.
^ currentPage
!

Item was changed:
----- Method: BooklikeMorph>>fullControlSpecs (in category 'page controls') -----
fullControlSpecs

^ {
#spacer.
#variableSpacer.
{'-'. #deletePage. 'Delete this page' translated}.
#spacer.
{'«'. #firstPage. 'First page' translated}.
#spacer.
{'<'. #previouspage.="" 'previous="" page'="" translated}.="">
#spacer.
{'·'. #invokeBookMenu. 'Click here to get a menu of options for this book.' translated}.
#spacer.
{'>'. #nextPage. 'Next page' translated}.
#spacer.
{ '»'. #lastPage. 'Final page' translated}.
#spacer.
{'+'. #insertPage. 'Add a new page after this one' translated}.
#variableSpacer.
+ {'o'. #fewerPageControls. 'Fewer controls' translated}
- {'³'. #fewerPageControls. 'Fewer controls' translated}
}
!

Item was changed:
----- Method: BooklikeMorph>>makePageControlsFrom: (in category 'page controls') -----
makePageControlsFrom: controlSpecs
"From the controlSpecs, create a set of page control and return them -- this method does *not* add the controls to the receiver."

| c col row |
+ c := (color saturation > 0.4) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
- c := (color saturation > 0.1) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
col := AlignmentMorph newColumn.
col color: c; borderWidth: 0; layoutInset: 0.
col hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.

row := AlignmentMorph newRow.
row color: c; borderWidth: 0; layoutInset: 0.
row hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5.
controlSpecs do: [:spec | | lastGuy b |
spec == #showDescription ifTrue: [row addMorphBack: self makeDescriptionViewer].
spec == #pageNumber ifTrue: [row addMorphBack: self makePageNumberItem].
spec == #spacer ifTrue: [row addTransparentSpacerOfSize: (10 @ 0)].
spec == #variableSpacer ifTrue: [
row addMorphBack: AlignmentMorph newVariableTransparentSpacer].
spec class == Array ifTrue: [
spec first isSymbol
ifTrue: [b := ThreePhaseButtonMorph labelSymbol: spec first]
ifFalse: [b := SimpleButtonMorph new borderWidth: 2;
+ borderColor: Color black; color: Color white.
- borderColor: Color black; color: Color veryLightGray.
b label: spec first font: Preferences standardMenuFont].
b target: self; actionSelector: spec second; setBalloonText: spec third.
(spec atPin: 4) = #border
ifTrue: [b actWhen: #buttonDown]
ifFalse: [b borderWidth: 0]. "default is none"
row addMorphBack: b.
(((lastGuy := spec last asLowercase) includesSubstring: 'menu') or:
[lastGuy includesSubstring: 'designations'])
ifTrue: [b actWhen: #buttonDown]]]. "pop up menu on mouseDown"
col addMorphBack: row.
^ col!

Item was changed:
----- Method: BooklikeMorph>>shortControlSpecs (in category 'page controls') -----
shortControlSpecs
"Answer specs defining the widgets in the short form of the control panel."

^ {
+ {#MenuIcon. #invokeShortBookMenu. 'Click here to get a menu of options for this book.' translated}.
- #spacer.
#variableSpacer.
+ {#PrevPage. #previousPage. 'Previous page' translated}.
- {'<'. #previouspage.="" 'previous="" page'="" translated}.="">
#spacer.
+ #pageNumber.
- {#MenuIcon. #invokeShortBookMenu. 'Click here to get a menu of options for this book.' translated}.
#spacer.
+ {#NextPage. #nextPage. 'Next page' translated}.
- {'>'. #nextPage. 'Next page' translated}.
#spacer.
#variableSpacer.
+ {'...'. #showMoreControls. 'More controls' translated}
- {#RightCaret. #showMoreControls. 'More controls' translated}
}
!

Item was changed:
----- Method: ScrapBook>>addToTrash: (in category 'scraps') -----
addToTrash: aMorph
"Paste the object onto a page of the system Trash book, unless the preference is set to empty the trash immediately."

| aPage |
TrashCanMorph preserveTrash ifFalse: [^ self].

aMorph position: book pages first position + (0@40).
book pages do: [:pp |
(pp submorphs size = 1 and: [pp hasProperty: #trash]) ifTrue: "perhaps remove that property here"
["page is blank"
^ pp addMorph: aMorph]].
+ aPage := book insertPageLabel: ('{1} {2}' format: Time dateAndTimeNow)
- aPage := book insertPageLabel: Time dateAndTimeNow printString
morphs: (Array with: aMorph).
aPage setProperty: #trash toValue: true!

Item was changed:
----- Method: ScrapBook>>scrapBook (in category 'scraps') -----
scrapBook
| header aButton label |
^ book ifNil: [
+ book := BookMorph new pageSize: 300@300; setNameTo: 'scraps' translated.
+ book addCornerGrips.
- book := BookMorph new pageSize: 200@300; setNameTo: 'scraps' translated.
book color: Color yellow muchLighter.
book borderColor: Color darkGray; borderWidth: 2.
book removeEverything; showPageControls; insertPage.
+
header := AlignmentMorph newRow wrapCentering: #center; cellPositioning: #leftCenter.
header setProperty: #header toValue: true.
+ header addMorph: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Collapse').
- header addMorph: (aButton := SimpleButtonMorph new label: 'O' font: Preferences standardButtonFont).
aButton target: book;
- color: Color tan;
actionSelector: #delete;
setBalloonText: 'Close the trashcan.\(to view again later, click on any trashcan).' withCRs translated.
-
header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
header addMorphBack: (label := UpdatingStringMorph new target: self) beSticky.
label getSelector: #trashTitle; useStringFormat; step.
header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
+ header addMorphBack: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Dismiss').
+ aButton target: self;
+ actionSelector: #maybeEmptyTrash;
- header addMorphBack: (aButton := SimpleButtonMorph new label: 'E' translated font: Preferences standardButtonFont).
- aButton target: self; color: Color veryLightGray; actionSelector: #maybeEmptyTrash;
setBalloonText: 'Click here to empty the trash.' translated.
+ book currentPage
+ layoutPolicy: TableLayout new;
+ addMorph: (TextMorph new
+ contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later. To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the "-" control (behind "..."). You can empty out all the objects in the trash can by hitting the "X" button at top right.' withCRs translated;
+ hResizing: #spaceFill).
- book currentPage addMorph: (TextMorph new contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later. To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the - control, and you can empty out all the objects in the trash can by hitting the "E" button at top right.' withCRs translated
- wrappedTo: 190).

book addMorphFront: header.
book setProperty: #scraps toValue: true].!

Item was changed:
----- Method: ScrapBook>>trashTitle (in category 'scraps') -----
trashTitle
+
+ ^ 'T R A S H' translated!
- | label pgs |
- label := 'T R A S H' translated.
- ^ (pgs := book pages size) < 2="">
- ifTrue:
- [label]
- ifFalse:
- [label, (' ({1} pages)' translated format:{pgs})]!

Item was changed:
+ ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'dropping/grabbing') -----
- ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'layout') -----
acceptDroppingMorph: aMorph event: evt
SoundService soundEnabled
ifTrue: [TrashCanMorph preserveTrash
ifTrue: [self class playDeleteSound]
ifFalse: [self playSoundNamed: 'scratch']].
evt hand visible: true.
self state: #off.
aMorph delete.
aMorph == ScrapBook default scrapBook
ifFalse: [ScrapBook default addToTrash: aMorph removeHalo]!





--
_,,,^..^,,,_
best, Eliot