author | Claus Gittinger <cg@exept.de> |
Mon, 11 Sep 2017 09:11:40 +0200 | |
changeset 17687 | 01e713d1af75 |
parent 17325 | 9c71e321f4f6 |
permissions | -rw-r--r-- |
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. |
|
17325 | 11 |
" |
12 |
"{ Package: 'stx:libtool' }" |
|
3892 | 13 |
|
17325 | 14 |
"{ NameSpace: Smalltalk }" |
3892 | 15 |
|
16 |
VariablePanel subclass:#FileBrowserV2PanelView |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
17 |
instanceVariableNames:'whichView viewIsVisible visibilityHolder oldOrigin oldCorner' |
3892 | 18 |
classVariableNames:'BarHeight' |
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-Tools-File' |
|
21 |
! |
|
22 |
||
23 |
!FileBrowserV2PanelView class methodsFor:'documentation'! |
|
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
28 |
All Rights Reserved |
|
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 |
copy of the Panel from CBrowser , if a better HorizontalPanel and VerticalPanel is available |
|
44 |
the new version can be used here |
|
5967 | 45 |
|
46 |
[Author:] |
|
47 |
Christian Penk |
|
3892 | 48 |
" |
49 |
! ! |
|
50 |
||
51 |
!FileBrowserV2PanelView methodsFor:'accessing'! |
|
52 |
||
17325 | 53 |
visible:aBooleanOrNil |
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
54 |
|view1 view2 newVisible newOrigin1 newOrigin2 newCorner1 newCorner2| |
3892 | 55 |
|
17325 | 56 |
newVisible := aBooleanOrNil ? true. |
3892 | 57 |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
58 |
((newVisible == self isVisible) or:[subViews size ~~ 2]) ifTrue:[ |
3892 | 59 |
^ self |
60 |
]. |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
61 |
viewIsVisible := newVisible. |
3892 | 62 |
|
63 |
view1 := subViews at:1. |
|
64 |
view2 := subViews at:2. |
|
65 |
||
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
66 |
viewIsVisible ifTrue:[ |
3892 | 67 |
" |
68 |
MAKE VISIBLE |
|
69 |
" |
|
70 |
view1 origin:0.0@0.0 corner:oldCorner. |
|
71 |
view2 origin:oldOrigin corner:1.0@1.0. |
|
72 |
self resizeSubviews. |
|
73 |
] ifFalse:[ |
|
74 |
" |
|
75 |
MAKE INVISIBLE |
|
76 |
" |
|
77 |
oldCorner := view1 relativeCorner. |
|
78 |
oldOrigin := view2 relativeOrigin. |
|
79 |
||
80 |
orientation == #vertical ifTrue:[ |
|
81 |
whichView == #first ifTrue:[ |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
82 |
newOrigin1 := 0.0 @ 0.0. newCorner1 := 1.0 @ 0.0. |
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
83 |
newOrigin2 := 0.0 @ 0.0. newCorner2 := view2 corner. |
3892 | 84 |
] ifFalse:[ |
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
85 |
newOrigin1 := 0.0 @ 0.0. newCorner1 := 1.0 @ 1.0. |
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
86 |
newOrigin2 := 0.0 @ 1.0. newCorner2 := view2 corner. |
3892 | 87 |
]. |
88 |
] ifFalse:[ |
|
89 |
whichView == #first ifTrue:[ |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
90 |
newOrigin1 := 0.0 @ 0.0. newCorner1 := 0.0 @ 1.0. |
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
91 |
newOrigin2 := 0.0 @ 0.0. newCorner2 := 1.0 @ 1.0. |
3892 | 92 |
] ifFalse:[ |
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
93 |
newOrigin1 := 0.0 @ 0.0. newCorner1 := 1.0 @ 1.0. |
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
94 |
newOrigin2 := 1.0 @ 0.0. newCorner2 := 1.0 @ 1.0. |
3892 | 95 |
] |
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
96 |
]. |
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
97 |
view1 origin:newOrigin1 corner:newCorner1. |
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
98 |
view2 origin:newOrigin2 corner:newCorner2. |
3892 | 99 |
]. |
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
100 |
visibilityHolder notNil ifTrue:[visibilityHolder value:viewIsVisible] |
17325 | 101 |
|
102 |
"Modified (format): / 04-02-2017 / 21:32:11 / cg" |
|
3892 | 103 |
! |
104 |
||
105 |
whichView |
|
106 |
"return the value of the instance variable 'whichView' (automatically generated)" |
|
107 |
||
108 |
^ whichView |
|
109 |
! |
|
110 |
||
111 |
whichView:something |
|
112 |
"set the value of the instance variable 'whichView' (automatically generated)" |
|
113 |
||
114 |
whichView := something. |
|
115 |
! ! |
|
116 |
||
4360 | 117 |
!FileBrowserV2PanelView methodsFor:'accessing-mvc'! |
3892 | 118 |
|
119 |
visibilityHolder |
|
120 |
^ visibilityHolder |
|
121 |
! |
|
122 |
||
123 |
visibilityHolder:aHolder |
|
124 |
visibilityHolder removeDependent:self. |
|
125 |
||
126 |
(visibilityHolder := aHolder) notNil ifTrue:[ |
|
127 |
visibilityHolder addDependent:self. |
|
128 |
||
129 |
realized ifTrue:[ |
|
130 |
self visible:(visibilityHolder value) |
|
131 |
] |
|
132 |
] |
|
133 |
! ! |
|
134 |
||
135 |
!FileBrowserV2PanelView methodsFor:'actions'! |
|
136 |
||
137 |
toggleVisibility |
|
138 |
||
139 |
self visible:(self isVisible not) |
|
140 |
! ! |
|
141 |
||
142 |
!FileBrowserV2PanelView methodsFor:'change & update'! |
|
143 |
||
144 |
update:what with:aPara from:chgObj |
|
145 |
||
146 |
chgObj == visibilityHolder ifTrue:[ |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
147 |
self visible:(chgObj value). |
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
148 |
^ self. |
3892 | 149 |
]. |
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
150 |
super update:what with:aPara from:chgObj |
3892 | 151 |
! ! |
152 |
||
153 |
!FileBrowserV2PanelView methodsFor:'initialization'! |
|
154 |
||
155 |
destroy |
|
156 |
visibilityHolder removeDependent:self. |
|
157 |
super destroy |
|
158 |
! |
|
159 |
||
160 |
initialize |
|
161 |
orientation := #vertical. |
|
162 |
whichView := #first. |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
163 |
viewIsVisible := true. |
3892 | 164 |
super initialize |
165 |
! |
|
166 |
||
167 |
realize |
|
168 |
super realize. |
|
169 |
||
170 |
visibilityHolder notNil ifTrue:[ |
|
171 |
self visible:(visibilityHolder value) |
|
172 |
] |
|
173 |
! ! |
|
174 |
||
175 |
!FileBrowserV2PanelView methodsFor:'queries'! |
|
176 |
||
177 |
anyNonRelativeSubviews |
|
178 |
"return true, if any of my subviews has no relative origin/extent" |
|
179 |
||
180 |
"/ cg asking ca: "whats the reason for this ?" |
|
181 |
"/ ^ subViews notNil |
|
182 |
^ super anyNonRelativeSubviews. |
|
183 |
! |
|
184 |
||
185 |
isVisible |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
186 |
^ viewIsVisible |
3892 | 187 |
! |
188 |
||
189 |
specClass |
|
190 |
^ FileBrowserV2UISpecifications panelSpecClass |
|
191 |
! ! |
|
192 |
||
193 |
!FileBrowserV2PanelView class methodsFor:'documentation'! |
|
194 |
||
195 |
version |
|
17325 | 196 |
^ '$Header$' |
3892 | 197 |
! ! |
17325 | 198 |