@@ -15,7 +15,8 @@ Class {
15
15
#name : #BrButtonModel ,
16
16
#superclass : #BrWidgetModel ,
17
17
#instVars : [
18
- ' action'
18
+ ' action' ,
19
+ ' enableAllModifiers'
19
20
],
20
21
#category : #' Brick-Button - Model'
21
22
}
@@ -56,6 +57,16 @@ BrButtonModel >> clickEvent: anEvent [
56
57
ifFalse: [ self action gtValueWithArgs: { self widget . self . anEvent } ]
57
58
]
58
59
60
+ { #category : #' mouse handlers' }
61
+ BrButtonModel >> disableAllModifiers [
62
+ enableAllModifiers := false
63
+ ]
64
+
65
+ { #category : #' mouse handlers' }
66
+ BrButtonModel >> enableAllModifiers [
67
+ enableAllModifiers := true
68
+ ]
69
+
59
70
{ #category : #' gt-extension' }
60
71
BrButtonModel >> gtActionFor: aView [
61
72
< gtView>
@@ -90,14 +101,18 @@ BrButtonModel >> hasModifiers: anEvent [
90
101
BrButtonModel >> initialize [
91
102
super initialize.
92
103
93
- action := [ :anElement :aButtonModel :anEvent | ]
104
+ action := [ :anElement :aButtonModel :anEvent | ].
105
+ self disableAllModifiers
94
106
]
95
107
96
108
{ #category : #initialization }
97
109
BrButtonModel >> initializeListeners [
98
110
self
99
111
when: BlClickEvent
100
- do: [ :anEvent | (self hasModifiers: anEvent) ifFalse: [ self clickEvent: anEvent ] ].
112
+ do: [ :anEvent |
113
+ (enableAllModifiers or : [ (self hasModifiers: anEvent) not ])
114
+ ifTrue: [ self clickEvent: anEvent ] ].
115
+
101
116
self
102
117
when: BlFocusInEvent
103
118
do: [ self
0 commit comments