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