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