--- a/ButtonC.st Thu Nov 23 11:37:10 1995 +0100
+++ b/ButtonC.st Thu Nov 23 11:42:48 1995 +0100
@@ -10,13 +10,10 @@
hereby transferred.
"
-'From Smalltalk/X, Version:2.10.5 on 4-may-1995 at 6:17:35 am'!
-
Controller subclass:#ButtonController
- instanceVariableNames:'enableChannel pressChannel releaseChannel
- pressed active entered isTriggerOnDown autoRepeat
- repeatBlock initialDelay repeatDelay pressActionBlock
- releaseActionBlock isToggle'
+ instanceVariableNames:'enableChannel pressChannel releaseChannel pressed active entered
+ isTriggerOnDown autoRepeat repeatBlock initialDelay repeatDelay
+ pressActionBlock releaseActionBlock isToggle'
classVariableNames:''
poolDictionaries:''
category:'Interface-Support-Controllers'
@@ -38,10 +35,6 @@
"
!
-version
- ^ '$Header: /cvs/stx/stx/libwidg/Attic/ButtonC.st,v 1.21 1995-11-14 21:44:27 cg Exp $'
-!
-
documentation
"
ButtonControllers are used with buttons and handle all user interaction.
@@ -82,71 +75,158 @@
active <Boolean> true during action evaluation (internal)
"
+!
+
+version
+ ^ '$Header: /cvs/stx/stx/libwidg/Attic/ButtonC.st,v 1.22 1995-11-23 10:39:34 cg Exp $'
! !
!ButtonController class methodsFor:'defaults'!
-defaultRepeatDelay
- "when autorepeat is enabled, and button is not released,
- repeat every repeatDelay seconds"
-
- ^ 0.025
-!
-
defaultInitialDelay
"when autorepeat is enabled, and button is not released,
start repeating after initialDelay seconds"
^ 0.2
+!
+
+defaultRepeatDelay
+ "when autorepeat is enabled, and button is not released,
+ repeat every repeatDelay seconds"
+
+ ^ 0.025
! !
-!ButtonController methodsFor:'accessing-state'!
+!ButtonController methodsFor:'accessing-behavior'!
+
+action:aBlock
+ "convenient method: depending on the setting the triggerOnDown flag,
+ either set the press-action clear any release-action or
+ vice versa, set the release-action and clear the press-action."
-pressed
- "return true, if I am pressed"
+ isTriggerOnDown ifTrue:[
+ releaseActionBlock := nil.
+ pressActionBlock := aBlock
+ ] ifFalse:[
+ releaseActionBlock := aBlock.
+ pressActionBlock := nil
+ ]
+!
- ^ pressed
+autoRepeat
+ "turn on autorepeat. OBSOLETE"
+
+ autoRepeat := true.
+ repeatBlock := [self repeat]
!
-active
- "return true, if I am active;
- that is: currently performing my action.
- This query can be used to avoid multiple redraws."
+autoRepeat:aBoolean
+ "turn on/off autorepeat"
+
+ autoRepeat := aBoolean.
+ repeatBlock := [self repeat]
- ^ active
+ "Modified: 5.9.1995 / 22:06:00 / claus"
+!
+
+beToggle
+ "make the receiver act like a toggle"
+
+ isTriggerOnDown := true.
+ isToggle := true
!
-enabled
- "return true, if I am enabled"
+beTriggerOnDown
+ "make the receiver act on button press"
+
+ isTriggerOnDown := true
+!
+
+beTriggerOnUp
+ "make the receiver act on button release"
- ^ enableChannel value
+ isTriggerOnDown := false
+!
+
+disable
+ "disable the button"
+
+ enableChannel value ifTrue:[
+ enableChannel value:false.
+ "/ view redraw - not needed; I listen to enableChannel
+ ]
!
-entered
- "return true, if the mouse pointer is currently in my view"
+enable
+ "enable the button"
- ^ entered
+ enableChannel value ifFalse:[
+ enableChannel value:true.
+ "/ view redraw - not needed; I listen to enableChannel
+ ]
!
-entered:aBoolean
- entered := aBoolean
+isTriggerOnDown
+ "return true, if I trigger on press
+ (in contrast to triggering on up, which is the default)"
+
+ ^ isTriggerOnDown
+!
+
+pressAction
+ "return the pressAction; thats the block which gets evaluated
+ when the button is pressed (if non-nil)"
+
+ ^ pressActionBlock
+!
+
+pressAction:aBlock
+ "define the action to be performed on press"
+
+ pressActionBlock := aBlock
!
-active:aBoolean
- active := aBoolean
+releaseAction
+ "return the releaseAction; thats the block which gets evaluated
+ when the button is relreased (if non-nil)"
+
+ ^ releaseActionBlock
+!
+
+releaseAction:aBlock
+ "define the action to be performed on release"
+
+ releaseActionBlock := aBlock
!
-setPressed:aBoolean
- pressed := aBoolean.
+toggle
+ "toggle and perform the action"
- "Created: 14.11.1995 / 21:37:08 / cg"
+ enableChannel value ifTrue:[
+ self toggleNoAction.
+ self performAction.
+ view changed:#toggle with:pressed
+ ]
!
-pressed:aBoolean
- pressed ~~ aBoolean ifTrue:[
- pressed := aBoolean.
- self performAction.
+toggleNoAction
+ "toggle, but do NOT perform any action"
+
+ pressed ifTrue:[
+ view turnOff.
+ pressed := false.
+ ] ifFalse:[
+ view turnOn.
+ pressed := true.
].
+!
+
+triggerOnDown:aBoolean
+ "set/clear the flag which controls if the action block is to be evaluated
+ on press or on release.
+ (see also ST-80 compatibility methods beTriggerOn*)"
+
+ isTriggerOnDown := aBoolean
! !
!ButtonController methodsFor:'accessing-channels'!
@@ -186,140 +266,61 @@
releaseChannel := aChannel
! !
-!ButtonController methodsFor:'accessing-behavior'!
-
-beTriggerOnDown
- "make the receiver act on button press"
+!ButtonController methodsFor:'accessing-state'!
- isTriggerOnDown := true
-!
+active
+ "return true, if I am active;
+ that is: currently performing my action.
+ This query can be used to avoid multiple redraws."
-beTriggerOnUp
- "make the receiver act on button release"
-
- isTriggerOnDown := false
+ ^ active
!
-triggerOnDown:aBoolean
- "set/clear the flag which controls if the action block is to be evaluated
- on press or on release.
- (see also ST-80 compatibility methods beTriggerOn*)"
-
- isTriggerOnDown := aBoolean
+active:aBoolean
+ active := aBoolean
!
-isTriggerOnDown
- "return true, if I trigger on press
- (in contrast to triggering on up, which is the default)"
-
- ^ isTriggerOnDown
-!
-
-beToggle
- "make the receiver act like a toggle"
+enabled
+ "return true, if I am enabled"
- isTriggerOnDown := true.
- isToggle := true
-!
-
-autoRepeat
- "turn on autorepeat. OBSOLETE"
-
- autoRepeat := true.
- repeatBlock := [self repeat]
+ ^ enableChannel value
!
-autoRepeat:aBoolean
- "turn on/off autorepeat"
+entered
+ "return true, if the mouse pointer is currently in my view"
- autoRepeat := aBoolean.
- repeatBlock := [self repeat]
+ ^ entered
+!
- "Modified: 5.9.1995 / 22:06:00 / claus"
+entered:aBoolean
+ entered := aBoolean
!
-action:aBlock
- "convenient method: depending on the setting the triggerOnDown flag,
- either set the press-action clear any release-action or
- vice versa, set the release-action and clear the press-action."
+pressed
+ "return true, if I am pressed"
- isTriggerOnDown ifTrue:[
- releaseActionBlock := nil.
- pressActionBlock := aBlock
- ] ifFalse:[
- releaseActionBlock := aBlock.
- pressActionBlock := nil
- ]
+ ^ pressed
!
-pressAction:aBlock
- "define the action to be performed on press"
-
- pressActionBlock := aBlock
-!
-
-releaseAction:aBlock
- "define the action to be performed on release"
-
- releaseActionBlock := aBlock
-!
-
-toggleNoAction
- "toggle, but do NOT perform any action"
-
- pressed ifTrue:[
- view turnOff.
- pressed := false.
- ] ifFalse:[
- view turnOn.
- pressed := true.
+pressed:aBoolean
+ pressed ~~ aBoolean ifTrue:[
+ pressed := aBoolean.
+ self performAction.
].
!
-toggle
- "toggle and perform the action"
-
- enableChannel value ifTrue:[
- self toggleNoAction.
- self performAction.
- view changed:#toggle with:pressed
- ]
-!
-
-pressAction
- "return the pressAction; thats the block which gets evaluated
- when the button is pressed (if non-nil)"
-
- ^ pressActionBlock
-!
+setPressed:aBoolean
+ pressed := aBoolean.
-releaseAction
- "return the releaseAction; thats the block which gets evaluated
- when the button is relreased (if non-nil)"
-
- ^ releaseActionBlock
-!
-
-enable
- "enable the button"
-
- enableChannel value ifFalse:[
- enableChannel value:true.
- "/ view redraw - not needed; I listen to enableChannel
- ]
-!
-
-disable
- "disable the button"
-
- enableChannel value ifTrue:[
- enableChannel value:false.
- "/ view redraw - not needed; I listen to enableChannel
- ]
+ "Created: 14.11.1995 / 21:37:08 / cg"
! !
!ButtonController methodsFor:'event handling'!
+buttonMultiPress:button x:x y:y
+ ^ self buttonPress:button x:x y:y
+!
+
buttonPress:button x:x y:y
(button == 1 or:[button == #select]) ifFalse:[
^ super buttonPress:button x:x y:y
@@ -392,52 +393,27 @@
]
!
-pointerEnter:state x:x y:y
- "mouse pointer entered my view.
- Redraw with enteredColors if they differ from the normal colors"
+enableStateChange
+ "this is sent, whenever the enable value has changed"
- entered := true.
- enableChannel value ifTrue:[
- pressed ifTrue:[
- "
- reentered after a leave with mouse-button down;
- restart autorepeating and/or if I am a button with
- triggerOnDown, show active again.
- "
- autoRepeat ifTrue:[
- Processor addTimedBlock:repeatBlock afterSeconds:initialDelay
- ].
- isTriggerOnDown ifFalse:[
- view showActive.
- ]
- ] ifFalse:[
- view redraw
- ]
- ]
+ view notNil ifTrue:[view enableStateChangeRedraw]
+
+ "Modified: 17.9.1995 / 19:55:52 / claus"
!
-pointerLeave:state
- "mouse pointer left my view.
- Redraw with normal colors if they differ from enteredColors"
+keyPress:key x:x y:y
+ "trigger on Return and space, if I am the focusView of my group
+ (i.e. if I got an explicit focus)"
- entered := false.
- pressed ifTrue:[
- "
- leave with mouse-button down;
- stop autorepeating and/or if I am a button with
- action on release, show passive
- "
- autoRepeat ifTrue:[
- Processor removeTimedBlock:repeatBlock
- ].
- isTriggerOnDown ifFalse:[
- view showPassive.
+ (key == #Return or:[key == Character space]) ifTrue:[
+ view hasFocus ifTrue:[
+ "just simulate a buttonPress/release here."
+ self buttonPress:1 x:0 y:0.
+ self buttonRelease:1 x:0 y:0.
+ ^ self.
]
- ] ifFalse:[
- enableChannel value ifTrue:[
- view redraw
- ]
- ]
+ ].
+ view keyPress:key x:x y:y
!
performAction
@@ -488,23 +464,52 @@
].
!
-buttonMultiPress:button x:x y:y
- ^ self buttonPress:button x:x y:y
+pointerEnter:state x:x y:y
+ "mouse pointer entered my view.
+ Redraw with enteredColors if they differ from the normal colors"
+
+ entered := true.
+ enableChannel value ifTrue:[
+ pressed ifTrue:[
+ "
+ reentered after a leave with mouse-button down;
+ restart autorepeating and/or if I am a button with
+ triggerOnDown, show active again.
+ "
+ autoRepeat ifTrue:[
+ Processor addTimedBlock:repeatBlock afterSeconds:initialDelay
+ ].
+ isTriggerOnDown ifFalse:[
+ view showActive.
+ ]
+ ] ifFalse:[
+ view redraw
+ ]
+ ]
!
-keyPress:key x:x y:y
- "trigger on Return and space, if I am the focusView of my group
- (i.e. if I got an explicit focus)"
+pointerLeave:state
+ "mouse pointer left my view.
+ Redraw with normal colors if they differ from enteredColors"
- (key == #Return or:[key == Character space]) ifTrue:[
- view hasFocus ifTrue:[
- "just simulate a buttonPress/release here."
- self buttonPress:1 x:0 y:0.
- self buttonRelease:1 x:0 y:0.
- ^ self.
+ entered := false.
+ pressed ifTrue:[
+ "
+ leave with mouse-button down;
+ stop autorepeating and/or if I am a button with
+ action on release, show passive
+ "
+ autoRepeat ifTrue:[
+ Processor removeTimedBlock:repeatBlock
+ ].
+ isTriggerOnDown ifFalse:[
+ view showPassive.
]
- ].
- view keyPress:key x:x y:y
+ ] ifFalse:[
+ enableChannel value ifTrue:[
+ view redraw
+ ]
+ ]
!
repeat
@@ -527,14 +532,6 @@
]
]
]
-!
-
-enableStateChange
- "this is sent, whenever the enable value has changed"
-
- view notNil ifTrue:[view enableStateChangeRedraw]
-
- "Modified: 17.9.1995 / 19:55:52 / claus"
! !
!ButtonController methodsFor:'initialization'!
@@ -553,3 +550,4 @@
isTriggerOnDown := false.
isToggle := false.
! !
+
--- a/ButtonController.st Thu Nov 23 11:37:10 1995 +0100
+++ b/ButtonController.st Thu Nov 23 11:42:48 1995 +0100
@@ -10,13 +10,10 @@
hereby transferred.
"
-'From Smalltalk/X, Version:2.10.5 on 4-may-1995 at 6:17:35 am'!
-
Controller subclass:#ButtonController
- instanceVariableNames:'enableChannel pressChannel releaseChannel
- pressed active entered isTriggerOnDown autoRepeat
- repeatBlock initialDelay repeatDelay pressActionBlock
- releaseActionBlock isToggle'
+ instanceVariableNames:'enableChannel pressChannel releaseChannel pressed active entered
+ isTriggerOnDown autoRepeat repeatBlock initialDelay repeatDelay
+ pressActionBlock releaseActionBlock isToggle'
classVariableNames:''
poolDictionaries:''
category:'Interface-Support-Controllers'
@@ -38,10 +35,6 @@
"
!
-version
- ^ '$Header: /cvs/stx/stx/libwidg/ButtonController.st,v 1.21 1995-11-14 21:44:27 cg Exp $'
-!
-
documentation
"
ButtonControllers are used with buttons and handle all user interaction.
@@ -82,71 +75,158 @@
active <Boolean> true during action evaluation (internal)
"
+!
+
+version
+ ^ '$Header: /cvs/stx/stx/libwidg/ButtonController.st,v 1.22 1995-11-23 10:39:34 cg Exp $'
! !
!ButtonController class methodsFor:'defaults'!
-defaultRepeatDelay
- "when autorepeat is enabled, and button is not released,
- repeat every repeatDelay seconds"
-
- ^ 0.025
-!
-
defaultInitialDelay
"when autorepeat is enabled, and button is not released,
start repeating after initialDelay seconds"
^ 0.2
+!
+
+defaultRepeatDelay
+ "when autorepeat is enabled, and button is not released,
+ repeat every repeatDelay seconds"
+
+ ^ 0.025
! !
-!ButtonController methodsFor:'accessing-state'!
+!ButtonController methodsFor:'accessing-behavior'!
+
+action:aBlock
+ "convenient method: depending on the setting the triggerOnDown flag,
+ either set the press-action clear any release-action or
+ vice versa, set the release-action and clear the press-action."
-pressed
- "return true, if I am pressed"
+ isTriggerOnDown ifTrue:[
+ releaseActionBlock := nil.
+ pressActionBlock := aBlock
+ ] ifFalse:[
+ releaseActionBlock := aBlock.
+ pressActionBlock := nil
+ ]
+!
- ^ pressed
+autoRepeat
+ "turn on autorepeat. OBSOLETE"
+
+ autoRepeat := true.
+ repeatBlock := [self repeat]
!
-active
- "return true, if I am active;
- that is: currently performing my action.
- This query can be used to avoid multiple redraws."
+autoRepeat:aBoolean
+ "turn on/off autorepeat"
+
+ autoRepeat := aBoolean.
+ repeatBlock := [self repeat]
- ^ active
+ "Modified: 5.9.1995 / 22:06:00 / claus"
+!
+
+beToggle
+ "make the receiver act like a toggle"
+
+ isTriggerOnDown := true.
+ isToggle := true
!
-enabled
- "return true, if I am enabled"
+beTriggerOnDown
+ "make the receiver act on button press"
+
+ isTriggerOnDown := true
+!
+
+beTriggerOnUp
+ "make the receiver act on button release"
- ^ enableChannel value
+ isTriggerOnDown := false
+!
+
+disable
+ "disable the button"
+
+ enableChannel value ifTrue:[
+ enableChannel value:false.
+ "/ view redraw - not needed; I listen to enableChannel
+ ]
!
-entered
- "return true, if the mouse pointer is currently in my view"
+enable
+ "enable the button"
- ^ entered
+ enableChannel value ifFalse:[
+ enableChannel value:true.
+ "/ view redraw - not needed; I listen to enableChannel
+ ]
!
-entered:aBoolean
- entered := aBoolean
+isTriggerOnDown
+ "return true, if I trigger on press
+ (in contrast to triggering on up, which is the default)"
+
+ ^ isTriggerOnDown
+!
+
+pressAction
+ "return the pressAction; thats the block which gets evaluated
+ when the button is pressed (if non-nil)"
+
+ ^ pressActionBlock
+!
+
+pressAction:aBlock
+ "define the action to be performed on press"
+
+ pressActionBlock := aBlock
!
-active:aBoolean
- active := aBoolean
+releaseAction
+ "return the releaseAction; thats the block which gets evaluated
+ when the button is relreased (if non-nil)"
+
+ ^ releaseActionBlock
+!
+
+releaseAction:aBlock
+ "define the action to be performed on release"
+
+ releaseActionBlock := aBlock
!
-setPressed:aBoolean
- pressed := aBoolean.
+toggle
+ "toggle and perform the action"
- "Created: 14.11.1995 / 21:37:08 / cg"
+ enableChannel value ifTrue:[
+ self toggleNoAction.
+ self performAction.
+ view changed:#toggle with:pressed
+ ]
!
-pressed:aBoolean
- pressed ~~ aBoolean ifTrue:[
- pressed := aBoolean.
- self performAction.
+toggleNoAction
+ "toggle, but do NOT perform any action"
+
+ pressed ifTrue:[
+ view turnOff.
+ pressed := false.
+ ] ifFalse:[
+ view turnOn.
+ pressed := true.
].
+!
+
+triggerOnDown:aBoolean
+ "set/clear the flag which controls if the action block is to be evaluated
+ on press or on release.
+ (see also ST-80 compatibility methods beTriggerOn*)"
+
+ isTriggerOnDown := aBoolean
! !
!ButtonController methodsFor:'accessing-channels'!
@@ -186,140 +266,61 @@
releaseChannel := aChannel
! !
-!ButtonController methodsFor:'accessing-behavior'!
-
-beTriggerOnDown
- "make the receiver act on button press"
+!ButtonController methodsFor:'accessing-state'!
- isTriggerOnDown := true
-!
+active
+ "return true, if I am active;
+ that is: currently performing my action.
+ This query can be used to avoid multiple redraws."
-beTriggerOnUp
- "make the receiver act on button release"
-
- isTriggerOnDown := false
+ ^ active
!
-triggerOnDown:aBoolean
- "set/clear the flag which controls if the action block is to be evaluated
- on press or on release.
- (see also ST-80 compatibility methods beTriggerOn*)"
-
- isTriggerOnDown := aBoolean
+active:aBoolean
+ active := aBoolean
!
-isTriggerOnDown
- "return true, if I trigger on press
- (in contrast to triggering on up, which is the default)"
-
- ^ isTriggerOnDown
-!
-
-beToggle
- "make the receiver act like a toggle"
+enabled
+ "return true, if I am enabled"
- isTriggerOnDown := true.
- isToggle := true
-!
-
-autoRepeat
- "turn on autorepeat. OBSOLETE"
-
- autoRepeat := true.
- repeatBlock := [self repeat]
+ ^ enableChannel value
!
-autoRepeat:aBoolean
- "turn on/off autorepeat"
+entered
+ "return true, if the mouse pointer is currently in my view"
- autoRepeat := aBoolean.
- repeatBlock := [self repeat]
+ ^ entered
+!
- "Modified: 5.9.1995 / 22:06:00 / claus"
+entered:aBoolean
+ entered := aBoolean
!
-action:aBlock
- "convenient method: depending on the setting the triggerOnDown flag,
- either set the press-action clear any release-action or
- vice versa, set the release-action and clear the press-action."
+pressed
+ "return true, if I am pressed"
- isTriggerOnDown ifTrue:[
- releaseActionBlock := nil.
- pressActionBlock := aBlock
- ] ifFalse:[
- releaseActionBlock := aBlock.
- pressActionBlock := nil
- ]
+ ^ pressed
!
-pressAction:aBlock
- "define the action to be performed on press"
-
- pressActionBlock := aBlock
-!
-
-releaseAction:aBlock
- "define the action to be performed on release"
-
- releaseActionBlock := aBlock
-!
-
-toggleNoAction
- "toggle, but do NOT perform any action"
-
- pressed ifTrue:[
- view turnOff.
- pressed := false.
- ] ifFalse:[
- view turnOn.
- pressed := true.
+pressed:aBoolean
+ pressed ~~ aBoolean ifTrue:[
+ pressed := aBoolean.
+ self performAction.
].
!
-toggle
- "toggle and perform the action"
-
- enableChannel value ifTrue:[
- self toggleNoAction.
- self performAction.
- view changed:#toggle with:pressed
- ]
-!
-
-pressAction
- "return the pressAction; thats the block which gets evaluated
- when the button is pressed (if non-nil)"
-
- ^ pressActionBlock
-!
+setPressed:aBoolean
+ pressed := aBoolean.
-releaseAction
- "return the releaseAction; thats the block which gets evaluated
- when the button is relreased (if non-nil)"
-
- ^ releaseActionBlock
-!
-
-enable
- "enable the button"
-
- enableChannel value ifFalse:[
- enableChannel value:true.
- "/ view redraw - not needed; I listen to enableChannel
- ]
-!
-
-disable
- "disable the button"
-
- enableChannel value ifTrue:[
- enableChannel value:false.
- "/ view redraw - not needed; I listen to enableChannel
- ]
+ "Created: 14.11.1995 / 21:37:08 / cg"
! !
!ButtonController methodsFor:'event handling'!
+buttonMultiPress:button x:x y:y
+ ^ self buttonPress:button x:x y:y
+!
+
buttonPress:button x:x y:y
(button == 1 or:[button == #select]) ifFalse:[
^ super buttonPress:button x:x y:y
@@ -392,52 +393,27 @@
]
!
-pointerEnter:state x:x y:y
- "mouse pointer entered my view.
- Redraw with enteredColors if they differ from the normal colors"
+enableStateChange
+ "this is sent, whenever the enable value has changed"
- entered := true.
- enableChannel value ifTrue:[
- pressed ifTrue:[
- "
- reentered after a leave with mouse-button down;
- restart autorepeating and/or if I am a button with
- triggerOnDown, show active again.
- "
- autoRepeat ifTrue:[
- Processor addTimedBlock:repeatBlock afterSeconds:initialDelay
- ].
- isTriggerOnDown ifFalse:[
- view showActive.
- ]
- ] ifFalse:[
- view redraw
- ]
- ]
+ view notNil ifTrue:[view enableStateChangeRedraw]
+
+ "Modified: 17.9.1995 / 19:55:52 / claus"
!
-pointerLeave:state
- "mouse pointer left my view.
- Redraw with normal colors if they differ from enteredColors"
+keyPress:key x:x y:y
+ "trigger on Return and space, if I am the focusView of my group
+ (i.e. if I got an explicit focus)"
- entered := false.
- pressed ifTrue:[
- "
- leave with mouse-button down;
- stop autorepeating and/or if I am a button with
- action on release, show passive
- "
- autoRepeat ifTrue:[
- Processor removeTimedBlock:repeatBlock
- ].
- isTriggerOnDown ifFalse:[
- view showPassive.
+ (key == #Return or:[key == Character space]) ifTrue:[
+ view hasFocus ifTrue:[
+ "just simulate a buttonPress/release here."
+ self buttonPress:1 x:0 y:0.
+ self buttonRelease:1 x:0 y:0.
+ ^ self.
]
- ] ifFalse:[
- enableChannel value ifTrue:[
- view redraw
- ]
- ]
+ ].
+ view keyPress:key x:x y:y
!
performAction
@@ -488,23 +464,52 @@
].
!
-buttonMultiPress:button x:x y:y
- ^ self buttonPress:button x:x y:y
+pointerEnter:state x:x y:y
+ "mouse pointer entered my view.
+ Redraw with enteredColors if they differ from the normal colors"
+
+ entered := true.
+ enableChannel value ifTrue:[
+ pressed ifTrue:[
+ "
+ reentered after a leave with mouse-button down;
+ restart autorepeating and/or if I am a button with
+ triggerOnDown, show active again.
+ "
+ autoRepeat ifTrue:[
+ Processor addTimedBlock:repeatBlock afterSeconds:initialDelay
+ ].
+ isTriggerOnDown ifFalse:[
+ view showActive.
+ ]
+ ] ifFalse:[
+ view redraw
+ ]
+ ]
!
-keyPress:key x:x y:y
- "trigger on Return and space, if I am the focusView of my group
- (i.e. if I got an explicit focus)"
+pointerLeave:state
+ "mouse pointer left my view.
+ Redraw with normal colors if they differ from enteredColors"
- (key == #Return or:[key == Character space]) ifTrue:[
- view hasFocus ifTrue:[
- "just simulate a buttonPress/release here."
- self buttonPress:1 x:0 y:0.
- self buttonRelease:1 x:0 y:0.
- ^ self.
+ entered := false.
+ pressed ifTrue:[
+ "
+ leave with mouse-button down;
+ stop autorepeating and/or if I am a button with
+ action on release, show passive
+ "
+ autoRepeat ifTrue:[
+ Processor removeTimedBlock:repeatBlock
+ ].
+ isTriggerOnDown ifFalse:[
+ view showPassive.
]
- ].
- view keyPress:key x:x y:y
+ ] ifFalse:[
+ enableChannel value ifTrue:[
+ view redraw
+ ]
+ ]
!
repeat
@@ -527,14 +532,6 @@
]
]
]
-!
-
-enableStateChange
- "this is sent, whenever the enable value has changed"
-
- view notNil ifTrue:[view enableStateChangeRedraw]
-
- "Modified: 17.9.1995 / 19:55:52 / claus"
! !
!ButtonController methodsFor:'initialization'!
@@ -553,3 +550,4 @@
isTriggerOnDown := false.
isToggle := false.
! !
+
--- a/PopUpListController.st Thu Nov 23 11:37:10 1995 +0100
+++ b/PopUpListController.st Thu Nov 23 11:42:48 1995 +0100
@@ -10,8 +10,6 @@
hereby transferred.
"
-'From Smalltalk/X, Version:2.10.6 on 4-aug-1995 at 1:24:43 am' !
-
ButtonController subclass:#PopUpListController
instanceVariableNames:''
classVariableNames:''
@@ -35,14 +33,14 @@
"
!
-version
- ^ '$Header: /cvs/stx/stx/libwidg/PopUpListController.st,v 1.3 1995-11-11 16:22:08 cg Exp $'
-!
-
documentation
"
redefined the behavior on various keys if my view has the focus.
"
+!
+
+version
+ ^ '$Header: /cvs/stx/stx/libwidg/PopUpListController.st,v 1.4 1995-11-23 10:39:59 cg Exp $'
! !
!PopUpListController methodsFor:'event handling'!
@@ -77,3 +75,4 @@
].
view keyPress:key x:x y:y
! !
+
--- a/PopUpLstC.st Thu Nov 23 11:37:10 1995 +0100
+++ b/PopUpLstC.st Thu Nov 23 11:42:48 1995 +0100
@@ -10,8 +10,6 @@
hereby transferred.
"
-'From Smalltalk/X, Version:2.10.6 on 4-aug-1995 at 1:24:43 am' !
-
ButtonController subclass:#PopUpListController
instanceVariableNames:''
classVariableNames:''
@@ -35,14 +33,14 @@
"
!
-version
- ^ '$Header: /cvs/stx/stx/libwidg/Attic/PopUpLstC.st,v 1.3 1995-11-11 16:22:08 cg Exp $'
-!
-
documentation
"
redefined the behavior on various keys if my view has the focus.
"
+!
+
+version
+ ^ '$Header: /cvs/stx/stx/libwidg/Attic/PopUpLstC.st,v 1.4 1995-11-23 10:39:59 cg Exp $'
! !
!PopUpListController methodsFor:'event handling'!
@@ -77,3 +75,4 @@
].
view keyPress:key x:x y:y
! !
+
--- a/RButtC.st Thu Nov 23 11:37:10 1995 +0100
+++ b/RButtC.st Thu Nov 23 11:42:48 1995 +0100
@@ -10,8 +10,6 @@
hereby transferred.
"
-'From Smalltalk/X, Version:2.10.5 on 14-mar-1995 at 11:07:27 am'!
-
ToggleController subclass:#RadioButtonController
instanceVariableNames:''
classVariableNames:''
@@ -35,10 +33,6 @@
"
!
-version
- ^ '$Header: /cvs/stx/stx/libwidg/Attic/RButtC.st,v 1.4 1995-11-11 16:22:21 cg Exp $'
-!
-
documentation
"
RadioButtonControllers redefine the response to a button-click.
@@ -51,6 +45,10 @@
You can place both toggles (for 'zero-or-one-on' behavior) or
radiobuttons (for 'one-on' behavior) into a buttongroup.
"
+!
+
+version
+ ^ '$Header: /cvs/stx/stx/libwidg/Attic/RButtC.st,v 1.5 1995-11-23 10:40:10 cg Exp $'
! !
!RadioButtonController methodsFor:'event handling'!
--- a/RadioButtonController.st Thu Nov 23 11:37:10 1995 +0100
+++ b/RadioButtonController.st Thu Nov 23 11:42:48 1995 +0100
@@ -10,8 +10,6 @@
hereby transferred.
"
-'From Smalltalk/X, Version:2.10.5 on 14-mar-1995 at 11:07:27 am'!
-
ToggleController subclass:#RadioButtonController
instanceVariableNames:''
classVariableNames:''
@@ -35,10 +33,6 @@
"
!
-version
- ^ '$Header: /cvs/stx/stx/libwidg/RadioButtonController.st,v 1.4 1995-11-11 16:22:21 cg Exp $'
-!
-
documentation
"
RadioButtonControllers redefine the response to a button-click.
@@ -51,6 +45,10 @@
You can place both toggles (for 'zero-or-one-on' behavior) or
radiobuttons (for 'one-on' behavior) into a buttongroup.
"
+!
+
+version
+ ^ '$Header: /cvs/stx/stx/libwidg/RadioButtonController.st,v 1.5 1995-11-23 10:40:10 cg Exp $'
! !
!RadioButtonController methodsFor:'event handling'!
--- a/SelList.st Thu Nov 23 11:37:10 1995 +0100
+++ b/SelList.st Thu Nov 23 11:42:48 1995 +0100
@@ -33,10 +33,6 @@
"
!
-version
- ^ '$Header: /cvs/stx/stx/libwidg/Attic/SelList.st,v 1.5 1995-11-11 16:22:48 cg Exp $'
-!
-
documentation
"
Instances of SelectionInList can be used as model for
@@ -90,6 +86,10 @@
].
b open
"
+!
+
+version
+ ^ '$Header: /cvs/stx/stx/libwidg/Attic/SelList.st,v 1.6 1995-11-23 10:42:48 cg Exp $'
! !
!SelectionInList class methodsFor:'instance creation'!
@@ -102,11 +102,50 @@
^ self new listHolder:(ValueHolder with:aList)
! !
-!SelectionInList methodsFor:'initialization'!
+!SelectionInList methodsFor:'accessing-holders'!
+
+listHolder
+ "return the one holding the list"
+
+ ^ listHolder
+!
+
+listHolder:aValueHolder
+ "set the one holding the list.
+ Q: should we forward a change-notification ?"
+
+ listHolder notNil ifTrue:[
+ listHolder removeDependent:self
+ ].
+ listHolder := aValueHolder.
+ listHolder addDependent:self
+!
-initialize
- self listHolder:(nil asValue). "/ could also use an empty collection here
- self selectionIndexHolder:(nil asValue).
+selectionHolder
+ "return someone holding on the selection itself
+ (not the index). Since we have no one, we need an adapter,
+ to get up-to-date values."
+
+ ^ AspectAdaptor
+ subject:self sendsUpdates:true
+ accessWith:#selection assignWith:#'selection:' aspect:#selectionIndex
+!
+
+selectionIndexHolder
+ "return the one holding the index"
+
+ ^ selectionIndexHolder
+!
+
+selectionIndexHolder:aValueHolder
+ "set the one holding the index.
+ Q: should we forward a change-notification ?"
+
+ selectionIndexHolder notNil ifTrue:[
+ selectionIndexHolder removeDependent:self
+ ].
+ selectionIndexHolder := aValueHolder.
+ selectionIndexHolder addDependent:self
! !
!SelectionInList methodsFor:'accessing-values'!
@@ -119,16 +158,6 @@
listHolder value:aCollection.
!
-selectionIndex
- ^ selectionIndexHolder value
-!
-
-selectionIndex:newIndex
- selectionIndexHolder value ~= newIndex ifTrue:[
- selectionIndexHolder value:newIndex
- ]
-!
-
selection
"return the selections value (i.e. the entry in the list"
@@ -144,6 +173,16 @@
If anObject is not in the list, the selection is cleared"
^ self selectionIndex:(self list indexOf:anObject ifAbsent:0)
+!
+
+selectionIndex
+ ^ selectionIndexHolder value
+!
+
+selectionIndex:newIndex
+ selectionIndexHolder value ~= newIndex ifTrue:[
+ selectionIndexHolder value:newIndex
+ ]
! !
!SelectionInList methodsFor:'change & update'!
@@ -168,6 +207,13 @@
]
! !
+!SelectionInList methodsFor:'initialization'!
+
+initialize
+ self listHolder:(nil asValue). "/ could also use an empty collection here
+ self selectionIndexHolder:(nil asValue).
+! !
+
!SelectionInList methodsFor:'obsolete backward compatibility'!
index
@@ -198,48 +244,3 @@
^ self selectionIndexHolder:aValueHolder
! !
-!SelectionInList methodsFor:'accessing-holders'!
-
-listHolder
- "return the one holding the list"
-
- ^ listHolder
-!
-
-listHolder:aValueHolder
- "set the one holding the list.
- Q: should we forward a change-notification ?"
-
- listHolder notNil ifTrue:[
- listHolder removeDependent:self
- ].
- listHolder := aValueHolder.
- listHolder addDependent:self
-!
-
-selectionIndexHolder
- "return the one holding the index"
-
- ^ selectionIndexHolder
-!
-
-selectionIndexHolder:aValueHolder
- "set the one holding the index.
- Q: should we forward a change-notification ?"
-
- selectionIndexHolder notNil ifTrue:[
- selectionIndexHolder removeDependent:self
- ].
- selectionIndexHolder := aValueHolder.
- selectionIndexHolder addDependent:self
-!
-
-selectionHolder
- "return someone holding on the selection itself
- (not the index). Since we have no one, we need an adapter,
- to get up-to-date values."
-
- ^ AspectAdaptor
- subject:self sendsUpdates:true
- accessWith:#selection assignWith:#'selection:' aspect:#selectionIndex
-! !
--- a/SelectionInList.st Thu Nov 23 11:37:10 1995 +0100
+++ b/SelectionInList.st Thu Nov 23 11:42:48 1995 +0100
@@ -33,10 +33,6 @@
"
!
-version
- ^ '$Header: /cvs/stx/stx/libwidg/SelectionInList.st,v 1.5 1995-11-11 16:22:48 cg Exp $'
-!
-
documentation
"
Instances of SelectionInList can be used as model for
@@ -90,6 +86,10 @@
].
b open
"
+!
+
+version
+ ^ '$Header: /cvs/stx/stx/libwidg/SelectionInList.st,v 1.6 1995-11-23 10:42:48 cg Exp $'
! !
!SelectionInList class methodsFor:'instance creation'!
@@ -102,11 +102,50 @@
^ self new listHolder:(ValueHolder with:aList)
! !
-!SelectionInList methodsFor:'initialization'!
+!SelectionInList methodsFor:'accessing-holders'!
+
+listHolder
+ "return the one holding the list"
+
+ ^ listHolder
+!
+
+listHolder:aValueHolder
+ "set the one holding the list.
+ Q: should we forward a change-notification ?"
+
+ listHolder notNil ifTrue:[
+ listHolder removeDependent:self
+ ].
+ listHolder := aValueHolder.
+ listHolder addDependent:self
+!
-initialize
- self listHolder:(nil asValue). "/ could also use an empty collection here
- self selectionIndexHolder:(nil asValue).
+selectionHolder
+ "return someone holding on the selection itself
+ (not the index). Since we have no one, we need an adapter,
+ to get up-to-date values."
+
+ ^ AspectAdaptor
+ subject:self sendsUpdates:true
+ accessWith:#selection assignWith:#'selection:' aspect:#selectionIndex
+!
+
+selectionIndexHolder
+ "return the one holding the index"
+
+ ^ selectionIndexHolder
+!
+
+selectionIndexHolder:aValueHolder
+ "set the one holding the index.
+ Q: should we forward a change-notification ?"
+
+ selectionIndexHolder notNil ifTrue:[
+ selectionIndexHolder removeDependent:self
+ ].
+ selectionIndexHolder := aValueHolder.
+ selectionIndexHolder addDependent:self
! !
!SelectionInList methodsFor:'accessing-values'!
@@ -119,16 +158,6 @@
listHolder value:aCollection.
!
-selectionIndex
- ^ selectionIndexHolder value
-!
-
-selectionIndex:newIndex
- selectionIndexHolder value ~= newIndex ifTrue:[
- selectionIndexHolder value:newIndex
- ]
-!
-
selection
"return the selections value (i.e. the entry in the list"
@@ -144,6 +173,16 @@
If anObject is not in the list, the selection is cleared"
^ self selectionIndex:(self list indexOf:anObject ifAbsent:0)
+!
+
+selectionIndex
+ ^ selectionIndexHolder value
+!
+
+selectionIndex:newIndex
+ selectionIndexHolder value ~= newIndex ifTrue:[
+ selectionIndexHolder value:newIndex
+ ]
! !
!SelectionInList methodsFor:'change & update'!
@@ -168,6 +207,13 @@
]
! !
+!SelectionInList methodsFor:'initialization'!
+
+initialize
+ self listHolder:(nil asValue). "/ could also use an empty collection here
+ self selectionIndexHolder:(nil asValue).
+! !
+
!SelectionInList methodsFor:'obsolete backward compatibility'!
index
@@ -198,48 +244,3 @@
^ self selectionIndexHolder:aValueHolder
! !
-!SelectionInList methodsFor:'accessing-holders'!
-
-listHolder
- "return the one holding the list"
-
- ^ listHolder
-!
-
-listHolder:aValueHolder
- "set the one holding the list.
- Q: should we forward a change-notification ?"
-
- listHolder notNil ifTrue:[
- listHolder removeDependent:self
- ].
- listHolder := aValueHolder.
- listHolder addDependent:self
-!
-
-selectionIndexHolder
- "return the one holding the index"
-
- ^ selectionIndexHolder
-!
-
-selectionIndexHolder:aValueHolder
- "set the one holding the index.
- Q: should we forward a change-notification ?"
-
- selectionIndexHolder notNil ifTrue:[
- selectionIndexHolder removeDependent:self
- ].
- selectionIndexHolder := aValueHolder.
- selectionIndexHolder addDependent:self
-!
-
-selectionHolder
- "return someone holding on the selection itself
- (not the index). Since we have no one, we need an adapter,
- to get up-to-date values."
-
- ^ AspectAdaptor
- subject:self sendsUpdates:true
- accessWith:#selection assignWith:#'selection:' aspect:#selectionIndex
-! !
--- a/ToggleC.st Thu Nov 23 11:37:10 1995 +0100
+++ b/ToggleC.st Thu Nov 23 11:42:48 1995 +0100
@@ -33,10 +33,6 @@
"
!
-version
- ^ '$Header: /cvs/stx/stx/libwidg/Attic/ToggleC.st,v 1.8 1995-11-11 16:23:28 cg Exp $'
-!
-
documentation
"
ToggleControllers redefine some of ButtonControllers behavior;
@@ -52,13 +48,19 @@
Other than that, all model relations are inherited - i.e. if the view has a model,
that one gets change-messages and the toggle updates on aspect changes.
"
+!
+
+version
+ ^ '$Header: /cvs/stx/stx/libwidg/Attic/ToggleC.st,v 1.9 1995-11-23 10:40:33 cg Exp $'
! !
-!ToggleController methodsFor:'initialization'!
+!ToggleController methodsFor:'accessing'!
-initialize
- super initialize.
- self beToggle
+action:aBlock
+ "set the action to be performed. This is called
+ with the toggles state as argument."
+
+ action := aBlock
! !
!ToggleController methodsFor:'events'!
@@ -76,11 +78,10 @@
super performAction
! !
-!ToggleController methodsFor:'accessing'!
+!ToggleController methodsFor:'initialization'!
-action:aBlock
- "set the action to be performed. This is called
- with the toggles state as argument."
+initialize
+ super initialize.
+ self beToggle
+! !
- action := aBlock
-! !
--- a/ToggleController.st Thu Nov 23 11:37:10 1995 +0100
+++ b/ToggleController.st Thu Nov 23 11:42:48 1995 +0100
@@ -33,10 +33,6 @@
"
!
-version
- ^ '$Header: /cvs/stx/stx/libwidg/ToggleController.st,v 1.8 1995-11-11 16:23:28 cg Exp $'
-!
-
documentation
"
ToggleControllers redefine some of ButtonControllers behavior;
@@ -52,13 +48,19 @@
Other than that, all model relations are inherited - i.e. if the view has a model,
that one gets change-messages and the toggle updates on aspect changes.
"
+!
+
+version
+ ^ '$Header: /cvs/stx/stx/libwidg/ToggleController.st,v 1.9 1995-11-23 10:40:33 cg Exp $'
! !
-!ToggleController methodsFor:'initialization'!
+!ToggleController methodsFor:'accessing'!
-initialize
- super initialize.
- self beToggle
+action:aBlock
+ "set the action to be performed. This is called
+ with the toggles state as argument."
+
+ action := aBlock
! !
!ToggleController methodsFor:'events'!
@@ -76,11 +78,10 @@
super performAction
! !
-!ToggleController methodsFor:'accessing'!
+!ToggleController methodsFor:'initialization'!
-action:aBlock
- "set the action to be performed. This is called
- with the toggles state as argument."
+initialize
+ super initialize.
+ self beToggle
+! !
- action := aBlock
-! !
--- a/VarHPanelC.st Thu Nov 23 11:37:10 1995 +0100
+++ b/VarHPanelC.st Thu Nov 23 11:42:48 1995 +0100
@@ -10,8 +10,6 @@
hereby transferred.
"
-'From Smalltalk/X, Version:2.10.4 on 6-mar-1995 at 20:00:05'!
-
VariablePanelController subclass:#VariableHorizontalPanelController
instanceVariableNames:''
classVariableNames:''
@@ -45,7 +43,7 @@
!
version
- ^ '$Header: /cvs/stx/stx/libwidg/Attic/VarHPanelC.st,v 1.5 1995-11-11 16:23:38 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/Attic/VarHPanelC.st,v 1.6 1995-11-23 10:40:56 cg Exp $'
! !
!VariableHorizontalPanelController methodsFor:'initialization'!
@@ -54,3 +52,4 @@
super initialize.
isHorizontal := true
! !
+
--- a/VarPanelC.st Thu Nov 23 11:37:10 1995 +0100
+++ b/VarPanelC.st Thu Nov 23 11:42:48 1995 +0100
@@ -10,8 +10,6 @@
hereby transferred.
"
-'From Smalltalk/X, Version:2.10.4 on 6-mar-1995 at 20:00:02'!
-
Controller subclass:#VariablePanelController
instanceVariableNames:'movedHandle prevPos startPos isHorizontal'
classVariableNames:''
@@ -46,7 +44,7 @@
!
version
- ^ '$Header: /cvs/stx/stx/libwidg/Attic/VarPanelC.st,v 1.6 1995-11-11 16:23:39 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/Attic/VarPanelC.st,v 1.7 1995-11-23 10:41:07 cg Exp $'
! !
!VariablePanelController methodsFor:'event handling'!
@@ -134,6 +132,56 @@
prevPos := pos
!
+buttonPress:button x:bx y:by
+ "button was pressed - if it hits a handle, start move"
+
+ |handle barHeight group|
+
+ ((button == 1) or:[button == #select]) ifTrue:[
+ handle := 1.
+ barHeight := view barHeight.
+
+ "
+ search the handle, invert the first time
+ "
+ view handleOriginsDo:[:hPoint |
+ |hx hy|
+
+ isHorizontal ifTrue:[
+ hx := hPoint x.
+ (bx between:hx and:(hx + barHeight)) ifTrue:[
+ movedHandle := handle.
+ prevPos := hx.
+ startPos := bx - hx.
+
+ view invertHandleBarAtX:hx y:0.
+ (group := view windowGroup) notNil ifTrue:[
+ group showCursor:view cursor
+ ].
+ ^ self
+ ].
+ ] ifFalse:[
+ hy := hPoint y.
+ (by between:hy and:(hy + barHeight)) ifTrue:[
+ movedHandle := handle.
+ prevPos := hy.
+ startPos := by - hy.
+
+ view invertHandleBarAtX:0 y:hy.
+ (group := view windowGroup) notNil ifTrue:[
+ group showCursor:view cursor
+ ].
+ ^ self
+ ].
+ ].
+ handle := handle + 1
+ ].
+ movedHandle := nil
+ ] ifFalse:[
+ super buttonPress:button x:bx y:by
+ ]
+!
+
buttonRelease:button x:x y:y
"end bar-move"
@@ -192,54 +240,5 @@
] ifFalse:[
super buttonRelease:button x:x y:y
]
-!
-
-buttonPress:button x:bx y:by
- "button was pressed - if it hits a handle, start move"
-
- |handle barHeight group|
-
- ((button == 1) or:[button == #select]) ifTrue:[
- handle := 1.
- barHeight := view barHeight.
-
- "
- search the handle, invert the first time
- "
- view handleOriginsDo:[:hPoint |
- |hx hy|
-
- isHorizontal ifTrue:[
- hx := hPoint x.
- (bx between:hx and:(hx + barHeight)) ifTrue:[
- movedHandle := handle.
- prevPos := hx.
- startPos := bx - hx.
+! !
- view invertHandleBarAtX:hx y:0.
- (group := view windowGroup) notNil ifTrue:[
- group showCursor:view cursor
- ].
- ^ self
- ].
- ] ifFalse:[
- hy := hPoint y.
- (by between:hy and:(hy + barHeight)) ifTrue:[
- movedHandle := handle.
- prevPos := hy.
- startPos := by - hy.
-
- view invertHandleBarAtX:0 y:hy.
- (group := view windowGroup) notNil ifTrue:[
- group showCursor:view cursor
- ].
- ^ self
- ].
- ].
- handle := handle + 1
- ].
- movedHandle := nil
- ] ifFalse:[
- super buttonPress:button x:bx y:by
- ]
-! !
--- a/VarVPanelC.st Thu Nov 23 11:37:10 1995 +0100
+++ b/VarVPanelC.st Thu Nov 23 11:42:48 1995 +0100
@@ -10,8 +10,6 @@
hereby transferred.
"
-'From Smalltalk/X, Version:2.10.4 on 6-mar-1995 at 20:00:05'!
-
VariablePanelController subclass:#VariableVerticalPanelController
instanceVariableNames:''
classVariableNames:''
@@ -45,7 +43,7 @@
!
version
- ^ '$Header: /cvs/stx/stx/libwidg/Attic/VarVPanelC.st,v 1.5 1995-11-11 16:23:47 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/Attic/VarVPanelC.st,v 1.6 1995-11-23 10:41:53 cg Exp $'
! !
!VariableVerticalPanelController methodsFor:'initialization'!
--- a/VariableHorizontalPanelController.st Thu Nov 23 11:37:10 1995 +0100
+++ b/VariableHorizontalPanelController.st Thu Nov 23 11:42:48 1995 +0100
@@ -10,8 +10,6 @@
hereby transferred.
"
-'From Smalltalk/X, Version:2.10.4 on 6-mar-1995 at 20:00:05'!
-
VariablePanelController subclass:#VariableHorizontalPanelController
instanceVariableNames:''
classVariableNames:''
@@ -45,7 +43,7 @@
!
version
- ^ '$Header: /cvs/stx/stx/libwidg/VariableHorizontalPanelController.st,v 1.5 1995-11-11 16:23:38 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/VariableHorizontalPanelController.st,v 1.6 1995-11-23 10:40:56 cg Exp $'
! !
!VariableHorizontalPanelController methodsFor:'initialization'!
@@ -54,3 +52,4 @@
super initialize.
isHorizontal := true
! !
+
--- a/VariablePanelController.st Thu Nov 23 11:37:10 1995 +0100
+++ b/VariablePanelController.st Thu Nov 23 11:42:48 1995 +0100
@@ -10,8 +10,6 @@
hereby transferred.
"
-'From Smalltalk/X, Version:2.10.4 on 6-mar-1995 at 20:00:02'!
-
Controller subclass:#VariablePanelController
instanceVariableNames:'movedHandle prevPos startPos isHorizontal'
classVariableNames:''
@@ -46,7 +44,7 @@
!
version
- ^ '$Header: /cvs/stx/stx/libwidg/VariablePanelController.st,v 1.6 1995-11-11 16:23:39 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/VariablePanelController.st,v 1.7 1995-11-23 10:41:07 cg Exp $'
! !
!VariablePanelController methodsFor:'event handling'!
@@ -134,6 +132,56 @@
prevPos := pos
!
+buttonPress:button x:bx y:by
+ "button was pressed - if it hits a handle, start move"
+
+ |handle barHeight group|
+
+ ((button == 1) or:[button == #select]) ifTrue:[
+ handle := 1.
+ barHeight := view barHeight.
+
+ "
+ search the handle, invert the first time
+ "
+ view handleOriginsDo:[:hPoint |
+ |hx hy|
+
+ isHorizontal ifTrue:[
+ hx := hPoint x.
+ (bx between:hx and:(hx + barHeight)) ifTrue:[
+ movedHandle := handle.
+ prevPos := hx.
+ startPos := bx - hx.
+
+ view invertHandleBarAtX:hx y:0.
+ (group := view windowGroup) notNil ifTrue:[
+ group showCursor:view cursor
+ ].
+ ^ self
+ ].
+ ] ifFalse:[
+ hy := hPoint y.
+ (by between:hy and:(hy + barHeight)) ifTrue:[
+ movedHandle := handle.
+ prevPos := hy.
+ startPos := by - hy.
+
+ view invertHandleBarAtX:0 y:hy.
+ (group := view windowGroup) notNil ifTrue:[
+ group showCursor:view cursor
+ ].
+ ^ self
+ ].
+ ].
+ handle := handle + 1
+ ].
+ movedHandle := nil
+ ] ifFalse:[
+ super buttonPress:button x:bx y:by
+ ]
+!
+
buttonRelease:button x:x y:y
"end bar-move"
@@ -192,54 +240,5 @@
] ifFalse:[
super buttonRelease:button x:x y:y
]
-!
-
-buttonPress:button x:bx y:by
- "button was pressed - if it hits a handle, start move"
-
- |handle barHeight group|
-
- ((button == 1) or:[button == #select]) ifTrue:[
- handle := 1.
- barHeight := view barHeight.
-
- "
- search the handle, invert the first time
- "
- view handleOriginsDo:[:hPoint |
- |hx hy|
-
- isHorizontal ifTrue:[
- hx := hPoint x.
- (bx between:hx and:(hx + barHeight)) ifTrue:[
- movedHandle := handle.
- prevPos := hx.
- startPos := bx - hx.
+! !
- view invertHandleBarAtX:hx y:0.
- (group := view windowGroup) notNil ifTrue:[
- group showCursor:view cursor
- ].
- ^ self
- ].
- ] ifFalse:[
- hy := hPoint y.
- (by between:hy and:(hy + barHeight)) ifTrue:[
- movedHandle := handle.
- prevPos := hy.
- startPos := by - hy.
-
- view invertHandleBarAtX:0 y:hy.
- (group := view windowGroup) notNil ifTrue:[
- group showCursor:view cursor
- ].
- ^ self
- ].
- ].
- handle := handle + 1
- ].
- movedHandle := nil
- ] ifFalse:[
- super buttonPress:button x:bx y:by
- ]
-! !
--- a/VariableVerticalPanelController.st Thu Nov 23 11:37:10 1995 +0100
+++ b/VariableVerticalPanelController.st Thu Nov 23 11:42:48 1995 +0100
@@ -10,8 +10,6 @@
hereby transferred.
"
-'From Smalltalk/X, Version:2.10.4 on 6-mar-1995 at 20:00:05'!
-
VariablePanelController subclass:#VariableVerticalPanelController
instanceVariableNames:''
classVariableNames:''
@@ -45,7 +43,7 @@
!
version
- ^ '$Header: /cvs/stx/stx/libwidg/VariableVerticalPanelController.st,v 1.5 1995-11-11 16:23:47 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/VariableVerticalPanelController.st,v 1.6 1995-11-23 10:41:53 cg Exp $'
! !
!VariableVerticalPanelController methodsFor:'initialization'!