--- a/EventMonitor.st Wed Oct 04 13:05:58 2006 +0200
+++ b/EventMonitor.st Wed Oct 04 13:18:43 2006 +0200
@@ -20,7 +20,8 @@
!
View subclass:#EventMonitorView
- instanceVariableNames:'outputStream labelHolder showButtonMotion showFocusEvents'
+ instanceVariableNames:'outputStream labelHolder showButtonMotion showFocusEvents
+ showTimestamp'
classVariableNames:''
poolDictionaries:''
privateIn:EventMonitor
@@ -182,6 +183,15 @@
choice: outputSelector
choiceValue: transcript
)
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'Show Timestamp'
+ itemValue: showTimestamp:
+ translateLabel: true
+ indication: showTimestamp
+ )
)
nil
nil
@@ -217,7 +227,7 @@
nil
)
- "Modified: / 04-10-2006 / 13:05:46 / cg"
+ "Modified: / 04-10-2006 / 13:15:11 / cg"
! !
!EventMonitor methodsFor:'aspects'!
@@ -264,6 +274,18 @@
^ self eventMonitorView showFocusEvents:aBoolean
"Created: / 04-10-2006 / 13:05:19 / cg"
+!
+
+showTimestamp
+ ^ self eventMonitorView showTimestamp
+
+ "Created: / 04-10-2006 / 13:14:49 / cg"
+!
+
+showTimestamp:aBoolean
+ ^ self eventMonitorView showTimestamp:aBoolean
+
+ "Created: / 04-10-2006 / 13:14:53 / cg"
! !
!EventMonitor methodsFor:'menu actions'!
@@ -349,6 +371,18 @@
showFocusEvents := aBoolean.
"Created: / 04-10-2006 / 13:04:04 / cg"
+!
+
+showTimestamp
+ ^ showTimestamp ? false
+
+ "Created: / 04-10-2006 / 13:06:57 / cg"
+!
+
+showTimestamp:aBoolean
+ showTimestamp := aBoolean.
+
+ "Created: / 04-10-2006 / 13:07:02 / cg"
! !
!EventMonitor::EventMonitorView methodsFor:'drawing'!
@@ -365,6 +399,14 @@
self displayString:eachLine value x:(p x) y:(p y).
y := y + (font heightOf:eachLine).
]
+!
+
+showEventTime
+ self showTimestamp ifTrue:[
+ Transcript show:(Timestamp now); show:' '.
+ ]
+
+ "Created: / 04-10-2006 / 13:08:27 / cg"
! !
!EventMonitor::EventMonitorView methodsFor:'events'!
@@ -372,6 +414,7 @@
buttonMotion:state x:x y:y
self showButtonMotion ifFalse:[^ self].
+ self showEventTime.
outputStream nextPutAll:'buttonMotion x:'.
x printOn:outputStream.
outputStream nextPutAll:' y:'.
@@ -380,10 +423,12 @@
state printOn:outputStream.
outputStream cr.
- "Modified: / 20-09-2006 / 10:29:50 / cg"
+ "Modified: / 04-10-2006 / 13:07:53 / cg"
!
buttonMultiPress:button x:x y:y
+ self showEventTime.
+
outputStream nextPutAll:'buttonMultiPress x:'.
x printOn:outputStream.
outputStream nextPutAll:' y:'.
@@ -392,11 +437,13 @@
button printOn:outputStream.
outputStream cr.
- "Modified: / 5.4.1997 / 01:23:42 / cg"
- "Created: / 19.5.1999 / 09:40:40 / cg"
+ "Created: / 19-05-1999 / 09:40:40 / cg"
+ "Modified: / 04-10-2006 / 13:08:36 / cg"
!
buttonPress:button x:x y:y
+ self showEventTime.
+
outputStream nextPutAll:'buttonPress x:'.
x printOn:outputStream.
outputStream nextPutAll:' y:'.
@@ -406,10 +453,12 @@
outputStream cr.
outputStream flush.
- "Modified: / 20-09-2006 / 10:29:43 / cg"
+ "Modified: / 04-10-2006 / 13:08:43 / cg"
!
buttonRelease:button x:x y:y
+ self showEventTime.
+
outputStream nextPutAll:'buttonRelease x:'.
x printOn:outputStream.
outputStream nextPutAll:' y:'.
@@ -418,10 +467,12 @@
button printOn:outputStream.
outputStream cr.
- "Modified: 5.4.1997 / 01:23:43 / cg"
+ "Modified: / 04-10-2006 / 13:08:46 / cg"
!
configureX:x y:y width:newWidth height:newHeight
+ self showEventTime.
+
outputStream nextPutAll:'configure x:'.
x printOn:outputStream.
outputStream nextPutAll:' y:'.
@@ -437,7 +488,7 @@
self invalidate.
- "Modified: 5.4.1997 / 01:23:45 / cg"
+ "Modified: / 04-10-2006 / 13:08:49 / cg"
!
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate
@@ -454,46 +505,56 @@
!
dropMessage:dropType data:dropData
+ self showEventTime.
+
outputStream nextPutAll:'drop '.
dropType printOn:outputStream.
outputStream nextPutAll:' data:'.
dropData printOn:outputStream.
outputStream cr.
- "Modified: 5.4.1997 / 01:23:28 / cg"
+ "Modified: / 04-10-2006 / 13:09:13 / cg"
!
focusIn
self showFocusEvents ifFalse:[^ self].
+ self showEventTime.
+
outputStream nextPutLine:'focusIn '.
"Created: / 07-03-1996 / 15:06:18 / cg"
- "Modified: / 04-10-2006 / 13:04:33 / cg"
+ "Modified: / 04-10-2006 / 13:09:17 / cg"
!
focusOut
self showFocusEvents ifFalse:[^ self].
+ self showEventTime.
+
outputStream nextPutLine:'focusOut '.
"Created: / 07-03-1996 / 15:06:21 / cg"
- "Modified: / 04-10-2006 / 13:04:40 / cg"
+ "Modified: / 04-10-2006 / 13:09:20 / cg"
!
hasKeyboardFocus:aBoolen
self showFocusEvents ifFalse:[^ self].
+ self showEventTime.
+
outputStream nextPutAll:'hasKeyboardFocus:'.
aBoolen printOn:outputStream.
outputStream cr.
- "Modified: / 04-10-2006 / 13:04:43 / cg"
+ "Modified: / 04-10-2006 / 13:09:23 / cg"
!
keyPress:key x:x y:y
|s rawKey untranslatedKey|
+ self showEventTime.
+
s := 'KeyPress x:' , x printString , ' y:' , y printString.
s printOn:outputStream.
@@ -511,12 +572,22 @@
s := s , ' rawKey:' , rawKey storeString.
s printOn:outputStream.
+
+ key isCharacter ifTrue:[
+ outputStream nextPutAll:' '''.
+ key asString printOn:outputStream.
+ outputStream nextPutAll:''''.
+ ].
outputStream cr.
+
+ "Modified: / 04-10-2006 / 13:12:07 / cg"
!
keyRelease:key x:x y:y
|untranslatedKey|
+ self showEventTime.
+
'KeyRelease x:' printOn:outputStream.
x printOn:outputStream.
' y:' printOn:outputStream.
@@ -540,17 +611,23 @@
].
outputStream cr
+
+ "Modified: / 04-10-2006 / 13:09:27 / cg"
!
mapped
+ self showEventTime.
+
outputStream nextPutLine:'mapped '.
super mapped.
- "Modified: / 6.1.1999 / 11:04:32 / cg"
+ "Modified: / 04-10-2006 / 13:09:31 / cg"
!
pointerEnter:state x:x y:y
+ self showEventTime.
+
outputStream nextPutAll:'pointerEnter x:'.
x printOn:outputStream.
outputStream nextPutAll:' y:'.
@@ -559,38 +636,46 @@
state printOn:outputStream.
outputStream cr.
- "Modified: 5.4.1997 / 01:24:02 / cg"
+ "Modified: / 04-10-2006 / 13:09:34 / cg"
!
pointerLeave:state
+ self showEventTime.
+
outputStream nextPutAll:'pointerLeave state:'.
state storeString printOn:outputStream.
outputStream cr.
- "Modified: 5.4.1997 / 01:24:05 / cg"
+ "Modified: / 04-10-2006 / 13:09:36 / cg"
!
sizeChanged:how
super sizeChanged:how.
self invalidate
+
+ "Modified: / 04-10-2006 / 13:17:46 / cg"
!
unmapped
+ self showEventTime.
+
outputStream nextPutLine:'unmapped '.
super unmapped.
- "Modified: / 6.1.1999 / 11:04:22 / cg"
+ "Modified: / 04-10-2006 / 13:09:41 / cg"
!
visibilityChange:how
+ self showEventTime.
+
outputStream nextPutAll:'visibilityChange:'.
how storeString printOn:outputStream.
outputStream cr.
super visibilityChange:how
- "Modified: / 6.1.1999 / 11:04:12 / cg"
+ "Modified: / 04-10-2006 / 13:09:43 / cg"
! !
!EventMonitor::EventMonitorView methodsFor:'initialization'!
@@ -617,5 +702,5 @@
!EventMonitor class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/EventMonitor.st,v 1.27 2006-10-04 11:05:58 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/EventMonitor.st,v 1.28 2006-10-04 11:18:43 cg Exp $'
! !