[squeak-dev] The Trunk: MorphicExtras-mt.269.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Fri Feb 14 14:12:24 UTC 2020


> +        ^ '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 <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Freitag, 14. Februar 2020 15:08:46
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
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 at 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 at 5.

         row := AlignmentMorph newRow.
         row color: c; borderWidth: 0; layoutInset: 0.
         row hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5 at 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 at 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 at 300; setNameTo: 'scraps' translated.
+                book addCornerGrips.
-                book := BookMorph new pageSize: 200 at 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]!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200214/c28f1bb7/attachment.html>


More information about the Squeak-dev mailing list