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

Commit ded7c11

Browse files
Merge pull request #1598 from livecode/bugfix-19710
[[ Bug 19710 ]] Fix a few variants of message box intelligence
2 parents e694416 + 86c9647 commit ded7c11

2 files changed

Lines changed: 29 additions & 3 deletions

File tree

Toolset/libraries/revidelibrary.8.livecodescript

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11198,8 +11198,12 @@ command ideExecuteScript pScript, pObject, pDebugMode, @rValidScript
1119811198

1119911199
if pObject is empty then
1120011200
put the long id of this card of the defaultStack into pObject
11201-
else if word 1 of pObject is "stack" then
11202-
set the defaultStack to the short name of pObject
11201+
else
11202+
set the defaultStack to the short name of ideStackOfObject(pObject)
11203+
end if
11204+
11205+
-- Need to target 'this card' if a stack is selected
11206+
if word 1 of pObject is "stack" then
1120311207
put the long id of this card of pObject into pObject
1120411208
end if
1120511209

tests/messagebox/execution.livecodescript

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ on TestIntelligenceObjectPropertyCompleted
262262

263263
local tValidScript
264264
ideExecuteScript "width", tButton, false, tValidScript
265-
TestAssert "intelligence object property autocomplete result", the result is empty
265+
TestAssert "intelligence object property autocomplete result", msg is the width of tButton
266266
TestAssert "intelligence object property autocomplete executed", tValidScript is "put the width of" && tButtonName
267267
end TestIntelligenceObjectPropertyCompleted
268268

@@ -304,3 +304,25 @@ on TestIntelligenceObjectCommandWithTwoParams
304304
TestAssert "intelligence object command two params result", msg is 2
305305
TestAssert "intelligence object command two params executed", tValidScript is tToExecute
306306
end TestIntelligenceObjectCommandWithTwoParams
307+
308+
on TestReferenceControlOnActiveStack
309+
local tStack, tField
310+
create stack
311+
put it into tStack
312+
313+
set the defaultStack to the short name of tStack
314+
315+
create field
316+
put it into tField
317+
318+
-- change the default stack
319+
create stack
320+
set the defaultStack to the short name of it
321+
322+
local tToExecute
323+
put "put bar into field 1" into tToExecute
324+
ideExecuteScript tToExecute, tStack, false, tValidScript
325+
326+
TestAssert "intelligence object command two params result", the text of tField is "bar"
327+
TestAssert "intelligence object command two params executed", tValidScript is tToExecute
328+
end TestReferenceControlOnActiveStack

0 commit comments

Comments
 (0)