3892
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2002 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
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 |
|
|
13 |
"
|
|
14 |
|
|
15 |
"{ Package: 'stx:libtool' }"
|
|
16 |
|
|
17 |
VariablePanel subclass:#FileBrowserV2PanelView
|
|
18 |
instanceVariableNames:'whichView visibilityHolder oldOrigin oldCorner'
|
|
19 |
classVariableNames:'BarHeight'
|
|
20 |
poolDictionaries:''
|
|
21 |
category:'Interface-Tools-File'
|
|
22 |
!
|
|
23 |
|
|
24 |
!FileBrowserV2PanelView class methodsFor:'documentation'!
|
|
25 |
|
|
26 |
copyright
|
|
27 |
"
|
|
28 |
COPYRIGHT (c) 2002 by eXept Software AG
|
|
29 |
All Rights Reserved
|
|
30 |
|
|
31 |
This software is furnished under a license and may be used
|
|
32 |
only in accordance with the terms of that license and with the
|
|
33 |
inclusion of the above copyright notice. This software may not
|
|
34 |
be provided or otherwise made available to, or used by, any
|
|
35 |
other person. No title to or ownership of the software is
|
|
36 |
hereby transferred.
|
|
37 |
|
|
38 |
|
|
39 |
"
|
|
40 |
!
|
|
41 |
|
|
42 |
documentation
|
|
43 |
|
|
44 |
"
|
|
45 |
copy of the Panel from CBrowser , if a better HorizontalPanel and VerticalPanel is available
|
|
46 |
the new version can be used here
|
|
47 |
"
|
|
48 |
! !
|
|
49 |
|
|
50 |
!FileBrowserV2PanelView methodsFor:'accessing'!
|
|
51 |
|
|
52 |
visible:aState
|
|
53 |
|view1 view2 state|
|
|
54 |
|
|
55 |
state := aState ? true.
|
|
56 |
|
|
57 |
(state == self isVisible or:[subViews size ~~ 2]) ifTrue:[
|
|
58 |
^ self
|
|
59 |
].
|
|
60 |
|
|
61 |
view1 := subViews at:1.
|
|
62 |
view2 := subViews at:2.
|
|
63 |
|
|
64 |
state ifTrue:[
|
|
65 |
"
|
|
66 |
MAKE VISIBLE
|
|
67 |
"
|
|
68 |
barHeight := BarHeight.
|
|
69 |
view1 origin:0.0@0.0 corner:oldCorner.
|
|
70 |
view2 origin:oldOrigin corner:1.0@1.0.
|
|
71 |
self resizeSubviews.
|
|
72 |
] ifFalse:[
|
|
73 |
"
|
|
74 |
MAKE INVISIBLE
|
|
75 |
"
|
|
76 |
BarHeight := barHeight.
|
|
77 |
barHeight := 0.
|
|
78 |
oldCorner := view1 relativeCorner.
|
|
79 |
oldOrigin := view2 relativeOrigin.
|
|
80 |
|
|
81 |
orientation == #vertical ifTrue:[
|
|
82 |
whichView == #first ifTrue:[
|
|
83 |
view1 origin:0.0@0.0 corner:1.0@0.0.
|
|
84 |
view2 origin:0.0@0.0 corner:(view2 corner).
|
|
85 |
] ifFalse:[
|
|
86 |
view1 origin:0.0@0.0 corner:1.0@1.0.
|
|
87 |
view2 origin:0.0@1.0 corner:(view2 corner).
|
|
88 |
].
|
|
89 |
] ifFalse:[
|
|
90 |
whichView == #first ifTrue:[
|
|
91 |
view1 origin:0.0@0.0 corner:0.0@1.0.
|
|
92 |
view2 origin:0.0@0.0 corner:1.0@1.0.
|
|
93 |
] ifFalse:[
|
|
94 |
view1 origin:0.0@0.0 corner:1.0@1.0.
|
|
95 |
view2 origin:1.0@0.0 corner:1.0@1.0.
|
|
96 |
]
|
|
97 |
]
|
|
98 |
].
|
|
99 |
visibilityHolder notNil ifTrue:[visibilityHolder value:state]
|
|
100 |
!
|
|
101 |
|
|
102 |
whichView
|
|
103 |
"return the value of the instance variable 'whichView' (automatically generated)"
|
|
104 |
|
|
105 |
^ whichView
|
|
106 |
!
|
|
107 |
|
|
108 |
whichView:something
|
|
109 |
"set the value of the instance variable 'whichView' (automatically generated)"
|
|
110 |
|
|
111 |
whichView := something.
|
|
112 |
! !
|
|
113 |
|
4360
|
114 |
!FileBrowserV2PanelView methodsFor:'accessing-mvc'!
|
3892
|
115 |
|
|
116 |
visibilityHolder
|
|
117 |
^ visibilityHolder
|
|
118 |
!
|
|
119 |
|
|
120 |
visibilityHolder:aHolder
|
|
121 |
visibilityHolder removeDependent:self.
|
|
122 |
|
|
123 |
(visibilityHolder := aHolder) notNil ifTrue:[
|
|
124 |
visibilityHolder addDependent:self.
|
|
125 |
|
|
126 |
realized ifTrue:[
|
|
127 |
self visible:(visibilityHolder value)
|
|
128 |
]
|
|
129 |
]
|
|
130 |
! !
|
|
131 |
|
|
132 |
!FileBrowserV2PanelView methodsFor:'actions'!
|
|
133 |
|
|
134 |
toggleVisibility
|
|
135 |
|
|
136 |
self visible:(self isVisible not)
|
|
137 |
! !
|
|
138 |
|
|
139 |
!FileBrowserV2PanelView methodsFor:'change & update'!
|
|
140 |
|
|
141 |
update:what with:aPara from:chgObj
|
|
142 |
|
|
143 |
chgObj == visibilityHolder ifTrue:[
|
|
144 |
^ self visible:(chgObj value)
|
|
145 |
].
|
|
146 |
^ super update:what with:aPara from:chgObj
|
|
147 |
|
|
148 |
! !
|
|
149 |
|
|
150 |
!FileBrowserV2PanelView methodsFor:'initialization'!
|
|
151 |
|
|
152 |
destroy
|
|
153 |
visibilityHolder removeDependent:self.
|
|
154 |
super destroy
|
|
155 |
!
|
|
156 |
|
|
157 |
initialize
|
|
158 |
orientation := #vertical.
|
|
159 |
whichView := #first.
|
|
160 |
|
|
161 |
super initialize
|
|
162 |
!
|
|
163 |
|
|
164 |
realize
|
|
165 |
super realize.
|
|
166 |
|
|
167 |
visibilityHolder notNil ifTrue:[
|
|
168 |
self visible:(visibilityHolder value)
|
|
169 |
]
|
|
170 |
! !
|
|
171 |
|
|
172 |
!FileBrowserV2PanelView methodsFor:'queries'!
|
|
173 |
|
|
174 |
anyNonRelativeSubviews
|
|
175 |
"return true, if any of my subviews has no relative origin/extent"
|
|
176 |
|
|
177 |
"/ cg asking ca: "whats the reason for this ?"
|
|
178 |
"/ ^ subViews notNil
|
|
179 |
^ super anyNonRelativeSubviews.
|
|
180 |
!
|
|
181 |
|
|
182 |
isVisible
|
|
183 |
^ barHeight ~~ 0
|
|
184 |
!
|
|
185 |
|
|
186 |
specClass
|
|
187 |
^ FileBrowserV2UISpecifications panelSpecClass
|
|
188 |
! !
|
|
189 |
|
|
190 |
!FileBrowserV2PanelView class methodsFor:'documentation'!
|
|
191 |
|
|
192 |
version
|
4360
|
193 |
^ '$Header: /cvs/stx/stx/libtool/FileBrowserV2PanelView.st,v 1.2 2002-12-10 11:03:27 cg Exp $'
|
3892
|
194 |
! !
|