1167
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1998 by eXept Software AG
|
3150
|
3 |
All Rights Reserved
|
1167
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
3150
|
13 |
"{ Package: 'stx:libwidg2' }"
|
1167
|
14 |
|
|
15 |
ComboBoxView subclass:#ComboBrowseView
|
|
16 |
instanceVariableNames:'browseAction'
|
|
17 |
classVariableNames:''
|
|
18 |
poolDictionaries:''
|
|
19 |
category:'Views-Interactors'
|
|
20 |
!
|
|
21 |
|
|
22 |
!ComboBrowseView class methodsFor:'documentation'!
|
|
23 |
|
|
24 |
copyright
|
|
25 |
"
|
|
26 |
COPYRIGHT (c) 1998 by eXept Software AG
|
3150
|
27 |
All Rights Reserved
|
1167
|
28 |
|
|
29 |
This software is furnished under a license and may be used
|
|
30 |
only in accordance with the terms of that license and with the
|
|
31 |
inclusion of the above copyright notice. This software may not
|
|
32 |
be provided or otherwise made available to, or used by, any
|
|
33 |
other person. No title to or ownership of the software is
|
|
34 |
hereby transferred.
|
|
35 |
"
|
|
36 |
|
|
37 |
|
|
38 |
!
|
|
39 |
|
|
40 |
documentation
|
|
41 |
"
|
|
42 |
This combines a text-input field with a '...'-Button.
|
1281
|
43 |
The Button opens a fileSelection browser to allow selecting a file.
|
|
44 |
The browse action can be changed programatically via the #browseAction:
|
1167
|
45 |
method.
|
|
46 |
|
|
47 |
[author:]
|
3150
|
48 |
Claus Gittinger
|
1167
|
49 |
"
|
|
50 |
!
|
|
51 |
|
|
52 |
examples
|
|
53 |
"
|
|
54 |
non MVC operation:
|
3150
|
55 |
[exBegin]
|
1167
|
56 |
|top b|
|
|
57 |
|
|
58 |
top := StandardSystemView new.
|
|
59 |
top extent:(300 @ 200).
|
|
60 |
|
|
61 |
b := ComboBrowseView in:top.
|
|
62 |
b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0).
|
|
63 |
b bottomInset:(b preferredExtent y negated).
|
|
64 |
|
|
65 |
top open.
|
3150
|
66 |
[exEnd]
|
1167
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
model operation:
|
3150
|
71 |
[exBegin]
|
1167
|
72 |
|model top b|
|
|
73 |
|
|
74 |
model := 'foo' asValue.
|
|
75 |
|
|
76 |
top := StandardSystemView new.
|
|
77 |
top extent:(300 @ 200).
|
|
78 |
|
|
79 |
b := ComboBrowseView in:top.
|
|
80 |
b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0).
|
|
81 |
b bottomInset:(b preferredExtent y negated).
|
|
82 |
|
|
83 |
b model:model.
|
|
84 |
|
|
85 |
top openModal.
|
|
86 |
Transcript showCR:('entered value: ' , model value).
|
3150
|
87 |
[exEnd]
|
1167
|
88 |
"
|
|
89 |
|
|
90 |
! !
|
|
91 |
|
|
92 |
!ComboBrowseView class methodsFor:'defaults'!
|
|
93 |
|
|
94 |
buttonForm
|
|
95 |
"return the pull-buttons image"
|
|
96 |
|
|
97 |
^ '...'
|
|
98 |
|
|
99 |
"Created: / 13.10.1998 / 16:38:45 / cg"
|
|
100 |
! !
|
|
101 |
|
|
102 |
!ComboBrowseView methodsFor:'accessing'!
|
|
103 |
|
|
104 |
browseAction
|
|
105 |
"return the value of the instance variable 'browseAction' (automatically generated)"
|
|
106 |
|
|
107 |
^ browseAction
|
|
108 |
|
|
109 |
"Created: / 13.10.1998 / 16:46:59 / cg"
|
|
110 |
!
|
|
111 |
|
|
112 |
browseAction:something
|
|
113 |
"set the value of the instance variable 'browseAction' (automatically generated)"
|
|
114 |
|
|
115 |
browseAction := something.
|
|
116 |
|
|
117 |
"Created: / 13.10.1998 / 16:46:59 / cg"
|
|
118 |
! !
|
|
119 |
|
|
120 |
!ComboBrowseView methodsFor:'initialization'!
|
|
121 |
|
|
122 |
initialize
|
|
123 |
super initialize.
|
|
124 |
|
1283
|
125 |
"/ self font:(Font family:'helvetica' size:10).
|
1167
|
126 |
browseAction := [FileSelectionBrowser open]
|
|
127 |
|
|
128 |
"Created: / 13.10.1998 / 16:47:46 / cg"
|
|
129 |
!
|
|
130 |
|
|
131 |
initializeButton
|
|
132 |
super initializeButton.
|
|
133 |
pullDownButton enable.
|
|
134 |
pullDownButton pressAction:[self openBrowser].
|
|
135 |
|
|
136 |
"Created: / 13.10.1998 / 16:39:50 / cg"
|
|
137 |
!
|
|
138 |
|
|
139 |
openBrowser
|
|
140 |
|s|
|
|
141 |
|
|
142 |
s := browseAction value.
|
|
143 |
pullDownButton turnOff.
|
|
144 |
s notNil ifTrue:[
|
3150
|
145 |
field contents:s.
|
1167
|
146 |
]
|
|
147 |
|
|
148 |
"Created: / 13.10.1998 / 16:40:56 / cg"
|
|
149 |
"Modified: / 13.10.1998 / 16:47:56 / cg"
|
|
150 |
! !
|
|
151 |
|
|
152 |
!ComboBrowseView class methodsFor:'documentation'!
|
|
153 |
|
|
154 |
version
|
3150
|
155 |
^ '$Header: /cvs/stx/stx/libwidg2/ComboBrowseView.st,v 1.4 2006-11-13 16:11:29 cg Exp $'
|
1167
|
156 |
! !
|