Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 3d078e1

Browse files
committed
Merge remote-tracking branch 'origin/develop-9.0' into merge-develop-9.0-02.05.2019
2 parents ada53d3 + 701f0ef commit 3d078e1

13 files changed

+595
-62
lines changed

Toolset/palettes/behaviors/revinspectorbehavior.livecodescript

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,19 @@ private function inspectorCalculateLayout pGroupList, pLeft, pTop, pRowWidth, pS
176176
return tInspectorHeight
177177
end inspectorCalculateLayout
178178

179-
local sManualHeight
179+
local sManualHeightOfStack, sNewHeight, sOldHeight
180180
on inspectorLayoutGroups pGroupList, pForceHeight
181+
182+
# store height of stack when manually resizing
183+
if pForceHeight is not true and the mouse is "down" and sNewHeight is not sOldHeight then
184+
put the height of this stack into sManualHeightOfStack
185+
end if
186+
187+
# reset sManualHeightOfStack to empty if inspector was closed
188+
if not the visible of me then
189+
put empty into sManualHeightOfStack
190+
end if
191+
181192
lock screen
182193
# Get the margin, padding
183194
local tMargin, tPadding
@@ -277,33 +288,66 @@ on inspectorLayoutGroups pGroupList, pForceHeight
277288
set the maxheight of me to tStackHeight
278289
end if
279290

280-
if pForceHeight and not sManualHeight then
281-
-- Make stack smaller rather than go offscreen
282-
local tScreenRect
283-
put revIDEStackScreenRect(the long id of me, true) into tScreenRect
284-
set the height of me to min(tStackHeight, item 4 of tScreenRect - tStackTop)
291+
# reset manualHeight if user expands a non-expandable tab to full height
292+
if not pForceHeight and not tCanExpand and sManualHeightOfStack is tStackHeight then
293+
put empty into sManualHeightOfStack
294+
end if
295+
296+
-- Make stack smaller rather than go offscreen
297+
local tScreenRect, tNewStackHeight
298+
put revIDEStackScreenRect(the long id of me, true) into tScreenRect
299+
300+
if sManualHeightOfStack is not empty then
301+
put min(sManualHeightOfStack, tStackHeight) into tNewStackHeight
302+
set the height of this stack to min(tNewStackHeight, item 4 of tScreenRect - tStackTop)
303+
else
304+
set the height of this stack to min(tStackHeight, item 4 of tScreenRect - tStackTop)
285305
end if
286306
set the left of me to tStackLeft
287307
set the top of me to tStackTop
288308

309+
local tvScrollIsOn, tvScrollChanged
310+
put false into tvScrollChanged
311+
289312
if there is a group "inspector" of me then
290-
if the height of me < tStackHeight then
291-
put true into sManualHeight
313+
put the vScrollbar of group "inspector" of me into tvScrollIsOn
314+
if the height of me < tStackHeight - tMargin then
292315
set the vscrollbar of group "inspector" of me to true
316+
if not tvScrollIsOn then
317+
put true into tvScrollChanged
318+
end if
293319
else
294-
put false into sManualHeight
295320
set the vscrollbar of group "inspector" of me to false
321+
if tvScrollIsOn then
322+
put true into tvScrollChanged
323+
end if
296324
end if
325+
297326
set the rect of group "inspector" of me to \
298327
item 1 of tContentRect, \
299328
item 2 of tContentRect, \
300329
the right of this card of me, \
301330
the bottom of this card of me - tMargin
302331
end if
303332
unlock messages
333+
334+
# adapt right size of controls to vScrollbar on and off
335+
if tvScrollChanged then resizeInspector
336+
304337
unlock screen
305338
end inspectorLayoutGroups
306339

340+
before resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight
341+
put pNewHeight into sNewHeight
342+
put pOldHeight into sOldHeight
343+
pass resizeStack
344+
end resizeStack
345+
346+
function getManualHeight
347+
return sManualHeightOfStack
348+
end getManualHeight
349+
350+
307351
local sSelectedSection, sSelectedSectionIndex
308352
private on inspectorSectionSet pSection
309353
if sDataA is empty then

Toolset/palettes/inspector/editors/com.livecode.pi.customprops.behavior.livecodescript

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
script "com.livecode.pi.customprops.behavior"
22
local sPropSet, sHilitePath
3+
constant kWidgetHeight = 150
34

45
on editorInitialize
56
put empty into sPropSet
@@ -113,8 +114,12 @@ on editorResize
113114
send "groupResize kLabelSize, kControlGap" to group "Set buttons" of me
114115

115116
# Use all space not taken by other elements for main array display
116-
local tWidgetHeight
117-
put the height of me - (4 * kControlGap + kLabelFieldHeight + kKeyFieldHeight + kValueFieldHeight + kSetButtonsHeight) into tWidgetHeight
117+
local tWidgetHeight, tValueHeight
118+
put kWidgetHeight into tWidgetHeight
119+
put max (the height of this card - ( 12 * kControlGap + kLabelFieldHeight \
120+
+ kKeyFieldHeight + kValueFieldHeight + kSetButtonsHeight \
121+
+ tWidgetHeight), kValueFieldHeight) into tValueHeight
122+
118123
set the height of widget 1 of me to tWidgetHeight
119124
set the width of widget 1 of me to the width of me
120125
set the left of widget 1 of me to the left of me
@@ -136,7 +141,7 @@ on editorResize
136141
set the left of field "value label" of me to the left of me
137142

138143
set the width of field "value" of me to the width of me - kLabelSize - kControlGap
139-
set the height of field "value" of me to kValueFieldHeight
144+
set the height of field "value" of me to kValueFieldHeight + tValueHeight
140145
set the top of field "value" of me to the bottom of field "key" of me + kControlGap
141146
set the left of field "value" of me to the right of field "value label" of me + kControlGap
142147

Toolset/palettes/inspector/editors/com.livecode.pi.stackfiles.behavior.livecodescript

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ on editorResize
4141
local tRect, tFieldRect
4242
put the rect of me into tRect
4343

44+
local tManualHeight, tManualGroupHeight
45+
put getManualHeight() into tManualHeight
46+
if tManualHeight is not empty then
47+
put tManualHeight - the height of group "background" - kControlGap - 2 into tManualGroupHeight
48+
set the height of me to tManualGroupHeight
49+
set the height of the owner of me to tManualGroupHeight
50+
end if
51+
4452
put tRect into tFieldRect
4553
put item 2 of tFieldRect + kButtonHeight + kColumnHeaderHeight + kControlGap into item 2 of tFieldRect
4654
set the effective rect of field "stackFilesField" of me to tFieldRect

Toolset/palettes/inspector/editors/com.livecode.pi.textcontents.behavior.livecodescript

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,28 @@ constant kMaxHeight = 800
4545
on editorResize
4646
lock screen
4747
lock messages
48+
local tManualHeight, tManualGroupHeight
49+
put getManualHeight() into tManualHeight
50+
if tManualHeight is not empty then
51+
put tManualHeight - the height of group "controls" of me - kControlGap - 1 - the height of group "background" into tManualGroupHeight
52+
set the height of me to tManualGroupHeight
53+
set the height of the owner of me to tManualGroupHeight
54+
end if
55+
4856
set the topleft of field "rowlabel" of me to the topleft of me
4957
set the topright of group "controls" of me to the topright of me
5058
local tRect
5159
put the effective rect of me into tRect
5260
put item 2 of tRect + the height of group "controls" of me + kControlGap into item 2 of tRect
5361

5462
local tHeight
55-
put the formattedHeight of field "htmltext" of me into tHeight
56-
put max(tHeight, item 4 of tRect - item 2 of tRect) into tHeight
63+
if tManualHeight is not empty then
64+
put tManualGroupHeight - kControlGap into tHeight
65+
else
66+
put the formattedHeight of field "htmltext" of me into tHeight
67+
put max(tHeight, item 4 of tRect - item 2 of tRect) into tHeight
68+
end if
69+
5770
put min(tHeight, kMaxHeight) into tHeight
5871
put item 2 of tRect + tHeight into item 4 of tRect
5972
set the rect of field "htmltext" of me to tRect

Toolset/palettes/project browser/behaviors/revideprojectbrowsercontainerrowbehavior.livecodescript

Lines changed: 66 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

235261
setProp 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
333376
end 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+
335389
on 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

Comments
 (0)