equal
deleted
inserted
replaced
31 other person. No title to or ownership of the software is |
31 other person. No title to or ownership of the software is |
32 hereby transferred. |
32 hereby transferred. |
33 " |
33 " |
34 ! |
34 ! |
35 |
35 |
36 version |
|
37 ^ '$Header: /cvs/stx/stx/libwidg/ToggleController.st,v 1.8 1995-11-11 16:23:28 cg Exp $' |
|
38 ! |
|
39 |
|
40 documentation |
36 documentation |
41 " |
37 " |
42 ToggleControllers redefine some of ButtonControllers behavior; |
38 ToggleControllers redefine some of ButtonControllers behavior; |
43 user interaction: they always triggerOnDown, and ignore buttonrelease. |
39 user interaction: they always triggerOnDown, and ignore buttonrelease. |
44 Finally, every buttonPress leads to a toggle action. |
40 Finally, every buttonPress leads to a toggle action. |
50 block. |
46 block. |
51 |
47 |
52 Other than that, all model relations are inherited - i.e. if the view has a model, |
48 Other than that, all model relations are inherited - i.e. if the view has a model, |
53 that one gets change-messages and the toggle updates on aspect changes. |
49 that one gets change-messages and the toggle updates on aspect changes. |
54 " |
50 " |
|
51 ! |
|
52 |
|
53 version |
|
54 ^ '$Header: /cvs/stx/stx/libwidg/ToggleController.st,v 1.9 1995-11-23 10:40:33 cg Exp $' |
55 ! ! |
55 ! ! |
56 |
56 |
57 !ToggleController methodsFor:'initialization'! |
57 !ToggleController methodsFor:'accessing'! |
58 |
58 |
59 initialize |
59 action:aBlock |
60 super initialize. |
60 "set the action to be performed. This is called |
61 self beToggle |
61 with the toggles state as argument." |
|
62 |
|
63 action := aBlock |
62 ! ! |
64 ! ! |
63 |
65 |
64 !ToggleController methodsFor:'events'! |
66 !ToggleController methodsFor:'events'! |
65 |
67 |
66 performAction |
68 performAction |
74 active := false. |
76 active := false. |
75 ]. |
77 ]. |
76 super performAction |
78 super performAction |
77 ! ! |
79 ! ! |
78 |
80 |
79 !ToggleController methodsFor:'accessing'! |
81 !ToggleController methodsFor:'initialization'! |
80 |
82 |
81 action:aBlock |
83 initialize |
82 "set the action to be performed. This is called |
84 super initialize. |
83 with the toggles state as argument." |
85 self beToggle |
|
86 ! ! |
84 |
87 |
85 action := aBlock |
|
86 ! ! |
|