-
-
Notifications
You must be signed in to change notification settings - Fork 343
/
RadioButtonModelExample.class.st
80 lines (62 loc) · 1.4 KB
/
RadioButtonModelExample.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
"
Model used for radio buttons in example of basic controls (see ""UITheme exampleBasicControls"").
"
Class {
#name : #RadioButtonModelExample,
#superclass : #Model,
#instVars : [
'option'
],
#category : #'Morphic-Examples-Widgets'
}
{ #category : #accessing }
RadioButtonModelExample >> beCenter [
"Set the option to #center."
self option: #center
]
{ #category : #accessing }
RadioButtonModelExample >> beLeft [
"Set the option to #left."
self option: #left
]
{ #category : #accessing }
RadioButtonModelExample >> beRight [
"Set the option to #right."
self option: #right
]
{ #category : #initialization }
RadioButtonModelExample >> initialize [
"Initialize the receiver."
super initialize.
self
option: #left
]
{ #category : #accessing }
RadioButtonModelExample >> isCenter [
"Answer whether the option if #center."
^self option == #center
]
{ #category : #accessing }
RadioButtonModelExample >> isLeft [
"Answer whether the option if #left."
^self option == #left
]
{ #category : #accessing }
RadioButtonModelExample >> isRight [
"Answer whether the option if #right."
^self option == #right
]
{ #category : #accessing }
RadioButtonModelExample >> option [
"Answer the value of option"
^ option
]
{ #category : #accessing }
RadioButtonModelExample >> option: aSymbol [
"Set the value of option"
option := aSymbol.
self
changed: #isLeft;
changed: #isCenter;
changed: #isRight
]