The Trunk: Tools-mt.998.mcz

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

The Trunk: Tools-mt.998.mcz

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

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

Name: Tools-mt.998
Author: mt
Time: 11 October 2020, 1:38:51.865652 pm
UUID: d8edf299-848e-494f-9ef9-fa7c89d1725d
Ancestors: Tools-eem.997

Refactoring 'Active' variables -- Step 2 of 2. Removes all uses of Active(World|Hand|Event) by replacing those with "self current(World|Hand|Event)" or "Project current world" when required to not add/cement Morphic dependency.

See http://forum.world.st/Changeset-Eliminating-global-state-from-Morphic-td5121690.html

=============== Diff against Tools-eem.997 ===============

Item was changed:
  ----- Method: ObjectExplorer>>step (in category 'monitoring') -----
  step
  "Let all views know that some of my objects need to be updated."
 
  self monitorList do: [ :object |
  object ifNotNil: [self changed: #objectChanged with: object]].
  self monitorList ifEmpty: [
+ self world stopStepping: self selector: #step ].!
- ActiveWorld stopStepping: self selector: #step ].!

Item was changed:
  ----- Method: ObjectExplorer>>views (in category 'accessing - view') -----
  views
 
+ ^ self findDeepSubmorphsIn: self world that: [:morph |
- ^ self findDeepSubmorphsIn: ActiveWorld that: [:morph |
  morph modelOrNil = self]!

Item was changed:
  ----- Method: ObjectExplorer>>world (in category 'monitoring') -----
  world
+
+ ^ Project current world!
- ^ActiveWorld!

Item was changed:
  ----- Method: PasteUpMorph>>defaultDesktopCommandKeyTriplets (in category '*Tools') -----
  defaultDesktopCommandKeyTriplets
  "Answer a list of triplets of the form
  <key> <receiver> <selector>   [+ optional fourth element, a <description> for use in desktop-command-key-help]
  that will provide the default desktop command key handlers.  If the selector takes an argument, that argument will be the command-key event"
  "World initializeDesktopCommandKeySelectors"
 
  | noviceKeys expertKeys |
 
  noviceKeys := {
+ {$o. self. #activateObjectsTool. 'Activate the "Objects Tool"' translated}.
+ {$r. self. #restoreMorphicDisplay. 'Redraw the screen' translated}.
+ {$z. self. #undoOrRedoCommand. 'Undo or redo the last undoable command' translated}.
+ {$F. Project current. #toggleFlapsSuppressed. 'Toggle the display of flaps' translated}.
+ {$N. self. #toggleClassicNavigatorIfAppropriate. 'Show/Hide the classic Navigator, if appropriate' translated}.
+ {$M. self. #toggleShowWorldMainDockingBar. 'Show/Hide the Main Docking Bar' translated}.
+ {$]. Smalltalk. #saveSession. 'Save the image.' translated}.
- { $o. ActiveWorld. #activateObjectsTool. 'Activate the "Objects Tool"'}.
- { $r. ActiveWorld. #restoreMorphicDisplay. 'Redraw the screen'}.
- { $z. self. #undoOrRedoCommand. 'Undo or redo the last undoable command'}.
- { $F. Project current. #toggleFlapsSuppressed. 'Toggle the display of flaps'}.
- { $N. self. #toggleClassicNavigatorIfAppropriate. 'Show/Hide the classic Navigator, if appropriate'}.
- { $M. self. #toggleShowWorldMainDockingBar. 'Show/Hide the Main Docking Bar'}.
- { $]. Smalltalk. #saveSession. 'Save the image.'}.
  }.
+
+ Preferences noviceMode ifTrue: [^ noviceKeys].
+
-
- Preferences noviceMode ifTrue:[^ noviceKeys].
-
  expertKeys := {
+ {$b. SystemBrowser. #defaultOpenBrowser. 'Open a new System Browser' translated}.
+ {$k. Workspace. #open. 'Open a new Workspace' translated}.
+ {$m. self. #putUpNewMorphMenu. 'Put up the "New Morph" menu' translated}.
+ {$O. self. #findAMonticelloBrowser. 'Bring a Monticello window into focus.' translated}.
+ {$t. self. #findATranscript:. 'Make a System Transcript visible' translated}.
+ {$w. SystemWindow. #closeTopWindow. 'Close the topmost window' translated}.
+ {Character escape. SystemWindow. #closeTopWindow. 'Close the topmost window' translated}.
+
+ {$C. self. #findAChangeSorter:. 'Make a Change Sorter visible' translated}.
+
+ {$L. self. #findAFileList:. 'Make a File List visible' translated}.
+ {$P. self. #findAPreferencesPanel:. 'Activate the Preferences tool' translated}.
+ {$R. Utilities. #browseRecentSubmissions. 'Make a Recent Submissions browser visible' translated}.
+
+ {$W. self. #findAMessageNamesWindow:. 'Make a MessageNames tool visible' translated}.
+ {$Z. ChangeList. #browseRecentLog. 'Browse recently-logged changes' translated}.
+
+ {$\. SystemWindow. #sendTopWindowToBack. 'Send the top window to the back' translated}.
+ {$_. Smalltalk. #quitPrimitive. 'Quit the image immediately.' translated}.
+
+ {$-. Preferences. #decreaseFontSize. 'Decrease all font sizes' translated}.
+ {$+. Preferences. #increaseFontSize. 'Increase all font sizes' translated}.
- { $b. SystemBrowser. #defaultOpenBrowser. 'Open a new System Browser'}.
- { $k. StringHolder. #open. 'Open a new, blank Workspace'}.
- { $m. self. #putUpNewMorphMenu. 'Put up the "New Morph" menu'}.
- { $O. self. #findAMonticelloBrowser. 'Bring a Monticello window into focus.'}.
- { $t. self. #findATranscript:. 'Make a System Transcript visible'}.
- { $w. SystemWindow. #closeTopWindow. 'Close the topmost window'}.
- { Character escape. SystemWindow. #closeTopWindow. 'Close the topmost window'}.
-
- { $C. self. #findAChangeSorter:. 'Make a Change Sorter visible'}.
-
- { $L. self. #findAFileList:. 'Make a File List visible'}.
- { $P. self. #findAPreferencesPanel:. 'Activate the Preferences tool'}.
- { $R. Utilities. #browseRecentSubmissions. 'Make a Recent Submissions browser visible'}.
-
- { $W. self. #findAMessageNamesWindow:. 'Make a MessageNames tool visible'}.
- { $Z. ChangeList. #browseRecentLog. 'Browse recently-logged changes'}.
-
- { $\. SystemWindow. #sendTopWindowToBack. 'Send the top window to the back'}.
- { $_. Smalltalk. #quitPrimitive. 'Quit the image immediately.'}.
-
- { $-. Preferences. #decreaseFontSize. 'Decrease all font sizes'}.
- { $+. Preferences. #increaseFontSize. 'Increase all font sizes'}.
  }.
+
+ ^ noviceKeys, expertKeys!
-
- ^ noviceKeys, expertKeys
- !

Item was changed:
  ----- Method: PluggableFileList>>startUpWithCaption: (in category 'StandardFileMenu') -----
  startUpWithCaption: captionOrNil
+ "Display the menu, slightly offset from the cursor, so that a slight tweak is required to confirm any action."
+
+ ^ self
+ startUpWithCaption: captionOrNil
+ at: (self currentHand ifNil: [Sensor]) cursorPoint!
- "Display the menu, slightly offset from the cursor,
- so that a slight tweak is required to confirm any action."
- ^ self startUpWithCaption: captionOrNil at: (ActiveHand ifNil:[Sensor cursorPoint]).!

Item was changed:
  ----- Method: PopUpMenu>>startUpCenteredWithCaption: (in category 'basic control sequence') -----
  startUpCenteredWithCaption: captionOrNil
+ "Differs from startUpWithCaption: by appearing with cursor in the menu, and thus ready to act on mouseUp, without requiring user tweak to confirm"
+
+ ^ self
+ startUpWithCaption: captionOrNil
+ at: (self currentHand ifNil: [Sensor]) cursorPoint - (20 @ 0)!
- "Differs from startUpWithCaption: by appearing with cursor in the menu,
- and thus ready to act on mouseUp, without requiring user tweak to confirm"
- ^ self startUpWithCaption: captionOrNil at: (ActiveHand ifNil:[Sensor]) cursorPoint - (20@0)!

Item was changed:
  ----- Method: PopUpMenu>>startUpWithCaption: (in category 'basic control sequence') -----
  startUpWithCaption: captionOrNil
  "Display the menu, slightly offset from the cursor,
  so that a slight tweak is required to confirm any action."
+ self flag: #fix. "mt: Could we manage to open pop-up menus in Morphic without accessing self currentHand?"
+
+ ^ self
+ startUpWithCaption: captionOrNil
+ at: (self currentHand ifNil: [Sensor]) cursorPoint!
- self flag: #fix. "mt: Could we manage to open pop-up menus in Morphic without accessing ActiveHand?"
- ^ self startUpWithCaption: captionOrNil at: (ActiveHand ifNil:[Sensor]) cursorPoint!

Item was changed:
  ----- Method: PopUpMenu>>startUpWithCaption:icon: (in category 'basic control sequence') -----
  startUpWithCaption: captionOrNil icon: aForm
+ "Display the menu, slightly offset from the cursor, so that a slight tweak is required to confirm any action."
+
- "Display the menu, slightly offset from the cursor,
- so that a slight tweak is required to confirm any action."
  ^ self
  startUpWithCaption: captionOrNil
  icon: aForm
+ at: (self currentHand ifNil: [Sensor]) cursorPoint!
- at: (ActiveHand ifNil:[Sensor]) cursorPoint
- !

Item was changed:
  ----- Method: PopUpMenu>>startUpWithoutKeyboard (in category 'basic control sequence') -----
  startUpWithoutKeyboard
  "Display and make a selection from the receiver as long as the button  is pressed. Answer the current selection.  Do not allow keyboard input into the menu"
 
+ ^ self
+ startUpWithCaption: nil
+ at: ((self currentHand ifNil: [Sensor]) cursorPoint)
+ allowKeyboard: false!
- ^ self startUpWithCaption: nil at: ((ActiveHand ifNil:[Sensor]) cursorPoint) allowKeyboard: false!