/
SpInputTextDropListPresenter.class.st
131 lines (108 loc) · 3.03 KB
/
SpInputTextDropListPresenter.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
"
I am an elementary Spec widget that associates an TextInputField and a DropListPresenter.
self example
I provide accessors dropList and input and shortcuts for the most common methods of their api.
"
Class {
#name : #SpInputTextDropListPresenter,
#superclass : #SpPresenter,
#instVars : [
'dropList',
'input'
],
#category : #'Spec2-PolyWidgets-Elementary'
}
{ #category : #specs }
SpInputTextDropListPresenter class >> defaultSpec [
<spec: #default>
^ SpLayout composed
newRow: [ :row |
row
add: #input origin: 0 @ 0 corner: 0.3 @ 1;
add: #dropList origin: 0.3 @ 0 corner: 1 @ 1 ];
yourself
]
{ #category : #'api-shortcuts' }
SpInputTextDropListPresenter >> acceptOnCR: aBoolean [
self input acceptOnCR: aBoolean
]
{ #category : #'api-shortcuts' }
SpInputTextDropListPresenter >> beEncrypted [
self input beEncrypted
]
{ #category : #'api-shortcuts' }
SpInputTextDropListPresenter >> displayBlock: aBlock [
self dropList displayBlock: aBlock
]
{ #category : #accessing }
SpInputTextDropListPresenter >> dropList [
^ dropList
]
{ #category : #'api-shortcuts' }
SpInputTextDropListPresenter >> emptyList [
self dropList emptyList
]
{ #category : #'api-shortcuts' }
SpInputTextDropListPresenter >> encrypted: aBoolean [
self input encrypted: aBoolean
]
{ #category : #'api-shortcuts' }
SpInputTextDropListPresenter >> entryCompletion: anEntryCompletion [
self input entryCompletion: anEntryCompletion
]
{ #category : #initialization }
SpInputTextDropListPresenter >> initializeWidgets [
input := self instantiate: SpTextInputFieldPresenter.
dropList := self instantiate: SpDropListPresenter.
self focusOrder
add: input;
add: dropList
]
{ #category : #accessing }
SpInputTextDropListPresenter >> input [
^ input
]
{ #category : #'api-shortcuts' }
SpInputTextDropListPresenter >> items: aList [
self dropList items: aList
]
{ #category : #'api-shortcuts' }
SpInputTextDropListPresenter >> listSize [
self dropList listSize
]
{ #category : #'api-shortcuts' }
SpInputTextDropListPresenter >> placeholder: aText [
self input placeholder: aText
]
{ #category : #'api-shortcuts' }
SpInputTextDropListPresenter >> resetSelection [
self dropList resetSelection
]
{ #category : #'api-shortcuts' }
SpInputTextDropListPresenter >> selectedItem [
self dropList selectedItem
]
{ #category : #'api-shortcuts' }
SpInputTextDropListPresenter >> setIndex: anIndex [
self dropList setIndex: anIndex
]
{ #category : #'api-shortcuts' }
SpInputTextDropListPresenter >> text [
self input text
]
{ #category : #'api-shortcuts' }
SpInputTextDropListPresenter >> text: aText [
self input text: aText
]
{ #category : #'events-shortcuts' }
SpInputTextDropListPresenter >> whenSelectedItemChanged: aBlock [
self dropList whenSelectedItemChanged: aBlock
]
{ #category : #'events-shortcuts' }
SpInputTextDropListPresenter >> whenSelectionChanged: aBlock [
self dropList whenSelectionChanged: aBlock
]
{ #category : #'events-shortcuts' }
SpInputTextDropListPresenter >> whenSelectionIndexChanged: aBlock [
self dropList whenSelectionIndexChanged: aBlock
]