Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.1791.mcz
==================== Summary ====================
Name: Morphic-ct.1791
Author: ct
Time: 1 November 2021, 6:59:37.506014 pm
UUID: c33323b2-7221-9d4f-b3af-d723dd256645
Ancestors: Morphic-eem.1784
Documentation: Adds example of #add:subMenu:target:selector:argumentList: to MenuMorph example.
=============== Diff against Morphic-eem.1784 ===============
Item was changed:
----- Method: MenuMorph class>>example (in category 'example') -----
example
"MenuMorph example popUpInWorld"
| menu |
menu := MenuMorph new.
menu addTitle: 'Fruit' translated.
menu addStayUpItem.
menu add: 'apples' action: #apples.
menu add: 'oranges' action: #oranges.
menu addLine.
menu addLine. "extra lines ignored"
menu add: 'peaches' action: #peaches.
menu addLine.
menu add: 'pears' action: #pears.
menu addLine.
+ menu add: 'test' subMenu: (MenuMorph new
+ defaultTarget: #peaches;
+ add: 'foo' action: #inspect;
+ yourself) target: 42 selector: #inform: argumentList: #('hello').
+ ^ menu!
- ^ menu
- !
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.1793.mcz
==================== Summary ====================
Name: Morphic-ct.1793
Author: ct
Time: 2 November 2021, 2:13:50.787566 pm
UUID: 7a1dd790-4559-fd46-808a-307e588d6f71
Ancestors: Morphic-mt.1785
Resolves two sends to deprecated messages.
=============== Diff against Morphic-mt.1785 ===============
Item was changed:
----- Method: MenuMorph>>balloonTextForLastItem: (in category 'construction') -----
balloonTextForLastItem: balloonText
+ submorphs last balloonText: balloonText!
- submorphs last setBalloonText: balloonText!
Item was changed:
----- Method: SystemWindow>>closeBoxHit (in category 'open/close') -----
closeBoxHit
"The user clicked on the close-box control in the window title. For Mac users only, the Mac convention of option-click-on-close-box is obeyed if the mac option key is down."
Preferences dismissAllOnOptionClose ifTrue:
+ [self currentEvent optionKeyPressed ifTrue:
- [Sensor rawMacOptionKeyPressed ifTrue:
[^ self world closeUnchangedWindows]].
self delete
!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.1957.mcz
==================== Summary ====================
Name: Morphic-ct.1957
Author: ct
Time: 1 April 2022, 3:58:43.713617 pm
UUID: 73b0c9b3-ca79-9945-b668-d92a3548ae44
Ancestors: Morphic-ul.1956
While running step methods, have the world become active. Before, any step methods/deferred UI message would have triggered the #default case in ActiveEventVariable only.
=============== Diff against Morphic-ul.1956 ===============
Item was changed:
----- Method: PasteUpMorph>>runStepMethods (in category 'stepping') -----
runStepMethods
+ self becomeActiveDuring: [
+ worldState runStepMethodsIn: self].!
- worldState runStepMethodsIn: self
- !
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.1991.mcz
==================== Summary ====================
Name: Morphic-ct.1991
Author: ct
Time: 18 May 2022, 1:15:26.246371 pm
UUID: 8c165900-282b-4b69-93c0-e61b23b4f6fd
Ancestors: Morphic-nice.1989
Increases robustness of #windowHostFocusMorph to honor some facts:
- Currently, there is no exact-once guarantee by the VM for the recording of #windowActivated and #windowDeactived events.
- It is also possible that new morphs temporarily change the keyboard focus while the host focus morph is active, e.g., dialog windows due to an asynchronous operation or an attempt to close the VM window while it is not active (actually, some window managers always disable the window when closing it via the taskbar/Alt + F4).
To fix this, extract the host focus as a class (WindowHostFocusMorph) that overrides #keyboardFocusDelegate. When another client stores the keyboard focus before changing it (for instance, see priorKeyboardFocus in DialogWindow>>#getUserResponse), any attempt to restore that focus later will pass it back to the original previousFocus. Before resetting the keyboard focus on #windowActivate:, make sure that the host focus morph still has the keyboard focus.
Please test again with all your crazy window managers and shortcuts out there. =)
Thanks to Chris (cmm) for the report and Marcel (mt) for the help!
=============== Diff against Morphic-nice.1989 ===============
Item was changed:
----- Method: PasteUpMorph>>windowEvent: (in category 'event handling') -----
windowEvent: anEvent
+
self windowEventHandler
ifNotNil: [^self windowEventHandler windowEvent: anEvent].
+
-
anEvent type
caseOf: {
[#windowClose] -> [
Preferences eToyFriendly
ifTrue: [ProjectNavigationMorph basicNew quitSqueak]
ifFalse: [TheWorldMenu basicNew quitSession]].
[#windowDeactivated] -> [
+ "The host window has been deactivated. Until it regains the focus, honor the fact that we will not receive keyboard events again by changing the current keyboard focus morph. windowHostFocusMorph represents the host system which now holds the keyboard focus instead of the previousFocus. If enabled, disable #mouseOverForKeyboardFocus temporarily because when inactive, we *can't* set the externally controlled keyboard focus."
+ (self valueOfProperty: #windowHostFocusMorph) ifNotNil: [:hostFocus |
+ "There is currently no exact-once guarantee for this event type from the VM. Mark any older host focus morph as inactive, it will be held as the previousFocus of the next host focus morph."
+ hostFocus active: false].
+ self setProperty: #windowHostFocusMorph toValue: (WindowHostFocusMorph new
+ in: [:hostFocus |
+ hostFocus previousFocus: anEvent hand keyboardFocus.
+ anEvent hand newKeyboardFocus: hostFocus.
+ Preferences mouseOverForKeyboardFocus ifTrue: [
+ hostFocus previousMouseOverForKeyboardFocus: true.
+ Preferences setPreference: #mouseOverForKeyboardFocus toValue: false]];
+ yourself)].
- "The host window has been deactivated. Until it regains the focus, honor the fact that we will not receive keyboard events again by changing the current keyboard focus morph. windowHostFocusMorph represents the host system which now holds the keyboard focus instead of the previousFocus. If enabled, disable #mouseOverForKeyboardFocus temporarily because when inactive, we *can't* set the keyboard focus."
- (self valueOfProperty: #windowHostFocusMorph ifAbsentPut: [
- Morph new
- name: #windowHostFocusMorph;
- yourself]) in: [:hostFocus |
- hostFocus setProperty: #previousFocus toValue: anEvent hand keyboardFocus.
- anEvent hand newKeyboardFocus: hostFocus.
- Preferences mouseOverForKeyboardFocus ifTrue: [
- hostFocus setProperty: #previousMouseOverForKeyboardFocus toValue: true.
- Preferences setPreference: #mouseOverForKeyboardFocus toValue: false]]].
[#windowActivated] -> [
"Alright, the spook is over!! We have back control over the keyboard focus, delete the windowHostFocusMorph and restore the previous focus holder and the #mouseOverForKeyboardFocus preference."
+ (self removeProperty: #windowHostFocusMorph) ifNotNil: [:hostFocus |
+ hostFocus active: false.
+ (anEvent hand keyboardFocus == hostFocus and: [hostFocus previousFocus notNil]) ifTrue:
+ [anEvent hand newKeyboardFocus: hostFocus previousFocus].
+ hostFocus previousMouseOverForKeyboardFocus ifNotNil: [:value |
+ Preferences setPreference: #mouseOverForKeyboardFocus toValue: value]]]. }
- self valueOfProperty: #windowHostFocusMorph ifPresentDo: [:hostFocus |
- hostFocus abandon.
- (hostFocus valueOfProperty: #previousFocus) ifNotNil: [:previousFocus |
- anEvent hand newKeyboardFocus: previousFocus].
- (hostFocus valueOfProperty: #previousMouseOverForKeyboardFocus) ifNotNil: [:value |
- Preferences setPreference: #mouseOverForKeyboardFocus toValue: value].
- self removeProperty: #windowHostFocusMorph]]. }
otherwise: []!
Item was added:
+ Morph subclass: #WindowHostFocusMorph
+ instanceVariableNames: 'active previousFocus previousMouseOverForKeyboardFocus'
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Morphic-Worlds'!
+
+ !WindowHostFocusMorph commentStamp: 'ct 5/18/2022 12:41' prior: 0!
+ I represent the host system as a focus holder, i.e., I receive the keyboard focus when the VM looses the keyboard focus. See PasteUpMorph>>#windowEvent:.!
Item was added:
+ ----- Method: WindowHostFocusMorph>>active (in category 'accessing') -----
+ active
+
+ ^ active!
Item was added:
+ ----- Method: WindowHostFocusMorph>>active: (in category 'accessing') -----
+ active: aBoolean
+
+ active := aBoolean.!
Item was added:
+ ----- Method: WindowHostFocusMorph>>initialize (in category 'initialization') -----
+ initialize
+
+ super initialize.
+
+ self active: true.!
Item was added:
+ ----- Method: WindowHostFocusMorph>>keyboardFocusDelegate (in category 'event handling') -----
+ keyboardFocusDelegate
+ "When the receiver was remembered as a prior keyboard focus in place of the previous focus morph, answer that previous morph as a keyboard focus delegate so that re-passing the focus to it works. For instance, this happens when a DialogWindow is invoked while the VM does not have the keyboard focus (e.g., when attempting to close the VM window from the outside)."
+
+ self flag: #forLater. "Preferably, we would even *prevent* other morphs from receiving the keyboard focus through this surrogate. However, there is currently no hook #okToChangeKeyboardFocus: in HandMorph>>#newKeyboardFocus: and re-setting the focus unagreedly might cause trouble in other focus holders."
+
+ self active ifTrue: [^ self].
+ ^ self previousFocus ifNotNil: [:morph | morph keyboardFocusDelegate]!
Item was added:
+ ----- Method: WindowHostFocusMorph>>previousFocus (in category 'accessing') -----
+ previousFocus
+
+ ^ previousFocus!
Item was added:
+ ----- Method: WindowHostFocusMorph>>previousFocus: (in category 'accessing') -----
+ previousFocus: aMorph
+
+ previousFocus := aMorph.!
Item was added:
+ ----- Method: WindowHostFocusMorph>>previousMouseOverForKeyboardFocus (in category 'accessing') -----
+ previousMouseOverForKeyboardFocus
+
+ ^ previousMouseOverForKeyboardFocus!
Item was added:
+ ----- Method: WindowHostFocusMorph>>previousMouseOverForKeyboardFocus: (in category 'accessing') -----
+ previousMouseOverForKeyboardFocus: aBoolean
+
+ previousMouseOverForKeyboardFocus := aBoolean.!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-kfr.2015.mcz
==================== Summary ====================
Name: Morphic-kfr.2015
Author: kfr
Time: 1 July 2022, 7:20:33.220758 pm
UUID: 4c01e4ed-3290-0848-990e-4a31fd76a48b
Ancestors: Morphic-kfr.2014
Reverting Morphic-kfr.2014. Issue solved in Graphics-kfr.527
=============== Diff against Morphic-kfr.2014 ===============
Item was changed:
----- Method: SketchMorph>>reduceColorPalette: (in category 'menu') -----
reduceColorPalette: evt
"Let the user ask for a reduced number of colors in this sketch"
| str nColors |
- originalForm depth > 16 ifTrue:[^self inform:'Not possible for pictures of 32 bit depth' translated].
str := UIManager default
request: 'Please enter a number greater than one.
(note: this cannot be undone, so answer zero
to abort if you need to make a backup first)' translated
initialAnswer: '256'.
nColors := Integer readFrom: (ReadStream on: str).
(nColors between: 2 and: 256) ifFalse: [^ self].
originalForm := originalForm copyWithColorsReducedTo: nColors.
rotatedForm := nil.
self changed!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-kfr.2014.mcz
==================== Summary ====================
Name: Morphic-kfr.2014
Author: kfr
Time: 30 June 2022, 9:36:19.692057 pm
UUID: 7bfd969f-17fb-c347-bcc6-3b6c2523990f
Ancestors: Morphic-mt.2013
Prevent accidental use of reducing color on 32 bit depth SketchMorph
=============== Diff against Morphic-mt.2013 ===============
Item was changed:
----- Method: SketchMorph>>reduceColorPalette: (in category 'menu') -----
reduceColorPalette: evt
"Let the user ask for a reduced number of colors in this sketch"
| str nColors |
+ originalForm depth > 16 ifTrue:[^self inform:'Not possible for pictures of 32 bit depth' translated].
str := UIManager default
request: 'Please enter a number greater than one.
(note: this cannot be undone, so answer zero
to abort if you need to make a backup first)' translated
initialAnswer: '256'.
nColors := Integer readFrom: (ReadStream on: str).
(nColors between: 2 and: 256) ifFalse: [^ self].
originalForm := originalForm copyWithColorsReducedTo: nColors.
rotatedForm := nil.
self changed!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.2011.mcz
==================== Summary ====================
Name: Morphic-ct.2011
Author: ct
Time: 17 June 2022, 12:47:31.817649 pm
UUID: 856b7484-f46f-bb42-b3fe-7b85b17694c3
Ancestors: Morphic-mt.2007
Corrects documentation for Morph >> #startDrag:. Please review briefly.
=============== Diff against Morphic-mt.2007 ===============
Item was changed:
----- Method: Morph>>startDrag: (in category 'event handling') -----
startDrag: evt
+ "Handle a drag event when the user moves the cursor over the receiver while pressing and holding the red button. This message is only sent to clients that request it by sending #waitForClicksOrDrag:event: to the initiating hand in their mouseDown: method. This default implementation does nothing."
- "Handle a double-click event. This message is only sent to clients that request it by sending #waitForClicksOrDrag:event: to the initiating hand in their mouseDown: method. This default implementation does nothing."
self eventHandler ifNotNil:
[self eventHandler startDrag: evt fromMorph: self].!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.2010.mcz
==================== Summary ====================
Name: Morphic-ct.2010
Author: ct
Time: 16 June 2022, 6:46:17.941852 pm
UUID: 7427f838-4f8f-7b49-99f5-d08cd9eeac53
Ancestors: Morphic-mt.2007
Proposal to fix z-order of docking bar menus when etoys mode is activated.
=============== Diff against Morphic-mt.2007 ===============
Item was added:
+ ----- Method: DockingBarMenuMorph>>popUpAdjacentTo:forHand:from: (in category 'as yet unclassified') -----
+ popUpAdjacentTo: rightOrLeftPoint forHand: hand from: sourceItem
+
+ | ownerInWorld world |
+ super popUpAdjacentTo: rightOrLeftPoint forHand: hand from: sourceItem.
+
+ "Docking bar and protruding menu should appear visually merged. Move the source item behind the receiver. If we did it the other way around, other navigators and docking bars in front of the sourceItem would cover the receiver. For the same reason, we can't use a higher different morphic layer numbers for docking bar menus because this would hide them after all other navigators."
+ world := owner world.
+ ownerInWorld := sourceItem firstOwnerSuchThat: [:owner | owner owner == world].
+ world addMorph: ownerInWorld inFrontOf: self.!
Item was changed:
----- Method: DockingBarMorph>>add:icon:help:subMenu: (in category 'construction') -----
add: wordingString icon: aForm help: helpString subMenu: aMenuMorph
"Append the given submenu with the given label."
| item |
item := DockingBarItemMorph new.
item contents: wordingString.
item subMenu: aMenuMorph.
item icon: aForm.
helpString isNil
ifFalse: [item setBalloonText: helpString].
aMenuMorph ifNotNil: [
+ "Docking bar and protruding menu should appear visually merged."
+ aMenuMorph morphicLayerNumber: self morphicLayerNumber].
- aMenuMorph morphicLayerNumber: self morphicLayerNumber + 1].
self addMorphBack: item!
Item was changed:
----- Method: DockingBarMorph>>add:icon:selectedIcon:help:subMenu: (in category 'construction') -----
add: wordingString icon: aForm selectedIcon: anotherForm help: helpString subMenu: aMenuMorph
"Append the given submenu with the given label."
| item |
item := DockingBarItemMorph new
contents: wordingString;
subMenu: aMenuMorph;
icon: aForm;
selectedIcon: anotherForm.
helpString ifNotNil: [
item setBalloonText: helpString ].
aMenuMorph ifNotNil: [
+ "Docking bar and protruding menu should appear visually merged."
+ aMenuMorph morphicLayerNumber: self morphicLayerNumber].
- aMenuMorph morphicLayerNumber: self morphicLayerNumber + 1 ].
self addMorphBack: item!
Item was changed:
----- Method: DockingBarMorph>>addItem: (in category 'construction') -----
addItem: aBlock
| item |
item := DockingBarItemMorph new.
aBlock value: item.
item subMenu ifNotNil: [:menu |
"Docking bar and protruding menu should appear visually merged."
+ menu morphicLayerNumber: self morphicLayerNumber].
- menu morphicLayerNumber: self morphicLayerNumber + 1].
self addMorphBack: item!
Item was changed:
----- Method: DockingBarMorph>>addUpdatingItem: (in category 'construction') -----
addUpdatingItem: aBlock
| item |
item := DockingBarUpdatingItemMorph new.
aBlock value: item.
item subMenu ifNotNil: [:menu |
"Docking bar and protruding menu should appear visually merged."
+ menu morphicLayerNumber: self morphicLayerNumber].
- menu morphicLayerNumber: self morphicLayerNumber + 1].
self addMorphBack: item!