@@ -22,7 +22,7 @@ on FillInData pDataA, pRow
2222 end if
2323
2424 -- Behaviors
25- if pDataA ["behavior scriptlines " ] is empty then
25+ if pDataA ["behavior" ] is empty then
2626 repeat with i = 1 to 10
2727 hide grc ("behaviorScriptLines" & i) of me
2828 end repeat
@@ -31,18 +31,41 @@ on FillInData pDataA, pRow
3131 # check parent behaviors
3232 local tTargetBehavior
3333 local tBehaviorList
34+ local tMissingBehaviorList
35+ local tSkipRepeat
3436
3537 put pDataA ["behavior" ] into tTargetBehavior
36- put tTargetBehavior & cr into tBehaviorList
37- repeat
38- put the behavior of tTargetBehavior into tTargetBehavior
39- if tTargetBehavior <> "" then
40- put tTargetBehavior & cr after tBehaviorList
41- else
42- exit repeat
38+
39+ if tTargetBehavior <> empty then
40+ if exists(tTargetBehavior ) then
41+ put tTargetBehavior & cr into tBehaviorList
42+ put false into tSkipRepeat
43+ else -- ##
44+ put tTargetBehavior & cr into tBehaviorList
45+ put tTargetBehavior & cr after tMissingBehaviorList
46+ put true into tSkipRepeat
4347 end if
44- end repeat
45- delete char - 1 of tBehaviorList -- return
48+ end if
49+
50+ if not tSkipRepeat then
51+ repeat
52+ put the behavior of tTargetBehavior into tTargetBehavior
53+
54+ if tTargetBehavior = empty then
55+ exit repeat
56+ end if
57+
58+ if not (exists(tTargetBehavior )) then -- ##
59+ put tTargetBehavior & cr after tBehaviorList
60+ put tTargetBehavior & cr after tMissingBehaviorList
61+ exit repeat
62+ else
63+ put tTargetBehavior & cr after tBehaviorList
64+ end if
65+ end repeat
66+ end if
67+ delete char - 1 of tBehaviorList -- return
68+ delete char - 1 of tMissingBehaviorList -- return
4669
4770 local tNoOfLInes
4871 local tCounter
@@ -51,6 +74,9 @@ on FillInData pDataA, pRow
5174 put min (the number of lines of tBehaviorList , 10 ) into tNoOfLines
5275 repeat with i = 1 to tNoOfLines
5376 set the toolTip of grc ("behaviorScriptLines" & i) of me to line i of tBehaviorList
77+ if line i of tBehaviorList is among the lines of tMissingBehaviorList then
78+ set the toolTip of grc ("behaviorScriptLines" & i) of me to ("Missing: " & line i of tBehaviorList )
79+ end if
5480 show grc ("behaviorScriptLines" & i) of me
5581 put ("cBehaviorLongID" & i) into tCPName
5682 set the tCPName of me to line i of tBehaviorList
@@ -234,6 +260,7 @@ end dvRowControl
234260
235261setProp dvHilite [pHiliteColor ] pBoolean
236262 # Override basic hilite feature...
263+ local tCPName
237264
238265 if pBoolean then
239266 set the foregroundColor of field "type" of me to revIDEColor("dataView_TextHiliteColor" )
@@ -242,7 +269,12 @@ setProp dvHilite[pHiliteColor] pBoolean
242269 set the backgroundColor of field "scriptLines" of me to revIDEColor("dataView_TextHiliteColor" )
243270 repeat with i = 1 to 10
244271 set the foregroundColor of grc ("behaviorScriptLines" & i) of me to revIDEColor("text_1" )
245- set the backgroundColor of grc ("behaviorScriptLines" & i) of me to revIDEColor("dataView_TextHiliteColor" )
272+ put ("cBehaviorLongID" & i) into tCPName
273+ if exists(the tCPName of me) then
274+ set the backgroundColor of grc ("behaviorScriptLines" & i) of me to revIDEColor("dataView_TextHiliteColor" )
275+ else
276+ set the backgroundColor of grc ("behaviorScriptLines" & i) of me to revIDEColor("dataView_scriptErrorBackgroundColor" )
277+ end if
246278 end repeat
247279 set the colorOverlay["color" ] of button "typeIcon" of me to revIDEColor("dataView_TextHiliteColor" )
248280 set the foregroundColor of me to revIDEColor("dataView_disclosureIconHiliteColor" )
@@ -262,11 +294,12 @@ setProp dvHilite[pHiliteColor] pBoolean
262294 set the backgroundColor of field "scriptLines" of me to revIDEColor("dataView_hiliteColor" )
263295 end if
264296
265- local tCPName
266297 repeat with i = 1 to 10
267298 put ("cBehaviorLongID" & i) into tCPName
268299 if exists(the tCPName of me) and the scriptStatus of the tCPName of me is "error" then
269300 set the backgroundColor of grc ("behaviorScriptLines" & i) of me to revIDEColor("dataView_scriptErrorBackgroundColor" )
301+ else if not (exists(the tCPName of me)) then
302+ set the backgroundColor of grc ("behaviorScriptLines" & i) of me to revIDEColor("dataView_scriptErrorBackgroundColor" )
270303 else
271304 set the backgroundColor of grc ("behaviorScriptLines" & i) of me to revIDEColor("dataView_hiliteColor" )
272305 end if
@@ -284,33 +317,43 @@ on mouseUp
284317 edit the script of the cObjectLongID of me
285318 break
286319 case "behaviorScriptLines1"
320+ checkExistence (the cBehaviorLongID1 of me), 1
287321 edit the script of the cBehaviorLongID1 of me
288322 break
289323 case "behaviorScriptLines2"
324+ checkExistence (the cBehaviorLongID2 of me), 2
290325 edit the script of the cBehaviorLongID2 of me
291326 break
292327 case "behaviorScriptLines3"
328+ checkExistence (the cBehaviorLongID3 of me), 3
293329 edit the script of the cBehaviorLongID3 of me
294330 break
295331 case "behaviorScriptLines4"
332+ checkExistence (the cBehaviorLongID4 of me), 4
296333 edit the script of the cBehaviorLongID4 of me
297334 break
298335 case "behaviorScriptLines5"
336+ checkExistence (the cBehaviorLongID5 of me), 5
299337 edit the script of the cBehaviorLongID5 of me
300338 break
301339 case "behaviorScriptLines6"
340+ checkExistence (the cBehaviorLongID6 of me), 6
302341 edit the script of the cBehaviorLongID6 of me
303342 break
304343 case "behaviorScriptLines7"
344+ checkExistence (the cBehaviorLongID7 of me), 7
305345 edit the script of the cBehaviorLongID7 of me
306346 break
307347 case "behaviorScriptLines8"
348+ checkExistence (the cBehaviorLongID8 of me), 8
308349 edit the script of the cBehaviorLongID8 of me
309350 break
310351 case "behaviorScriptLines9"
352+ checkExistence (the cBehaviorLongID9 of me), 9
311353 edit the script of the cBehaviorLongID9 of me
312354 break
313355 case "behaviorScriptLines10"
356+ checkExistence (the cBehaviorLongID10 of me), 10
314357 edit the script of the cBehaviorLongID10 of me
315358 break
316359 case "icon"
@@ -332,6 +375,17 @@ on mouseDoubleUp
332375 goToObject the cObjectLongID of me
333376end mouseDoubleUp
334377
378+ command checkExistence pLongID, pOrdinal
379+ local tGraphic
380+ if exists(pLongID ) then
381+ return empty
382+ else
383+ put ("behaviorScriptLines" & pOrdinal ) into tGraphic
384+ answer the toolTip of grc tGraphic of me
385+ exit to top
386+ end if
387+ end checkExistence
388+
335389on CloseFieldEditor pFieldEditor, pRow, pKey, pClosingTriggeredBy
336390 # The text the user entered is different than the current value of the target field.
337391 if word 1 of the cObjectLongID of me is "stack" and \
0 commit comments