1: ================================================================================ 2: 3: Smalltalk.KSU defineClass: #ColorHSBController 4: superclass: #{UI.Controller} 5: indexedType: #none 6: private: false 7: instanceVariableNames: '' 8: classInstanceVariableNames: '' 9: imports: '' 10: category: '' 11: 12: ================================================================================ 13: 14: KSU.ColorHSBController method for 'events' 15: 16: enterEvent: event 17: 18: super enterEvent: event. 19: Cursor crossHair show. 20: ^nil 21: 22: ------------------------------------------------------------ 23: 24: KSU.ColorHSBController method for 'events' 25: 26: exitEvent: event 27: 28: super exitEvent: event. 29: Cursor normal show. 30: ^nil 31: 32: ------------------------------------------------------------ 33: 34: KSU.ColorHSBController method for 'events' 35: 36: mouseMovedEvent: event 37: 38: self viewHasCursor ifTrue: [Cursor crossHair show] ifFalse: [Cursor normal show]. 39: ^nil 40: 41: ------------------------------------------------------------ 42: 43: KSU.ColorHSBController method for 'events' 44: 45: redButtonPressedEvent: event 46: 47: | aspectArea previousPoint currentPoint normalizedValue | 48: aspectArea := self view aspectArea. 49: previousPoint := nil. 50: [self sensor redButtonPressed] whileTrue: 51: [currentPoint := self sensor cursorPoint. 52: currentPoint = previousPoint 53: ifFalse: 54: [| endingTime | 55: endingTime := Time microsecondClock + 250000. 56: normalizedValue := (currentPoint x - aspectArea left) / (aspectArea right - aspectArea left). 57: normalizedValue := 0 max: (normalizedValue min: 1). 58: (self model perform: (self view aspectSelector , 'Gauge') asSymbol) value: normalizedValue. 59: (Delay untilMicroseconds: endingTime) wait. 60: previousPoint := currentPoint]. 61: Processor yield]. 62: ^nil 63: 64: ================================================================================ 65: 66: KSU.ColorHSBController class 67: instanceVariableNames: '' 68: 69: ================================================================================
This document was generated by KSU.TextDoclet on 2012/11/10 at 10:32:57.