@@ -373,7 +373,7 @@ GMTEEditor >> brushButtons: anObject [
373
373
374
374
{
375
375
#category : #building ,
376
- #' squeak_changestamp' : ' TW 7/9 /2024 18:15 '
376
+ #' squeak_changestamp' : ' mcjj 7/10 /2024 16:51 '
377
377
}
378
378
GMTEEditor >> buildWith: builder [
379
379
" builds the editor with ToolBuilder"
@@ -393,7 +393,7 @@ GMTEEditor >> buildWith: builder [
393
393
self createInspectorSpecWithBuilder: builder};
394
394
closeAction: #onClose ;
395
395
minimumExtent: GMTEEditor editorMinimumExtent).
396
-
396
+
397
397
self commandBar: (newMorph submorphNamed: ' command bar' ).
398
398
" self commandBar vResizing: #rigid."
399
399
self tileStore: (newMorph submorphNamed: ' tile store' ).
@@ -422,7 +422,8 @@ GMTEEditor >> buildWith: builder [
422
422
423
423
self
424
424
initializeDefaultTileMapMatrix;
425
- associatedMorph: newMorph.
425
+ associatedMorph: newMorph;
426
+ setupInputHandlingFor: newMorph.
426
427
427
428
^ newMorph
428
429
]
@@ -967,6 +968,15 @@ GMTEEditor >> disableSingleLayerButtons [
967
968
GMTEEditor singleLayerActionNames do: [:aString | (self associatedMorph submorphNamed: aString) enabled: false ]
968
969
]
969
970
971
+ {
972
+ #category : #' input handling' ,
973
+ #' squeak_changestamp' : ' mcjj 7/10/2024 16:47'
974
+ }
975
+ GMTEEditor >> dropKeyboardFocus: anEvent [
976
+
977
+ anEvent hand releaseKeyboardFocus: self associatedMorph
978
+ ]
979
+
970
980
{
971
981
#category : #' as yet unclassified' ,
972
982
#' squeak_changestamp' : ' TW 6/25/2024 17:51'
@@ -1096,6 +1106,15 @@ GMTEEditor >> getGridWidthAsString [
1096
1106
^ self getGridWidth asString
1097
1107
]
1098
1108
1109
+ {
1110
+ #category : #' input handling' ,
1111
+ #' squeak_changestamp' : ' mcjj 7/10/2024 16:46'
1112
+ }
1113
+ GMTEEditor >> getKeyboardFocus: anEvent [
1114
+
1115
+ anEvent hand newKeyboardFocus: self associatedMorph
1116
+ ]
1117
+
1099
1118
{
1100
1119
#category : #' layer manipulation' ,
1101
1120
#' squeak_changestamp' : ' TW 6/23/2024 21:50'
@@ -1163,6 +1182,18 @@ GMTEEditor >> getTileRatioAsString [
1163
1182
^ self getTileRatio asString
1164
1183
]
1165
1184
1185
+ {
1186
+ #category : #' input handling' ,
1187
+ #' squeak_changestamp' : ' mcjj 7/10/2024 16:49'
1188
+ }
1189
+ GMTEEditor >> handleKeyStroke: anEvent [
1190
+
1191
+ | keyValue |
1192
+ keyValue := anEvent key.
1193
+ Transcript show: keyValue
1194
+ " keyValue = $A"
1195
+ ]
1196
+
1166
1197
{
1167
1198
#category : #' menu button functions' ,
1168
1199
#' squeak_changestamp' : ' TW 6/23/2024 20:09'
@@ -1985,6 +2016,20 @@ GMTEEditor >> settingsMenu [
1985
2016
builder open: aMenuSpec
1986
2017
]
1987
2018
2019
+ {
2020
+ #category : #' input handling' ,
2021
+ #' squeak_changestamp' : ' mcjj 7/10/2024 16:49'
2022
+ }
2023
+ GMTEEditor >> setupInputHandlingFor: aMorph [
2024
+
2025
+ aMorph
2026
+ on: #mouseMove send: #getKeyboardFocus: to: self ;
2027
+ on: #mouseLeave send: #dropKeyboardFocus: to: self ;
2028
+ on: #keyStroke send: #handleKeyStroke: to: self .
2029
+
2030
+ aMorph eventHandler wantsEveryMouseMove: true
2031
+ ]
2032
+
1988
2033
{
1989
2034
#category : #' layer manipulation' ,
1990
2035
#' squeak_changestamp' : ' jj 6/22/2024 21:43'
0 commit comments