author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 19 Jul 2017 09:42:32 +0200 | |
branch | jv |
changeset 17619 | edb119820fcb |
parent 12431 | 9f0c59c742d5 |
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 |
"{ Package: 'stx:libtool' }" |
|
13 |
||
14 |
VariablePanel subclass:#FileBrowserV2PanelView |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
15 |
instanceVariableNames:'whichView viewIsVisible visibilityHolder oldOrigin oldCorner' |
3892 | 16 |
classVariableNames:'BarHeight' |
17 |
poolDictionaries:'' |
|
18 |
category:'Interface-Tools-File' |
|
19 |
! |
|
20 |
||
21 |
!FileBrowserV2PanelView class methodsFor:'documentation'! |
|
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
||
35 |
||
36 |
" |
|
37 |
! |
|
38 |
||
39 |
documentation |
|
40 |
" |
|
41 |
copy of the Panel from CBrowser , if a better HorizontalPanel and VerticalPanel is available |
|
42 |
the new version can be used here |
|
5967 | 43 |
|
44 |
[Author:] |
|
45 |
Christian Penk |
|
3892 | 46 |
" |
47 |
! ! |
|
48 |
||
49 |
!FileBrowserV2PanelView methodsFor:'accessing'! |
|
50 |
||
51 |
visible:aState |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
52 |
|view1 view2 newVisible newOrigin1 newOrigin2 newCorner1 newCorner2| |
3892 | 53 |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
54 |
newVisible := aState ? true. |
3892 | 55 |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
56 |
((newVisible == self isVisible) or:[subViews size ~~ 2]) ifTrue:[ |
3892 | 57 |
^ self |
58 |
]. |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
59 |
viewIsVisible := newVisible. |
3892 | 60 |
|
61 |
view1 := subViews at:1. |
|
62 |
view2 := subViews at:2. |
|
63 |
||
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
64 |
viewIsVisible ifTrue:[ |
3892 | 65 |
" |
66 |
MAKE VISIBLE |
|
67 |
" |
|
68 |
view1 origin:0.0@0.0 corner:oldCorner. |
|
69 |
view2 origin:oldOrigin corner:1.0@1.0. |
|
70 |
self resizeSubviews. |
|
71 |
] ifFalse:[ |
|
72 |
" |
|
73 |
MAKE INVISIBLE |
|
74 |
" |
|
75 |
oldCorner := view1 relativeCorner. |
|
76 |
oldOrigin := view2 relativeOrigin. |
|
77 |
||
78 |
orientation == #vertical ifTrue:[ |
|
79 |
whichView == #first ifTrue:[ |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
80 |
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
|
81 |
newOrigin2 := 0.0 @ 0.0. newCorner2 := view2 corner. |
3892 | 82 |
] ifFalse:[ |
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 @ 1.0. |
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
84 |
newOrigin2 := 0.0 @ 1.0. newCorner2 := view2 corner. |
3892 | 85 |
]. |
86 |
] ifFalse:[ |
|
87 |
whichView == #first ifTrue:[ |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
88 |
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
|
89 |
newOrigin2 := 0.0 @ 0.0. newCorner2 := 1.0 @ 1.0. |
3892 | 90 |
] ifFalse:[ |
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 := 1.0 @ 1.0. |
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
92 |
newOrigin2 := 1.0 @ 0.0. newCorner2 := 1.0 @ 1.0. |
3892 | 93 |
] |
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
94 |
]. |
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
95 |
view1 origin:newOrigin1 corner:newCorner1. |
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
96 |
view2 origin:newOrigin2 corner:newCorner2. |
3892 | 97 |
]. |
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
98 |
visibilityHolder notNil ifTrue:[visibilityHolder value:viewIsVisible] |
3892 | 99 |
! |
100 |
||
101 |
whichView |
|
102 |
"return the value of the instance variable 'whichView' (automatically generated)" |
|
103 |
||
104 |
^ whichView |
|
105 |
! |
|
106 |
||
107 |
whichView:something |
|
108 |
"set the value of the instance variable 'whichView' (automatically generated)" |
|
109 |
||
110 |
whichView := something. |
|
111 |
! ! |
|
112 |
||
4360 | 113 |
!FileBrowserV2PanelView methodsFor:'accessing-mvc'! |
3892 | 114 |
|
115 |
visibilityHolder |
|
116 |
^ visibilityHolder |
|
117 |
! |
|
118 |
||
119 |
visibilityHolder:aHolder |
|
120 |
visibilityHolder removeDependent:self. |
|
121 |
||
122 |
(visibilityHolder := aHolder) notNil ifTrue:[ |
|
123 |
visibilityHolder addDependent:self. |
|
124 |
||
125 |
realized ifTrue:[ |
|
126 |
self visible:(visibilityHolder value) |
|
127 |
] |
|
128 |
] |
|
129 |
! ! |
|
130 |
||
131 |
!FileBrowserV2PanelView methodsFor:'actions'! |
|
132 |
||
133 |
toggleVisibility |
|
134 |
||
135 |
self visible:(self isVisible not) |
|
136 |
! ! |
|
137 |
||
138 |
!FileBrowserV2PanelView methodsFor:'change & update'! |
|
139 |
||
140 |
update:what with:aPara from:chgObj |
|
141 |
||
142 |
chgObj == visibilityHolder ifTrue:[ |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
143 |
self visible:(chgObj value). |
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
144 |
^ self. |
3892 | 145 |
]. |
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
146 |
super update:what with:aPara from:chgObj |
3892 | 147 |
! ! |
148 |
||
149 |
!FileBrowserV2PanelView methodsFor:'initialization'! |
|
150 |
||
151 |
destroy |
|
152 |
visibilityHolder removeDependent:self. |
|
153 |
super destroy |
|
154 |
! |
|
155 |
||
156 |
initialize |
|
157 |
orientation := #vertical. |
|
158 |
whichView := #first. |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
159 |
viewIsVisible := true. |
3892 | 160 |
super initialize |
161 |
! |
|
162 |
||
163 |
realize |
|
164 |
super realize. |
|
165 |
||
166 |
visibilityHolder notNil ifTrue:[ |
|
167 |
self visible:(visibilityHolder value) |
|
168 |
] |
|
169 |
! ! |
|
170 |
||
171 |
!FileBrowserV2PanelView methodsFor:'queries'! |
|
172 |
||
173 |
anyNonRelativeSubviews |
|
174 |
"return true, if any of my subviews has no relative origin/extent" |
|
175 |
||
176 |
"/ cg asking ca: "whats the reason for this ?" |
|
177 |
"/ ^ subViews notNil |
|
178 |
^ super anyNonRelativeSubviews. |
|
179 |
! |
|
180 |
||
181 |
isVisible |
|
4609
303b9b434cda
do NOT misuse the barHeight variable as isVisible flag !
Claus Gittinger <cg@exept.de>
parents:
4360
diff
changeset
|
182 |
^ viewIsVisible |
3892 | 183 |
! |
184 |
||
185 |
specClass |
|
186 |
^ FileBrowserV2UISpecifications panelSpecClass |
|
187 |
! ! |
|
188 |
||
189 |
!FileBrowserV2PanelView class methodsFor:'documentation'! |
|
190 |
||
191 |
version |
|
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
192 |
^ '$Id: FileBrowserV2PanelView.st 7854 2012-01-30 17:49:41Z vranyj1 $' |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
193 |
! |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
194 |
|
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
195 |
version_HG |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
196 |
|
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
197 |
^ '$Changeset: <not expanded> $' |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
198 |
! |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
199 |
|
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
200 |
version_SVN |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
201 |
^ '$Id: FileBrowserV2PanelView.st 7854 2012-01-30 17:49:41Z vranyj1 $' |
12125 | 202 |
! ! |
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
203 |