author | Jan Vrany <jan.vrany@labware.com> |
Thu, 18 Nov 2021 22:33:41 +0000 | |
changeset 244 | 5093490824df |
parent 243 | a3ea49d8ac0e |
child 251 | 1519e5fd57bd |
permissions | -rw-r--r-- |
110 | 1 |
" |
2 |
jv:vdb - Visual / VM Debugger |
|
3 |
Copyright (C) 2015-now Jan Vrany |
|
211
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
4 |
Copyright (C) 2021 LabWare |
110 | 5 |
|
6 |
This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License' |
|
7 |
||
8 |
You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/ |
|
9 |
" |
|
10 |
"{ Package: 'jv:vdb' }" |
|
11 |
||
12 |
"{ NameSpace: Smalltalk }" |
|
13 |
||
14 |
VDBAbstractTreeApplication subclass:#VDBRegisterListApplication |
|
15 |
instanceVariableNames:'registerListHolder selectedRegisterHolder' |
|
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'VDB-UI-Others' |
|
19 |
! |
|
20 |
||
21 |
!VDBRegisterListApplication class methodsFor:'documentation'! |
|
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
jv:vdb - Visual / VM Debugger |
|
26 |
Copyright (C) 2015-now Jan Vrany |
|
211
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
27 |
Copyright (C) 2021 LabWare |
110 | 28 |
|
29 |
This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License' |
|
30 |
||
31 |
You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/ |
|
32 |
" |
|
33 |
! ! |
|
34 |
||
35 |
!VDBRegisterListApplication class methodsFor:'accessing'! |
|
36 |
||
115
0dd989ce3ae7
Cleanup default window titles
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
112
diff
changeset
|
37 |
defaultWindowTitle |
0dd989ce3ae7
Cleanup default window titles
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
112
diff
changeset
|
38 |
^ self resources string:'Registers' |
110 | 39 |
|
40 |
"Created: / 11-07-2017 / 16:37:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
112
d293d117e978
Add register view to frame details application (`VDBFrameApplication`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
110
diff
changeset
|
41 |
"Modified: / 01-10-2018 / 12:08:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
110 | 42 |
! ! |
43 |
||
44 |
!VDBRegisterListApplication class methodsFor:'interface specs'! |
|
45 |
||
46 |
columnsSpec |
|
47 |
"This resource specification was automatically generated |
|
48 |
by the DataSetBuilder of ST/X." |
|
49 |
||
50 |
"Do not manually edit this!! If it is corrupted, |
|
51 |
the DataSetBuilder may not be able to read the specification." |
|
52 |
||
53 |
" |
|
54 |
DataSetBuilder new openOnClass:VDBFrameApplication andSelector:#columnsSpec |
|
55 |
" |
|
56 |
||
57 |
<resource: #tableColumns> |
|
58 |
||
59 |
^#( |
|
60 |
(DataSetColumnSpec |
|
61 |
label: 'Value' |
|
62 |
labelAlignment: left |
|
63 |
labelButtonType: Button |
|
64 |
width: 1.0 |
|
65 |
height: heightOfFirstRow |
|
66 |
menuFromApplication: false |
|
67 |
printSelector: value |
|
68 |
backgroundSelector: backgroundColor |
|
69 |
showRowSeparator: false |
|
70 |
showColSeparator: false |
|
71 |
) |
|
72 |
) |
|
73 |
||
74 |
! ! |
|
75 |
||
76 |
!VDBRegisterListApplication class methodsFor:'plugIn spec'! |
|
77 |
||
78 |
aspectSelectors |
|
79 |
"This resource specification was automatically generated |
|
80 |
by the UIPainter of ST/X." |
|
81 |
||
82 |
"Do not manually edit this. If it is corrupted, |
|
83 |
the UIPainter may not be able to read the specification." |
|
84 |
||
85 |
"Return a description of exported aspects; |
|
86 |
these can be connected to aspects of an embedding application |
|
87 |
(if this app is embedded in a subCanvas)." |
|
88 |
||
89 |
^ #( |
|
90 |
#debuggerHolder |
|
211
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
91 |
#frameHolder |
110 | 92 |
#registerListHolder |
93 |
#selectedRegisterHolder |
|
94 |
). |
|
95 |
||
96 |
"Modified: / 27-09-2018 / 20:32:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
211
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
97 |
"Modified: / 12-03-2021 / 15:44:08 / Jan Vrany <jan.vrany@labware.com>" |
110 | 98 |
! ! |
99 |
||
100 |
!VDBRegisterListApplication class methodsFor:'startup-web applications'! |
|
101 |
||
102 |
initialPageSpec |
|
103 |
"this is only required for web-applications" |
|
104 |
||
105 |
^ self shouldImplement |
|
106 |
! |
|
107 |
||
108 |
pageSpecs |
|
109 |
"this is only required for web-applications" |
|
110 |
||
111 |
^ self shouldImplement |
|
112 |
! ! |
|
113 |
||
114 |
!VDBRegisterListApplication methodsFor:'aspects'! |
|
115 |
||
116 |
backgroundColorFor: aVDBRegisterPresenter |
|
242
625254789cc8
UI: add theme support to register list
Jan Vrany <jan.vrany@labware.com>
parents:
241
diff
changeset
|
117 |
<resource: #style (#'registerListApplication.changedRegisterBackgroundColor')> |
625254789cc8
UI: add theme support to register list
Jan Vrany <jan.vrany@labware.com>
parents:
241
diff
changeset
|
118 |
|
625254789cc8
UI: add theme support to register list
Jan Vrany <jan.vrany@labware.com>
parents:
241
diff
changeset
|
119 |
aVDBRegisterPresenter register hasChanged ifTrue:[ |
625254789cc8
UI: add theme support to register list
Jan Vrany <jan.vrany@labware.com>
parents:
241
diff
changeset
|
120 |
^ self styleSheet colorAt: 'registerListApplication.changedRegisterBackgroundColor' default:[ Color yellow lighter lighter ] |
625254789cc8
UI: add theme support to register list
Jan Vrany <jan.vrany@labware.com>
parents:
241
diff
changeset
|
121 |
]. |
625254789cc8
UI: add theme support to register list
Jan Vrany <jan.vrany@labware.com>
parents:
241
diff
changeset
|
122 |
^ nil |
625254789cc8
UI: add theme support to register list
Jan Vrany <jan.vrany@labware.com>
parents:
241
diff
changeset
|
123 |
|
625254789cc8
UI: add theme support to register list
Jan Vrany <jan.vrany@labware.com>
parents:
241
diff
changeset
|
124 |
" |
625254789cc8
UI: add theme support to register list
Jan Vrany <jan.vrany@labware.com>
parents:
241
diff
changeset
|
125 |
VDBRegisterListApplication initializeDefaultStyleSheet; defaultStyleSheet. |
625254789cc8
UI: add theme support to register list
Jan Vrany <jan.vrany@labware.com>
parents:
241
diff
changeset
|
126 |
" |
110 | 127 |
|
128 |
"Created: / 01-02-2018 / 09:08:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
129 |
"Modified: / 27-09-2018 / 20:41:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
242
625254789cc8
UI: add theme support to register list
Jan Vrany <jan.vrany@labware.com>
parents:
241
diff
changeset
|
130 |
"Modified (comment): / 18-11-2021 / 12:20:35 / Jan Vrany <jan.vrany@labware.com>" |
110 | 131 |
! |
132 |
||
211
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
133 |
frameHolder: aValueModel |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
134 |
| registers | |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
135 |
|
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
136 |
registers := (AspectAdaptor forAspect:#registers) |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
137 |
subjectChannel: aValueModel; |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
138 |
yourself. |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
139 |
self registerListHolder: registers |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
140 |
|
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
141 |
"Created: / 12-03-2021 / 15:43:53 / Jan Vrany <jan.vrany@labware.com>" |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
142 |
! |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
143 |
|
110 | 144 |
registerListHolder |
145 |
"return/create the 'variableObjectListHolder' value holder (automatically generated)" |
|
146 |
||
147 |
registerListHolder isNil ifTrue:[ |
|
148 |
registerListHolder := ValueHolder with: #(). |
|
149 |
registerListHolder addDependent:self. |
|
150 |
]. |
|
151 |
^ registerListHolder |
|
152 |
||
153 |
"Created: / 27-09-2018 / 20:31:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
154 |
! |
|
155 |
||
156 |
registerListHolder:something |
|
157 |
"set the 'variableObjectListHolder' value holder (automatically generated)" |
|
158 |
||
159 |
|oldValue newValue| |
|
160 |
||
161 |
registerListHolder notNil ifTrue:[ |
|
162 |
oldValue := registerListHolder value. |
|
163 |
registerListHolder removeDependent:self. |
|
164 |
]. |
|
165 |
registerListHolder := something. |
|
166 |
registerListHolder notNil ifTrue:[ |
|
167 |
registerListHolder addDependent:self. |
|
168 |
]. |
|
169 |
newValue := registerListHolder value. |
|
170 |
oldValue ~~ newValue ifTrue:[ |
|
171 |
self update:#value with:newValue from:registerListHolder. |
|
172 |
]. |
|
173 |
||
174 |
"Created: / 27-09-2018 / 20:31:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
175 |
! |
|
176 |
||
177 |
selectedRegisterHolder |
|
178 |
"return/create the 'selectedVariableHolder' value holder (automatically generated)" |
|
179 |
||
180 |
selectedRegisterHolder isNil ifTrue:[ |
|
181 |
selectedRegisterHolder := ValueHolder new. |
|
182 |
selectedRegisterHolder addDependent:self. |
|
183 |
]. |
|
184 |
^ selectedRegisterHolder |
|
185 |
||
186 |
"Created: / 27-09-2018 / 20:31:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
187 |
! |
|
188 |
||
189 |
selectedRegisterHolder:something |
|
190 |
"set the 'selectedVariableHolder' value holder (automatically generated)" |
|
191 |
||
192 |
| oldValue newValue | |
|
193 |
||
194 |
selectedRegisterHolder notNil ifTrue:[ |
|
195 |
oldValue := selectedRegisterHolder value. |
|
196 |
selectedRegisterHolder removeDependent:self. |
|
197 |
]. |
|
198 |
selectedRegisterHolder := something. |
|
199 |
selectedRegisterHolder notNil ifTrue:[ |
|
200 |
selectedRegisterHolder addDependent:self. |
|
201 |
]. |
|
202 |
newValue := selectedRegisterHolder value. |
|
203 |
oldValue ~~ newValue ifTrue:[ |
|
204 |
self |
|
205 |
update:#value |
|
206 |
with:newValue |
|
207 |
from:selectedRegisterHolder. |
|
208 |
]. |
|
209 |
||
210 |
"Created: / 27-09-2018 / 20:31:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
211 |
! ! |
|
212 |
||
213 |
!VDBRegisterListApplication methodsFor:'change & update'! |
|
214 |
||
215 |
update:aspect with:param from:sender |
|
216 |
"Invoked when an object that I depend upon sends a change notification." |
|
217 |
||
218 |
sender == registerListHolder ifTrue:[ |
|
151
bc7626f46210
Performance: do not update contents of windows when not needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
219 |
self enqueueDelayedUpdateContents. |
110 | 220 |
^ self. |
221 |
]. |
|
222 |
super update:aspect with:param from:sender |
|
223 |
||
151
bc7626f46210
Performance: do not update contents of windows when not needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
224 |
"Modified: / 14-02-2019 / 16:31:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
110 | 225 |
! ! |
226 |
||
227 |
!VDBRegisterListApplication methodsFor:'change & update-delayed'! |
|
228 |
||
244
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
229 |
delayedInvalidateInternalList |
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
230 |
| scrolledView | |
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
231 |
|
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
232 |
internalListView notNil ifTrue:[ |
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
233 |
scrolledView := internalListView scrolledView. |
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
234 |
(scrolledView notNil and:[ scrolledView isVisible ]) ifTrue:[ |
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
235 |
| registerPs | |
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
236 |
|
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
237 |
registerPs := self internalListHolder value. |
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
238 |
registerPs notEmptyOrNil ifTrue: [ |
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
239 |
registerPs do: [:each | each valueString ] |
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
240 |
]. |
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
241 |
] |
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
242 |
]. |
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
243 |
super delayedInvalidateInternalList. |
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
244 |
|
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
245 |
"Created: / 18-11-2021 / 18:02:40 / Jan Vrany <jan.vrany@labware.com>" |
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
246 |
! |
5093490824df
UI: temporary fix to avoid register list flickering when single-stepping
Jan Vrany <jan.vrany@labware.com>
parents:
243
diff
changeset
|
247 |
|
110 | 248 |
delayedUpdateInternalList |
211
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
249 |
| registers registerPs mustUpdate | |
110 | 250 |
|
251 |
registers := self registerListHolder value ? #(). |
|
211
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
252 |
registerPs := self internalListHolder root children. |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
253 |
|
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
254 |
"/ Since set of registers for given inferior is 99% likely to |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
255 |
"/ be the same all the time, here we keep the list of presenters |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
256 |
"/ and only update presenter's register if possible. This avoids |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
257 |
"/ flickering and preserve selection and scroll position. |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
258 |
"/ |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
259 |
"/ Still, we have to catch the case the set of registers changes - |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
260 |
"/ this may happen on IBM Cell or when debugging multiple inferiors |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
261 |
"/ each running different architecture. |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
262 |
|
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
263 |
mustUpdate := registers size ~~ registerPs size. |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
264 |
mustUpdate ifFalse: [ |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
265 |
| i | |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
266 |
|
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
267 |
i := 1. |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
268 |
[ mustUpdate not and: [ i <= registers size ] ] whileTrue: [ |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
269 |
(registers at: i) register = (registerPs at: i) register register ifTrue: [ |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
270 |
"/ Good, this presenter is for the same register, so just |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
271 |
"/ updates it's value |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
272 |
(registerPs at: i) setRegister: (registers at: i) |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
273 |
] ifFalse: [ |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
274 |
"/ Hmm...some other register, we need a full update |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
275 |
"/ (this also short-circuits the loop) |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
276 |
mustUpdate := true. |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
277 |
]. |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
278 |
i := i + 1. |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
279 |
] |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
280 |
]. |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
281 |
|
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
282 |
mustUpdate ifTrue: [ |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
283 |
"/ Full update is needed, regenerate a list of registers. |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
284 |
registerPs := registers collect:[ :reg | VDBRegisterPresenter new setRegister: reg ]. |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
285 |
self internalListHolder root |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
286 |
children: registerPs; |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
287 |
expand. |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
288 |
] ifFalse: [ |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
289 |
"/ No full update needed, but some of the values may have changed, |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
290 |
"/ so redraw the list (remember, register values in presenter objects |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
291 |
"/ are already updated, see the loop above). |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
292 |
self delayedInvalidateInternalList. |
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
293 |
]. |
110 | 294 |
|
295 |
"Modified: / 28-09-2018 / 06:50:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
211
2bf7c99e6efa
UI: avoid regenerating register list if possible to avoid flickering
Jan Vrany <jan.vrany@labware.com>
parents:
151
diff
changeset
|
296 |
"Modified (format): / 12-03-2021 / 17:56:34 / Jan Vrany <jan.vrany@labware.com>" |
110 | 297 |
! |
298 |
||
299 |
delayedUpdateSelection |
|
300 |
| internalSelection | |
|
301 |
||
302 |
internalSelection := self internalSelectionHolder value. |
|
303 |
internalSelection notNil ifTrue:[ |
|
304 |
self selectedRegisterHolder value: internalSelection register |
|
305 |
] ifFalse:[ |
|
306 |
self selectedRegisterHolder value: nil |
|
307 |
]. |
|
308 |
||
309 |
"Modified: / 27-09-2018 / 21:08:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
310 |
! ! |
|
311 |
||
312 |
!VDBRegisterListApplication methodsFor:'drag & drop'! |
|
313 |
||
314 |
dropObjects:aCollectionOfDropObjects |
|
315 |
"drop manager wants to drop. |
|
316 |
This is ony sent, if #canDrop: returned true. |
|
317 |
Must be redefined in order for drop to work." |
|
318 |
||
319 |
^ self shouldImplement |
|
320 |
! ! |
|
321 |
||
322 |
!VDBRegisterListApplication methodsFor:'event handling'! |
|
323 |
||
243
a3ea49d8ac0e
UX: hilight changed register when changed via API
Jan Vrany <jan.vrany@labware.com>
parents:
242
diff
changeset
|
324 |
onRegisterValueChangedEvent: aGDBRegisterValueChangedEvent |
a3ea49d8ac0e
UX: hilight changed register when changed via API
Jan Vrany <jan.vrany@labware.com>
parents:
242
diff
changeset
|
325 |
self enqueueDelayedInvalidateInternalList |
a3ea49d8ac0e
UX: hilight changed register when changed via API
Jan Vrany <jan.vrany@labware.com>
parents:
242
diff
changeset
|
326 |
|
a3ea49d8ac0e
UX: hilight changed register when changed via API
Jan Vrany <jan.vrany@labware.com>
parents:
242
diff
changeset
|
327 |
"Created: / 18-11-2021 / 12:09:00 / Jan Vrany <jan.vrany@labware.com>" |
a3ea49d8ac0e
UX: hilight changed register when changed via API
Jan Vrany <jan.vrany@labware.com>
parents:
242
diff
changeset
|
328 |
! |
a3ea49d8ac0e
UX: hilight changed register when changed via API
Jan Vrany <jan.vrany@labware.com>
parents:
242
diff
changeset
|
329 |
|
110 | 330 |
onStoppedEvent: aGDBStoppedEvent |
331 |
self enqueueDelayedInvalidateInternalList |
|
332 |
||
333 |
"Created: / 01-02-2018 / 23:14:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
334 |
! ! |
|
335 |
||
336 |
!VDBRegisterListApplication methodsFor:'initialization & release'! |
|
337 |
||
338 |
subscribe |
|
241
9996050286c5
Always call `super subscribe` when overriding
Jan Vrany <jan.vrany@labware.com>
parents:
211
diff
changeset
|
339 |
super subscribe. |
110 | 340 |
|
341 |
debugger announcer |
|
241
9996050286c5
Always call `super subscribe` when overriding
Jan Vrany <jan.vrany@labware.com>
parents:
211
diff
changeset
|
342 |
when: GDBStoppedEvent send: #onStoppedEvent: to: self; |
9996050286c5
Always call `super subscribe` when overriding
Jan Vrany <jan.vrany@labware.com>
parents:
211
diff
changeset
|
343 |
when: GDBRegisterValueChangedEvent send: #onRegisterValueChangedEvent: to: self. |
110 | 344 |
|
345 |
"Created: / 01-02-2018 / 23:07:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
241
9996050286c5
Always call `super subscribe` when overriding
Jan Vrany <jan.vrany@labware.com>
parents:
211
diff
changeset
|
346 |
"Modified: / 18-11-2021 / 12:08:45 / Jan Vrany <jan.vrany@labware.com>" |
9996050286c5
Always call `super subscribe` when overriding
Jan Vrany <jan.vrany@labware.com>
parents:
211
diff
changeset
|
347 |
"Modified (comment): / 18-11-2021 / 16:24:43 / Jan Vrany <jan.vrany@labware.com>" |
110 | 348 |
! ! |
349 |
||
350 |
!VDBRegisterListApplication class methodsFor:'documentation'! |
|
351 |
||
352 |
version_HG |
|
353 |
||
354 |
^ '$Changeset: <not expanded> $' |
|
355 |
! ! |
|
356 |