The Trunk: Tools-mt.792.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.792.mcz

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

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

Name: Tools-mt.792
Author: mt
Time: 17 January 2018, 9:51:49.588014 am
UUID: e076ab09-18c5-8d40-a360-fa91d66da8bf
Ancestors: Tools-mt.791

Accept or cancel new file dialogs via [cr] or [escape] key.

Btw: I think those dialogs should be moved to "ToolBuilder-Morphic" because they are like ListChooser etc. That is, no MVC support. And they should drop the "Dialog" suffix because they are models.

=============== Diff against Tools-mt.791 ===============

Item was changed:
  ----- Method: DirectoryChooserDialog>>buildWith: (in category 'toolbuilder') -----
  buildWith: builder
  "assemble the spec for the chooser dialog UI"
 
  | windowSpec window |
  windowSpec := self buildWindowWith: builder specs: {
  (self frameOffsetFromTop: 0
  fromLeft: 0
  width: 1
  offsetFromBottom: 0) -> [self buildDirectoryTreeWith: builder].
  }.
  windowSpec buttons addAll: ( self buildButtonsWith: builder ).
  window := builder build: windowSpec.
+ Project current isMorphic ifTrue: [window addKeyboardCaptureFilter: self].
  self changed: #selectedPath.
  ^window
  !

Item was changed:
  ----- Method: DirectoryChooserDialog>>initialExtent (in category 'toolbuilder') -----
  initialExtent
  "Since this is a single list it can be a bit narrower than a FileChooserDialog"
 
+ ^ super initialExtent * (0.5 @ 1)!
- ^300@400!

Item was added:
+ ----- Method: FileAbstractSelectionDialog>>filterEvent:for: (in category 'event handling') -----
+ filterEvent: aKeyboardEvent for: aMorph
+
+ | char |
+ aKeyboardEvent isKeystroke ifFalse: [^ aKeyboardEvent].
+ aKeyboardEvent anyModifierKeyPressed ifTrue: [^ aKeyboardEvent].
+
+ char := aKeyboardEvent keyCharacter.
+
+ (char = Character cr or: [char = Character enter])
+ ifTrue: [self acceptFileName. aKeyboardEvent ignore].
+ char = Character escape
+ ifTrue: [self cancelFileChooser. aKeyboardEvent ignore].
+
+ ^ aKeyboardEvent!

Item was changed:
  ----- Method: FileChooserDialog>>buildWith: (in category 'toolbuilder') -----
  buildWith: builder
  "assemble the spec for the chooser dialog UI"
 
  | windowSpec window |
  windowSpec := self buildWindowWith: builder specs: {
  (self frameOffsetFromTop: 0
  fromLeft: 0.25
  width: 0.75
  offsetFromBottom: 0) -> [self buildFileListWith: builder].
  (self frameOffsetFromTop: 0
  fromLeft: 0
  width: 0.25
  offsetFromBottom: 0) -> [self buildDirectoryTreeWith: builder].
  }.
  windowSpec buttons addAll: ( self buildButtonsWith: builder ).
  window := builder build: windowSpec.
+ Project current isMorphic ifTrue: [window addKeyboardCaptureFilter: self].
  self changed: #selectedPath.
  ^window
  !

Item was changed:
  ----- Method: FileSaverDialog>>buildWith: (in category 'toolbuilder') -----
  buildWith: builder
  "assemble the spec for the saver dialog UI and build the window"
 
  | window windowSpec |
  windowSpec := self buildWindowWith: builder specs: {
  (self topConstantHeightFrame: self textViewHeight + self viewSpacing
  fromLeft: 0
  width: 1) -> [self buildTextInputWith: builder].
  (self frameOffsetFromTop: self textViewHeight + self viewSpacing
  fromLeft: 0.25
  width: 0.75
  offsetFromBottom: 0) -> [self buildFileListWith: builder].
  (self frameOffsetFromTop: self textViewHeight + self viewSpacing
  fromLeft: 0
  width: 0.25
  offsetFromBottom: 0) -> [self buildDirectoryTreeWith: builder].
  }.
  windowSpec buttons addAll: ( self buildButtonsWith: builder ).
  window := builder build: windowSpec.
+ Project current isMorphic ifTrue: [window addKeyboardCaptureFilter: self].
  self changed: #selectedPath.
  self inputText: fileName.
  ^window
  !