From fffc0a6b0460b1ca08ce252d1133b007c887c555 Mon Sep 17 00:00:00 2001 From: Alex Brisan Date: Mon, 5 Feb 2018 14:57:39 +0000 Subject: [PATCH 0001/1134] [[ Bugfix 20951 ]] Fixed bug causing garbage at end of repeat to be ignored --- docs/notes/bugfix-20951.md | 1 + engine/src/keywords.cpp | 20 +++++++++---- tests/lcs/parser/repeat.parsertest | 46 ++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 6 deletions(-) create mode 100644 docs/notes/bugfix-20951.md create mode 100644 tests/lcs/parser/repeat.parsertest diff --git a/docs/notes/bugfix-20951.md b/docs/notes/bugfix-20951.md new file mode 100644 index 00000000000..b361920edec --- /dev/null +++ b/docs/notes/bugfix-20951.md @@ -0,0 +1 @@ +# Fix bug ignoring garbage values at end of repeat line diff --git a/engine/src/keywords.cpp b/engine/src/keywords.cpp index 2470f40b9ee..f95d1c24815 100644 --- a/engine/src/keywords.cpp +++ b/engine/src/keywords.cpp @@ -703,12 +703,20 @@ Parse_stat MCRepeat::parse(MCScriptPoint &sp) return PS_ERROR; } if (sp.skip_token(SP_REPEAT, TT_UNDEFINED, RF_STEP) == PS_NORMAL) - if (sp.parseexp(False, True, &step) != PS_NORMAL) - { - MCperror->add - (PE_REPEAT_BADWITHSTARTEXP, sp); - return PS_ERROR; - } + { + if (sp.parseexp(False, True, &step) != PS_NORMAL) + { + MCperror->add + (PE_REPEAT_BADWITHSTARTEXP, sp); + return PS_ERROR; + } + } + else if (sp.next(type) != PS_EOL) + { + MCperror -> add + (PE_REPEAT_BADCOND, sp); + return PS_ERROR; + } break; default: /* repeat form */ fprintf(stderr, "Repeat: ERROR bad control form\n"); diff --git a/tests/lcs/parser/repeat.parsertest b/tests/lcs/parser/repeat.parsertest new file mode 100644 index 00000000000..a4416dece9f --- /dev/null +++ b/tests/lcs/parser/repeat.parsertest @@ -0,0 +1,46 @@ +%% Copyright (C) 2016 LiveCode Ltd. +%% +%% This file is part of LiveCode. +%% +%% LiveCode is free software; you can redistribute it and/or modify it under +%% the terms of the GNU General Public License v3 as published by the Free +%% Software Foundation. +%% +%% LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY +%% WARRANTY; without even the implied warranty of MERCHANTABILITY or +%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +%% for more details. +%% +%% You should have received a copy of the GNU General Public License +%% along with LiveCode. If not see . + +%% REPEAT WITH no step +%TEST RepeatWithNoStep +on mouseUp + repeat with i = 1 to 10 + end repeat +end mouseUp +%EXPECT PASS +%SUCCESS +%ENDTEST + +%% Repeat With step +%TEST RepeatWithCorrectStep +on mouseUp + repeat with i = 1 to 10 step 1 + end repeat +end mouseUp +%EXPECT PASS +%SUCCESS +%ENDTEST + +%% Repeat with step should fail +%TEST RepeatWithIncorrectStep +on mouseUp + repeat with i = 1 to 10 %{AFTER_ENDVALUE} by 10 + end repeat +end mouseUp +%EXPECT PASS +%ERROR PE_REPEAT_BADCOND AT AFTER_ENDVALUE +%ENDTEST + From a9ad5d2f01c001b2b41be8102d86e2511e35ea7f Mon Sep 17 00:00:00 2001 From: Alex Brisan Date: Mon, 12 Feb 2018 11:04:57 +0000 Subject: [PATCH 0002/1134] [[ Bug 20951 ]] Fixed IDE file --- .../drawing/drawing.livecodescript | 70 ++++++++++--------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/extensions/script-libraries/drawing/drawing.livecodescript b/extensions/script-libraries/drawing/drawing.livecodescript index 7b7b2d3cb89..743a9f67f3b 100644 --- a/extensions/script-libraries/drawing/drawing.livecodescript +++ b/extensions/script-libraries/drawing/drawing.livecodescript @@ -20,16 +20,16 @@ on extensionInitialize if the target is not me then pass extensionInitialize end if - + insert the script of me into back - + if the environment contains "development" then set the _ideoverride of me to true local tName put the short name of me into tName - revSBAddDependencyForInclusion "extensions", tName, "externals", "XML" + revSBAddDependencyForInclusion "extensions", tName, "externals", "XML" end if - + svgSpecLoad end extensionInitialize @@ -37,7 +37,7 @@ on extensionFinalize if the target is not me then pass extensionFinalize end if - + remove the script of me from back end extensionFinalize @@ -539,7 +539,7 @@ private command _svgFlatten @xContext, @xElement end if end if end if - + /* Now all the processing for this element has been done, we process each * child, in order. */ if xElement["content"] is an array then @@ -809,7 +809,7 @@ private command _svgCompileTransform @xContext, pTransform, pBBox, @rCompiledTra _InternalError format("unknown transform '%s'", tTransform[1]) break end switch - put _svgTransformConcat(tMatrix, tNextMatrix) into tMatrix + put _svgTransformConcat(tMatrix, tNextMatrix) into tMatrix end repeat put empty into rCompiledTransform if not _svgTransformIsIdentity(tMatrix) then @@ -1006,7 +1006,7 @@ private command _svgCompileResolveGradient @xContext, pElement, @rGradient if the number of elements in tColors > 0 then put tColors into rGradient["colors"] put tOffsets into rGradient["offsets"] - end if + end if end if end _svgCompileResolveGradient @@ -1064,7 +1064,7 @@ private command _svgCompileSvg @xContext, pElement else if tPreserveAspectRatio contains "yMax" then add (tHeight - tViewBox[4] * tVScaleY) to tVTranslateY end if - + local tViewportMatrix put _svgTransformTranslate(tVTranslateX, tVTranslateY) into tViewportMatrix put _svgTransformConcat(tViewportMatrix, _svgTransformScale(tVScaleX, tVScaleY)) into tViewportMatrix @@ -1167,7 +1167,7 @@ private command _svgCompileShape @xContext, pType, pBBox if param(4) is an array then put param(4) into tOperation[2] else - repeat with tIndex = 4 to paramCount() + repeat with tIndex = 4 to the paramCount put param(tIndex) into tOperation[2][tIndex - 3] end repeat end if @@ -1240,8 +1240,10 @@ private function _svgBoxPoints pPoints put pPoints[1] into tRight put pPoints[2] into tTop put pPoints[2] into tBottom - repeat with i = 1 to the number of elements in pPoints by 2 - if pPoints[i] < tLeft then + local tNumberPoints + put the number of elements in pPoints into tNumberPoints + repeat with i = 1 to tNumberPoints step 2 + if pPoints[i] < tLeft then put pPoints[i] into tLeft else if pPoints[i] > tRight then put pPoints[i] into tRight @@ -2369,7 +2371,7 @@ private function _svgParseTransformValue @xValue local tArity put the number of elements in tValues into tArity - + switch tType case "matrix" if tArity is not 6 then @@ -2888,10 +2890,10 @@ private command svgSpecLoad /* Record the name of the new element. */ put word 2 of tLine into tCurrentElement["name"] - + next repeat end if - + /* The 'property' and 'attribute' lines have the same format and define * a feature. */ if tLineType is "property" or tLineType is "attribute" then @@ -2901,7 +2903,7 @@ private command svgSpecLoad _svgSpecError tCurrentRow, "no current element" next repeat end if - + /* Properties must only be defined against the element with no * name. */ if tLineType is "property" and \ @@ -2980,7 +2982,7 @@ private command svgSpecLoad /* Add the feature to the current element's feature map. */ put tFeature into tCurrentElement[tLineType][tFeature["name"]] - + next repeat end if @@ -3002,7 +3004,7 @@ private command svgSpecLoad /* For named elements, the property array is a set of applicable * properties. */ put true into tCurrentElement["property"][word 2 of tLine] - + next repeat end if @@ -3128,53 +3130,53 @@ end _svgSpecError */ private function xmlImportFromFile pXMLFile local tArray - + local tTreeId put revCreateXMLTreeFromFileWithNamespaces(pXMLFile, true, true, false) into tTreeId - + if tTreeId begins with "xmlerr," then throw tTreeId end if - + try local tRootNode put revXMLRootNode(tTreeId) into tRootNode if tRootNode begins with "xmlerr," then throw tRootNode end if - + put _xmlImportNode(tTreeId, revXMLRootNode(tTreeId)) into tArray - + finally revDeleteXMLTree tTreeId end try - + return tArray end xmlImportFromFile private function xmlImportFromText pXMLText local tArray - + local tTreeId put revCreateXMLTreeWithNamespaces(pXMLText, true, true, false) into tTreeId - + if tTreeId begins with "xmlerr," then throw tTreeId end if - + try local tRootNode put revXMLRootNode(tTreeId) into tRootNode if tRootNode begins with "xmlerr," then throw tRootNode end if - + put _xmlImportNode(tTreeId, revXMLRootNode(tTreeId)) into tArray - + finally revDeleteXMLTree tTreeId end try - + return tArray end xmlImportFromText @@ -3197,7 +3199,7 @@ private function _xmlImportNode pTreeId, pNode /* Extract the node type and index from the pNode path */ local tArray _xmlImportNodeTypeAndIndex pNode, tArray["type"], tArray["index"] - + -- First extract the attributes, these go into an 'attribute' field -- as an array mapping attribute name to value local tAttributes @@ -3207,14 +3209,14 @@ private function _xmlImportNode pTreeId, pNode end if split tAttributes by return and "=" put tAttributes into tArray["features"] - + -- Get the list of child nodes local tChildNodes put revXMLChildNames(pTreeId, pNode, return, empty, true, true) into tChildNodes if tChildNodes begins with "xmlerr," then throw tChildNodes end if - + /* If the list of child nodes of the element is not empty, then we * recursively import each child node into a sequence; otherwise the node * only contains text (or has no content) which we import as a string. */ @@ -3236,7 +3238,7 @@ private function _xmlImportNode pTreeId, pNode /* The content of the node, whether it be just a string or a sequence of * other nodes is placed in the 'content' key of the resulting node array. */ put tContent into tArray["content"] - + return tArray end _xmlImportNode From d3a907ddb95d0f1039895a9fa6f46bffa173adb3 Mon Sep 17 00:00:00 2001 From: livecodeali Date: Fri, 16 Feb 2018 14:56:49 +0000 Subject: [PATCH 0003/1134] [[ Bug 20269 ]] Add parser test --- tests/lcs/parser/dispatch.parsertest | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/lcs/parser/dispatch.parsertest diff --git a/tests/lcs/parser/dispatch.parsertest b/tests/lcs/parser/dispatch.parsertest new file mode 100644 index 00000000000..f2ae883a618 --- /dev/null +++ b/tests/lcs/parser/dispatch.parsertest @@ -0,0 +1,23 @@ +%% Copyright (C) 2018 LiveCode Ltd. +%% +%% This file is part of LiveCode. +%% +%% LiveCode is free software; you can redistribute it and/or modify it under +%% the terms of the GNU General Public License v3 as published by the Free +%% Software Foundation. +%% +%% LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY +%% WARRANTY; without even the implied warranty of MERCHANTABILITY or +%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +%% for more details. +%% +%% You should have received a copy of the GNU General Public License +%% along with LiveCode. If not see . + +%TEST DispatchCmdWithMissingParams +on dispatch_test + dispatch "something" with %{AFTER_WITH} +end dispatch_test +%EXPECT PASS +%ERROR PE_DISPATCH_BADPARAMS AT AFTER_WITH +%ENDTEST From d27c0735f5e8de4163d7296a1ec350fec90fa460 Mon Sep 17 00:00:00 2001 From: livecodeali Date: Fri, 12 Jan 2018 13:33:32 +0000 Subject: [PATCH 0004/1134] [[ WidgetUtils ]] Use icon library for placeholder icons where possible --- extensions/modules/widget-utils/widget-utils.lcb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/modules/widget-utils/widget-utils.lcb b/extensions/modules/widget-utils/widget-utils.lcb index 30501629a18..2b73e313dfb 100644 --- a/extensions/modules/widget-utils/widget-utils.lcb +++ b/extensions/modules/widget-utils/widget-utils.lcb @@ -23,6 +23,7 @@ module com.livecode.library.widgetutils use com.livecode.canvas use com.livecode.engine +use com.livecode.library.iconsvg metadata version is "1.0.0" metadata author is "LiveCode" @@ -285,7 +286,6 @@ end handler constant kMacPlaceholderSvgIcon is "M14.926,0.656H1.067C0.478,0.656,0,1.137,0,1.73v9.844c0,0.594,0.478,1.074,1.067,1.074h5.316 c0,0-0.934,2.149-3.493,2.149v0.537h1.88h4.568h3.493v-0.537c-2.631,0-3.226-2.149-3.226-2.149h5.32 c0.588,0,1.065-0.48,1.065-1.074V1.73C15.992,1.137,15.514,0.656,14.926,0.656z M7.996,12.427c-0.331,0-0.599-0.268-0.599-0.599 c0-0.33,0.268-0.598,0.599-0.598c0.33,0,0.599,0.268,0.599,0.598C8.594,12.159,8.326,12.427,7.996,12.427z M14.849,10.906H1.143 V1.798H14.85L14.849,10.906L14.849,10.906zM6.824,9.133c0.393-0.016,0.542-0.255,1.017-0.255c0.476,0,0.609,0.255,1.024,0.247 C9.288,9.117,9.556,8.74,9.814,8.363c0.3-0.438,0.423-0.862,0.431-0.883c-0.01-0.005-0.824-0.317-0.833-1.255 c-0.008-0.786,0.642-1.163,0.67-1.182C9.718,4.51,9.149,4.437,8.947,4.429C8.465,4.38,8.005,4.713,7.759,4.713 c-0.244,0-0.623-0.277-1.023-0.27C6.209,4.451,5.724,4.75,5.452,5.221c-0.547,0.95-0.14,2.356,0.393,3.127 C6.105,8.725,6.416,9.148,6.824,9.133z M8.953,2.928c-0.312,0.013-0.689,0.208-0.914,0.47c-0.2,0.233-0.376,0.604-0.329,0.96 c0.349,0.027,0.704-0.177,0.921-0.439C8.847,3.656,8.993,3.292,8.953,2.928z" constant kIosPlaceholderSvgIcon is "M4.621 6.965c0 1.368-.833 2.38-2.262 2.38-1.19 0-2.083-1.012-2.083-2.38 0-1.31.952-2.381 2.202-2.381 1.31 0 2.143 1.071 2.143 2.381zM1.327 78.5V23.78H3.57V78.5H1.327zM78.174 39.512c0 27.588-15.315 40.129-32.079 40.129-17.125 0-30.993-13.565-30.993-38.988C15.102 14.549 29.453.526 47.301.526 64.787.524 78.174 14.318 78.174 39.512zm-60.799.57C17.375 61 27.513 77.25 46.201 77.25c18.818 0 29.611-16.75 29.611-37.406 0-19.155-8.648-36.636-28.382-36.636S17.375 19.667 17.375 40.082zM86.406 72.571c3.763 2.508 10.258 4.93 15.844 4.93 10.602 0 20.031-7.417 20.031-18.334 0-10.131-6.281-15.417-16.945-19.958-9.544-4.064-18.125-8.475-18.125-19.305 0-11.285 8.891-19.267 20.975-19.267 6.498 0 11.4 1.824 13.68 3.42l-.906 1.968c-1.938-1.367-7.176-3.109-12.874-3.109-12.771 0-18.334 9.65-18.334 16.754 0 9.812 7.606 13.093 17.41 17.767 11.399 5.585 17.44 10.51 17.44 21.227 0 11.514-8.207 20.86-22.799 20.86-6.043 0-12.996-2.051-16.416-4.674l1.019-2.279z" -constant kAndroidPlaceholderSvgIcon is "M493 615Q509 615 520.5 603.5 532 592 532 576 532 560 520.5 548.5 509 537 493 537 477 537 466 548.5 455 560 455 576 455 592 466 603.5 477 615 493 615ZM915 615Q931 615 942 603.5 953 592 953 576 953 560 942 548.5 931 537 915 537 899 537 887.5 548.5 876 560 876 576 876 592 887.5 603.5 899 615 915 615ZM103 799Q145 799 175 829 205 859 205 901L205 1331Q205 1374 175.5 1404 146 1434 103 1434 60 1434 30 1404 0 1374 0 1331L0 901Q0 859 30 829 60 799 103 799ZM1163 818L1163 1484Q1163 1530 1131 1562 1099 1594 1054 1594L979 1594 979 1821Q979 1864 949 1894 919 1924 876 1924 833 1924 803 1894 773 1864 773 1821L773 1594 635 1594 635 1821Q635 1864 605 1894 575 1924 532 1924 490 1924 460 1894 430 1864 430 1821L429 1594 355 1594Q309 1594 277 1562 245 1530 245 1484L245 818 1163 818ZM931 413Q1038 468 1102 566.5 1166 665 1166 782L241 782Q241 665 305 566.5 369 468 477 413L406 282Q399 269 411 262 424 256 431 268L503 400Q598 358 704 358 810 358 905 400L977 268Q984 256 997 262 1009 269 1002 282ZM1408 901L1408 1331Q1408 1374 1378 1404 1348 1434 1305 1434 1263 1434 1233 1404 1203 1374 1203 1331L1203 901Q1203 858 1233 828.5 1263 799 1305 799 1348 799 1378 828.5 1408 858 1408 901Z" /** Summary: Returns a placeholder icon for a given operating system @@ -306,7 +306,11 @@ public handler placeholderIcon(in pOS as String) returns String else if pOS is "ios" then return kIosPlaceholderSvgIcon else if pOS is "android" then - return kAndroidPlaceholderSvgIcon + return iconSVGPathFromName("android") + else if pOS is "windows" then + return iconSVGPathFromName("windows") + else if pOS is "linux" then + return iconSVGPathFromName("linux") else throw "no placeholder icon for" && pOS && "operating system" end if From 12b46bebd2bf560796916213ef3e848063d72408 Mon Sep 17 00:00:00 2001 From: livecodeali Date: Wed, 7 Mar 2018 09:48:05 +0000 Subject: [PATCH 0005/1134] [[ WidgetUtils ]] Ensure iconsvg is loaded before widgetutils --- extensions/widgets/androidfield/tests/properties.livecodescript | 1 + extensions/widgets/browser/tests/basic.livecodescript | 1 + extensions/widgets/graph/tests/properties.livecodescript | 2 +- extensions/widgets/header/tests/properties.livecodescript | 2 +- extensions/widgets/mactextfield/tests/properties.livecodescript | 1 + extensions/widgets/navbar/tests/properties.livecodescript | 2 +- extensions/widgets/paletteactions/tests/basic.livecodescript | 2 +- extensions/widgets/svgpath/tests/properties.livecodescript | 2 +- 8 files changed, 8 insertions(+), 5 deletions(-) diff --git a/extensions/widgets/androidfield/tests/properties.livecodescript b/extensions/widgets/androidfield/tests/properties.livecodescript index f0be9e40716..bc0e299d6c3 100644 --- a/extensions/widgets/androidfield/tests/properties.livecodescript +++ b/extensions/widgets/androidfield/tests/properties.livecodescript @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with LiveCode. If not see . */ on TestSetup + TestLoadExtension "com.livecode.library.iconsvg" TestLoadExtension "com.livecode.library.widgetutils" TestLoadExtension "com.livecode.library.scriptitems" TestLoadExtension "com.livecode.widget.native.android.field" diff --git a/extensions/widgets/browser/tests/basic.livecodescript b/extensions/widgets/browser/tests/basic.livecodescript index bf417413014..7001381646c 100644 --- a/extensions/widgets/browser/tests/basic.livecodescript +++ b/extensions/widgets/browser/tests/basic.livecodescript @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with LiveCode. If not see . */ on TestSetup + TestLoadExtension "com.livecode.library.iconsvg" TestLoadExtension "com.livecode.library.widgetutils" TestLoadExtension "com.livecode.widget.browser" end TestSetup diff --git a/extensions/widgets/graph/tests/properties.livecodescript b/extensions/widgets/graph/tests/properties.livecodescript index 61042ec9a28..87a2d23fc5a 100644 --- a/extensions/widgets/graph/tests/properties.livecodescript +++ b/extensions/widgets/graph/tests/properties.livecodescript @@ -26,8 +26,8 @@ private function getGraphData end getGraphData on TestSetup - TestLoadExtension "com.livecode.library.widgetutils" TestLoadExtension "com.livecode.library.iconsvg" + TestLoadExtension "com.livecode.library.widgetutils" TestLoadExtension "com.livecode.widget.linegraph" create stack diff --git a/extensions/widgets/header/tests/properties.livecodescript b/extensions/widgets/header/tests/properties.livecodescript index 6092237f00d..e3d11d8f9e9 100644 --- a/extensions/widgets/header/tests/properties.livecodescript +++ b/extensions/widgets/header/tests/properties.livecodescript @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with LiveCode. If not see . */ on TestSetup - TestLoadExtension "com.livecode.library.widgetutils" TestLoadExtension "com.livecode.library.iconsvg" + TestLoadExtension "com.livecode.library.widgetutils" TestLoadExtension "com.livecode.widget.headerbar" create widget "testHeader" as "com.livecode.widget.headerbar" end TestSetup diff --git a/extensions/widgets/mactextfield/tests/properties.livecodescript b/extensions/widgets/mactextfield/tests/properties.livecodescript index 999cee48740..eed8c600483 100644 --- a/extensions/widgets/mactextfield/tests/properties.livecodescript +++ b/extensions/widgets/mactextfield/tests/properties.livecodescript @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with LiveCode. If not see . */ on TestSetup + TestLoadExtension "com.livecode.library.iconsvg" TestLoadExtension "com.livecode.library.widgetutils" TestLoadExtension "com.livecode.library.scriptitems" TestLoadExtension "com.livecode.widget.native.mac.textfield" diff --git a/extensions/widgets/navbar/tests/properties.livecodescript b/extensions/widgets/navbar/tests/properties.livecodescript index 7571a1956af..2d9473790b2 100644 --- a/extensions/widgets/navbar/tests/properties.livecodescript +++ b/extensions/widgets/navbar/tests/properties.livecodescript @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with LiveCode. If not see . */ on TestSetup - TestLoadExtension "com.livecode.library.widgetutils" TestLoadExtension "com.livecode.library.iconsvg" + TestLoadExtension "com.livecode.library.widgetutils" TestLoadExtension "com.livecode.widget.navbar" create widget "testNavBar" as "com.livecode.widget.navbar" end TestSetup diff --git a/extensions/widgets/paletteactions/tests/basic.livecodescript b/extensions/widgets/paletteactions/tests/basic.livecodescript index 4e9f5ad59b6..8ebe3fc3859 100644 --- a/extensions/widgets/paletteactions/tests/basic.livecodescript +++ b/extensions/widgets/paletteactions/tests/basic.livecodescript @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with LiveCode. If not see . */ on TestSetup - TestLoadExtension "com.livecode.library.widgetutils" TestLoadExtension "com.livecode.library.iconsvg" + TestLoadExtension "com.livecode.library.widgetutils" TestLoadExtension "com.livecode.widget.paletteactions" end TestSetup diff --git a/extensions/widgets/svgpath/tests/properties.livecodescript b/extensions/widgets/svgpath/tests/properties.livecodescript index 47e9cf3fc39..3ea0b87e806 100644 --- a/extensions/widgets/svgpath/tests/properties.livecodescript +++ b/extensions/widgets/svgpath/tests/properties.livecodescript @@ -21,8 +21,8 @@ private function getPathData end getPathData on TestSetup - TestLoadExtension "com.livecode.library.widgetutils" TestLoadExtension "com.livecode.library.iconsvg" + TestLoadExtension "com.livecode.library.widgetutils" TestLoadExtension "com.livecode.widget.svgpath" create widget "testSvgPath" as "com.livecode.widget.svgpath" end TestSetup From e68c037f4879989ba30652096c7820a8eafc37ce Mon Sep 17 00:00:00 2001 From: livecodeali Date: Wed, 7 Mar 2018 10:30:22 +0000 Subject: [PATCH 0006/1134] [[ WidgetUtils ]] Ensure emscripten widgets can use html5 placeholder icon --- .../modules/widget-utils/widget-utils.lcb | 4 +- .../widgets/html5button/html5button.lcb | 51 ++----------------- 2 files changed, 6 insertions(+), 49 deletions(-) diff --git a/extensions/modules/widget-utils/widget-utils.lcb b/extensions/modules/widget-utils/widget-utils.lcb index 2b73e313dfb..e4d1c00daeb 100644 --- a/extensions/modules/widget-utils/widget-utils.lcb +++ b/extensions/modules/widget-utils/widget-utils.lcb @@ -310,7 +310,9 @@ public handler placeholderIcon(in pOS as String) returns String else if pOS is "windows" then return iconSVGPathFromName("windows") else if pOS is "linux" then - return iconSVGPathFromName("linux") + return iconSVGPathFromName("linux") + else if pOS is "emscripten" then + return iconSVGPathFromName("html5") else throw "no placeholder icon for" && pOS && "operating system" end if diff --git a/extensions/widgets/html5button/html5button.lcb b/extensions/widgets/html5button/html5button.lcb index 1db3010540e..9d1f8e88cbf 100644 --- a/extensions/widgets/html5button/html5button.lcb +++ b/extensions/widgets/html5button/html5button.lcb @@ -26,6 +26,7 @@ use com.livecode.emscripten use com.livecode.widget use com.livecode.canvas use com.livecode.engine +use com.livecode.library.widgetutils metadata version is "1.0.0" metadata author is "LiveCode" @@ -124,53 +125,6 @@ private handler OnJSClick(pEvent as JSObject) returns nothing SetLabel("Clicked!") end handler -private handler expandRectangle(in pRect as Rectangle, in pExp as Number) returns Rectangle - return rectangle [ the left of pRect - pExp, the top of pRect - pExp, the right of pRect + pExp, the bottom of pRect + pExp] -end handler - -constant kBorderWidth is 5 -private handler paintPlaceholderLabel(in pCanvas as Canvas, in pBounds as Rectangle, \ - in pLabel as String, in pFont as optional Font, in pColor as optional Color) - save state of pCanvas - - // Draw the border - variable tFillPaint as Paint - variable tStrokePaint as Paint - put solid paint with color [0.875, 0.875, 0.875] into tFillPaint - put solid paint with color [0.75, 0.75, 0.75] into tStrokePaint - - set the paint of pCanvas to tFillPaint - fill rectangle path of pBounds on this canvas - set the paint of this canvas to tStrokePaint - set the stroke width of this canvas to kBorderWidth - set the join style of this canvas to "bevel" - stroke rectangle path of expandRectangle(pBounds, -kBorderWidth / 2) on this canvas - - // Draw the control name - put solid paint with color [1, 1, 1] into tFillPaint - - if pFont is nothing then - put font "Arial" at size 14 into pFont - end if - - if pColor is nothing then - put color [0.25, 0.25, 0.25] into pColor - end if - put solid paint with pColor into tStrokePaint - - variable tTextBounds as Rectangle - put the image bounds of text pLabel on pCanvas into tTextBounds - - translate pCanvas by [ the width of pBounds / 2, the height of pBounds / 2] - translate pCanvas by [ -(the width of tTextBounds / 2), the height of tTextBounds / 2] - set the paint of pCanvas to tFillPaint - fill rounded rectangle path of expandRectangle(tTextBounds, kBorderWidth) with radius 5 on pCanvas - set the paint of pCanvas to tStrokePaint - fill text pLabel at point [0, 0] on pCanvas - - restore state of pCanvas -end handler - public handler OnPaint() if IsHTML5() then return @@ -183,7 +137,8 @@ public handler OnPaint() put mLabel into tLabel end if - paintPlaceholderLabel(this canvas, my bounds, tLabel, my font, color [0,0,0]) + paintPlaceholderImage(this canvas, my bounds, \ + placeholderIcon("emscripten"), tLabel, my font, nothing) end handler public handler SetLabel(in pLabel as String) From 71eedb644330b39d6af7bc7bff4e736c0f97085a Mon Sep 17 00:00:00 2001 From: Brian Milby Date: Sat, 10 Mar 2018 22:52:06 -0600 Subject: [PATCH 0007/1134] LCG Demo - Add Navigation Bar option to highlight none of the icons `set the hilitedItem of widget to 0` will disable the highlight The selected item index allowed minimum was changed to 0 If the hilitedItem is 0, then an empty string will be returned for the name. --- extensions/widgets/navbar/navbar.lcb | 16 +++++++++++----- extensions/widgets/navbar/notes/lcg-demo.md | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 extensions/widgets/navbar/notes/lcg-demo.md diff --git a/extensions/widgets/navbar/navbar.lcb b/extensions/widgets/navbar/navbar.lcb index 2cd9a7d446e..87e733ca196 100644 --- a/extensions/widgets/navbar/navbar.lcb +++ b/extensions/widgets/navbar/navbar.lcb @@ -356,6 +356,8 @@ Description: The is the item number of the currently-highlighted navigation item, starting from 1. It can be used as a key into the . +Setting 0 will cause nothing to be highlighted. + Related: hilitedItemName (property) References: itemArray(property) @@ -365,7 +367,7 @@ metadata hilitedItem.editor is "com.livecode.pi.integer" metadata hilitedItem.default is "1" metadata hilitedItem.label is "Selected item index" metadata hilitedItem.step is "1" -metadata hilitedItem.min is "1" +metadata hilitedItem.min is "0" /** Syntax: set the hilitedItemName of to @@ -1249,7 +1251,7 @@ end handler public handler setNavSelectedItem(in pSelectedItem as Integer) returns nothing if pSelectedItem is not mSelectedItem and \ - pSelectedItem > 0 and \ + pSelectedItem >= 0 and \ pSelectedItem <= the number of elements in mNavData then put pSelectedItem into mSelectedItem post "hiliteChanged" @@ -1260,10 +1262,10 @@ end handler public handler setNavSelectedItemName(in pName as String) returns nothing variable tCount as Integer variable tItem as Array - + -- Find the item index corresponding to pName and set it as the -- currently-highlighted item. - + repeat with tCount from 1 up to the number of elements in mNavData put mNavData[tCount] into tItem if tItem["name"] is pName then @@ -1275,7 +1277,11 @@ public handler setNavSelectedItemName(in pName as String) returns nothing end handler public handler getNavSelectedItemName() returns String - return mNavData[mSelectedItem]["name"] + if mSelectedItem = 0 then + return "" + else + return mNavData[mSelectedItem]["name"] + end if end handler public handler setItemStyle(in pItemStyle as String) returns nothing diff --git a/extensions/widgets/navbar/notes/lcg-demo.md b/extensions/widgets/navbar/notes/lcg-demo.md new file mode 100644 index 00000000000..55433b10c19 --- /dev/null +++ b/extensions/widgets/navbar/notes/lcg-demo.md @@ -0,0 +1 @@ +#LCG Demo - Add Navigation Bar option to highlight none of the icons From aa9649b5440ed2345bffd6d12d01e74120ecbeec Mon Sep 17 00:00:00 2001 From: Brian Milby Date: Thu, 19 Apr 2018 21:58:11 -0500 Subject: [PATCH 0008/1134] [[ Navigation Bar ]] Add option to highlight none of the icons Update documentation references for the new 0 option to have nothing highlighted. Add ability to set the selected icon name to "" to make nothing highlight. Updated documentation to indicate that custom icons are possible (reference Icon SVG Library). Renamed note and expanded to document potential backward compatibility issue (a call to `getNavSelectedItemName` in a previous version of the widget with nothing selected will throw an error). --- extensions/widgets/navbar/navbar.lcb | 30 ++++++++++++------- .../navbar/notes/feature-nohighlight.md | 18 +++++++++++ extensions/widgets/navbar/notes/lcg-demo.md | 1 - 3 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 extensions/widgets/navbar/notes/feature-nohighlight.md delete mode 100644 extensions/widgets/navbar/notes/lcg-demo.md diff --git a/extensions/widgets/navbar/navbar.lcb b/extensions/widgets/navbar/navbar.lcb index 87e733ca196..016de180eb0 100644 --- a/extensions/widgets/navbar/navbar.lcb +++ b/extensions/widgets/navbar/navbar.lcb @@ -25,7 +25,7 @@ The widget displays a row of navigation items. Each of these has a , or both. All of the navigation item data is available as a single array via the property. -At any time, one of the navigation items may be +At any time, zero or one of the navigation items may be . This is useful, for example, for indicating the current card. When the user clicks one of the navigation items, the widget sends a message. @@ -117,7 +117,7 @@ use com.livecode.library.widgetutils -- adding metadata to ensure the extension displays correctly in livecode metadata author is "LiveCode" -metadata version is "2.0.0" +metadata version is "2.1.0" metadata title is "Navigation Bar" metadata preferredSize is "320,49" metadata svgicon is "M0,0v29.5h80.2V0H0z M21.1,21.5c-0.2-0.1-0.4-0.2-0.4-0.2c-0.5-0.2-0.9-0.3-1.4-0.4c-0.7-0.1-0.9-0.4-0.9-1.1c0-0.1-0.1-0.9,0-1c0.4-0.2,0.5-0.9,0.5-1.3c0-0.3,0.2-0.5,0.3-0.7c0.2-0.3,0.2-0.6,0.3-0.9c0.1-0.2,0.2-0.6,0.1-0.8c0-0.2-0.2-0.4-0.2-0.6c0-0.3,0.1-0.6,0.1-0.9c0-0.5,0-0.9,0-1.4c-0.2-1.2-1.4-1.6-2.5-1.9c-1-0.2-2.2,0.3-2.9,1c-0.3,0.3-0.6,0.7-0.7,1.1c-0.1,0.4,0,0.9,0,1.2c0,0.2,0,0.4,0.1,0.6c0,0.2,0.1,0.3,0.1,0.5c0,0.1-0.1,0.2-0.1,0.3c-0.2,0.4,0,1,0.2,1.4c0.1,0.2,0.2,0.4,0.3,0.5c0.2,0.2,0.2,0.3,0.2,0.6c0,0.4,0.1,1.2,0.6,1.4c0.1,0.1,0,0.8-0.1,0.9c0,0.7,0,1-0.6,1.1c-0.5,0.1-0.9,0.2-1.4,0.4c-0.2,0.1-0.4,0.2-0.7,0.3c-2-1.4-3.4-3.8-3.4-6.4c0-4.3,3.5-7.8,7.8-7.8s7.8,3.5,7.8,7.8C24.3,17.8,23,20.1,21.1,21.5z M45.1,22.7l-4.9-3.6v-0.7l0.2,0.2l3.6,2.6L42.6,17l-0.1-0.4l0.3-0.3l3.4-2.5H42h-0.4l-0.1-0.4l-1.4-4.2l-1.4,4.2l-0.1,0.4h-0.4h-4.3l3.4,2.5l0.3,0.3L37.5,17l-1.4,4.2l3.6-2.6l0.2-0.2v0.7L35,22.7l1.9-5.9l-4.9-3.6h6.1l1.9-5.9l1.9,5.9h6.1l-4.9,3.6L45.1,22.7z M71.1,23.1l-4.9-4.9c-1,0.9-2.4,1.4-3.9,1.5V19c3-0.1,5.4-2.5,5.4-5.5c0-3.1-2.5-5.5-5.5-5.5c-3.1,0-5.5,2.5-5.5,5.5c0,3,2.4,5.4,5.4,5.5v0.7c-3.4-0.1-6-2.8-6-6.2c0-3.4,2.8-6.2,6.2-6.2c3.4,0,6.2,2.8,6.2,6.2c0,1.5-0.6,2.9-1.5,4l4.9,4.9L71.1,23.1z" @@ -241,9 +241,11 @@ Description: The names of the icons displayed by the navigation items when not highlighted. -Each icon name must be one of the predefined graphics provided by the "IconSVG" +Each icon name must be one of the graphics supplied by the "IconSVG" library. You can get a list of available predefined path names by running -`put iconNames()` in the Message Box. +`put iconNames()` in the Message Box. See the + +documentation for handlers to manage user icon families. Setting the can add items to the navigation bar. If the new value of the has more items than the navigation bar, @@ -256,7 +258,7 @@ navigation bar, the remaining navigation items have their icons reset to the default icon. References: hilitedItemIcons(property), itemLabels(property), -itemNames(property) +itemNames(property), com.livecode.library.iconsvg (library) */ property itemIcons get getNavIcons set setNavIcons @@ -273,9 +275,11 @@ Description: The names of the icons displayed by the navigation items when highlighted. -Each icon name must be one of the predefined graphics provided by the "IconSVG" +Each icon name must be one of the graphics supplied by the "IconSVG" library. You can get a list of available predefined path names by running -`put iconNames()` in the Message Box. +`put iconNames()` in the Message Box. See the + +documentation for handlers to manage user icon families. Setting the can add items to the navigation bar. If the new value of the has more items than the @@ -287,7 +291,8 @@ If the new value of the has fewer items than the navigation bar, the remaining navigation items have their highlighted-state icons reset to the default icon. -References: itemIcons(property), itemLabels(property), itemNames(property) +References: itemIcons(property), itemLabels(property), itemNames(property), +com.livecode.library.iconsvg (library) */ property hilitedItemIcons get getNavSelectedIcons set setNavSelectedIcons metadata hilitedItemIcons.user_visible is "false" @@ -354,7 +359,7 @@ Value(integer): The item number of the navigation item that is highlighted. Description: The is the item number of the currently-highlighted navigation -item, starting from 1. It can be used as a key into the . +item. It can be used as a key into the . Setting 0 will cause nothing to be highlighted. @@ -379,7 +384,7 @@ Value(string): The name of the navigation item that is highlighted. Description: The is the name of the currently-highlighted navigation -item. +item. If nothing is highlighted, the value is an empty string. References: hilitedItem (property) */ @@ -1263,6 +1268,11 @@ public handler setNavSelectedItemName(in pName as String) returns nothing variable tCount as Integer variable tItem as Array + if pName is "" then + setNavSelectedItem(0) + return + end if + -- Find the item index corresponding to pName and set it as the -- currently-highlighted item. diff --git a/extensions/widgets/navbar/notes/feature-nohighlight.md b/extensions/widgets/navbar/notes/feature-nohighlight.md new file mode 100644 index 00000000000..0bd4c55991f --- /dev/null +++ b/extensions/widgets/navbar/notes/feature-nohighlight.md @@ -0,0 +1,18 @@ +# No Highlight Option + +Add an option to have none of the navigation items highlighted. + +## Properties + +* The **hilightedItem** property has been enhanced to accept a value of + 0 which indicates that no items will be highlighted. + +## Backward Compatibility Note + +* If a stack is saved without an item being highlighted, then when + opened in an earlier version of the widget, a call to + `getNavSelectedItemName` will throw an error if called before an + item is selected. + +* The widget will render properly (with nothing highlighted) and issue + the **hiliteChanged** message when an item is selected. \ No newline at end of file diff --git a/extensions/widgets/navbar/notes/lcg-demo.md b/extensions/widgets/navbar/notes/lcg-demo.md deleted file mode 100644 index 55433b10c19..00000000000 --- a/extensions/widgets/navbar/notes/lcg-demo.md +++ /dev/null @@ -1 +0,0 @@ -#LCG Demo - Add Navigation Bar option to highlight none of the icons From b9ee7270ece3b8e9971d5316e8dbd0f99b1dbbaf Mon Sep 17 00:00:00 2001 From: Brian Milby Date: Sun, 22 Jul 2018 19:09:41 -0500 Subject: [PATCH 0009/1134] [[ Bug 19550 ]] Add support for symbolic links in standalone builds __revSBCopyFolder / __revSBCopyFile silently failed when attempting to copy directory structures that contain symbolic links. The reason they failed was that "there is a file" returns false for symbolic links. While adding symbolic link support, `rename` was discovered to not properly handle symbolic links to directories. Instead of renaming the link, it would rename the referenced directory. `__revSBCopyFolder` - Updated folder owner/permission copy to include Linux - Added code to return a warning if copy not successful `__revSBCopyFile` - Used `__readlink` to determine if a file was a link - Added code to use `cp -a` to properly copy symbolic links - Wrapped the existing code in an if block to handle regular files `revRedirectMacOSResourcesRecurse` - Use `mv` to rename files on Mac/Linux to properly handle symbolic links --- docs/notes/bugfix-19550.md | 1 + .../revsaveasstandalone.livecodescript | 12 +- ide-support/revsblibrary.livecodescript | 103 +++++++++++------- 3 files changed, 74 insertions(+), 42 deletions(-) create mode 100644 docs/notes/bugfix-19550.md diff --git a/docs/notes/bugfix-19550.md b/docs/notes/bugfix-19550.md new file mode 100644 index 00000000000..863204cc98f --- /dev/null +++ b/docs/notes/bugfix-19550.md @@ -0,0 +1 @@ +# Add support for symbolic links in Mac/Linux standalone applications \ No newline at end of file diff --git a/ide-support/revsaveasstandalone.livecodescript b/ide-support/revsaveasstandalone.livecodescript index ffdb9712052..d191883fed5 100644 --- a/ide-support/revsaveasstandalone.livecodescript +++ b/ide-support/revsaveasstandalone.livecodescript @@ -2549,7 +2549,17 @@ command revRedirectMacOSResourcesRecurse pSourceFolder, pTargetFolder if revRedirectMacOSResourcesIsExecutable(pSourceFolder & slash & tFile) then next repeat end if - rename (pSourceFolder & slash & tFile) to (pTargetFolder & slash & tFile) + switch the platform + case "macos" + case "linux" + get shell("mv" && quote & pSourceFolder & slash & tFile & quote && \ + quote & pTargetFolder & slash & tFile & quote) + break + case "windows" + --following line does not work properly for symlink folders + rename (pSourceFolder & slash & tFile) to (pTargetFolder & slash & tFile) + break + end switch end repeat local tFolder diff --git a/ide-support/revsblibrary.livecodescript b/ide-support/revsblibrary.livecodescript index c4056792ae5..2edf2f0b68f 100644 --- a/ide-support/revsblibrary.livecodescript +++ b/ide-support/revsblibrary.livecodescript @@ -258,7 +258,7 @@ private command __revSBCopyFolder pSource, pTarget, pCallback, pCallbackTarget, exit repeat end if end if - if the platform is "macos" then -- stat it and set some flags + if the platform is "macos" or the platform is "Linux" then -- stat it and set some flags local tUser, tGroup set the itemDelimiter to "/" set the defaultFolder to pSource & "/" & item 1 to -2 of tResource @@ -297,6 +297,10 @@ private command __revSBCopyFolder pSource, pTarget, pCallback, pCallbackTarget, set the defaultFolder to tOldFolder + if tResult is not empty then + revStandaloneAddWarning tResult & ":" && quote & pSource & quote + end if + return tResult end __revSBCopyFolder @@ -310,9 +314,14 @@ private command __revSBCopyFile pSourceFile, pTargetFile, pCallback, pCallbackTa local tOldFolder, tSize, tPermissions, tUser, tGroup, tFileType local tResult + local tSourceFileIsLink if tResult is empty then if there is no file pSourceFile then - put "cannot find source file" into tResult + if __readlink(pSourceFile) is not empty then + put true into tSourceFileIsLink + else + put "cannot find source file" into tResult + end if end if end if @@ -348,51 +357,63 @@ private command __revSBCopyFile pSourceFile, pTargetFile, pCallback, pCallbackTa end if end if - if tResult is empty then - open file pTargetFile for binary write - if the result is not empty then - put "cannot create target file" into tResult - end if - end if - - if tResult is empty then - open file pSourceFile for binary read - if the result is not empty then - put "cannot read from source file", the result into tResult - end if - end if - - local tAmountCopied - if tResult is empty then - if pCallbackTarget is not empty and there is a pCallbackTarget then - send pCallback && 0, tSize to pCallbackTarget - end if - repeat forever - read from file pSourceFile for 1048576 - if the result is not empty and the result is not "eof" then - put "cannot read from source file", the result into tResult - exit repeat + if tSourceFileIsLink then + if tResult is empty then + # __readlink only works for MacOS and Linux so no need for a switch here + get shell("cp -a" && quote & pSourceFile & quote && \ + quote & pTargetfile & quote) + if it is not empty then + put "cannot copy symbolic link" into tResult end if - if it is empty then - exit repeat + # Copying a symbolic link takes no time, so do not send a callback. + end if + else # regular file + if tResult is empty then + open file pTargetFile for binary write + if the result is not empty then + put "cannot create target file" into tResult end if - write it to file pTargetFile + end if + + if tResult is empty then + open file pSourceFile for binary read if the result is not empty then - put "cannot write to target file" into tResult - exit repeat + put "cannot read from source file", the result into tResult end if - add the number of chars of it to tAmountCopied + end if + + local tAmountCopied + if tResult is empty then if pCallbackTarget is not empty and there is a pCallbackTarget then - send pCallback && tAmountCopied, tSize to pCallbackTarget + send pCallback && 0, tSize to pCallbackTarget end if - end repeat - end if - - if pTargetFile is among the lines of the openFiles then - close file pTargetFile - end if - if pSourceFile is among the lines of the openFiles then - close file pSourceFile + repeat forever + read from file pSourceFile for 1048576 + if the result is not empty and the result is not "eof" then + put "cannot read from source file", the result into tResult + exit repeat + end if + if it is empty then + exit repeat + end if + write it to file pTargetFile + if the result is not empty then + put "cannot write to target file" into tResult + exit repeat + end if + add the number of chars of it to tAmountCopied + if pCallbackTarget is not empty and there is a pCallbackTarget then + send pCallback && tAmountCopied, tSize to pCallbackTarget + end if + end repeat + end if + + if pTargetFile is among the lines of the openFiles then + close file pTargetFile + end if + if pSourceFile is among the lines of the openFiles then + close file pSourceFile + end if end if # OK-2007-11-30 : Modified to work for Linux too From 9873ae6e8785c54b2bc594be866cd83835b2e90d Mon Sep 17 00:00:00 2001 From: Brian Milby Date: Tue, 24 Jul 2018 16:46:10 -0500 Subject: [PATCH 0010/1134] [[ Bug 19550 ]] Add support for symbolic links in standalone builds Need to check every file to see if it is a link. `there is a file` fails for symbolic links to folders, but it succeeds on symbolic links to files that exist. We always want to create a symbolic link in the app if one was in the source. --- ide-support/revsblibrary.livecodescript | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ide-support/revsblibrary.livecodescript b/ide-support/revsblibrary.livecodescript index 2edf2f0b68f..422aa5eebc4 100644 --- a/ide-support/revsblibrary.livecodescript +++ b/ide-support/revsblibrary.livecodescript @@ -316,12 +316,10 @@ private command __revSBCopyFile pSourceFile, pTargetFile, pCallback, pCallbackTa local tSourceFileIsLink if tResult is empty then - if there is no file pSourceFile then - if __readlink(pSourceFile) is not empty then - put true into tSourceFileIsLink - else - put "cannot find source file" into tResult - end if + if __readlink(pSourceFile) is not empty then + put true into tSourceFileIsLink + else if there is no file pSourceFile then + put "cannot find source file" into tResult end if end if From a0d6069228adc787dc7ba479fb380160a7059956 Mon Sep 17 00:00:00 2001 From: Monte Goulding Date: Fri, 3 Aug 2018 09:20:37 +1000 Subject: [PATCH 0011/1134] [[ Xcode Setup ]] Add support for setup of Xcode-beta.app --- tools/setup_xcode_sdks.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/tools/setup_xcode_sdks.py b/tools/setup_xcode_sdks.py index 5cc2a0a0294..4b52eb299d0 100644 --- a/tools/setup_xcode_sdks.py +++ b/tools/setup_xcode_sdks.py @@ -80,8 +80,11 @@ def xcode_paths(base_dir): return_list.append(entry + "/" + l1_entry) return return_list -def target_xcode(base_dir): - return "{}/{}".format(base_dir, "Xcode.app") +def target_xcode(base_dir, beta): + if beta: + return "{}/{}".format(base_dir, "Xcode-beta.app") + else: + return "{}/{}".format(base_dir, "Xcode.app") class SDKInstaller(object): def __init__(self, base_dir): @@ -98,8 +101,8 @@ def _status(self, state, message): print("not ok - " + message) self._success = False - def install(self, platform, versions): - target = target_xcode(self._base_dir) + def install(self, platform, versions, beta): + target = target_xcode(self._base_dir, beta) self._install_sdks(target, platform, versions) self._set_sdk_minversion(target, platform, versions) @@ -200,9 +203,12 @@ def _install_sdk(self, xcode_app, platform, version): installer = CachingSDKInstaller(".", "./XcodeSDKs") else: installer = SDKInstaller(".") - installer.install("iPhoneOS", iphoneos_versions) - installer.install("iPhoneSimulator", iphonesimulator_versions) - installer.install("MacOSX", macosx_versions) + + beta = "--beta" in sys.argv + + installer.install("iPhoneOS", iphoneos_versions, beta) + installer.install("iPhoneSimulator", iphonesimulator_versions, beta) + installer.install("MacOSX", macosx_versions, beta) if not installer.is_successful(): print("ERROR: Some SDKs couldn't be installed") From c91b5fbbb84ed44d193a4ad7dcb7a6c268aae004 Mon Sep 17 00:00:00 2001 From: Andrew Ferguson Date: Thu, 16 Aug 2018 12:57:37 +0100 Subject: [PATCH 0012/1134] [[Bugfix-14721]] Added go visible form of go command The go command has been updated to include the go visible form which automatically sets the visible property of the stack to true when it is opened. This is particularly useful for script-only stacks that display any kind of interface (ie: that have visible controls), as they currently need to manually include a line in the openStack or preOpenStack handler to set the visible property to true. --- engine/src/cmds.h | 1 + engine/src/cmdss.cpp | 12 +++++++++--- engine/src/exec-interface.cpp | 16 ++++++++-------- engine/src/exec.h | 4 ++-- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/engine/src/cmds.h b/engine/src/cmds.h index 52b304b6c1b..fb9837a15b2 100644 --- a/engine/src/cmds.h +++ b/engine/src/cmds.h @@ -1738,6 +1738,7 @@ class MCGo : public MCStatement Window_mode mode; Boolean marked; Boolean visible; + Boolean explicit_visibility = False; Boolean thisstack; MCChunk *widget; diff --git a/engine/src/cmdss.cpp b/engine/src/cmdss.cpp index 88396ccb7eb..491016289e7 100644 --- a/engine/src/cmdss.cpp +++ b/engine/src/cmdss.cpp @@ -111,8 +111,14 @@ Parse_stat MCGo::parse(MCScriptPoint &sp) Chunk_term lterm = CT_UNDEFINED; initpoint(sp); - if (sp.skip_token(SP_FACTOR, TT_PROPERTY, P_INVISIBLE) == PS_NORMAL) + if (sp.skip_token(SP_FACTOR, TT_PROPERTY, P_INVISIBLE) == PS_NORMAL) { visible = False; + explicit_visibility = True; + } + if (sp.skip_token(SP_FACTOR, TT_PROPERTY, P_VISIBLE) == PS_NORMAL) { + visible = True; + explicit_visibility = True; + } while (True) { if (sp.next(type) != PS_NORMAL) @@ -744,9 +750,9 @@ void MCGo::exec_ctxt(MCExecContext &ctxt) } } else if (window != nil) - MCInterfaceExecGoCardInWindow(ctxt, cptr, *t_window, visible == True, thisstack == True); + MCInterfaceExecGoCardInWindow(ctxt, cptr, *t_window, visible == True, explicit_visibility == True, thisstack == True); else - MCInterfaceExecGoCardAsMode(ctxt, cptr, mode, visible == True, thisstack == True); + MCInterfaceExecGoCardAsMode(ctxt, cptr, mode, visible == True, explicit_visibility == True, thisstack == True); } MCHide::~MCHide() diff --git a/engine/src/exec-interface.cpp b/engine/src/exec-interface.cpp index f0f165d973b..a5d792b276b 100644 --- a/engine/src/exec-interface.cpp +++ b/engine/src/exec-interface.cpp @@ -4329,7 +4329,7 @@ void MCInterfaceExecChooseTool(MCExecContext& ctxt, MCStringRef p_input, int p_t //////////////////////////////////////////////////////////////////////////////// -void MCInterfaceExecGo(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, int p_mode, bool p_this_stack, bool p_visible) +void MCInterfaceExecGo(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, int p_mode, bool p_this_stack, bool p_visible, bool p_explicit_visibility) { if (p_card == nil) { @@ -4452,11 +4452,11 @@ void MCInterfaceExecGo(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window MCtrace = False; // MW-2007-02-11: [[ Bug 4029 ]] - 'go invisible' fails to close stack window if window already open - if (!p_visible && t_stack -> getflag(F_VISIBLE)) + if (p_explicit_visibility) { if (t_stack -> getwindow() != NULL) MCscreen -> closewindow(t_stack -> getwindow()); - t_stack->setflag(False, F_VISIBLE); + t_stack->setflag(p_visible, F_VISIBLE); } // MW-2011-02-27: [[ Bug ]] Make sure that if we open as a sheet, we have a parent pointer! @@ -4539,14 +4539,14 @@ void MCInterfaceExecGo(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window ctxt . Throw(); } -void MCInterfaceExecGoCardAsMode(MCExecContext& ctxt, MCCard *p_card, int p_mode, bool p_visible, bool p_this_stack) +void MCInterfaceExecGoCardAsMode(MCExecContext& ctxt, MCCard *p_card, int p_mode, bool p_visible, bool p_explicit_visibility, bool p_this_stack) { - MCInterfaceExecGo(ctxt, p_card, nil, p_mode, p_this_stack, p_visible); + MCInterfaceExecGo(ctxt, p_card, nil, p_mode, p_this_stack, p_visible, p_explicit_visibility); } -void MCInterfaceExecGoCardInWindow(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, bool p_visible, bool p_this_stack) +void MCInterfaceExecGoCardInWindow(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, bool p_visible, bool p_explicit_visibility, bool p_this_stack) { - MCInterfaceExecGo(ctxt, p_card, p_window, WM_MODELESS, p_this_stack, p_visible); + MCInterfaceExecGo(ctxt, p_card, p_window, WM_MODELESS, p_this_stack, p_visible, p_explicit_visibility); } void MCInterfaceExecGoRecentCard(MCExecContext& ctxt) @@ -4572,7 +4572,7 @@ void MCInterfaceExecGoHome(MCExecContext& ctxt, MCCard *p_card) MCdefaultstackptr->close(); MCdefaultstackptr->checkdestroy(); } - MCInterfaceExecGo(ctxt, p_card, nil, 0, false, true); + MCInterfaceExecGo(ctxt, p_card, nil, 0, false, true, false); } //////////////////////////////////////////////////////////////////////////////// diff --git a/engine/src/exec.h b/engine/src/exec.h index 81f22a8fe02..041fd9104a4 100644 --- a/engine/src/exec.h +++ b/engine/src/exec.h @@ -2449,8 +2449,8 @@ void MCInterfaceExecReplaceInField(MCExecContext& ctxt, MCStringRef p_pattern, M void MCInterfaceExecChooseTool(MCExecContext& ctxt, MCStringRef p_input, int p_tool); -void MCInterfaceExecGoCardAsMode(MCExecContext& ctxt, MCCard *p_card, int p_mode, bool p_visible, bool p_this_stack); -void MCInterfaceExecGoCardInWindow(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, bool p_visible, bool p_this_stack); +void MCInterfaceExecGoCardAsMode(MCExecContext& ctxt, MCCard *p_card, int p_mode, bool p_visible, bool p_explicit_visibility, bool p_this_stack); +void MCInterfaceExecGoCardInWindow(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, bool p_visible, bool p_explicit_visibility, bool p_this_stack); void MCInterfaceExecGoRecentCard(MCExecContext& ctxt); void MCInterfaceExecGoCardRelative(MCExecContext& ctxt, bool p_forward, real8 p_amount); void MCInterfaceExecGoCardEnd(MCExecContext& ctxt, bool p_is_start); From e04b8b956dd6afd9a8ffecf43980f4d72e334a49 Mon Sep 17 00:00:00 2001 From: Andrew Ferguson Date: Thu, 16 Aug 2018 13:03:19 +0100 Subject: [PATCH 0013/1134] [[Bugfix-14721]] Add parser and script tests for go visible A new parser test file has been created for the go command, as it did not have one before. Three new tests have been added, to test the basic syntax of go stack "stack", go visible stack "stack" and go invisible stack "stack". This test file is far from complete - there are many other forms of the go command that have not been tested, however I have added in only the three most relevent to the go visible command. Any others can be added separately in a different branch. Several new tests for the go command have been added to the core interface test file. These tests check that the stack actually opens when using the visible and invisible forms and that the visibility of the stack is correctly set. --- tests/lcs/core/interface/go.livecodescript | 81 +++++++++++++++++++++- tests/lcs/parser/go.parsertest | 39 +++++++++++ 2 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 tests/lcs/parser/go.parsertest diff --git a/tests/lcs/core/interface/go.livecodescript b/tests/lcs/core/interface/go.livecodescript index 009593777db..d886fdbd5bc 100644 --- a/tests/lcs/core/interface/go.livecodescript +++ b/tests/lcs/core/interface/go.livecodescript @@ -55,14 +55,19 @@ on TestGoCardUnquotedName end TestGoCardUnquotedName local sStackFileName -command _TestCreateStack pBinary +command _TestCreateStack pBinary pVisible local tStack put "stackToGo" into tStack if pBinary then create stack tStack + set the visible of stack tStack to pVisible else create script only stack tStack + if pVisible then + put "on preOpenStack" & return & "set the visible of me to" && pVisible & return & "end preOpenStack" into tScript + set the script of stack tStack to tScript + end if end if put the tempname into sStackFileName @@ -78,7 +83,7 @@ end _TestCleanupStack command _TestGoStackUrl pWhich TestSkipIfNot "write" local tStack - _TestCreateStack pWhich is "binary" + _TestCreateStack pWhich is "binary", true put it into tStack go url ("file:" & sStackFileName) TestDiagnostic the result @@ -117,3 +122,75 @@ on TestGoToCard TestAssert "openCard sent to opened card", the cOpened of card 1 TestAssert "closeCard sent to closed card", the cClosed of card 2 end TestGoToCard + +on _TestGoInvisibleVisibleStack pMode pWhich pVisible + TestSkipIfNot "write" + local tStack + _TestCreateStack pWhich is "binary", pVisible is "visible" + put it into tStack + do "go" && pMode && "stack sStackFilename" + TestDiagnostic the result + if pMode is empty then + put pVisible into pExpectedVisibility + else if pMode is "invisible" and pWhich is "script only" and pVisible is "visible" then + --a special case: + --a visible script only stack will be visible even if go invisible + --is used because the stack becomes visible by a "set the visible..." + --line in preOpenStack or openStack. So the setting of the visibility + --by the engine will be overridden when the stack is opened + put "visible" into pExpectedVisibility + else + put pMode into pExpectedVisibility + end if + TestAssert "go" && pMode && "on a" && pVisible && pWhich && "stack opened", there is a stack tStack + TestAssert "go" && pMode && "on a" && pVisible && pWhich && "stack is" && pExpectedVisibility, the visible of stack tStack is (pExpectedVisibility is "visible") + _TestCleanupStack +end _TestGoInvisibleVisibleStack + +on TestGoVisibleOnVisibleBinary + _TestGoInvisibleVisibleStack "visible", "binary", "visible" +end TestGoVisibleOnVisibleBinary + +on TestGoVisibleOnInvisibleBinary + _TestGoInvisibleVisibleStack "visible", "binary", "invisible" +end TestGoVisibleOnInvisibleBinary + +on TestGoVisibleOnVisibleScriptOnly + _TestGoInvisibleVisibleStack "visible", "script only", "visible" +end TestGoVisibleOnVisibleScriptOnly + +on TestGoVisibleOnInvisibleScriptOnly + _TestGoInvisibleVisibleStack "visible", "script only", "invisible" +end TestGoVisibleOnInvisibleScriptOnly + +on TestGoInvisibleOnVisibleBinary + _TestGoInvisibleVisibleStack "invisible", "binary", "visible" +end TestGoInvisibleOnVisibleBinary + +on TestGoInvisibleOnInvisibleBinary + _TestGoInvisibleVisibleStack "invisible", "binary", "invisible" +end TestGoInvisibleOnInvisibleBinary + +on TestGoInvisibleOnVisibleScriptOnly + _TestGoInvisibleVisibleStack "invisible", "script only", "visible" +end TestGoInvisibleOnVisibleScriptOnly + +on TestGoInvisibleOnInvisibleScriptOnly + _TestGoInvisibleVisibleStack "invisible", "script only", "invisible" +end TestGoInvisibleOnInvisibleScriptOnly + +on TestGoRegularOnVisibleBinary + _TestGoInvisibleVisibleStack "", "binary", "visible" +end TestGoRegularOnVisibleBinary + +on TestGoRegularOnInvisibleBinary + _TestGoInvisibleVisibleStack "", "binary", "invisible" +end TestGoRegularOnInvisibleBinary + +on TestGoRegularOnVisibleScriptOnly + _TestGoInvisibleVisibleStack "", "script only", "visible" +end TestGoRegularOnVisibleScriptOnly + +on TestGoRegularOnInvisibleScriptOnly + _TestGoInvisibleVisibleStack "", "script only", "invisible" +end TestGoRegularOnInvisibleScriptOnly diff --git a/tests/lcs/parser/go.parsertest b/tests/lcs/parser/go.parsertest new file mode 100644 index 00000000000..bc03de7ddc7 --- /dev/null +++ b/tests/lcs/parser/go.parsertest @@ -0,0 +1,39 @@ +%% Copyright (C) 2018 LiveCode Ltd. +%% +%% This file is part of LiveCode. +%% +%% LiveCode is free software; you can redistribute it and/or modify it under +%% the terms of the GNU General Public License v3 as published by the Free +%% Software Foundation. +%% +%% LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY +%% WARRANTY; without even the implied warranty of MERCHANTABILITY or +%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +%% for more details. +%% +%% You should have received a copy of the GNU General Public License +%% along with LiveCode. If not see . + +%TEST GoRegularStack +on parse_test + go stack "sample" +end parse_test +%EXPECT PASS +%SUCCESS +%ENDTEST + +%TEST GoVisibleStack +on parse_test + go visible stack "sample" +end parse_test +%EXPECT PASS +%SUCCESS +%ENDTEST + +%TEST GoVisibleStack +on parse_test + go invisible stack "sample" +end parse_test +%EXPECT PASS +%SUCCESS +%ENDTEST From 2565ef3bf3ef73a0e25b5bc79357579ef34580b3 Mon Sep 17 00:00:00 2001 From: Andrew Ferguson Date: Thu, 16 Aug 2018 13:09:09 +0100 Subject: [PATCH 0014/1134] [[Bugfix-14721]] Updated dictionary for go visible The dictionary file for the go command has been updated to include the new go visible command. A note has also been added to point out the occasion where the go visible and go invisible commands will not work as expected (when the stack overrides the command by setting its visible property in its script as it opens). --- docs/dictionary/command/go.lcdoc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/dictionary/command/go.lcdoc b/docs/dictionary/command/go.lcdoc index d593c1aa2cc..ddb4bbf95dd 100644 --- a/docs/dictionary/command/go.lcdoc +++ b/docs/dictionary/command/go.lcdoc @@ -4,11 +4,11 @@ Synonyms: open Type: command -Syntax: go [invisible] [to] [of ] [{as |in [a] new window|in }] +Syntax: go [{visible | invisible}] [to] [of ] [{as |in [a] new window|in }] -Syntax: go [invisible] [to] {first | prev[ious]| next | last | any} [marked] [] +Syntax: go [{visible | invisible}] [to] {first | prev[ious]| next | last | any} [marked] [] -Syntax: go [invisible] [to] {recent | start | finish | home} +Syntax: go [{visible | invisible}] [to] {recent | start | finish | home} Syntax: go {forward | forth | back[ward]} [] @@ -36,6 +36,9 @@ go back 7 Example: go invisible stack "Preferences" +Example: +go visible stack "Script-only stack" + Example: local tStackFile, tStackFolder put the effective filename of me into tStackFile @@ -153,6 +156,11 @@ among the previously-visited cards: form moves forward in the recent cards list. "forward" and "forth" are synonyms. +If you use the visible form, the stack is made visible after being +opened. (When going to a stack, this form sets the stack's + to true.) Use this form of the command to display a +script-only stack without explicitly setting the +in the or handlers. If you use the invisible form, the window or card change does not show on the screen. (When going to a stack, this form sets the stack's @@ -160,6 +168,10 @@ show on the screen. (When going to a stack, this form sets the stack's a stack without displaying it on screen. To display the stack later, use the or set its to true. +Note that if a stack’s property is set in either the +or handlers, then this will override the expected behaviour +of the visible and invisible forms. + Any visual effects that have been queued with the visual effect command are displayed when the command is executed (unless the screen is locked). From f4cc1a08baa6c4294c8238c0e9e4e820de9e7144 Mon Sep 17 00:00:00 2001 From: Andrew Ferguson Date: Thu, 16 Aug 2018 16:43:51 +0100 Subject: [PATCH 0015/1134] [[Bugfix-14721]] Represent visibility type by enum The two boolean variables that represented the visibility of the stack, p_visible and p_explicitly_visible, have been replaced by a single enum p_visibility_type, of type MCGoStackVisibilityType, which has three options: kImplicit (if the regular go form is used, so the visible property of the stack remains unchanged), kExplicitVisible (if the go visible form is used, so the visibility of the stack should be set to true) and kExplicitInvisible (if the go invisible form is used, so the visibility of the stack should be set to false). The visible variable of the MCGo class (declared on line 1740 of cmds.h) has not been removed as it appears to be used by several other parts of the engine. --- engine/src/cmds.h | 2 +- engine/src/cmdss.cpp | 16 ++++++---------- engine/src/exec-interface.cpp | 21 +++++++++++++-------- engine/src/exec.h | 5 +++-- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/engine/src/cmds.h b/engine/src/cmds.h index fb9837a15b2..39b656fe065 100644 --- a/engine/src/cmds.h +++ b/engine/src/cmds.h @@ -1738,7 +1738,7 @@ class MCGo : public MCStatement Window_mode mode; Boolean marked; Boolean visible; - Boolean explicit_visibility = False; + MCGoStackVisibility visibilityType = kImplicit; Boolean thisstack; MCChunk *widget; diff --git a/engine/src/cmdss.cpp b/engine/src/cmdss.cpp index 491016289e7..616f98514d2 100644 --- a/engine/src/cmdss.cpp +++ b/engine/src/cmdss.cpp @@ -111,14 +111,10 @@ Parse_stat MCGo::parse(MCScriptPoint &sp) Chunk_term lterm = CT_UNDEFINED; initpoint(sp); - if (sp.skip_token(SP_FACTOR, TT_PROPERTY, P_INVISIBLE) == PS_NORMAL) { - visible = False; - explicit_visibility = True; - } - if (sp.skip_token(SP_FACTOR, TT_PROPERTY, P_VISIBLE) == PS_NORMAL) { - visible = True; - explicit_visibility = True; - } + if (sp.skip_token(SP_FACTOR, TT_PROPERTY, P_INVISIBLE) == PS_NORMAL) + visibilityType = kExplicitInvisible; + if (sp.skip_token(SP_FACTOR, TT_PROPERTY, P_VISIBLE) == PS_NORMAL) + visibilityType = kExplicitVisible; while (True) { if (sp.next(type) != PS_NORMAL) @@ -750,9 +746,9 @@ void MCGo::exec_ctxt(MCExecContext &ctxt) } } else if (window != nil) - MCInterfaceExecGoCardInWindow(ctxt, cptr, *t_window, visible == True, explicit_visibility == True, thisstack == True); + MCInterfaceExecGoCardInWindow(ctxt, cptr, *t_window, visibilityType, thisstack == True); else - MCInterfaceExecGoCardAsMode(ctxt, cptr, mode, visible == True, explicit_visibility == True, thisstack == True); + MCInterfaceExecGoCardAsMode(ctxt, cptr, mode, visibilityType, thisstack == True); } MCHide::~MCHide() diff --git a/engine/src/exec-interface.cpp b/engine/src/exec-interface.cpp index a5d792b276b..3bdad3be7b9 100644 --- a/engine/src/exec-interface.cpp +++ b/engine/src/exec-interface.cpp @@ -4329,8 +4329,9 @@ void MCInterfaceExecChooseTool(MCExecContext& ctxt, MCStringRef p_input, int p_t //////////////////////////////////////////////////////////////////////////////// -void MCInterfaceExecGo(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, int p_mode, bool p_this_stack, bool p_visible, bool p_explicit_visibility) +void MCInterfaceExecGo(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, int p_mode, bool p_this_stack, MCGoStackVisibility p_visibility_type) { + if (p_card == nil) { if (MCresult -> isclear()) @@ -4452,11 +4453,14 @@ void MCInterfaceExecGo(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window MCtrace = False; // MW-2007-02-11: [[ Bug 4029 ]] - 'go invisible' fails to close stack window if window already open - if (p_explicit_visibility) + if (p_visibility_type != kImplicit) { if (t_stack -> getwindow() != NULL) MCscreen -> closewindow(t_stack -> getwindow()); - t_stack->setflag(p_visible, F_VISIBLE); + if (p_visibility_type == kExplicitVisible) + t_stack->setflag(true, F_VISIBLE); + if (p_visibility_type == kExplicitInvisible) + t_stack->setflag(false, F_VISIBLE); } // MW-2011-02-27: [[ Bug ]] Make sure that if we open as a sheet, we have a parent pointer! @@ -4539,14 +4543,14 @@ void MCInterfaceExecGo(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window ctxt . Throw(); } -void MCInterfaceExecGoCardAsMode(MCExecContext& ctxt, MCCard *p_card, int p_mode, bool p_visible, bool p_explicit_visibility, bool p_this_stack) +void MCInterfaceExecGoCardAsMode(MCExecContext& ctxt, MCCard *p_card, int p_mode, MCGoStackVisibility p_visibility_type, bool p_this_stack) { - MCInterfaceExecGo(ctxt, p_card, nil, p_mode, p_this_stack, p_visible, p_explicit_visibility); + MCInterfaceExecGo(ctxt, p_card, nil, p_mode, p_this_stack, p_visibility_type); } -void MCInterfaceExecGoCardInWindow(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, bool p_visible, bool p_explicit_visibility, bool p_this_stack) +void MCInterfaceExecGoCardInWindow(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, MCGoStackVisibility p_visibility_type, bool p_this_stack) { - MCInterfaceExecGo(ctxt, p_card, p_window, WM_MODELESS, p_this_stack, p_visible, p_explicit_visibility); + MCInterfaceExecGo(ctxt, p_card, p_window, WM_MODELESS, p_this_stack, p_visibility_type); } void MCInterfaceExecGoRecentCard(MCExecContext& ctxt) @@ -4572,7 +4576,8 @@ void MCInterfaceExecGoHome(MCExecContext& ctxt, MCCard *p_card) MCdefaultstackptr->close(); MCdefaultstackptr->checkdestroy(); } - MCInterfaceExecGo(ctxt, p_card, nil, 0, false, true, false); + MCGoStackVisibility visibilityType = kImplicit; + MCInterfaceExecGo(ctxt, p_card, nil, 0, false, visibilityType); } //////////////////////////////////////////////////////////////////////////////// diff --git a/engine/src/exec.h b/engine/src/exec.h index 041fd9104a4..c5fbd1f21df 100644 --- a/engine/src/exec.h +++ b/engine/src/exec.h @@ -2449,8 +2449,9 @@ void MCInterfaceExecReplaceInField(MCExecContext& ctxt, MCStringRef p_pattern, M void MCInterfaceExecChooseTool(MCExecContext& ctxt, MCStringRef p_input, int p_tool); -void MCInterfaceExecGoCardAsMode(MCExecContext& ctxt, MCCard *p_card, int p_mode, bool p_visible, bool p_explicit_visibility, bool p_this_stack); -void MCInterfaceExecGoCardInWindow(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, bool p_visible, bool p_explicit_visibility, bool p_this_stack); +enum MCGoStackVisibility { kImplicit, kExplicitVisible, kExplicitInvisible }; +void MCInterfaceExecGoCardAsMode(MCExecContext& ctxt, MCCard *p_card, int p_mode, MCGoStackVisibility p_visibility_type, bool p_this_stack); +void MCInterfaceExecGoCardInWindow(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, MCGoStackVisibility p_visibility_type, bool p_this_stack); void MCInterfaceExecGoRecentCard(MCExecContext& ctxt); void MCInterfaceExecGoCardRelative(MCExecContext& ctxt, bool p_forward, real8 p_amount); void MCInterfaceExecGoCardEnd(MCExecContext& ctxt, bool p_is_start); From b46a43fdf36524d29ee03cb8865b51e6166777a1 Mon Sep 17 00:00:00 2001 From: Andrew Ferguson Date: Thu, 16 Aug 2018 16:58:16 +0100 Subject: [PATCH 0016/1134] [[Bugfix-14721]] Seperate parameters by comma The parameters on the _TestGoInvisibleVisibleStack and _TestCreateStack commands have been seperated by a comma. --- tests/lcs/core/interface/go.livecodescript | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/lcs/core/interface/go.livecodescript b/tests/lcs/core/interface/go.livecodescript index d886fdbd5bc..a8db125dfbe 100644 --- a/tests/lcs/core/interface/go.livecodescript +++ b/tests/lcs/core/interface/go.livecodescript @@ -55,7 +55,7 @@ on TestGoCardUnquotedName end TestGoCardUnquotedName local sStackFileName -command _TestCreateStack pBinary pVisible +command _TestCreateStack pBinary, pVisible local tStack put "stackToGo" into tStack @@ -123,7 +123,7 @@ on TestGoToCard TestAssert "closeCard sent to closed card", the cClosed of card 2 end TestGoToCard -on _TestGoInvisibleVisibleStack pMode pWhich pVisible +on _TestGoInvisibleVisibleStack pMode, pWhich, pVisible TestSkipIfNot "write" local tStack _TestCreateStack pWhich is "binary", pVisible is "visible" From 64bf79523074923c8fb856ea3cfc6031a1d1ad13 Mon Sep 17 00:00:00 2001 From: Andrew Ferguson Date: Fri, 17 Aug 2018 10:14:17 +0100 Subject: [PATCH 0017/1134] [[Bugfix-14721]] Increase readability of enum The readibility of the MCGoStackVisibility enum has been increased by renaming it to MCInterfaceExecGoVisibility, and prepending the new enum name to all the enumeration values. Also the use of braces in the enum definition has been updated to conform to the existing style (note to self: read C++style.md *first* next time). --- engine/src/cmds.h | 2 +- engine/src/cmdss.cpp | 4 ++-- engine/src/exec-interface.cpp | 14 +++++++------- engine/src/exec.h | 11 ++++++++--- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/engine/src/cmds.h b/engine/src/cmds.h index 39b656fe065..85557943f39 100644 --- a/engine/src/cmds.h +++ b/engine/src/cmds.h @@ -1738,7 +1738,7 @@ class MCGo : public MCStatement Window_mode mode; Boolean marked; Boolean visible; - MCGoStackVisibility visibilityType = kImplicit; + MCInterfaceExecGoVisibility visibilityType = kMCInterfaceExecGoVisibilityImplicit; Boolean thisstack; MCChunk *widget; diff --git a/engine/src/cmdss.cpp b/engine/src/cmdss.cpp index 616f98514d2..e35323d0752 100644 --- a/engine/src/cmdss.cpp +++ b/engine/src/cmdss.cpp @@ -112,9 +112,9 @@ Parse_stat MCGo::parse(MCScriptPoint &sp) initpoint(sp); if (sp.skip_token(SP_FACTOR, TT_PROPERTY, P_INVISIBLE) == PS_NORMAL) - visibilityType = kExplicitInvisible; + visibilityType = kMCInterfaceExecGoVisibilityExplicitInvisible; if (sp.skip_token(SP_FACTOR, TT_PROPERTY, P_VISIBLE) == PS_NORMAL) - visibilityType = kExplicitVisible; + visibilityType = kMCInterfaceExecGoVisibilityExplicitVisible; while (True) { if (sp.next(type) != PS_NORMAL) diff --git a/engine/src/exec-interface.cpp b/engine/src/exec-interface.cpp index 3bdad3be7b9..c5f08bc6cbb 100644 --- a/engine/src/exec-interface.cpp +++ b/engine/src/exec-interface.cpp @@ -4329,7 +4329,7 @@ void MCInterfaceExecChooseTool(MCExecContext& ctxt, MCStringRef p_input, int p_t //////////////////////////////////////////////////////////////////////////////// -void MCInterfaceExecGo(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, int p_mode, bool p_this_stack, MCGoStackVisibility p_visibility_type) +void MCInterfaceExecGo(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, int p_mode, bool p_this_stack, MCInterfaceExecGoVisibility p_visibility_type) { if (p_card == nil) @@ -4453,13 +4453,13 @@ void MCInterfaceExecGo(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window MCtrace = False; // MW-2007-02-11: [[ Bug 4029 ]] - 'go invisible' fails to close stack window if window already open - if (p_visibility_type != kImplicit) + if (p_visibility_type != kMCInterfaceExecGoVisibilityImplicit) { if (t_stack -> getwindow() != NULL) MCscreen -> closewindow(t_stack -> getwindow()); - if (p_visibility_type == kExplicitVisible) + if (p_visibility_type == kMCInterfaceExecGoVisibilityExplicitVisible) t_stack->setflag(true, F_VISIBLE); - if (p_visibility_type == kExplicitInvisible) + if (p_visibility_type == kMCInterfaceExecGoVisibilityExplicitInvisible) t_stack->setflag(false, F_VISIBLE); } @@ -4543,12 +4543,12 @@ void MCInterfaceExecGo(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window ctxt . Throw(); } -void MCInterfaceExecGoCardAsMode(MCExecContext& ctxt, MCCard *p_card, int p_mode, MCGoStackVisibility p_visibility_type, bool p_this_stack) +void MCInterfaceExecGoCardAsMode(MCExecContext& ctxt, MCCard *p_card, int p_mode, MCInterfaceExecGoVisibility p_visibility_type, bool p_this_stack) { MCInterfaceExecGo(ctxt, p_card, nil, p_mode, p_this_stack, p_visibility_type); } -void MCInterfaceExecGoCardInWindow(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, MCGoStackVisibility p_visibility_type, bool p_this_stack) +void MCInterfaceExecGoCardInWindow(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, MCInterfaceExecGoVisibility p_visibility_type, bool p_this_stack) { MCInterfaceExecGo(ctxt, p_card, p_window, WM_MODELESS, p_this_stack, p_visibility_type); } @@ -4576,7 +4576,7 @@ void MCInterfaceExecGoHome(MCExecContext& ctxt, MCCard *p_card) MCdefaultstackptr->close(); MCdefaultstackptr->checkdestroy(); } - MCGoStackVisibility visibilityType = kImplicit; + MCInterfaceExecGoVisibility visibilityType = kMCInterfaceExecGoVisibilityImplicit; MCInterfaceExecGo(ctxt, p_card, nil, 0, false, visibilityType); } diff --git a/engine/src/exec.h b/engine/src/exec.h index c5fbd1f21df..0e38c5e76a4 100644 --- a/engine/src/exec.h +++ b/engine/src/exec.h @@ -2449,9 +2449,14 @@ void MCInterfaceExecReplaceInField(MCExecContext& ctxt, MCStringRef p_pattern, M void MCInterfaceExecChooseTool(MCExecContext& ctxt, MCStringRef p_input, int p_tool); -enum MCGoStackVisibility { kImplicit, kExplicitVisible, kExplicitInvisible }; -void MCInterfaceExecGoCardAsMode(MCExecContext& ctxt, MCCard *p_card, int p_mode, MCGoStackVisibility p_visibility_type, bool p_this_stack); -void MCInterfaceExecGoCardInWindow(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, MCGoStackVisibility p_visibility_type, bool p_this_stack); +enum MCInterfaceExecGoVisibility +{ + kMCInterfaceExecGoVisibilityImplicit, + kMCInterfaceExecGoVisibilityExplicitVisible, + kMCInterfaceExecGoVisibilityExplicitInvisible +}; +void MCInterfaceExecGoCardAsMode(MCExecContext& ctxt, MCCard *p_card, int p_mode, MCInterfaceExecGoVisibility p_visibility_type, bool p_this_stack); +void MCInterfaceExecGoCardInWindow(MCExecContext& ctxt, MCCard *p_card, MCStringRef p_window, MCInterfaceExecGoVisibility p_visibility_type, bool p_this_stack); void MCInterfaceExecGoRecentCard(MCExecContext& ctxt); void MCInterfaceExecGoCardRelative(MCExecContext& ctxt, bool p_forward, real8 p_amount); void MCInterfaceExecGoCardEnd(MCExecContext& ctxt, bool p_is_start); From e1a84aeee809ee3e92af54b07bebae0e8aa1399f Mon Sep 17 00:00:00 2001 From: Andrew Ferguson Date: Fri, 17 Aug 2018 10:31:55 +0100 Subject: [PATCH 0018/1134] [[Bugfix-14721]] Add release note A release note has been added for the new visible form of the go command. --- docs/notes/Bugfix-14721.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/notes/Bugfix-14721.md diff --git a/docs/notes/Bugfix-14721.md b/docs/notes/Bugfix-14721.md new file mode 100644 index 00000000000..61d83a5ced8 --- /dev/null +++ b/docs/notes/Bugfix-14721.md @@ -0,0 +1 @@ +# Implement 'go visible ' as an antonym to 'go invisible' From 3340244731768f819e4dafdbdddfecbcc35453e2 Mon Sep 17 00:00:00 2001 From: Andrew Ferguson Date: Fri, 17 Aug 2018 11:52:16 +0100 Subject: [PATCH 0019/1134] [[Bugfix-14721]] Cleanup variables The visibiltyType variable has been renamed to visibility_type to conform to the coding standards. An unnecessary instance of the MCInterfaceExecGoVisibilityType enum was removed and replaced with a direct reference to the enum. The visibile boolean variable is now redundant and has been removed. --- engine/src/cmds.h | 5 ++--- engine/src/cmdss.cpp | 8 ++++---- engine/src/exec-interface.cpp | 3 +-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/engine/src/cmds.h b/engine/src/cmds.h index 85557943f39..3724775b515 100644 --- a/engine/src/cmds.h +++ b/engine/src/cmds.h @@ -1737,8 +1737,7 @@ class MCGo : public MCStatement MCExpression *window; Window_mode mode; Boolean marked; - Boolean visible; - MCInterfaceExecGoVisibility visibilityType = kMCInterfaceExecGoVisibilityImplicit; + MCInterfaceExecGoVisibility visibility_type; Boolean thisstack; MCChunk *widget; @@ -1751,7 +1750,7 @@ class MCGo : public MCStatement window(nil), mode(WM_LAST), marked(False), - visible(True), + visibility_type(kMCInterfaceExecGoVisibilityImplicit), thisstack(False), widget(nil), direction(CT_BACKWARD) diff --git a/engine/src/cmdss.cpp b/engine/src/cmdss.cpp index e35323d0752..7a0d26ff775 100644 --- a/engine/src/cmdss.cpp +++ b/engine/src/cmdss.cpp @@ -112,9 +112,9 @@ Parse_stat MCGo::parse(MCScriptPoint &sp) initpoint(sp); if (sp.skip_token(SP_FACTOR, TT_PROPERTY, P_INVISIBLE) == PS_NORMAL) - visibilityType = kMCInterfaceExecGoVisibilityExplicitInvisible; + visibility_type = kMCInterfaceExecGoVisibilityExplicitInvisible; if (sp.skip_token(SP_FACTOR, TT_PROPERTY, P_VISIBLE) == PS_NORMAL) - visibilityType = kMCInterfaceExecGoVisibilityExplicitVisible; + visibility_type = kMCInterfaceExecGoVisibilityExplicitVisible; while (True) { if (sp.next(type) != PS_NORMAL) @@ -746,9 +746,9 @@ void MCGo::exec_ctxt(MCExecContext &ctxt) } } else if (window != nil) - MCInterfaceExecGoCardInWindow(ctxt, cptr, *t_window, visibilityType, thisstack == True); + MCInterfaceExecGoCardInWindow(ctxt, cptr, *t_window, visibility_type, thisstack == True); else - MCInterfaceExecGoCardAsMode(ctxt, cptr, mode, visibilityType, thisstack == True); + MCInterfaceExecGoCardAsMode(ctxt, cptr, mode, visibility_type, thisstack == True); } MCHide::~MCHide() diff --git a/engine/src/exec-interface.cpp b/engine/src/exec-interface.cpp index c5f08bc6cbb..c8c42065b5c 100644 --- a/engine/src/exec-interface.cpp +++ b/engine/src/exec-interface.cpp @@ -4576,8 +4576,7 @@ void MCInterfaceExecGoHome(MCExecContext& ctxt, MCCard *p_card) MCdefaultstackptr->close(); MCdefaultstackptr->checkdestroy(); } - MCInterfaceExecGoVisibility visibilityType = kMCInterfaceExecGoVisibilityImplicit; - MCInterfaceExecGo(ctxt, p_card, nil, 0, false, visibilityType); + MCInterfaceExecGo(ctxt, p_card, nil, 0, false, MCInterfaceExecGoVisibility(kMCInterfaceExecGoVisibilityImplicit)); } //////////////////////////////////////////////////////////////////////////////// From b875fbd63de19e03def6ef9c624dd99c1cbd5717 Mon Sep 17 00:00:00 2001 From: Andrew Ferguson Date: Mon, 20 Aug 2018 11:09:51 +0100 Subject: [PATCH 0020/1134] [[Bugfix-14721]] Removed unnecessary cast to enum A cast to the MCInterfaceExecGoVisibility enum has been replaced with a direct pass of the relevent item in the enum. --- engine/src/exec-interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/exec-interface.cpp b/engine/src/exec-interface.cpp index c8c42065b5c..f80b264678b 100644 --- a/engine/src/exec-interface.cpp +++ b/engine/src/exec-interface.cpp @@ -4576,7 +4576,7 @@ void MCInterfaceExecGoHome(MCExecContext& ctxt, MCCard *p_card) MCdefaultstackptr->close(); MCdefaultstackptr->checkdestroy(); } - MCInterfaceExecGo(ctxt, p_card, nil, 0, false, MCInterfaceExecGoVisibility(kMCInterfaceExecGoVisibilityImplicit)); + MCInterfaceExecGo(ctxt, p_card, nil, 0, false, kMCInterfaceExecGoVisibilityImplicit); } //////////////////////////////////////////////////////////////////////////////// From 0ecb595550f9c11004d3c27a5538d59049cc30e2 Mon Sep 17 00:00:00 2001 From: Ian Macphail Date: Tue, 21 Aug 2018 11:05:14 +0100 Subject: [PATCH 0021/1134] [[ libgraphics ]] Ensure graphic effect structs are initialised to default values --- engine/src/graphicscontext.cpp | 6 +----- engine/src/module-canvas.cpp | 5 ++--- engine/src/player-platform.cpp | 26 +++++++------------------- 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/engine/src/graphicscontext.cpp b/engine/src/graphicscontext.cpp index de2eb291409..8cdb992d940 100644 --- a/engine/src/graphicscontext.cpp +++ b/engine/src/graphicscontext.cpp @@ -236,11 +236,7 @@ void MCGraphicsContext::begin(bool p_group) bool MCGraphicsContext::begin_with_effects(MCBitmapEffectsRef p_effects, const MCRectangle &p_shape) { - MCGBitmapEffects t_effects; - t_effects . has_drop_shadow = false; - t_effects . has_outer_glow = false; - t_effects . has_inner_glow = false; - t_effects . has_inner_shadow = false; + MCGBitmapEffects t_effects = MCGBitmapEffects(); if ((p_effects -> mask & kMCBitmapEffectTypeColorOverlayBit) != 0) { diff --git a/engine/src/module-canvas.cpp b/engine/src/module-canvas.cpp index c5962418e31..6c203846ed8 100644 --- a/engine/src/module-canvas.cpp +++ b/engine/src/module-canvas.cpp @@ -5668,9 +5668,8 @@ void MCCanvasBeginLayerWithEffect(MCCanvasEffectRef p_effect, MCCanvasRef p_canv if (!MCCanvasPropertiesPush(*t_canvas)) return; - MCGBitmapEffects t_effects; - t_effects.has_color_overlay = t_effects.has_drop_shadow = t_effects.has_inner_glow = t_effects.has_inner_shadow = t_effects.has_outer_glow = false; - + MCGBitmapEffects t_effects = MCGBitmapEffects(); + __MCCanvasEffectImpl *t_effect_impl; t_effect_impl = MCCanvasEffectGet(p_effect); diff --git a/engine/src/player-platform.cpp b/engine/src/player-platform.cpp index 1486d9b9e84..1efce067315 100644 --- a/engine/src/player-platform.cpp +++ b/engine/src/player-platform.cpp @@ -180,13 +180,9 @@ class MCPlayerVolumePopup: public MCStack MCRectangle t_volume_well; t_volume_well = getVolumeBarPartRect(dirty, kMCPlayerControllerPartVolumeWell); - MCGBitmapEffects t_effects; - t_effects . has_drop_shadow = false; - t_effects . has_outer_glow = false; - t_effects . has_inner_glow = false; + MCGBitmapEffects t_effects = MCGBitmapEffects(); t_effects . has_inner_shadow = true; - t_effects . has_color_overlay = false; - + MCGShadowEffect t_inner_shadow; t_inner_shadow . color = MCGColorMakeRGBA(0.0f, 0.0f, 0.0f, 56.0 / 255.0); t_inner_shadow . blend_mode = kMCGBlendModeClear; @@ -526,13 +522,9 @@ class MCPlayerRatePopup: public MCStack MCRectangle t_rate_well; t_rate_well = getRateBarPartRect(dirty, kMCPlayerControllerPartRateWell); - MCGBitmapEffects t_effects; - t_effects . has_drop_shadow = false; - t_effects . has_outer_glow = false; - t_effects . has_inner_glow = false; + MCGBitmapEffects t_effects = MCGBitmapEffects(); t_effects . has_inner_shadow = true; - t_effects . has_color_overlay = false; - + MCGShadowEffect t_inner_shadow; t_inner_shadow . color = MCGColorMakeRGBA(0.0f, 0.0f, 0.0f, 56.0 / 255.0); t_inner_shadow . blend_mode = kMCGBlendModeClear; @@ -2590,13 +2582,9 @@ void MCPlayer::drawControllerWellButton(MCGContextRef p_gcontext) t_drawn_well_rect . x += 4; t_drawn_well_rect . width -= 10; - MCGBitmapEffects t_effects; - t_effects . has_drop_shadow = false; - t_effects . has_outer_glow = false; - t_effects . has_inner_glow = false; - t_effects . has_inner_shadow = true; - t_effects . has_color_overlay = false; - + MCGBitmapEffects t_effects = MCGBitmapEffects(); + t_effects . has_inner_shadow = true; + MCGShadowEffect t_inner_shadow; t_inner_shadow . color = MCGColorMakeRGBA(56.0 / 255.0, 56.0 / 255.0, 56.0 / 255.0, 56.0 / 255.0); t_inner_shadow . blend_mode = kMCGBlendModeClear; From 60bb574b88a96b75343ee5c2d0fc09a10588eac0 Mon Sep 17 00:00:00 2001 From: Monte Goulding Date: Wed, 29 Aug 2018 11:59:03 +1000 Subject: [PATCH 0022/1134] [[ Bug ]] Fix alloc & init handler definitions --- extensions/widgets/macbutton/macbutton.lcb | 2 +- extensions/widgets/mactextfield/mactextfield.lcb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/widgets/macbutton/macbutton.lcb b/extensions/widgets/macbutton/macbutton.lcb index 71b05cc04bc..5c57a8e1ede 100644 --- a/extensions/widgets/macbutton/macbutton.lcb +++ b/extensions/widgets/macbutton/macbutton.lcb @@ -159,7 +159,7 @@ end handler private type NSUInteger is CULong private foreign handler ObjC_NSButtonAlloc() returns ObjcRetainedId binds to "objc:NSButton.+alloc" -private foreign handler ObjC_NSButtonInit(in pObj as ObjcId) returns ObjcId binds to "objc:NSButton.-init" +private foreign handler ObjC_NSButtonInit(in pObj as ObjcRetainedId) returns optional ObjcRetainedId binds to "objc:NSButton.-init" private foreign handler ObjC_NSButtonSetEnabled(in pObj as ObjcId, in pEnabled as CBool) returns nothing binds to "objc:NSButton.-setEnabled:" private foreign handler ObjC_NSButtonSetFont(in pObj as ObjcId, in pFont as ObjcId) returns nothing binds to "objc:NSButton.-setFont:" private foreign handler ObjC_NSButtonSetButtonType(in pObj as ObjcId, in pStyle as NSUInteger) returns nothing binds to "objc:NSButton.-setButtonType:" diff --git a/extensions/widgets/mactextfield/mactextfield.lcb b/extensions/widgets/mactextfield/mactextfield.lcb index 9d0053a2e86..4494c909d73 100644 --- a/extensions/widgets/mactextfield/mactextfield.lcb +++ b/extensions/widgets/mactextfield/mactextfield.lcb @@ -258,7 +258,7 @@ end handler private type NSUInteger is CULong private foreign handler ObjC_NSTextFieldAlloc() returns ObjcRetainedId binds to "objc:NSTextField.+alloc" -private foreign handler ObjC_NSTextFieldInit(in pObj as ObjcId) returns ObjcId binds to "objc:NSTextField.-init" +private foreign handler ObjC_NSTextFieldInit(in pObj as ObjcRetainedId) returns optional ObjcRetainedId binds to "objc:NSTextField.-init" private foreign handler ObjC_NSTextFieldSetEnabled(in pObj as ObjcId, in pEnabled as CBool) returns nothing binds to "objc:NSTextField.-setEnabled:" private foreign handler ObjC_NSTextFieldSetFont(in pObj as ObjcId, in pFont as ObjcId) returns nothing binds to "objc:NSTextField.-setFont:" private foreign handler ObjC_NSTextFieldSetBezelStyle(in pObj as ObjcId, in pStyle as NSUInteger) returns nothing binds to "objc:NSTextField.-setBezelStyle:" From b66ae32217aee33534f75b9ba4646c0924978daf Mon Sep 17 00:00:00 2001 From: livecodesam Date: Thu, 13 Sep 2018 10:52:18 +0100 Subject: [PATCH 0023/1134] [Bugfix-18359] Added note about non-numeric x-values for hilitedCoordinates --- docs/notes/bugfix-18359.md | 1 + extensions/widgets/graph/graph.lcb | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 docs/notes/bugfix-18359.md diff --git a/docs/notes/bugfix-18359.md b/docs/notes/bugfix-18359.md new file mode 100644 index 00000000000..f7bd5fe3643 --- /dev/null +++ b/docs/notes/bugfix-18359.md @@ -0,0 +1 @@ +# Added note to hiliteCoordinates about non-numeric x-values. diff --git a/extensions/widgets/graph/graph.lcb b/extensions/widgets/graph/graph.lcb index 83e3b004c22..ade8b2a58b4 100644 --- a/extensions/widgets/graph/graph.lcb +++ b/extensions/widgets/graph/graph.lcb @@ -245,6 +245,9 @@ If the of the graph widget is not empty, then the widget will highlight the specified coordinates with a dot and dashed horizontal and vertical lines. +>*Note:* If the x-axis values in the graph data are non-numeric, +>then the x-value of the point set must mathc one of those values. + Related: hilitedCoordinatesColor (property) */ property hilitedCoordinates get GetHilitedCoordinates set SetHilitedCoordinates From d043993e3f49b025b9cc9b16e3d629e704d5e830 Mon Sep 17 00:00:00 2001 From: livecodesam Date: Thu, 13 Sep 2018 10:57:11 +0100 Subject: [PATCH 0024/1134] Update graph.lcb --- extensions/widgets/graph/graph.lcb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/widgets/graph/graph.lcb b/extensions/widgets/graph/graph.lcb index ade8b2a58b4..d6e5816d8ad 100644 --- a/extensions/widgets/graph/graph.lcb +++ b/extensions/widgets/graph/graph.lcb @@ -246,7 +246,7 @@ widget will highlight the specified coordinates with a dot and dashed horizontal and vertical lines. >*Note:* If the x-axis values in the graph data are non-numeric, ->then the x-value of the point set must mathc one of those values. +>then the x-value of the point set must match one of those values. Related: hilitedCoordinatesColor (property) */ From 3b7e065bb1f24299a5e8e592a435c4b169178363 Mon Sep 17 00:00:00 2001 From: Brian Milby Date: Thu, 18 Oct 2018 00:15:24 -0500 Subject: [PATCH 0025/1134] [[ Tree View Widget ]] Auto expand to show selected row The tree view widget now has the ability to automatically expand to reveal a row when it is selected. If **scrollHilitedElementIntoView** is not `true` then the scroll position will be adjusted to maintain the currently visible top row. The tree view fold state can now be reset in two ways. To set the array data in a folded state then use the **foldedArrayData** property. To collapse the tree without changing the data, get the **foldedArrayData**. Added 2 module variables to control redraw and determine when fold state changes (`mRedraw` and `mFoldChanged`). Added `pathIsValid` handler to ensure that a user supplied path actually exists. Validation is now done in the `setSelectedElement` handler so the requirement to test for an empty path in `selectPath` is removed. Added `unfoldFullPath` handler to take care of ensuring the full selection path is unfolded. Code is included to maintain the top visible row if `mScrollHilitedElementIntoView` is not `true`. Updated `applyFoldStateKey` handler to set `mFoldChanged` when an expansion is performed. Updated to check for the need to expand. --- .../treeview/notes/feature-auto_expand.md | 10 ++ extensions/widgets/treeview/treeview.lcb | 132 +++++++++++++++--- 2 files changed, 122 insertions(+), 20 deletions(-) create mode 100644 extensions/widgets/treeview/notes/feature-auto_expand.md diff --git a/extensions/widgets/treeview/notes/feature-auto_expand.md b/extensions/widgets/treeview/notes/feature-auto_expand.md new file mode 100644 index 00000000000..bfaeea93da1 --- /dev/null +++ b/extensions/widgets/treeview/notes/feature-auto_expand.md @@ -0,0 +1,10 @@ +# Properties + +The tree view widget now has the ability to automatically expand to reveal +a row when it is selected. If **scrollHilitedElementIntoView** is not `true` +then the scroll position will be adjusted to maintain the currently visible +top row. + +The tree view fold state can now be reset in two ways. To set the array +data in a folded state then use the **foldedArrayData** property. To +collapse the tree without changing the data, get the **foldedArrayData**. diff --git a/extensions/widgets/treeview/treeview.lcb b/extensions/widgets/treeview/treeview.lcb index 6f63467e4c9..176b5c47bd5 100644 --- a/extensions/widgets/treeview/treeview.lcb +++ b/extensions/widgets/treeview/treeview.lcb @@ -83,7 +83,7 @@ use com.livecode.library.widgetutils use com.livecode.foreign metadata author is "LiveCode" -metadata version is "2.1.0" +metadata version is "2.2.0" metadata title is "Tree View" metadata svgicon is "M152.4,249.7c-6.4,0-11.8,4.3-13.5,10.1h-10v-26.7h10c1.7,5.8,7.1,10.1,13.5,10.1c7.8,0,14.1-6.3,14.1-14.1s-6.3-14.1-14.1-14.1c-6.4,0-11.8,4.3-13.5,10.1h-10v-16.1c8.4-1.8,14.8-9.3,14.8-18.3c0-10.4-8.4-18.8-18.8-18.8s-18.8,8.4-18.8,18.8c0,9,6.3,16.5,14.7,18.3v58.8h18c1.7,5.8,7.1,10.1,13.5,10.1c7.8,0,14.1-6.3,14.1-14.1S160.2,249.7,152.4,249.7z M128.7,202h-7.5v-7.5h-7.5V187h7.5v-7.5h7.5v7.5h7.5v7.5h-7.5V202z" metadata _ide is "true" @@ -104,6 +104,23 @@ The arrayData is the data currently being displayed by the tree view widget. property arrayData get getArrayData set setArrayData metadata arrayData.label is "Array data" +/** +Syntax: set the foldedArrayData of to +Syntax: get the foldedArrayData of +Summary: The array being displayed by the widget + +Parameters: +pArray (array): The array data. + +Description: +The arrayData is the data currently being displayed by the tree view widget. +Setting the arrayData using the foldedArrayData property will reset the fold +state to fold all elements. +**/ + +property foldedArrayData get getFoldedArrayData set setFoldedArrayData +metadata foldedArrayData.user_visible is "false" + /** Syntax: set the hilitedElement of to Syntax: get the hilitedElement of @@ -427,6 +444,8 @@ private variable mRecalculate as Boolean private variable mUpdateSeparator as Boolean private variable mUpdateDataList as Boolean private variable mRecalculateFit as Boolean +private variable mRedraw as Boolean +private variable mFoldChanged as Boolean private variable mAlternateRowBackgrounds as Boolean @@ -520,6 +539,8 @@ public handler OnCreate() returns nothing put true into mUpdateDataList put true into mUpdateSeparator put true into mRecalculateFit + put true into mRedraw + put false into mFoldChanged put false into mShowSeparator put 0.5 into mSeparatorRatio @@ -1356,6 +1377,20 @@ private handler getValueOnPath(in pPath as List, in pArray as Array) returns any end if end handler +-- Used to validate user input as a valid path +-- An empty path is generally used to clear the selected row +private handler pathIsValid(in pPath as List, in pArray as any) returns Boolean + if pPath is the empty list or not(pArray is an array) then + return false + else if (element 1 of pPath) is not among the keys of pArray then + return false + else if the number of elements in pPath is 1 then + return true + else + return pathIsValid(element 2 to -1 of pPath, pArray[element 1 of pPath]) + end if +end handler + // Return the whole stored array private handler getArrayData() returns Array return mData @@ -1685,7 +1720,40 @@ private handler unfoldPath(in pPath as List) // Changing fold state makes a recalculation necessary put true into mRecalculate put true into mUpdateSeparator - redraw all + if mRedraw then + put false into mFoldChanged + redraw all + end if + end if +end handler + +// Ensure all elements in a path are unfolded +private handler unfoldFullPath(in pPath as List) + variable tTopPath as List + if mFirstDataItem > 1 then + put mDataList[mFirstDataItem]["path"] into tTopPath + end if + + variable tElement as Integer + put false into mRedraw + repeat with tElement from 1 up to the number of elements in pPath + unfoldPath(element 1 to tElement of pPath) + end repeat + put true into mRedraw + + if mFoldChanged and not(mScrollHilitedElementIntoView) and \ + mFirstDataItem > 1 and \ + mDataList[mFirstDataItem]["path"] is not tTopPath then + variable tCount as Integer + repeat with tCount from mFirstDataItem + 1 up to the number of elements in mDataList + if mDataList[tCount]["path"] is tTopPath then + variable tViewCount as Integer + put the ceiling of (mViewHeight / mRowHeight) into tViewCount + put 1 into mFirstDataItem + ensureElementInView(tCount + tViewCount - 1) + exit repeat + end if + end repeat end if end handler @@ -1713,18 +1781,16 @@ private handler selectPath(in pPath as List) end if if mSelectedElement is nothing or tPathNotAlreadySelected or \ - mScrollHilitedElementIntoView then - if pPath is not the empty list and \ - not applyToNode(selectKey, pPath, 0, 1, mDataList, mData) then - put nothing into mSelectedElement - end if - if tPathNotAlreadySelected then - post "hiliteChanged" - end if - redraw all + mScrollHilitedElementIntoView or mFoldChanged then + put false into mFoldChanged + if not applyToNode(selectKey, pPath, 0, 1, mDataList, mData) then + put nothing into mSelectedElement + end if + if tPathNotAlreadySelected then + post "hiliteChanged" + end if + redraw all end if - - end handler // Unselect the key at the target path @@ -1809,13 +1875,21 @@ private handler applyFoldStateKey(in pKey as String, in pLevel as Integer, in pS if tElement["key"] is pKey and pLevel is tElement["indent"] then // Either splice in the below elements if pFoldState["folded"] is false then - put false into xList[tCount]["folded"] + + if "folded" is not among the keys of xList[tCount] then + put true into xList[tCount]["folded"] + end if + + if xList[tCount]["folded"] then + put false into xList[tCount]["folded"] + put true into mFoldChanged + + splice convertArrayToList(pArray, pLevel + 1, tElement["path"]) after element tCount of xList - splice convertArrayToList(pArray, pLevel + 1, tElement["path"]) after element tCount of xList - - // Apply the fold state on the subelements - if "array" is among the keys of pFoldState then - applyFoldState(pLevel + 1, tCount, pFoldState["array"], pArray, xList) + // Apply the fold state on the subelements + if "array" is among the keys of pFoldState then + applyFoldState(pLevel + 1, tCount, pFoldState["array"], pArray, xList) + end if end if // or delete them else @@ -1865,6 +1939,17 @@ private handler setArrayData(in pData as Array) returns nothing redraw all end handler +private handler getFoldedArrayData() returns Array + put the empty array into mFoldState + setArrayData(mData) + return mData +end handler + +private handler setFoldedArrayData(in pData as Array) returns nothing + put the empty array into mFoldState + setArrayData(pData) +end handler + private handler setFrameBorder(in pFrameBorder as Boolean) returns nothing put pFrameBorder into mFrameBorder redraw all @@ -1873,7 +1958,14 @@ end handler private handler setSelectedElement(in pElement as String) variable tPath as List split pElement by mPathDelimiter into tPath - selectPath(tPath) + if pathIsValid(tPath, mData) then + if the number of elements in tPath > 1 then + unfoldFullPath(element 1 to -2 of tPath) + end if + selectPath(tPath) + else + unselectPath(mSelectedElement) + end if end handler private handler getSelectedElement() returns String From 6350fe453cbf24237b7bed990543c397801d99e7 Mon Sep 17 00:00:00 2001 From: Sean Cole Date: Tue, 23 Oct 2018 17:19:09 +0100 Subject: [PATCH 0026/1134] [[Docs]] Update Filter to make better distinction for regEx --- docs/dictionary/command/filter.lcdoc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/dictionary/command/filter.lcdoc b/docs/dictionary/command/filter.lcdoc index 466ffc9d5d0..4bcc2df7b80 100644 --- a/docs/dictionary/command/filter.lcdoc +++ b/docs/dictionary/command/filter.lcdoc @@ -71,20 +71,17 @@ Description: Use the command to pick specific lines, items, keys or elements in a container or expression. -The ...with form and the ...matching form retain the +The '...with' form and the '...matching' form retain the lines, items, keys or elements that contain a match for the specified . -The ...without form and the ...not matching form discard +The '...without' form and the '...not matching' form discard the lines, items, keys or elements that do not contain a match for the specified . If you don't specify lines, items, keys or elements then lines are filtered by default. -If a regex pattern is specified, the evaluates to a -regular expression. - If a wildcard is specified, the consists of a string of characters to match, which may be combined with any number of the following special characters: @@ -111,12 +108,17 @@ You can match instances of special chars as follows: For example, the wildcard `[[]A]*` will match any -string beginning with `[A]`. +string beginning with `[A]`. Broken down, there is '[[]' which equates +to an open square bracket '[' followed by 'A]*' as the closing square +bracket is not a special character. The three bracketed forms can be combined to create more complex character classes, for example the pattern [!abcA-C] matches any character which is not a, b or c (upper or lower case) +If 'regex pattern' is specified, the evaluates to a +regular expression. + If no type is specified, the is handled as a wildcard. From d6aa8fffa31ddf2e86fe26a84b50446b072c7708 Mon Sep 17 00:00:00 2001 From: Sean Cole Date: Wed, 24 Oct 2018 03:19:57 +0100 Subject: [PATCH 0027/1134] A few suggested and necessary alterations --- docs/dictionary/command/filter.lcdoc | 60 +++++++++++++++------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/docs/dictionary/command/filter.lcdoc b/docs/dictionary/command/filter.lcdoc index 4bcc2df7b80..df444609e12 100644 --- a/docs/dictionary/command/filter.lcdoc +++ b/docs/dictionary/command/filter.lcdoc @@ -2,7 +2,7 @@ Name: filter Type: command -Syntax: filter [{lines | items | keys | elements} of] {with | without | [not] matching} [{wildcard pattern | regex pattern}] [into ] +Syntax: filter [{lines | items | keys | element| without | [not] matching} [] [is} of] {with nto ] Summary: Filters each line, item, key or element in a source container or @@ -56,46 +56,51 @@ Parameters: filterSource: An expression that evaluates to a string, array, or a container. +patternType: +Either `wildcard pattern` or `regex pattern`. + filterPattern: An expression used to match certain lines, items, keys or elements. targetContainer: -An expression that evaluates to a container +An expression that evaluates to a container. It: -If the filter command is used on a which is not a -container, and no is specified, the filtered string +If the filter command is used on a which is not +a , and no is specified, the filtered string or array will be placed in the variable. Description: Use the command to pick specific lines, items, keys or elements -in a container or expression. +in a or . -The '...with' form and the '...matching' form retain the +The `filter...with` form and the `filter...matching` form retain the lines, items, keys or elements that contain a match for the specified . -The '...without' form and the '...not matching' form discard +The `filter...without` form and the `filter...not matching` form discard the lines, items, keys or elements that do not contain a match for the specified . If you don't specify lines, items, keys or elements then lines are filtered by default. -If a wildcard is specified, the consists -of a string of characters to match, which may be combined with any -number of the following special characters: +If a `wildcard pattern` is specified or no is +specified, the consists of a string of characters to +match, which may be combined with any number of the following +special characters: -- * : Matches zero or more of any character. The A*C +- `*` : Matches zero or more of any character. The filterPattern `A*C` matches "AC", "ABC", or "ADZXC". -- ? : Matches exactly one character. The A?C matches +- `?` : Matches exactly one character. The filterPattern `A?C` matches "ABC", but not "AC" or "ADZXC". -- [chars] : Matches any one of the characters inside the brackets. The - A[BC]D matches "ABD" or "ACD", but not "AD" or "ABCD". -- [char-char] : Matches any character whose unicode codepoint is between - the first character and the second character. -- [!chars] : Matches any character which is not one of the characters +- `[chars]` : Matches any one of the characters inside the brackets. The + filterPattern `A[BC]D` matches "ABD" or "ACD", but not "AD" or "ABCD". +- `[!chars]` : Matches any character which is not one of the characters inside the brackets. +- `[char-char]` : Matches any character whose unicode codepoint is between + the first character and the second character, such as `[a-y]` any character + between "a" and "y" but not "z" You can match instances of special chars as follows: @@ -108,22 +113,22 @@ You can match instances of special chars as follows: For example, the wildcard `[[]A]*` will match any -string beginning with `[A]`. Broken down, there is '[[]' which equates -to an open square bracket '[' followed by 'A]*' as the closing square +string beginning with `[A]`. Broken down, there is `[[]` which equates +to an open square bracket `[` followed by `A]*` as the closing square bracket is not a special character. The three bracketed forms can be combined to create more complex character classes, for example the pattern [!abcA-C] matches any character which is not a, b or c (upper or lower case) -If 'regex pattern' is specified, the evaluates to a -regular expression. - -If no type is specified, the is handled -as a wildcard. +>**Note:** If the `regex pattern` is specified, +the evaluates to a . +> +>If no is specified, the is handled +as a `wildcard pattern` type. -If no is specified, and you filter a container, the -container contents will be replaced by the filtered result. +If no is specified, and you filter a , +the contents will be replaced by the filtered result. Changes: The ...without form was added in version 2.1.1. In previous @@ -142,6 +147,7 @@ Filtering of array keys and elements was added in version 8.1. References: replace (command), sort (command), matchChunk (function), matchText (function), replaceText (function), it (keyword), -caseSensitive (property) +caseSensitive (property), container (glossary), expression (glossary), +regular expression (glossary) Tags: text processing From cf77c97ff8d750a3a6ad841cf33c9c55ba79caa8 Mon Sep 17 00:00:00 2001 From: Sean Cole Date: Wed, 24 Oct 2018 03:29:48 +0100 Subject: [PATCH 0028/1134] Repaired syntax Something weird happened to the syntax --- docs/dictionary/command/filter.lcdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dictionary/command/filter.lcdoc b/docs/dictionary/command/filter.lcdoc index df444609e12..931b1b424e4 100644 --- a/docs/dictionary/command/filter.lcdoc +++ b/docs/dictionary/command/filter.lcdoc @@ -2,7 +2,7 @@ Name: filter Type: command -Syntax: filter [{lines | items | keys | element| without | [not] matching} [] [is} of] {with nto ] +Syntax: filter [{lines | items | keys | elements} of] {with| without | [not] matching} [] [into ] Summary: Filters each line, item, key or element in a source container or From f25b90abef648650807234917b6e4ab5be600d62 Mon Sep 17 00:00:00 2001 From: Sean Cole Date: Wed, 24 Oct 2018 13:59:36 +0100 Subject: [PATCH 0029/1134] Split regex and wildcard syntax and remove suggested references to a patternType parameter. --- docs/dictionary/command/filter.lcdoc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/dictionary/command/filter.lcdoc b/docs/dictionary/command/filter.lcdoc index 931b1b424e4..9c00c5a21c9 100644 --- a/docs/dictionary/command/filter.lcdoc +++ b/docs/dictionary/command/filter.lcdoc @@ -2,7 +2,9 @@ Name: filter Type: command -Syntax: filter [{lines | items | keys | elements} of] {with| without | [not] matching} [] [into ] +Syntax: filter [{lines | items | keys | elements} of] {with| without | [not] matching} [wildcard pattern] [into ] + +Syntax: filter [{lines | items | keys | elements} of] {with| without | [not] matching} regex pattern [into ] Summary: Filters each line, item, key or element in a source container or @@ -56,9 +58,6 @@ Parameters: filterSource: An expression that evaluates to a string, array, or a container. -patternType: -Either `wildcard pattern` or `regex pattern`. - filterPattern: An expression used to match certain lines, items, keys or elements. @@ -85,7 +84,7 @@ specified . If you don't specify lines, items, keys or elements then lines are filtered by default. -If a `wildcard pattern` is specified or no is +If a `wildcard pattern` is specified or no pattern type is specified, the consists of a string of characters to match, which may be combined with any number of the following special characters: @@ -121,10 +120,10 @@ The three bracketed forms can be combined to create more complex character classes, for example the pattern [!abcA-C] matches any character which is not a, b or c (upper or lower case) ->**Note:** If the `regex pattern` is specified, +>**Note:** If the `regex pattern` type is specified, the evaluates to a . > ->If no is specified, the is handled +>If no pattern type is specified, the is handled as a `wildcard pattern` type. If no is specified, and you filter a , From 653ff53749eebb735a6cde7dba3c52d66c827318 Mon Sep 17 00:00:00 2001 From: Sean Cole Date: Fri, 26 Oct 2018 17:02:57 +0100 Subject: [PATCH 0030/1134] wildcardPattern and regexPattern parameters added MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Replaced filterPattern with wildcardPattern and regexPattern • Rearranged the paragraphs of the description for sense --- docs/dictionary/command/filter.lcdoc | 43 ++++++++++++++++------------ 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/docs/dictionary/command/filter.lcdoc b/docs/dictionary/command/filter.lcdoc index 9c00c5a21c9..a85cb353f93 100644 --- a/docs/dictionary/command/filter.lcdoc +++ b/docs/dictionary/command/filter.lcdoc @@ -2,14 +2,13 @@ Name: filter Type: command -Syntax: filter [{lines | items | keys | elements} of] {with| without | [not] matching} [wildcard pattern] [into ] +Syntax: filter [{lines | items | keys | elements} of] {with| without | [not] matching} [wildcard pattern] [into ] -Syntax: filter [{lines | items | keys | elements} of] {with| without | [not] matching} regex pattern [into ] +Syntax: filter [{lines | items | keys | elements} of] {with| without | [not] matching} regex pattern [into ] Summary: -Filters each line, item, key or element in a source container or -expression, removing the lines, items, keys or elements that do or don't -match a pattern. +Filters each line, item, key or element in a source container or expression, +removing the lines, items, keys or elements that do or don't match a pattern. Introduced: 1.0 @@ -58,8 +57,14 @@ Parameters: filterSource: An expression that evaluates to a string, array, or a container. -filterPattern: +wildcardPattern: An expression used to match certain lines, items, keys or elements. +See description. + +regexPattern: +An regular expression used to match certain lines, items, keys or elements. +See [Microsofts RegEx Quick Reference](https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference) +guide for more info on regex usage. targetContainer: An expression that evaluates to a container. @@ -75,19 +80,25 @@ in a or . The `filter...with` form and the `filter...matching` form retain the lines, items, keys or elements that contain a match for the specified -. + or . The `filter...without` form and the `filter...not matching` form discard the lines, items, keys or elements that do not contain a match for the -specified . +specified or . If you don't specify lines, items, keys or elements then lines are filtered by default. -If a `wildcard pattern` is specified or no pattern type is -specified, the consists of a string of characters to -match, which may be combined with any number of the following -special characters: +>**Note:** If neither `wildcard pattern` or `regex pattern` forms are explicitly +specified then the wildcard pattern form is assumed. + +If the `regex pattern` form is specified, the should +be formatted as a . There are [many websites](https://www.google.com/search?regex) +that provide examples and tutorials of RegEx expressions. + +If the 'wildcard pattern' form is to be used, the should +consists of a string of characters to match, which may be combined with any +number of the following special characters: - `*` : Matches zero or more of any character. The filterPattern `A*C` matches "AC", "ABC", or "ADZXC". @@ -111,7 +122,7 @@ You can match instances of special chars as follows: - `!` with `!` -For example, the wildcard `[[]A]*` will match any +For example, the `[[]A]*` will match any string beginning with `[A]`. Broken down, there is `[[]` which equates to an open square bracket `[` followed by `A]*` as the closing square bracket is not a special character. @@ -120,12 +131,6 @@ The three bracketed forms can be combined to create more complex character classes, for example the pattern [!abcA-C] matches any character which is not a, b or c (upper or lower case) ->**Note:** If the `regex pattern` type is specified, -the evaluates to a . -> ->If no pattern type is specified, the is handled -as a `wildcard pattern` type. - If no is specified, and you filter a , the contents will be replaced by the filtered result. From 3654ed8b500a7e1f7d1a55eaeed1a15e6df437c9 Mon Sep 17 00:00:00 2001 From: Brian Milby Date: Fri, 26 Oct 2018 21:09:10 -0500 Subject: [PATCH 0031/1134] [[ Bug 20659 ]] Update TreeView to ignore mouseUp when row has changed Add `mMouseDownRow` to record the row clicked when a mouseDown event is registered that does not take place in the scrollBar or Separator. Add check to the `OnClick` handler to ensure that clicks are ignored if the mouseDown and mouseUp rows are different. Moved the `addBaseLevelElement` handler to ensure that it is not called when mouseDown and mouseUp rows are different. Converted spaces to tabs in several places. --- extensions/widgets/treeview/notes/21659.md | 1 + extensions/widgets/treeview/treeview.lcb | 110 ++++++++++++--------- 2 files changed, 62 insertions(+), 49 deletions(-) create mode 100644 extensions/widgets/treeview/notes/21659.md diff --git a/extensions/widgets/treeview/notes/21659.md b/extensions/widgets/treeview/notes/21659.md new file mode 100644 index 00000000000..b412e107e16 --- /dev/null +++ b/extensions/widgets/treeview/notes/21659.md @@ -0,0 +1 @@ +# [21659] Update TreeView to ignore mouseUp when row has changed diff --git a/extensions/widgets/treeview/treeview.lcb b/extensions/widgets/treeview/treeview.lcb index 176b5c47bd5..8b0ad1834ad 100644 --- a/extensions/widgets/treeview/treeview.lcb +++ b/extensions/widgets/treeview/treeview.lcb @@ -83,7 +83,7 @@ use com.livecode.library.widgetutils use com.livecode.foreign metadata author is "LiveCode" -metadata version is "2.2.0" +metadata version is "2.2.1" metadata title is "Tree View" metadata svgicon is "M152.4,249.7c-6.4,0-11.8,4.3-13.5,10.1h-10v-26.7h10c1.7,5.8,7.1,10.1,13.5,10.1c7.8,0,14.1-6.3,14.1-14.1s-6.3-14.1-14.1-14.1c-6.4,0-11.8,4.3-13.5,10.1h-10v-16.1c8.4-1.8,14.8-9.3,14.8-18.3c0-10.4-8.4-18.8-18.8-18.8s-18.8,8.4-18.8,18.8c0,9,6.3,16.5,14.7,18.3v58.8h18c1.7,5.8,7.1,10.1,13.5,10.1c7.8,0,14.1-6.3,14.1-14.1S160.2,249.7,152.4,249.7z M128.7,202h-7.5v-7.5h-7.5V187h7.5v-7.5h7.5v7.5h7.5v7.5h-7.5V202z" metadata _ide is "true" @@ -452,6 +452,7 @@ private variable mAlternateRowBackgrounds as Boolean private variable mIndentPixels as Integer private variable mHoverRow as Integer private variable mHoverIcon as String +private variable mMouseDownRow as Integer private variable mFrameBorder as Boolean @@ -827,6 +828,12 @@ public handler OnMouseDown() returns nothing put true into mSeparatorDragging end if end if + + if mSeparatorDragging or scrollDragging() then + put 0 into mMouseDownRow + else + put yPosToRowNumber(the y of the mouse position) into mMouseDownRow + end if end handler public handler OnMouseMove() returns nothing @@ -850,32 +857,32 @@ public handler OnMouseMove() returns nothing put 0 into tNewRatio else if tNewRatio > 1 then put 1 into tNewRatio - end if + end if setSeparatorRatio(tNewRatio) else - variable tRedraw as Boolean - put false into tRedraw + variable tRedraw as Boolean + put false into tRedraw variable tNewHoverRow as Integer put yPosToRowNumber(the y of the mouse position) into tNewHoverRow if mHoverRow is not tNewHoverRow then put tNewHoverRow into mHoverRow - put true into tRedraw + put true into tRedraw + end if + if mHoverRow is 1 then + put "" into mHoverIcon + else + variable tHoverIcon as String + put xPosToIconString(the x of the mouse position, mHoverRow) into tHoverIcon + if mHoverIcon is not tHoverIcon then + put tHoverIcon into mHoverIcon + put true into tRedraw + end if + setHoverTooltip(tHoverIcon) + end if + + if tRedraw then + redraw all end if - if mHoverRow is 1 then - put "" into mHoverIcon - else - variable tHoverIcon as String - put xPosToIconString(the x of the mouse position, mHoverRow) into tHoverIcon - if mHoverIcon is not tHoverIcon then - put tHoverIcon into mHoverIcon - put true into tRedraw - end if - setHoverTooltip(tHoverIcon) - end if - - if tRedraw then - redraw all - end if end if end handler @@ -914,7 +921,7 @@ public handler OnMouseScroll(in pDeltaX as Real, in pDeltaY as Real) returns not updateScrollbar(mViewWidth, mViewHeight, mDataHeight, mViewTopPosition) redraw all - end if + end if end handler public handler OnClick() returns nothing @@ -922,12 +929,6 @@ public handler OnClick() returns nothing put yPosToRowNumber(the y of the mouse position) into mHoverRow end if - // If the first row was clicked then add a new element - if mHoverRow is 1 then - addBaseLevelElement() - return - end if - // Click in the scrollbar region does nothing if the x of the click position > mViewWidth - scrollbarWidth() then return @@ -936,13 +937,24 @@ public handler OnClick() returns nothing // Click on the separator does nothing if mShowSeparator then if mSeparatorDragging then - put false into mSeparatorDragging - return + put false into mSeparatorDragging + return else if the click position is within separatorRectangle() then return end if end if + // Just return if mouseDown and mouseUp are not in the same row + if mHoverRow is not mMouseDownRow then + return + end if + + // If the first row was clicked then add a new element + if mHoverRow is 1 then + addBaseLevelElement() + return + end if + // Just return if the click was below all the data if mHoverRow > the number of elements in mDataList then return @@ -953,15 +965,15 @@ public handler OnClick() returns nothing // Check if the delete icon was clicked if mHoverIcon is "delete" then - variable tPrompt as String - variable tPath - put tData["path"] into tPath - combine tPath with "][" - put "Really delete array element at path [" & the result & "]?" into tPrompt - execute script "answer \q" & tPrompt & "\q with OK and Cancel; return it" - if the result is "OK" then - removePath(tData["path"]) - end if + variable tPrompt as String + variable tPath + put tData["path"] into tPath + combine tPath with "][" + put "Really delete array element at path [" & the result & "]?" into tPrompt + execute script "answer \q" & tPrompt & "\q with OK and Cancel; return it" + if the result is "OK" then + removePath(tData["path"]) + end if return end if @@ -991,12 +1003,12 @@ public handler OnClick() returns nothing if not mShowSeparator or tX < the left of separatorRectangle() then if tData["folded"] is true then unfoldPath(tData["path"]) - else + else foldPath(tData["path"]) - end if - return + end if + return end if - end if + end if end if if the click count is 1 then @@ -1010,15 +1022,15 @@ public handler OnClick() returns nothing if the click count > 1 then if tData["leaf"] then - combine tData["path"] with mPathDelimiter into tPathString + combine tData["path"] with mPathDelimiter into tPathString post "actionDoubleClick" with [tPathString] else - if tData["folded"] is true then - unfoldPath(tData["path"]) - else - foldPath(tData["path"]) - end if - end if + if tData["folded"] is true then + unfoldPath(tData["path"]) + else + foldPath(tData["path"]) + end if + end if end if end handler From f4153ce773b8b389f611b5a8df4e1c3a0ba78372 Mon Sep 17 00:00:00 2001 From: Brian Milby Date: Wed, 31 Oct 2018 01:34:02 -0500 Subject: [PATCH 0032/1134] [[ TreeView ]] Get/Set Fold State Add `foldState` property to allow the full fold state to be retrieved and managed via LCS. This will allow arbitrary states to be saved and restored along with the ability to clear the fold state. Checks were added so that invalid data does not crash the widget. If the `folded` key is missing for a key in the array, then it is skipped. If a boolean is not set for the `folded` key value, then the value is ignored. --- extensions/widgets/treeview/treeview.lcb | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/extensions/widgets/treeview/treeview.lcb b/extensions/widgets/treeview/treeview.lcb index 6f63467e4c9..acbf5ca9a74 100644 --- a/extensions/widgets/treeview/treeview.lcb +++ b/extensions/widgets/treeview/treeview.lcb @@ -104,6 +104,21 @@ The arrayData is the data currently being displayed by the tree view widget. property arrayData get getArrayData set setArrayData metadata arrayData.label is "Array data" +/** +Syntax: set the foldState of to +Syntax: get the foldState of +Summary: The fold state of the array being displayed by the widget + +Parameters: +pFoldState (array): The fold state data. + +Description: +The foldState is the fold state currently being displayed by the tree view widget. +**/ + +property foldState get getFoldState set setFoldState +metadata foldState.user_visible is "false" + /** Syntax: set the hilitedElement of to Syntax: get the hilitedElement of @@ -1361,6 +1376,10 @@ private handler getArrayData() returns Array return mData end handler +private handler getFoldState() returns Array + return mFoldState +end handler + -- Sorts numerically, converting strings to numbers where possible private handler CompareKeysNumeric(in pLeft as any, in pRight as any) returns Integer variable tLeft as optional any @@ -1842,6 +1861,12 @@ private handler applyFoldState(in pLevel as Integer, in pStart as Integer, in pF next repeat end if + // If user supplied fold state is invalid + if "folded" is not among the keys of pFoldState[tKey] or \ + not(pFoldState[tKey]["folded"] is a boolean) then + next repeat + end if + applyFoldStateKey(tKey, pLevel, pStart, pFoldState[tKey], pArray[tKey], xList) end repeat @@ -1865,6 +1890,12 @@ private handler setArrayData(in pData as Array) returns nothing redraw all end handler +private handler setFoldState(in pData as Array) returns nothing + put pData into mFoldState + put true into mUpdateDataList + redraw all +end handler + private handler setFrameBorder(in pFrameBorder as Boolean) returns nothing put pFrameBorder into mFrameBorder redraw all From a221d9e2af68acb076b6a511830de58eb26511f5 Mon Sep 17 00:00:00 2001 From: Brian Milby Date: Wed, 31 Oct 2018 21:10:37 -0500 Subject: [PATCH 0033/1134] [[ TreeView ]] Get/Set Fold State * Add feature note * Expand dictionary entry to provide an example of how the fold state array is structured. * Add handler to check the fold state array and thrown an error if invalid. --- .../treeview/notes/feature-fold_state.md | 18 +++++++ extensions/widgets/treeview/treeview.lcb | 53 ++++++++++++++++--- 2 files changed, 64 insertions(+), 7 deletions(-) create mode 100644 extensions/widgets/treeview/notes/feature-fold_state.md diff --git a/extensions/widgets/treeview/notes/feature-fold_state.md b/extensions/widgets/treeview/notes/feature-fold_state.md new file mode 100644 index 00000000000..03d196a5dbf --- /dev/null +++ b/extensions/widgets/treeview/notes/feature-fold_state.md @@ -0,0 +1,18 @@ +# Properties + +The tree view widget now has the ability to get and set the fold state. + +One property has been added to achieve this option: +* **foldState**: array + +The fold state array is structured as follows: + +``` + [key1] + ["folded"] + ["array"] + [subkey1] + ["folded"] + [key2] + ["folded"] +``` diff --git a/extensions/widgets/treeview/treeview.lcb b/extensions/widgets/treeview/treeview.lcb index acbf5ca9a74..509bfdd7713 100644 --- a/extensions/widgets/treeview/treeview.lcb +++ b/extensions/widgets/treeview/treeview.lcb @@ -110,10 +110,23 @@ Syntax: get the foldState of Summary: The fold state of the array being displayed by the widget Parameters: -pFoldState (array): The fold state data. +pFoldState (array): The fold state data. See description for details. Description: The foldState is the fold state currently being displayed by the tree view widget. + +The fold state array only contains elements of the data array where the +value is a subarray. The value for each `folded` key must be a boolean. + +``` + [key1] + ["folded"] + ["array"] + [subkey1] + ["folded"] + [key2] + ["folded"] +``` **/ property foldState get getFoldState set setFoldState @@ -1861,17 +1874,40 @@ private handler applyFoldState(in pLevel as Integer, in pStart as Integer, in pF next repeat end if - // If user supplied fold state is invalid - if "folded" is not among the keys of pFoldState[tKey] or \ - not(pFoldState[tKey]["folded"] is a boolean) then - next repeat - end if - applyFoldStateKey(tKey, pLevel, pStart, pFoldState[tKey], pArray[tKey], xList) end repeat end handler +private handler checkFoldState(inout pFoldState as Array) returns Boolean + if pFoldState is empty then + return true + end if + + variable tKey as String + variable tValue as String + repeat for each key tKey in pFoldState + if not (pFoldState[tKey] is an array) or \ + "folded" is not among the keys of pFoldState[tKey] then + return false + end if + if not(pFoldState[tKey]["folded"] is a boolean) then + put pFoldState[tKey]["folded"] into tValue + delete pFoldState[tKey]["folded"] + if tValue is "true" then + put true into pFoldState[tKey]["folded"] + else + put false into pFoldState[tKey]["folded"] + end if + end if + if "array" is among the keys of pFoldState[tKey] and \ + not checkFoldState(pFoldState[tKey]["array"]) then + return false + end if + end repeat + return true +end handler + private handler setRowBackgrounds(in pShowAlternateBackgrounds as Boolean) returns nothing put pShowAlternateBackgrounds into mAlternateRowBackgrounds redraw all @@ -1891,6 +1927,9 @@ private handler setArrayData(in pData as Array) returns nothing end handler private handler setFoldState(in pData as Array) returns nothing + if not checkFoldState(pData) then + throw "Invalid fold state" + end if put pData into mFoldState put true into mUpdateDataList redraw all From ab4f8d7f73e83146e74eaa26922ff61ec7550605 Mon Sep 17 00:00:00 2001 From: Brian Milby Date: Fri, 26 Oct 2018 21:25:22 -0500 Subject: [PATCH 0034/1134] [[ Bug 21361 ]] Add option to reset fold state when setting arrayData Add bugfix note to existing PR --- extensions/widgets/treeview/notes/21361.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 extensions/widgets/treeview/notes/21361.md diff --git a/extensions/widgets/treeview/notes/21361.md b/extensions/widgets/treeview/notes/21361.md new file mode 100644 index 00000000000..2b59366b17e --- /dev/null +++ b/extensions/widgets/treeview/notes/21361.md @@ -0,0 +1 @@ +# [21361] Add option to reset fold state when setting arrayData \ No newline at end of file From ef24f1102aecd4951e015996035a9c8976e0a327 Mon Sep 17 00:00:00 2001 From: Brian Milby Date: Wed, 31 Oct 2018 23:43:12 -0500 Subject: [PATCH 0035/1134] [[ TreeView ]] Add hilitedElementFoldState property Add a property to allow the fold state of the selected element to be get and set. This also allows determining if the selected element is a leaf node. Updated documentation for enum parameters so they are formatted properly. Moved getSelectedElement handler so the ordering of get/set handlers is more consistent (get handlers appear before set handlers). --- .../treeview/notes/feature-auto_expand.md | 4 + extensions/widgets/treeview/treeview.lcb | 93 ++++++++++++++++--- 2 files changed, 86 insertions(+), 11 deletions(-) diff --git a/extensions/widgets/treeview/notes/feature-auto_expand.md b/extensions/widgets/treeview/notes/feature-auto_expand.md index bfaeea93da1..4325c21930d 100644 --- a/extensions/widgets/treeview/notes/feature-auto_expand.md +++ b/extensions/widgets/treeview/notes/feature-auto_expand.md @@ -8,3 +8,7 @@ top row. The tree view fold state can now be reset in two ways. To set the array data in a folded state then use the **foldedArrayData** property. To collapse the tree without changing the data, get the **foldedArrayData**. + +The tree view widget now has the ability to get and set the fold state +of the selected element via the **hilitedElementFoldState** property. +Values are `folded`, `unfolded`, and `leaf`. \ No newline at end of file diff --git a/extensions/widgets/treeview/treeview.lcb b/extensions/widgets/treeview/treeview.lcb index 8b0ad1834ad..aa83f319729 100644 --- a/extensions/widgets/treeview/treeview.lcb +++ b/extensions/widgets/treeview/treeview.lcb @@ -142,6 +142,27 @@ Setting to an invalid path or to `empty` will unselect the currently selected ro property hilitedElement get getSelectedElement set setSelectedElement metadata hilitedElement.label is "Hilited element" +/** +Syntax: set the hilitedElementFoldState of to +Syntax: get the hilitedElementFoldState of + +Summary: Get/set the fold state of the selected element + +Parameters: +pFoldState (enum): The fold state of the selected element. +- "folded": Sub-array for the selected element is hidden. +- "unfolded": Sub-array for the selected element is visible. +- "leaf": Selected element is a leaf node. This value may not be set. + +Description: + is the fold state of the selected element. When setting +the fold state, attempts to set the value for a leaf node will have no +effect. Setting the fold state when no element is selected has no effect. +**/ + +property hilitedElementFoldState get getSelectedElementFoldState set setSelectedElementFoldState +metadata hilitedElementFoldState.user_visible is "false" + /** Syntax: set the hiliteNewElement of to {true|false} Syntax: get the hiliteNewElement of @@ -262,8 +283,8 @@ Summary: Manipulates the order in which elements of the tree view are displayed, Parameters: pOrder (enum): The order in which to display elements of the tree view. --"ascending": Display from first to last in the order. This is the default --"descending": Display from last to first in the order. +- "ascending": Display from first to last in the order. This is the default +- "descending": Display from last to first in the order. Description: Use the property to display the elements of the tree view in ascending or descending order of the @@ -286,8 +307,8 @@ Summary: Manipulates the type of ordering in which elements of the tree view are Parameters: pType (enum): The type of ordering to use in displaying elements of the tree view. --"text": Display in alphabetical order of the keys --"numeric": Display in numeric order of the keys. This is the default +- "text": Display in alphabetical order of the keys +- "numeric": Display in numeric order of the keys. This is the default Description: Use the property to use text or numeric comparison when ordering the keys of the @@ -1389,6 +1410,18 @@ private handler getValueOnPath(in pPath as List, in pArray as Array) returns any end if end handler +private handler pathIsAnArray(in pPath as List, in pArray as any) returns Boolean + if pPath is the empty list then + return pArray is an array + else if (element 1 of pPath) is not among the keys of pArray then + return false + else if the number of elements in pPath is 1 then + return pArray[element 1 of pPath] is an array + else + return pathIsAnArray(element 2 to -1 of pPath, pArray[element 1 of pPath]) + end if +end handler + -- Used to validate user input as a valid path -- An empty path is generally used to clear the selected row private handler pathIsValid(in pPath as List, in pArray as any) returns Boolean @@ -1967,6 +2000,18 @@ private handler setFrameBorder(in pFrameBorder as Boolean) returns nothing redraw all end handler +private handler getSelectedElement() returns String + variable tElement as String + if mSelectedElement is not nothing then + combine mSelectedElement with mPathDelimiter into tElement + // Make sure empty path is recognised as a valid path + put mPathDelimiter after tElement + else + put the empty string into tElement + end if + return tElement +end handler + private handler setSelectedElement(in pElement as String) variable tPath as List split pElement by mPathDelimiter into tPath @@ -1980,16 +2025,42 @@ private handler setSelectedElement(in pElement as String) end if end handler -private handler getSelectedElement() returns String - variable tElement as String +private handler getSelectedElementFoldState() returns String + variable tFoldState as String + put the empty string into tFoldState if mSelectedElement is not nothing then - combine mSelectedElement with mPathDelimiter into tElement - // Make sure empty path is recognised as a valid path - put mPathDelimiter after tElement + variable tCount as Integer + repeat with tCount from 2 up to the number of elements in mDataList + if mDataList[tCount]["selected"] then + if mDataList[tCount]["leaf"] then + put "leaf" into tFoldState + else if mDataList[tCount]["folded"] then + put "folded" into tFoldState + else + put "unfolded" into tFoldState + end if + exit repeat + end if + end repeat + end if + return tFoldState +end handler + +private handler setSelectedElementFoldState(in pFoldState as String) returns nothing + variable tSetTheFoldState as Boolean + put (mSelectedElement is not nothing) and \ + pathIsAnArray(mSelectedElement, mData) into tSetTheFoldState + if pFoldState is "folded" then + if tSetTheFoldState then + foldPath(mSelectedElement) + end if + else if pFoldState is "unfolded" then + if tSetTheFoldState then + unFoldPath(mSelectedElement) + end if else - put the empty string into tElement + throw "Invalid fold state" end if - return tElement end handler private handler setReadOnly(in pReadOnly as Boolean) From f154442b89bae513e8968f5eb8d9776c96a70f29 Mon Sep 17 00:00:00 2001 From: Brian Milby Date: Wed, 31 Oct 2018 23:49:19 -0500 Subject: [PATCH 0036/1134] [[ Docs ]] Update Push Button Widget enums The enum properties were not formatted properly for the dictionary. Added a space between `-` and the entry so it will be generated as a list. --- extensions/widgets/pushbutton/pushbutton.lcb | 62 ++++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/extensions/widgets/pushbutton/pushbutton.lcb b/extensions/widgets/pushbutton/pushbutton.lcb index 917798724e1..190cbbad903 100644 --- a/extensions/widgets/pushbutton/pushbutton.lcb +++ b/extensions/widgets/pushbutton/pushbutton.lcb @@ -47,10 +47,10 @@ Summary: The theme of the widget Parameters: pWidgetTheme(enum): The theme of the widget --"iOS" --"Android(Floating Action)" --"Android(Raised)" --"Android(Flat)" +- "iOS" +- "Android(Floating Action)" +- "Android(Raised)" +- "Android(Flat)" Description: Use the property to set the theme of the widget. @@ -69,8 +69,8 @@ Summary: The display style of the widget's label Parameters: pStyle(enum): The display style --"text" --"icon" +- "text" +- "icon" Description: Use the property to set the display style of the widget's label, either text or an icon. @@ -151,9 +151,9 @@ Summary: The background opacity of the button Parameters: pOpacity(enum): The background opacity of the button --"Opaque" --"Translucent" --"Transparent" +- "Opaque" +- "Translucent" +- "Transparent" Description: Use the property to set the opacity of the button's background. @@ -175,26 +175,26 @@ Summary: The color scheme of the widget Parameters: pColorScheme(enum): The color scheme of the widget --"Black" --"Red" --"Pink" --"Purple" --"Deep Purple" --"Indigo" --"Blue" --"Light Blue" --"Cyan" --"Teal" --"Green" --"Light Green" --"Lime" --"Yellow" --"Amber" --"Orange" --"Deep Orange" --"Brown" --"Grey" --"Blue Grey" +- "Black" +- "Red" +- "Pink" +- "Purple" +- "Deep Purple" +- "Indigo" +- "Blue" +- "Light Blue" +- "Cyan" +- "Teal" +- "Green" +- "Light Green" +- "Lime" +- "Yellow" +- "Amber" +- "Orange" +- "Deep Orange" +- "Brown" +- "Grey" +- "Blue Grey" Description: Use the property to set the color scheme of the widget, Android only. @@ -213,8 +213,8 @@ Summary: The color theme of the widget Parameters: pColorTheme(enum): The color theme of the widget --"Light" --"Dark" +- "Light" +- "Dark" Description: Use the property to set the color theme of the widget, Android only. From 6ee0a238311eee4b573799db1e9ebdfa03d9238d Mon Sep 17 00:00:00 2001 From: Brian Milby Date: Thu, 1 Nov 2018 23:40:58 -0500 Subject: [PATCH 0037/1134] [[ Bug 21361 ]] Add property to allow auto reset fold state **autoFoldStateReset** property added to allow the fold state to be reset when the array data is set. Default value is `false` to match existing behavior. Property is saved and restored with the other widget data. --- extensions/widgets/treeview/treeview.lcb | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/extensions/widgets/treeview/treeview.lcb b/extensions/widgets/treeview/treeview.lcb index aa83f319729..26b71f70e02 100644 --- a/extensions/widgets/treeview/treeview.lcb +++ b/extensions/widgets/treeview/treeview.lcb @@ -196,6 +196,22 @@ References: hilitedElement (property) property scrollHilitedElementIntoView get mScrollHilitedElementIntoView set mScrollHilitedElementIntoView metadata scrollHilitedElementIntoView.label is "Scroll hilited element into view" +/** +Syntax: set the autoFoldStateReset of to {true|false} +Syntax: get the autoFoldStateReset of + +Summary: Automatically reset fold state when array data is set. + +Description: +Use the property to determine if the fold state is +reset (tree is completely folded) when the property is set. + +References: arrayData (property) +**/ + +property autoFoldStateReset get mAutoFoldStateReset set mAutoFoldStateReset +metadata autoFoldStateReset.label is "Automatically reset fold state when array data is set" + /** Name: foreColor @@ -479,6 +495,7 @@ private variable mFrameBorder as Boolean private variable mSelectedElement as optional List private variable mFoldState as Array +private variable mAutoFoldStateReset as Boolean private variable mLastKeyAdded as optional String private variable mHiliteNewElement as Boolean private variable mScrollHilitedElementIntoView as Boolean @@ -570,6 +587,7 @@ public handler OnCreate() returns nothing put the empty array into mFoldState put the empty array into mData + put false into mAutoFoldStateReset put false into mHiliteNewElement put false into mScrollHilitedElementIntoView end handler @@ -581,6 +599,7 @@ public handler OnSave(out rProperties as Array) put mArrayStyle into rProperties["array style"] put mSortAscending into rProperties["sort ascending"] put mSortNumeric into rProperties["sort numeric"] + put mAutoFoldStateReset into rProperties["auto fold state reset"] put mHiliteNewElement into rProperties["hilite new element"] put mScrollHilitedElementIntoView into rProperties["scroll hilited element into view"] @@ -604,6 +623,10 @@ public handler OnLoad(in pProperties as Array) put pProperties["sort numeric"] into mSortNumeric end if + if "auto fold state reset" is among the keys of pProperties then + put pProperties["auto fold state reset"] into mAutoFoldStateReset + end if + if "hilite new element" is among the keys of pProperties then put pProperties["hilite new element"] into mHiliteNewElement end if @@ -1979,6 +2002,9 @@ end handler // Replace the existing data wholesale with a new array pData private handler setArrayData(in pData as Array) returns nothing + if mAutoFoldStateReset then + put the empty array into mFoldState + end if put pData into mData put true into mUpdateDataList redraw all From 68bafd355bcf6960f63b007cfcf9c571d591bb8a Mon Sep 17 00:00:00 2001 From: Brian Milby Date: Fri, 2 Nov 2018 00:10:10 -0500 Subject: [PATCH 0038/1134] [[ TreeView Widget ]] Back out foldedArrayData property Remove **foldedArrayData** property from widget source and feature note. Replaced with **autoFoldStateReset** property in another commit to address bug 21361. PR 6770 is a better solution for manual clearing of the fold state and more general in that it allows complete control of the fold state array. --- .../treeview/notes/feature-auto_expand.md | 20 ++++++++----- extensions/widgets/treeview/treeview.lcb | 28 ------------------- 2 files changed, 13 insertions(+), 35 deletions(-) diff --git a/extensions/widgets/treeview/notes/feature-auto_expand.md b/extensions/widgets/treeview/notes/feature-auto_expand.md index 4325c21930d..071b63e5422 100644 --- a/extensions/widgets/treeview/notes/feature-auto_expand.md +++ b/extensions/widgets/treeview/notes/feature-auto_expand.md @@ -1,14 +1,20 @@ # Properties -The tree view widget now has the ability to automatically expand to reveal -a row when it is selected. If **scrollHilitedElementIntoView** is not `true` +The tree view widget now will automatically expand to reveal a row when +it is selected. If **scrollHilitedElementIntoView** is not `true` then the scroll position will be adjusted to maintain the currently visible top row. -The tree view fold state can now be reset in two ways. To set the array -data in a folded state then use the **foldedArrayData** property. To -collapse the tree without changing the data, get the **foldedArrayData**. - The tree view widget now has the ability to get and set the fold state of the selected element via the **hilitedElementFoldState** property. -Values are `folded`, `unfolded`, and `leaf`. \ No newline at end of file +Values are `folded`, `unfolded`, and `leaf`. + +Setting a value other than `folded` or `unfolded` will throw an error. + +Setting a value when nothing is selected or setting a value on a leaf +node will have no effect. + +The **autoFoldStateReset** boolean property is added to allow the fold +state to be reset when the array data is set. + +Default value is `false` to match existing behavior. \ No newline at end of file diff --git a/extensions/widgets/treeview/treeview.lcb b/extensions/widgets/treeview/treeview.lcb index 26b71f70e02..7cfd935aea1 100644 --- a/extensions/widgets/treeview/treeview.lcb +++ b/extensions/widgets/treeview/treeview.lcb @@ -104,23 +104,6 @@ The arrayData is the data currently being displayed by the tree view widget. property arrayData get getArrayData set setArrayData metadata arrayData.label is "Array data" -/** -Syntax: set the foldedArrayData of to -Syntax: get the foldedArrayData of -Summary: The array being displayed by the widget - -Parameters: -pArray (array): The array data. - -Description: -The arrayData is the data currently being displayed by the tree view widget. -Setting the arrayData using the foldedArrayData property will reset the fold -state to fold all elements. -**/ - -property foldedArrayData get getFoldedArrayData set setFoldedArrayData -metadata foldedArrayData.user_visible is "false" - /** Syntax: set the hilitedElement of to Syntax: get the hilitedElement of @@ -2010,17 +1993,6 @@ private handler setArrayData(in pData as Array) returns nothing redraw all end handler -private handler getFoldedArrayData() returns Array - put the empty array into mFoldState - setArrayData(mData) - return mData -end handler - -private handler setFoldedArrayData(in pData as Array) returns nothing - put the empty array into mFoldState - setArrayData(pData) -end handler - private handler setFrameBorder(in pFrameBorder as Boolean) returns nothing put pFrameBorder into mFrameBorder redraw all From bf8271fd751a56ac412f48ee9e9fa4a0cf469f9d Mon Sep 17 00:00:00 2001 From: livecodesam Date: Fri, 2 Nov 2018 12:59:10 +0000 Subject: [PATCH 0039/1134] revDatabaseCursors to revDeleteFolder --- docs/dictionary/command/revDeleteFolder.lcdoc | 41 ++++++++++--------- .../function/revDataFromQuery.lcdoc | 30 +++++++------- .../function/revDatabaseCursors.lcdoc | 15 ++++--- docs/dictionary/function/revDatabaseID.lcdoc | 8 ++-- .../dictionary/function/revDatabaseType.lcdoc | 4 +- .../function/revdb_closecursor.lcdoc | 8 ++-- .../dictionary/function/revdb_movefirst.lcdoc | 7 ++-- docs/dictionary/function/revdb_movelast.lcdoc | 7 ++-- 8 files changed, 59 insertions(+), 61 deletions(-) diff --git a/docs/dictionary/command/revDeleteFolder.lcdoc b/docs/dictionary/command/revDeleteFolder.lcdoc index c7ce804f4c0..e34d082685b 100644 --- a/docs/dictionary/command/revDeleteFolder.lcdoc +++ b/docs/dictionary/command/revDeleteFolder.lcdoc @@ -46,27 +46,28 @@ On Mac OS and OS X systems, the places the > should not rename or move and it didn't > create without obtaining explicit confirmation from the user. ->*Note:* When included in a , the library> is implemented as a hidden and made available when -> the receives its first message. During the -> first part of the startup process, before -> this is sent, the is not yet -> available. This may affect attempts to use this in -> , , , or -> in the
. Once the has -> finished starting up, the is available and the -> can be used in any . +>*Note:* When included in a , the +> is implemented as a hidden and made +> available when the receives its first +> message. During the first part of the +> startup process, before this is sent, the +> is not yet available. This may affect +> attempts to use this in , , +> , or in the +>
. Once the has finished starting up, +> the is available and the +> can be used in any . References: revCopyFolder (command), create folder (command), answer folder (command), delete file (command), revMoveFolder (command), -function (control structure), folders (function), application (glossary), -return (glossary), standalone application (glossary), file (glossary), -shell (glossary), subfolder (glossary), platform (glossary), -command (glossary), Windows (glossary), main stack (glossary), -OS X (glossary), AppleScript (glossary), group (glossary), -result (glossary), Unix (glossary), Mac OS (glossary), folder (glossary), -message (glossary), handler (glossary), Common library (library), -library (library), startup (message), openBackground (message), -preOpenStack (message), openStack (message), preOpenCard (message), -stack (object) +function (control structure), folders (function), result (function), +application (glossary), return (glossary), +standalone application (glossary), file (glossary), shell (glossary), +subfolder (glossary), platform (glossary), command (glossary), +Windows (glossary), main stack (glossary), OS X (glossary), +AppleScript (glossary), group (glossary), Unix (glossary), +Mac OS (glossary), folder (glossary), message (glossary), +handler (glossary), Common library (library), library (library), +startup (message), openBackground (message), preOpenStack (message), +openStack (message), preOpenCard (message), stack (object) diff --git a/docs/dictionary/function/revDataFromQuery.lcdoc b/docs/dictionary/function/revDataFromQuery.lcdoc index 89658d49053..d55ce93a0b4 100644 --- a/docs/dictionary/function/revDataFromQuery.lcdoc +++ b/docs/dictionary/function/revDataFromQuery.lcdoc @@ -8,8 +8,8 @@ Syntax: revDataFromQuery([],[], , Summary: Gets from a according to a and -places the resulting data in a , without creating a . +places the resulting data in a , without creating a +. Associations: database library @@ -67,18 +67,18 @@ It is convenient to use the , instead of revQueryDatabase, when you want to obtain the data for use but don't need to retain a reference to the that the data came from. The executes the , gets -the found by the , closes the created by the , and -returns the data. Important:The function should not -be used if any of the data being retrieved is binary, doing so will -probably produce unexpected results. If you wish to use this function to -return things like image data, the data should be encoded before being -stored in the database, this could for example be done with the - . Also remember to specify a columDelim and - that will not appear in the data. Alternatively, both these -problems can be avoided by using the to -generate a record set, then using to retrieve -each field individually. +the found by the , closes the + created by the , and returns the data. +>*Important*: The function should not +> be used if any of the data being retrieved is binary, doing so will +> probably produce unexpected results. If you wish to use this function to +> return things like image data, the data should be encoded before being +> stored in the database, this could for example be done with the +> . Also remember to specify a columDelim and +> that will not appear in the data. Alternatively, both these +> problems can be avoided by using the to +> generate a record set, then using to retrieve +> each field individually. The may contain one or more placeholders, which are sequential numbers by a colon. The @@ -144,7 +144,7 @@ function (control structure), base64Encode (function), function (glossary), revQueryDatabase (function), revDatabaseColumnNamed (function), LiveCode custom library (glossary), return (glossary), variable (glossary), database (glossary), -record set (database cursor) (glossary), record (glossary), +record set (glossary), record (glossary), Standalone Application Settings (glossary), standalone application (glossary), SQL query (glossary), delimit (glossary), prepend (glossary), string (keyword), diff --git a/docs/dictionary/function/revDatabaseCursors.lcdoc b/docs/dictionary/function/revDatabaseCursors.lcdoc index 49269bda390..b73a43f2490 100644 --- a/docs/dictionary/function/revDatabaseCursors.lcdoc +++ b/docs/dictionary/function/revDatabaseCursors.lcdoc @@ -7,8 +7,8 @@ Type: function Syntax: revDatabaseCursors() Summary: - the IDs -associated with a connection to a . + the IDs associated with a connection +to a . Associations: database library @@ -40,9 +40,8 @@ separated by commas. Description: Use the to perform an operation on each -, or to find out how many - exist on a particular - connection. +, or to find out how many exist +on a particular connection. The record set IDs returned are those opened by the specified . @@ -61,9 +60,9 @@ The revDatabaseCursors synonym was added in version 2.0. References: revCloseCursor (command), function (control structure), Standalone Application Settings (glossary), database (glossary), -standalone application (glossary), -record set (database cursor) (glossary), return (glossary), -LiveCode custom library (glossary), Database library (library) +standalone application (glossary), record set (glossary), +return (glossary), LiveCode custom library (glossary), +Database library (library) Tags: database diff --git a/docs/dictionary/function/revDatabaseID.lcdoc b/docs/dictionary/function/revDatabaseID.lcdoc index 99815074e92..bb448bbb2f6 100644 --- a/docs/dictionary/function/revDatabaseID.lcdoc +++ b/docs/dictionary/function/revDatabaseID.lcdoc @@ -7,8 +7,8 @@ Type: function Syntax: revDatabaseID() Summary: - the database ID of the that opened a . + the database ID of the that opened a +. Associations: database library @@ -38,7 +38,7 @@ The returns a positive . Description: Use the to find out which a - belongs to. + belongs to. The returned value is the same as the value returned by the when the was first opened. @@ -61,7 +61,7 @@ The revDatabaseID synonym was added in version 2.0. References: revCloseDatabase (command), function (control structure), revOpenDatabase (function), Standalone Application Settings (glossary), database (glossary), standalone application (glossary), -record set (database cursor) (glossary), return (glossary), +record set (glossary), return (glossary), LiveCode custom library (glossary), integer (keyword), Database library (library) diff --git a/docs/dictionary/function/revDatabaseType.lcdoc b/docs/dictionary/function/revDatabaseType.lcdoc index 83dfd96a37e..467a1bfbcad 100644 --- a/docs/dictionary/function/revDatabaseType.lcdoc +++ b/docs/dictionary/function/revDatabaseType.lcdoc @@ -53,8 +53,8 @@ perform different operations depending on what kind of database is being used. You can use the to distinguish between -different types. For example, you may need to frame a differently depending on what type of you are +different types. For example, you may need to frame a + differently depending on what type of you are communicating with. >*Important:* The is part of the diff --git a/docs/dictionary/function/revdb_closecursor.lcdoc b/docs/dictionary/function/revdb_closecursor.lcdoc index 8bdc6a5a124..dcea8ac0060 100644 --- a/docs/dictionary/function/revdb_closecursor.lcdoc +++ b/docs/dictionary/function/revdb_closecursor.lcdoc @@ -33,8 +33,8 @@ The returns an error message if the closure is not successful. Otherwise, it returns empty. Description: -Use the to clean up after using a . +Use the to clean up after using a +. Evaluating the has the same effect as the . The only difference @@ -52,8 +52,8 @@ is that one is a and the other is a . References: revCloseCursor (command), function (control structure), function call (glossary), Standalone Application Settings (glossary), command (glossary), standalone application (glossary), execute (glossary), -record set (database cursor) (glossary), -LiveCode custom library (glossary), Database library (library) +record set (glossary), LiveCode custom library (glossary), +Database library (library) Tags: database diff --git a/docs/dictionary/function/revdb_movefirst.lcdoc b/docs/dictionary/function/revdb_movefirst.lcdoc index 859296af695..f51f056697e 100644 --- a/docs/dictionary/function/revdb_movefirst.lcdoc +++ b/docs/dictionary/function/revdb_movefirst.lcdoc @@ -23,13 +23,12 @@ revdb_movefirst(savedResults) Parameters: recordSetID: The number returned by the revQueryDatabase or revQueryDatabaseBLOB -function when the record set (database cursor) was created. +function when the record set was created. Returns: The returns true if it successfully moved to the first , false if it could not move to the first -because there are no in the . +because there are no in the . Description: Use the to move around within the selected @@ -53,7 +52,7 @@ References: revMoveToLastRecord (command), revMoveToFirstRecord (command), revMoveToNextRecord (command), function (control structure), revCurrentRecord (function), revCurrentRecordIsFirst (function), revCurrentRecordIsLast (function), LiveCode custom library (glossary), -execute (glossary), record set (database cursor) (glossary), +execute (glossary), record set (glossary), record (glossary), Standalone Application Settings (glossary), standalone application (glossary), function call (glossary), command (glossary), Database library (library) diff --git a/docs/dictionary/function/revdb_movelast.lcdoc b/docs/dictionary/function/revdb_movelast.lcdoc index d3e339b32d0..5cdb399d0e1 100644 --- a/docs/dictionary/function/revdb_movelast.lcdoc +++ b/docs/dictionary/function/revdb_movelast.lcdoc @@ -23,13 +23,12 @@ revdb_movelast(mySearch) Parameters: recordSetID: The number returned by the revQueryDatabase or revQueryDatabaseBLOB -function when the record set (database cursor) was created. +function when the record set was created. Returns: The returns true if it successfully moved to the last , false if it could not move to the last -because there are no in the . +because there are no in the . Description: Use the to move around within the selected @@ -53,7 +52,7 @@ References: revMoveToLastRecord (command), revMoveToFirstRecord (command), revMoveToNextRecord (command), function (control structure), revCurrentRecord (function), revCurrentRecordIsFirst (function), revCurrentRecordIsLast (function), LiveCode custom library (glossary), -execute (glossary), record set (database cursor) (glossary), +execute (glossary), record set (glossary), record (glossary), Standalone Application Settings (glossary), standalone application (glossary), function call (glossary), command (glossary), Database library (library) From bb81c3d50fabfd995bd500d3cdd5f0993e2cc9da Mon Sep 17 00:00:00 2001 From: livecodeali Date: Fri, 2 Nov 2018 14:18:59 +0000 Subject: [PATCH 0040/1134] [[ Bug 21672 ]] Disable auto content inset adjustment on iOS 11 scroller --- docs/notes/bugfix-21672.md | 1 + engine/src/mbliphonescroller.mm | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 docs/notes/bugfix-21672.md diff --git a/docs/notes/bugfix-21672.md b/docs/notes/bugfix-21672.md new file mode 100644 index 00000000000..3329d86f835 --- /dev/null +++ b/docs/notes/bugfix-21672.md @@ -0,0 +1 @@ +# Disable iOS 11 native scroller content inset adjustment behavior diff --git a/engine/src/mbliphonescroller.mm b/engine/src/mbliphonescroller.mm index 81ef4f9add1..7e9aab0742b 100644 --- a/engine/src/mbliphonescroller.mm +++ b/engine/src/mbliphonescroller.mm @@ -752,7 +752,14 @@ bool MCScrollViewGetContentOffset(UIScrollView *p_view, int32_t &r_x, int32_t &r t_view = [[UIScrollView alloc] initWithFrame: CGRectMake(0, 0, 0, 0)]; if (t_view == nil) return nil; - + +#if __IPHONE_OS_VERSION_MAX_ALLOWED > 110000 + if (@available(iOS 11.0, *)) { + [t_view setContentInsetAdjustmentBehavior: UIScrollViewContentInsetAdjustmentNever]; + } +#endif + [t_view setContentInset: UIEdgeInsetsMake(0, 0, 0, 0)]; + [t_view setHidden: YES]; m_delegate = [[com_runrev_livecode_MCiOSScrollViewDelegate alloc] initWithInstance: this]; From 4f317e6ce072ead19926e8a083fe39c7a7939b4c Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Tue, 6 Nov 2018 15:07:32 +0200 Subject: [PATCH 0041/1134] [21663] Fix error in S/B for Android when TimeZone lib is included --- ide-support/revsaveasandroidstandalone.livecodescript | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ide-support/revsaveasandroidstandalone.livecodescript b/ide-support/revsaveasandroidstandalone.livecodescript index a4ae86494b5..cd386873814 100644 --- a/ide-support/revsaveasandroidstandalone.livecodescript +++ b/ide-support/revsaveasandroidstandalone.livecodescript @@ -1204,6 +1204,10 @@ private command addAssetsFromFolderToArchive pFolder, pBaseName, pArchive, @pFon if the last item of pFolder is ".svn" then exit addAssetsFromFolderToArchive end if + + if char -1 of pFolder is slash then + delete char -1 of pFolder + end if local tOldFolder put the folder into tOldFolder From a155d85e8f02dbd311ac5c69b76c322a39f15a19 Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Tue, 6 Nov 2018 15:11:54 +0200 Subject: [PATCH 0042/1134] [21663] Added bugfix note --- docs/notes/bugfix-21663.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/notes/bugfix-21663.md diff --git a/docs/notes/bugfix-21663.md b/docs/notes/bugfix-21663.md new file mode 100644 index 00000000000..4f4c7e4bb80 --- /dev/null +++ b/docs/notes/bugfix-21663.md @@ -0,0 +1 @@ +# Fix error when building an Android standalone and the TimeZone library is included From 42ff2975637be179388ad087d905f50ac4260ff2 Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Tue, 6 Nov 2018 16:35:44 +0200 Subject: [PATCH 0043/1134] Updated ide submodule ptr --- ide | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ide b/ide index 465f761e8de..0a7252be010 160000 --- a/ide +++ b/ide @@ -1 +1 @@ -Subproject commit 465f761e8de13f444a3f60416b74adb4c2732009 +Subproject commit 0a7252be01079893871cf400fd8d8f49cb25ae7d From d570de23834f66504e623b35889af97a4760b612 Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Thu, 8 Nov 2018 12:52:56 +0200 Subject: [PATCH 0044/1134] [21681] Ensure start and end date are respected on mobilePickDate --- engine/src/java/com/runrev/android/DialogModule.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/src/java/com/runrev/android/DialogModule.java b/engine/src/java/com/runrev/android/DialogModule.java index 9a93f2ebec6..590c9d9aec8 100644 --- a/engine/src/java/com/runrev/android/DialogModule.java +++ b/engine/src/java/com/runrev/android/DialogModule.java @@ -171,14 +171,14 @@ public void onDismiss(DialogInterface p_dialog) if (p_with_min) { Method t_setMinDate; - t_setMinDate = t_dialog.getClass().getMethod("setMinDate", new Class[] {Long.TYPE}); + t_setMinDate = t_date_picker.getClass().getMethod("setMinDate", new Class[] {Long.TYPE}); t_setMinDate.invoke(t_date_picker, new Object[] {p_min * 1000}); } if (p_with_max) { Method t_setMaxDate; - t_setMaxDate = t_dialog.getClass().getMethod("setMaxDate", new Class[] {Long.TYPE}); + t_setMaxDate = t_date_picker.getClass().getMethod("setMaxDate", new Class[] {Long.TYPE}); t_setMaxDate.invoke(t_date_picker, new Object[] {p_max * 1000}); } } From 78115375ba0d31ff6ca3aaeb2ee64718fa2ed898 Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Thu, 8 Nov 2018 12:55:03 +0200 Subject: [PATCH 0045/1134] [21681] Added bugfix note --- docs/notes/bugfix-21681.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/notes/bugfix-21681.md diff --git a/docs/notes/bugfix-21681.md b/docs/notes/bugfix-21681.md new file mode 100644 index 00000000000..68566f5fe4b --- /dev/null +++ b/docs/notes/bugfix-21681.md @@ -0,0 +1 @@ +# Ensure start and end dates are respected on mobilePickDate on Android From b72efcbeecaf8bd2f0c4f69742a96fecb5b883c2 Mon Sep 17 00:00:00 2001 From: livecodesam Date: Thu, 8 Nov 2018 11:28:44 +0000 Subject: [PATCH 0046/1134] [bugfix-19231] Correct code example in rawClipboardData --- docs/dictionary/property/rawClipboardData.lcdoc | 4 ++-- docs/notes/bugfix-19231.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 docs/notes/bugfix-19231.md diff --git a/docs/dictionary/property/rawClipboardData.lcdoc b/docs/dictionary/property/rawClipboardData.lcdoc index 88af3582dba..4c11c5fb601 100644 --- a/docs/dictionary/property/rawClipboardData.lcdoc +++ b/docs/dictionary/property/rawClipboardData.lcdoc @@ -24,7 +24,7 @@ Example: lock the clipboard set the rawClipboardData["text/plain;charset=utf-8"] \ to textEncode("Hello, World!", "UTF-8" ) -- Linux -set the rawClipboardData["CF_UNICODE"] \ +set the rawClipboardData["CF_UNICODETEXT"] \ to textEncode("Hello, World!", "UTF-16" ) -- Windows set the rawClipboardData["public.utf8-plain-text"] \ to textEncode("Hello, World!", "UTF-8" ) -- OSX @@ -76,7 +76,7 @@ encoding. References: lock clipboard (command), unlock clipboard (command), clipboard (function), textEncode (function), textDecode (function), -clipboard (glossary), clipboardData (property), +clipboard (glossary), property (glossary), clipboardData (property), fullClipboardData (property), rawDragData (property) Tags: ui, clipboard diff --git a/docs/notes/bugfix-19231.md b/docs/notes/bugfix-19231.md new file mode 100644 index 00000000000..b5646200985 --- /dev/null +++ b/docs/notes/bugfix-19231.md @@ -0,0 +1 @@ +# Correct code example in documentation for rawClipboardData From a4eab18732ebd9a25a8948a0475eafbd9a673e8c Mon Sep 17 00:00:00 2001 From: livecodesam Date: Fri, 9 Nov 2018 10:57:29 +0000 Subject: [PATCH 0047/1134] [bugfix-14440] Add note about caseSensitive to offset function entry --- docs/dictionary/function/offset.lcdoc | 13 +++++++++++-- docs/notes/bugfix-14440.md | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 docs/notes/bugfix-14440.md diff --git a/docs/dictionary/function/offset.lcdoc b/docs/dictionary/function/offset.lcdoc index 4454cc61343..6979611904f 100644 --- a/docs/dictionary/function/offset.lcdoc +++ b/docs/dictionary/function/offset.lcdoc @@ -56,12 +56,21 @@ specified number of in the . The is relative to this starting instead of the beginning of the . +>*Note:* The is affected by the . +>By default, this property is set to false, meaning uppercase letters +>and their lowercase equivalents are treated as the same. For example, + offset("A","abcABC") +>returns 1 by default, however after setting the to +>true, it returns 4 instead. + + References: find (command), sort container (command), function (control structure), wordOffset (function), itemOffset (function), length (function), lineOffset (function), value (function), return (glossary), non-negative (glossary), -character (keyword), characters (keyword), integer (keyword), -string (keyword), point (keyword), begins with (operator) +property (glossary), character (keyword), characters (keyword), +integer (keyword), string (keyword), point (keyword), +begins with (operator), caseSensitive (property) Tags: text processing diff --git a/docs/notes/bugfix-14440.md b/docs/notes/bugfix-14440.md new file mode 100644 index 00000000000..7196903428a --- /dev/null +++ b/docs/notes/bugfix-14440.md @@ -0,0 +1 @@ +# Added note in the offset function's documentation about caseSensitive's effect on it. From 6f65b436d34d0ea4fd262f87b56b0cd3316bc7cf Mon Sep 17 00:00:00 2001 From: Sean Cole Date: Sat, 10 Nov 2018 14:46:56 +0000 Subject: [PATCH 0048/1134] Small typo fix --- docs/dictionary/command/filter.lcdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dictionary/command/filter.lcdoc b/docs/dictionary/command/filter.lcdoc index a85cb353f93..fb93fc0ea91 100644 --- a/docs/dictionary/command/filter.lcdoc +++ b/docs/dictionary/command/filter.lcdoc @@ -63,7 +63,7 @@ See description. regexPattern: An regular expression used to match certain lines, items, keys or elements. -See [Microsofts RegEx Quick Reference](https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference) +See [Microsoft's RegEx Quick Reference](https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference) guide for more info on regex usage. targetContainer: From c9df581ad691042225f269baef946dd3104e0e7b Mon Sep 17 00:00:00 2001 From: Monte Goulding Date: Tue, 13 Nov 2018 14:39:17 +1100 Subject: [PATCH 0049/1134] [[ Bug 21685 ]] Fix android keyboard resize handling Recent changes to the keyboard handling on android resulted in the instance variable `m_keyboard_visible` being out of sync with the actual keyboard visibility. This patch changes that variable to be purely a sentinel for `updateKeyboardVisible` and moves the keyboard visibility detection from the global layout listener to a new `keyboardIsVisible` method. --- docs/notes/bugfix-21685.md | 1 + .../src/java/com/runrev/android/Engine.java | 34 ++++++++++++++++--- .../com/runrev/android/LiveCodeActivity.java | 19 +---------- 3 files changed, 31 insertions(+), 23 deletions(-) create mode 100644 docs/notes/bugfix-21685.md diff --git a/docs/notes/bugfix-21685.md b/docs/notes/bugfix-21685.md new file mode 100644 index 00000000000..c6b8b3e6fb2 --- /dev/null +++ b/docs/notes/bugfix-21685.md @@ -0,0 +1 @@ +# Redraw screen correctly when hiding the keyboard on Android \ No newline at end of file diff --git a/engine/src/java/com/runrev/android/Engine.java b/engine/src/java/com/runrev/android/Engine.java index 8063a79ae51..990e08f1733 100644 --- a/engine/src/java/com/runrev/android/Engine.java +++ b/engine/src/java/com/runrev/android/Engine.java @@ -1254,7 +1254,7 @@ private Rect getWorkarea(boolean p_update, int p_new_width, int p_new_height) getLocationOnScreen(t_origin); // We have new values and the keyboard isn't showing so update any sizes we don't already know - if (p_update && !m_keyboard_visible) + if (p_update && !keyboardIsVisible()) { t_working_rect = new Rect(t_origin[0], t_origin[1], t_origin[0] + p_new_width, t_origin[1] + p_new_height); @@ -1392,18 +1392,42 @@ public boolean onTouchEvent(MotionEvent p_event) private boolean m_orientation_sizechange = false; private boolean m_keyboard_visible = false; + + boolean keyboardIsVisible() + { + // status bar height + int t_status_bar_height = 0; + int t_resource_id = getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (t_resource_id > 0) + { + t_status_bar_height = getResources().getDimensionPixelSize(t_resource_id); + } + + // display window size for the app layout + Rect t_app_rect = new Rect(); + getActivity().getWindow().getDecorView().getWindowVisibleDisplayFrame(t_app_rect); + + int t_screen_height = ((LiveCodeActivity)getContext()).s_main_layout.getRootView().getHeight(); + + // keyboard height equals (screen height - (user app height + status)) + int t_keyboard_height = t_screen_height - (t_app_rect.height() + t_status_bar_height); + + return t_keyboard_height > 0; + } - void updateKeyboardVisible(boolean p_visible) + void updateKeyboardVisible() { - if (p_visible == m_keyboard_visible) + boolean t_visible = keyboardIsVisible(); + + if (t_visible == m_keyboard_visible) return; // Log.i(TAG, "updateKeyboardVisible(" + p_visible + ")"); - m_keyboard_visible = p_visible; + m_keyboard_visible = t_visible; // IM-2013-11-15: [[ Bug 10485 ]] Notify engine when keyboard visiblity changes - if (p_visible) + if (t_visible) doKeyboardShown(0); else doKeyboardHidden(); diff --git a/engine/src/java/com/runrev/android/LiveCodeActivity.java b/engine/src/java/com/runrev/android/LiveCodeActivity.java index 0ba4af61ee6..4e773a0f7d7 100644 --- a/engine/src/java/com/runrev/android/LiveCodeActivity.java +++ b/engine/src/java/com/runrev/android/LiveCodeActivity.java @@ -83,24 +83,7 @@ protected void onCreate(Bundle p_saved_state) @Override public void onGlobalLayout() { - // status bar height - int t_status_bar_height = 0; - int t_resource_id = getResources().getIdentifier("status_bar_height", "dimen", "android"); - if (t_resource_id > 0) - { - t_status_bar_height = getResources().getDimensionPixelSize(t_resource_id); - } - - // display window size for the app layout - Rect t_app_rect = new Rect(); - getWindow().getDecorView().getWindowVisibleDisplayFrame(t_app_rect); - - int t_screen_height = s_main_layout.getRootView().getHeight(); - - // keyboard height equals (screen height - (user app height + status)) - int t_keyboard_height = t_screen_height - (t_app_rect.height() + t_status_bar_height); - - s_main_view.updateKeyboardVisible(t_keyboard_height > 0); + s_main_view.updateKeyboardVisible(); } }); } From 7f9135cb42a87f38bd4264575d287944c4d97f9f Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Tue, 13 Nov 2018 10:20:16 +0200 Subject: [PATCH 0050/1134] [9.0.2 RC2] Updated version --- version | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/version b/version index 2a6d041c6b3..011e7866ca0 100644 --- a/version +++ b/version @@ -1,6 +1,6 @@ -BUILD_REVISION = 15150 +BUILD_REVISION = 15151 BUILD_MAJOR_VERSION = 9 BUILD_MINOR_VERSION = 0 BUILD_POINT_VERSION = 2 -BUILD_SHORT_VERSION = 9.0.2-rc-1 -BUILD_LONG_VERSION = 9.0.2.15150 (RC 1) +BUILD_SHORT_VERSION = 9.0.2-rc-2 +BUILD_LONG_VERSION = 9.0.2.15151 (RC 2) From a374938e51abeca0bec121723544d570848dc7c7 Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Tue, 13 Nov 2018 16:03:36 +0200 Subject: [PATCH 0051/1134] [21690] Fix crash when clicking on magnify palette with Browse tool --- engine/src/idraw.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/src/idraw.cpp b/engine/src/idraw.cpp index 5fd14575174..f2f7524b6f9 100644 --- a/engine/src/idraw.cpp +++ b/engine/src/idraw.cpp @@ -640,10 +640,12 @@ Boolean MCImage::magmdown(uint2 which) // PM-2014-04-01: [[Bug 11072]] Convert image to mutable if an editing tool is selected, to prevent LC crashing if (isEditingTool(getstack()->gettool(this))) + { convert_to_mutable(); - if (static_cast(m_rep)->image_mdown(which) == True) - return True; + if (static_cast(m_rep)->image_mdown(which) == True) + return True; + } state |= CS_MFOCUSED; From 34b16f51dc74b7c592a9f1f3d6726e5e96ae2e23 Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Tue, 13 Nov 2018 16:08:44 +0200 Subject: [PATCH 0052/1134] [21690] Added bugfix note --- docs/notes/bugfix-21690.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/notes/bugfix-21690.md diff --git a/docs/notes/bugfix-21690.md b/docs/notes/bugfix-21690.md new file mode 100644 index 00000000000..1167a6d89c6 --- /dev/null +++ b/docs/notes/bugfix-21690.md @@ -0,0 +1 @@ +# Fix crash when clicking on the magnify palette and a non-paint tool is selected From 2cce35b4104c001f2337c7d20b453a113a1b0368 Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Thu, 15 Nov 2018 15:12:02 +0200 Subject: [PATCH 0053/1134] [21683] Fix crash when setting read-only props --- engine/src/executionerrors.h | 3 +++ engine/src/widget.cpp | 22 ++++++++++++++++++++++ libscript/src/script-error.cpp | 10 ++++++++++ libscript/src/script-instance.cpp | 4 ++++ libscript/src/script-private.h | 5 +++++ 5 files changed, 44 insertions(+) diff --git a/engine/src/executionerrors.h b/engine/src/executionerrors.h index 7a4f1dd565c..7f77b7cfb54 100644 --- a/engine/src/executionerrors.h +++ b/engine/src/executionerrors.h @@ -2777,6 +2777,9 @@ enum Exec_errors // {EE-0909} android permission: bad permission name EE_BAD_PERMISSION_NAME, + // {EE-0910} Property: value is not a data + EE_PROPERTY_NOTADATA + }; extern const char *MCexecutionerrors; diff --git a/engine/src/widget.cpp b/engine/src/widget.cpp index 228bff4c664..930db32b4b6 100644 --- a/engine/src/widget.cpp +++ b/engine/src/widget.cpp @@ -668,6 +668,28 @@ bool MCWidget::setcustomprop(MCExecContext& ctxt, MCNameRef p_set_name, MCNameRe !MCExtensionConvertFromScriptType(ctxt, t_set_type, InOut(t_value))) { CatchError(ctxt); + + Exec_errors t_error; + + MCResolvedTypeInfo t_resolved_type; + if (!MCTypeInfoResolve(t_set_type, t_resolved_type)) + return false; + + if ( t_resolved_type . named_type == kMCBooleanTypeInfo) + t_error = EE_PROPERTY_NAB; + + else if (t_resolved_type . named_type == kMCNumberTypeInfo) + t_error = EE_PROPERTY_NAN; + else if (t_resolved_type . named_type == kMCStringTypeInfo) + t_error = EE_PROPERTY_NAS; + else if (t_resolved_type . named_type == kMCArrayTypeInfo || t_resolved_type . named_type == kMCProperListTypeInfo) + t_error = EE_PROPERTY_NOTANARRAY; + else if (t_resolved_type . named_type == kMCDataTypeInfo) + t_error = EE_PROPERTY_NOTADATA; + else + t_error = EE_PROPERTY_CANTSET; + + ctxt . LegacyThrow(t_error); return false; } diff --git a/libscript/src/script-error.cpp b/libscript/src/script-error.cpp index a89d51720a6..9524a28e149 100644 --- a/libscript/src/script-error.cpp +++ b/libscript/src/script-error.cpp @@ -397,3 +397,13 @@ MCScriptCreateErrorExpectedError(MCErrorRef& r_error) MCSTR("error propagated without error object"), nil); } + +bool MCScriptThrowAttemptToSetReadOnlyPropertyError(MCScriptInstanceRef p_instance, MCNameRef p_property) +{ + return MCErrorCreateAndThrow(kMCScriptCannotSetReadOnlyPropertyErrorTypeInfo, + "module", + p_instance -> module -> name, + "property", + p_property, + nil); +} diff --git a/libscript/src/script-instance.cpp b/libscript/src/script-instance.cpp index 2a5933540c8..ccf3c6aa002 100644 --- a/libscript/src/script-instance.cpp +++ b/libscript/src/script-instance.cpp @@ -420,6 +420,10 @@ MCScriptSetPropertyInInstance(MCScriptInstanceRef self, MCScriptDefinition *t_setter; t_setter = t_property_def->setter != 0 ? self->module->definitions[t_property_def->setter - 1] : nil; + // If there is no setter for the property then this is an error. + if (t_setter == nil) + return MCScriptThrowAttemptToSetReadOnlyPropertyError(self, p_property); + /* LOAD CHECK */ __MCScriptAssert__(t_setter != nil, "property has no setter"); diff --git a/libscript/src/script-private.h b/libscript/src/script-private.h index 77aec00bb14..ada589fae8d 100644 --- a/libscript/src/script-private.h +++ b/libscript/src/script-private.h @@ -606,6 +606,11 @@ MCScriptInternalHandlerQuery(MCHandlerRef handler, bool MCScriptThrowPropertyNotFoundError(MCScriptInstanceRef instance, MCNameRef property); + +bool +MCScriptThrowAttemptToSetReadOnlyPropertyError(MCScriptInstanceRef instance, + MCNameRef property); + bool MCScriptThrowHandlerNotFoundError(MCScriptInstanceRef instance, MCNameRef handler); From a2ad8c9f10ea71f0284a94f27050cb9afd6ef13a Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Thu, 15 Nov 2018 15:51:04 +0200 Subject: [PATCH 0054/1134] [21683] Further tweaks --- engine/src/widget.cpp | 24 +++++++++++++++++++----- libscript/src/script-error.cpp | 2 +- libscript/src/script-instance.cpp | 2 +- libscript/src/script-private.h | 2 +- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/engine/src/widget.cpp b/engine/src/widget.cpp index 930db32b4b6..555d535b1a6 100644 --- a/engine/src/widget.cpp +++ b/engine/src/widget.cpp @@ -670,26 +670,40 @@ bool MCWidget::setcustomprop(MCExecContext& ctxt, MCNameRef p_set_name, MCNameRe CatchError(ctxt); Exec_errors t_error; + bool t_throw = false; MCResolvedTypeInfo t_resolved_type; if (!MCTypeInfoResolve(t_set_type, t_resolved_type)) return false; if ( t_resolved_type . named_type == kMCBooleanTypeInfo) + { t_error = EE_PROPERTY_NAB; - + t_throw = true; + } else if (t_resolved_type . named_type == kMCNumberTypeInfo) + { t_error = EE_PROPERTY_NAN; + t_throw = true; + } else if (t_resolved_type . named_type == kMCStringTypeInfo) + { t_error = EE_PROPERTY_NAS; + t_throw = true; + } else if (t_resolved_type . named_type == kMCArrayTypeInfo || t_resolved_type . named_type == kMCProperListTypeInfo) + { t_error = EE_PROPERTY_NOTANARRAY; + t_throw = true; + } else if (t_resolved_type . named_type == kMCDataTypeInfo) + { t_error = EE_PROPERTY_NOTADATA; - else - t_error = EE_PROPERTY_CANTSET; - - ctxt . LegacyThrow(t_error); + t_throw = true; + } + + if (t_throw) + ctxt . LegacyThrow(t_error); return false; } diff --git a/libscript/src/script-error.cpp b/libscript/src/script-error.cpp index 9524a28e149..46c7c402e39 100644 --- a/libscript/src/script-error.cpp +++ b/libscript/src/script-error.cpp @@ -398,7 +398,7 @@ MCScriptCreateErrorExpectedError(MCErrorRef& r_error) nil); } -bool MCScriptThrowAttemptToSetReadOnlyPropertyError(MCScriptInstanceRef p_instance, MCNameRef p_property) +bool MCScriptThrowCannotSetReadOnlyPropertyError(MCScriptInstanceRef p_instance, MCNameRef p_property) { return MCErrorCreateAndThrow(kMCScriptCannotSetReadOnlyPropertyErrorTypeInfo, "module", diff --git a/libscript/src/script-instance.cpp b/libscript/src/script-instance.cpp index ccf3c6aa002..d8ffe15bbfa 100644 --- a/libscript/src/script-instance.cpp +++ b/libscript/src/script-instance.cpp @@ -422,7 +422,7 @@ MCScriptSetPropertyInInstance(MCScriptInstanceRef self, // If there is no setter for the property then this is an error. if (t_setter == nil) - return MCScriptThrowAttemptToSetReadOnlyPropertyError(self, p_property); + return MCScriptThrowCannotSetReadOnlyPropertyError(self, p_property); /* LOAD CHECK */ __MCScriptAssert__(t_setter != nil, diff --git a/libscript/src/script-private.h b/libscript/src/script-private.h index ada589fae8d..61aa524e971 100644 --- a/libscript/src/script-private.h +++ b/libscript/src/script-private.h @@ -608,7 +608,7 @@ MCScriptThrowPropertyNotFoundError(MCScriptInstanceRef instance, MCNameRef property); bool -MCScriptThrowAttemptToSetReadOnlyPropertyError(MCScriptInstanceRef instance, +MCScriptThrowCannotSetReadOnlyPropertyError(MCScriptInstanceRef instance, MCNameRef property); bool From c167eebfb07b07608e9e1f6bd2200a592ec1ed35 Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Thu, 15 Nov 2018 15:52:40 +0200 Subject: [PATCH 0055/1134] [21683] Added bugfix note --- docs/notes/bugfix-21683.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/notes/bugfix-21683.md diff --git a/docs/notes/bugfix-21683.md b/docs/notes/bugfix-21683.md new file mode 100644 index 00000000000..54a01723563 --- /dev/null +++ b/docs/notes/bugfix-21683.md @@ -0,0 +1 @@ +# Fix crash when setting a widget read-only property From a2254049e50a9458c7e00076f5bb717abcf84b01 Mon Sep 17 00:00:00 2001 From: livecodealex Date: Mon, 19 Nov 2018 14:35:32 +0000 Subject: [PATCH 0056/1134] [[ ByteOffset ]] Fixed bug causing incorrect results --- docs/notes/bugfix-byteoffset.md | 1 + libfoundation/src/foundation-data.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 docs/notes/bugfix-byteoffset.md diff --git a/docs/notes/bugfix-byteoffset.md b/docs/notes/bugfix-byteoffset.md new file mode 100644 index 00000000000..78284489a4c --- /dev/null +++ b/docs/notes/bugfix-byteoffset.md @@ -0,0 +1 @@ +# Fixed bug causing byteOffset to behave incorectly in certain cases diff --git a/libfoundation/src/foundation-data.cpp b/libfoundation/src/foundation-data.cpp index c89a3d2d997..c62fd67805e 100644 --- a/libfoundation/src/foundation-data.cpp +++ b/libfoundation/src/foundation-data.cpp @@ -798,11 +798,18 @@ bool MCDataFirstIndexOf(MCDataRef p_data, MCDataRef p_chunk, MCRange p_range, ui if (p_range.length == 0) return false; - uindex_t t_limit, t_chunk_byte_count; + uindex_t t_limit, t_chunk_byte_count, t_data_byte_count; t_chunk_byte_count = MCDataGetLength(p_chunk); + t_data_byte_count = MCDataGetLength(p_data); + if (t_chunk_byte_count == 0) return false; - t_limit = p_range . offset + p_range . length - t_chunk_byte_count + 1; + else if (t_data_byte_count < t_chunk_byte_count) + return false; + else if (p_range.length < t_chunk_byte_count) + return false; + + t_limit = p_range . offset + t_data_byte_count- t_chunk_byte_count + 1; const byte_t *t_bytes = MCDataGetBytePtr(p_data); const byte_t *t_chunk_bytes = MCDataGetBytePtr(p_chunk); From 420426525b9f4bb20c872e72e397974fda235e61 Mon Sep 17 00:00:00 2001 From: livecodeali Date: Mon, 19 Nov 2018 17:33:21 +0000 Subject: [PATCH 0057/1134] [[ Cleanup ]] Add newline to end of file --- libfoundation/include/system-info.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libfoundation/include/system-info.h b/libfoundation/include/system-info.h index bc756773f58..09252a770a8 100644 --- a/libfoundation/include/system-info.h +++ b/libfoundation/include/system-info.h @@ -23,4 +23,5 @@ along with LiveCode. If not see . */ * System information * ================================================================ */ -MC_DLLEXPORT bool MCSInfoGetArchitecture(MCStringRef & r_string); \ No newline at end of file +MC_DLLEXPORT bool MCSInfoGetArchitecture(MCStringRef & r_string); + From e187852cafeb94251adfef472e26dffdd70db027 Mon Sep 17 00:00:00 2001 From: livecodealex Date: Tue, 20 Nov 2018 11:51:38 +0000 Subject: [PATCH 0058/1134] [[ Bug 21705 ]] Added some test cases --- tests/lcs/core/strings/offset.livecodescript | 86 ++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/tests/lcs/core/strings/offset.livecodescript b/tests/lcs/core/strings/offset.livecodescript index 4b41be07972..c383dd111b9 100644 --- a/tests/lcs/core/strings/offset.livecodescript +++ b/tests/lcs/core/strings/offset.livecodescript @@ -29,3 +29,89 @@ on TestOffsetSingleUnicodeChar set the caseSensitive to false TestAssert "offset of native needle in unicode string - caseless", offset(tNeedle, tHaystack) is 3 end TestOffsetSingleUnicodeChar + +// Function provided by Bernd Niggemann as part of bug report +// #21704 +function allOffsets pDelim, pString, pCaseSensitive, pNoOverlap + local tNewPos, tPos, tResult, tLen + + set the caseSensitive to pCaseSensitive is true + + put 0 into tPos + if pNoOverlap then + put the len of pDelim - 1 into tLen + repeat forever + put offset(pDelim, pString, tPos) into tNewPos + if tNewPos = 0 then exit repeat + add tNewPos to tPos + put tPos,"" after tResult + add tLen to tPos + end repeat + else + repeat forever + put offset(pDelim, pString, tPos) into tNewPos + if tNewPos = 0 then exit repeat + add tNewPos to tPos + put tPos,"" after tResult + end repeat + end if + + if tResult is empty then return 0 + else return char 1 to -2 of tResult +end allOffsets + +// Test whether we can correctly detect offsets in strings that contain +// native unicode chars, in a case sensitive manner +on TestOffsetMultipleUnicodeCharsSensitiveText1 + local tNeedle, tHaystack + + put "aaaaaaa" into tNeedle + put "𠜎aa𠜎aaa ばいしんせい ばいしんせい aaaaaaaaaaaaaaaaaaa c aaaaaaaaaaaaaaaaaaa" into tHaystack + + local tExpectedOffsets + put "23,24,25,26,27,28,29,30,31,32,33,34,35,45,46,47,48,49,50,51,52,53,54,55,56,57" into tExpectedOffsets + + TestAssert "the offsets match the expected offsets", tExpectedOffsets is allOffsets(tNeedle, tHaystack, true, false) +end TestOffsetMultipleUnicodeCharsSensitiveText1 + +// Test whether we can correctly detect offsets in strings that contain +// native unicode chars, in a case in-sensitive manner, in a different text +on TestOffsetMultipleUnicodeCharsInSensitiveText2 + local tNeedle, tHaystack + + put "aaa" into tNeedle + put "aa 𠜎 aaaaaaaaaaaaa↘𠜎aaaa" into tHaystack + + local tExpectedOffsets + put "6,7,8,9,10,11,12,13,14,15,16,21,22" into tExpectedOffsets + + TestAssert "the offsets match the expected offsets", tExpectedOffsets is allOffsets(tNeedle, tHaystack, true, false) +end TestOffsetMultipleUnicodeCharsInSensitiveText2 + +// Test whether we can correctly detect offsets in strings that contain +// native unicode chars, in a case in-sensitive manner +on TestOffsetMultipleUnicodeCharsInSensitive2 + local tNeedle, tHaystack + + put "aaa" into tNeedle + put "aa 𠜎 aaaaaaaaAAAaa↘𠜎aaaa" into tHaystack + + local tExpectedOffsets + put "6,7,8,9,10,11,12,13,14,15,16,21,22" into tExpectedOffsets + + TestAssert "the offsets match the expected offsets", tExpectedOffsets is allOffsets(tNeedle, tHaystack, false, false) +end TestOffsetMultipleUnicodeCharsInSensitive2 + +// Test whether we can correctly detect offsets in strings that contain +// native unicode chars, in a case sensitive manner +on TestOffsetMultipleUnicodeCharsInSensitive3 + local tNeedle, tHaystack + + put "𐀁" into tNeedle + put "𐀁𐀁𐀁𐀁𐀁𐀁" into tHaystack + + local tExpectedOffsets + put "1,2,3,4,5,6" into tExpectedOffsets + + TestAssert "the offsets match the expected offsets", tExpectedOffsets is allOffsets(tNeedle, tHaystack, true, false) +end TestOffsetMultipleUnicodeCharsInSensitive3 From 27560cb402f87e4aa3d1c7e97cecd2f4cd27d24c Mon Sep 17 00:00:00 2001 From: livecodealex Date: Tue, 20 Nov 2018 12:35:28 +0000 Subject: [PATCH 0059/1134] [[ Bug 21704 ]] Added tests for byteOffset --- .../core/strings/byteoffset.livecodescript | 126 +++++++++++++++++- 1 file changed, 125 insertions(+), 1 deletion(-) diff --git a/tests/lcs/core/strings/byteoffset.livecodescript b/tests/lcs/core/strings/byteoffset.livecodescript index 30347517ad3..455e86d2b22 100644 --- a/tests/lcs/core/strings/byteoffset.livecodescript +++ b/tests/lcs/core/strings/byteoffset.livecodescript @@ -16,6 +16,38 @@ for more details. You should have received a copy of the GNU General Public License along with LiveCode. If not see . */ +// Function provided by Bernd Niggemann as part of bug report +// #21704 +// We have changed the implementation to use byteOffset rather than offset +function allOffsets pDelim, pString, pCaseSensitive, pNoOverlap + local tNewPos, tPos, tResult, tLen + + set the caseSensitive to pCaseSensitive is true + + put 0 into tPos + if pNoOverlap then + put the len of pDelim - 1 into tLen + repeat forever + put byteoffset(pDelim, pString, tPos) into tNewPos + if tNewPos = 0 then exit repeat + add tNewPos to tPos + put tPos,"" after tResult + add tLen to tPos + end repeat + else + repeat forever + put byteoffset(pDelim, pString, tPos) into tNewPos + if tNewPos = 0 then exit repeat + add tNewPos to tPos + put tPos,"" after tResult + end repeat + end if + + if tResult is empty then return 0 + else return char 1 to -2 of tResult +end allOffsets + + on TestByteOffsetNonEmptyNeedleEmptyHaystack local tNeedle, tHaystack put "DEF" into tNeedle @@ -53,4 +85,96 @@ on TestByteOffsetEmptyNeedleNonEmptyHaystack TestAssert "byteoffset of empty needle in non-empty haystack", byteoffset(tNeedle, tHaystack) is 0 -end TestByteOffsetEmptyNeedleNonEmptyHaystack \ No newline at end of file +end TestByteOffsetEmptyNeedleNonEmptyHaystack + +on TestByteOffsetBinaryEncodingShouldNotGiveAnswer + local tNeedle, tHaystack + put "Rejkyavik" into tNeedle + put "R" into tHaystack + + TestAssert "byteoffset of needler longer than haystack should return 0", byteoffset(tNeedle, tHaystack) is 0 +end TestByteOffsetBinaryEncodingShouldNotGiveAnswer + +on TestByteOffsetBinaryEncodingShouldGiveAnswer + local tNeedle, tHaystack + put "j" into tNeedle + put "Rejkyavik" into tHaystack + + TestAssert "byteoffset of non-empty needle in non-empty haystack", byteoffset(tNeedle, tHaystack) is 3 +end TestByteOffsetBinaryEncodingShouldGiveAnswer + +on TestByteOffsetBinaryEncodingShouldNotGiveAnswerEncoded + local tNeedle, tHaystack + put textEncode("Rejkyavik", "UTF-32") into tNeedle + put textEncode("R", "UTF-32") into tHaystack + + TestAssert "byteoffset of needler longer than haystack should return 0", byteoffset(tNeedle, tHaystack) is 0 +end TestByteOffsetBinaryEncodingShouldNotGiveAnswerEncoded + +on TestByteOffsetBinaryEncodingShouldGiveAnswerEncoded + local tNeedle, tHaystack + put textEncode("j", "UTF-32") into tNeedle + put textEncode("Rejkyavik", "UTF-32") into tHaystack + + TestAssert "byteoffset of non-empty needle in non-empty haystack", byteoffset(tNeedle, tHaystack) is 9 +end TestByteOffsetBinaryEncodingShouldGiveAnswerEncoded + + +on TestByteOffsetBinaryEncodingShouldGiveAnswerEncodedChineseChars + local tNeedle, tHaystack + put textEncode("aaaaaaa", "UTF-32") into tNeedle + put textEncode("𠜎aa𠜎aaa ばいしんせい ばいしんせい aaaaaaaaaaaaaaaaaaa c aaaaaaaaaaaaaaaaaaa", "UTF-32") into tHaystack + + local tExpectedResult + put "89,93,97,101,105,109,113,117,121,125,129,133,137,177,181,185,189,193,197,201,205,209,213,217,221,225" into tExpectedResult + + TestAssert "byteoffset of non-empty needle in non-empty haystack with chinese characters", allOffsets(tNeedle, tHaystack, true, false) is tExpectedResult +end TestByteOffsetBinaryEncodingShouldGiveAnswerEncodedChineseChars + +// Test whether we can correctly detect offsets in strings that contain +// native unicode chars, in a case in-sensitive manner, in a different text +on TestOffsetMultipleUnicodeCharsInSensitiveText2 + local tNeedle, tHaystack + + put textEncode("aaa", "UTF-32") into tNeedle + put textEncode("aa 𠜎 aaaaaaaaaaaaa↘𠜎aaaa", "UTF-32") into tHaystack + + local tExpectedOffsets + put "21,25,29,33,37,41,45,49,53,57,61,81,85" into tExpectedOffsets + + put allOffsets(tNeedle, tHaystack, true, false) + + TestAssert "the offsets match the expected offsets", tExpectedOffsets is allOffsets(tNeedle, tHaystack, true, false) +end TestOffsetMultipleUnicodeCharsInSensitiveText2 + +// Test whether we can correctly detect offsets in strings that contain +// native unicode chars, in a case in-sensitive manner +on TestOffsetMultipleUnicodeCharsInSensitive2 + local tNeedle, tHaystack + + put textEncode("aaa", "UTF-32") into tNeedle + put textEncode("aa 𠜎 aaaaaaaaAAAaa↘𠜎aaaa", "UTF-32") into tHaystack + + local tExpectedOffsets + put "21,25,29,33,37,41,45,49,53,57,61,81,85" into tExpectedOffsets + + put allOffsets(tNeedle, tHaystack, false, false) + + TestAssert "the offsets match the expected offsets", tExpectedOffsets is not allOffsets(tNeedle, tHaystack, false, false) +end TestOffsetMultipleUnicodeCharsInSensitive2 + +// Test whether we can correctly detect offsets in strings that contain +// native unicode chars, in a case sensitive manner +on TestOffsetMultipleUnicodeCharsInSensitive3 + local tNeedle, tHaystack + + put textEncode("𐀁", "UTF-32") into tNeedle + put textEncode("𐀁𐀁𐀁𐀁𐀁𐀁", "UTF-32") into tHaystack + + local tExpectedOffsets + put "1,2,3,4,5,6" into tExpectedOffsets + + put allOffsets(tNeedle, tHaystack, false, false) + + TestAssert "the offsets match the expected offsets", tExpectedOffsets is allOffsets(tNeedle, tHaystack, true, false) +end TestOffsetMultipleUnicodeCharsInSensitive3 \ No newline at end of file From d26c59365bb44612f5da548bc43bc96548655237 Mon Sep 17 00:00:00 2001 From: livecodealex Date: Tue, 20 Nov 2018 12:48:48 +0000 Subject: [PATCH 0060/1134] [[ Bug 21704 ]] Changed encoding of tests file to UTF-8 --- tests/lcs/core/strings/byteoffset.livecodescript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lcs/core/strings/byteoffset.livecodescript b/tests/lcs/core/strings/byteoffset.livecodescript index 455e86d2b22..424365aeea2 100644 --- a/tests/lcs/core/strings/byteoffset.livecodescript +++ b/tests/lcs/core/strings/byteoffset.livecodescript @@ -1,4 +1,4 @@ -script "CoreStringsByteoffset" +script "CoreStringsByteoffset" /* Copyright (C) 2016 LiveCode Ltd. From 91e6041e70c7f357910ce5bba1dc1d6212bfa5d3 Mon Sep 17 00:00:00 2001 From: livecodealex Date: Tue, 20 Nov 2018 12:50:28 +0000 Subject: [PATCH 0061/1134] [[ Bug 21705 ]] Added UTF-8 encoding to tests file --- tests/lcs/core/strings/offset.livecodescript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lcs/core/strings/offset.livecodescript b/tests/lcs/core/strings/offset.livecodescript index c383dd111b9..a1b3e62db14 100644 --- a/tests/lcs/core/strings/offset.livecodescript +++ b/tests/lcs/core/strings/offset.livecodescript @@ -1,4 +1,4 @@ -script "CoreStringOffset" +script "CoreStringOffset" /* Copyright (C) 2016 LiveCode Ltd. From 7b63f69953cf1f283555d2cb7fc09c18fa15a0c8 Mon Sep 17 00:00:00 2001 From: livecodealex Date: Tue, 20 Nov 2018 14:36:51 +0000 Subject: [PATCH 0062/1134] [[ Bug 21704 ]] Fixed incorrect test --- tests/lcs/core/strings/byteoffset.livecodescript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lcs/core/strings/byteoffset.livecodescript b/tests/lcs/core/strings/byteoffset.livecodescript index 424365aeea2..f080946591c 100644 --- a/tests/lcs/core/strings/byteoffset.livecodescript +++ b/tests/lcs/core/strings/byteoffset.livecodescript @@ -172,7 +172,7 @@ on TestOffsetMultipleUnicodeCharsInSensitive3 put textEncode("𐀁𐀁𐀁𐀁𐀁𐀁", "UTF-32") into tHaystack local tExpectedOffsets - put "1,2,3,4,5,6" into tExpectedOffsets + put "1,3,5,7,9,11,13,15,17,19,21" into tExpectedOffsets put allOffsets(tNeedle, tHaystack, false, false) From 488e812eba6de78bbc15e405d085411a8abb7954 Mon Sep 17 00:00:00 2001 From: livecodealex Date: Tue, 20 Nov 2018 17:32:20 +0000 Subject: [PATCH 0063/1134] [[ Bug 21705 ]] Fixed bug --- engine/src/exec-strings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/src/exec-strings.cpp b/engine/src/exec-strings.cpp index 6cc9973c063..49f7b164592 100644 --- a/engine/src/exec-strings.cpp +++ b/engine/src/exec-strings.cpp @@ -1874,8 +1874,8 @@ void MCStringsEvalOffset(MCExecContext& ctxt, MCStringRef p_chunk, MCStringRef p MCRange t_char_range, t_cu_range; // AL-2015-05-07: [[ Bug 15327 ]] Start offset is grapheme offset not codeunit, so map to grapheme offset first. MCStringMapIndices(p_string, kMCCharChunkTypeGrapheme, MCRangeMake(0, p_start_offset), t_cu_range); - // AL-2014-05-27: [[ Bug 12517 ]] Offset should be 0 for an empty input string - if (MCStringIsEmpty(p_chunk) || !MCStringFirstIndexOf(p_string, p_chunk, p_start_offset, t_options, t_offset)) + // AL-2014-05-27: [[ Bug 12517 ]] Offset should be 0 for an empty input string + if (MCStringIsEmpty(p_chunk) || !MCStringFirstIndexOf(p_string, p_chunk, t_cu_range.length, t_options, t_offset)) r_result = 0; else { From 9cff78a17bf695c7d03455bffcccb696bfab25a0 Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Wed, 21 Nov 2018 10:30:53 +0200 Subject: [PATCH 0064/1134] [21706] Ensure plist has correct location keys on iOS 12 --- ide-support/revsaveasiosstandalone.livecodescript | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ide-support/revsaveasiosstandalone.livecodescript b/ide-support/revsaveasiosstandalone.livecodescript index e1d89b6e37c..1c2632b46bf 100644 --- a/ide-support/revsaveasiosstandalone.livecodescript +++ b/ide-support/revsaveasiosstandalone.livecodescript @@ -1446,7 +1446,7 @@ private command revCreateMobilePlist pSettings, pAppBundle, pTarget, pFonts, pPl -- AB-2017-05-31: Add more background modes local tBackgroundModes - if tEnableBackgroundExecution is empty then + if tEnableBackgroundExecution is empty then put "false" into tEnableBackgroundExecution end if @@ -1690,7 +1690,7 @@ private command revCreateMobilePlist pSettings, pAppBundle, pTarget, pFonts, pPl end if replace "${STATUS_BAR_SOLID}" with "<" & tStatusBarSolid & "/>" in pPlist - -- the icons-related part of the plist is stored in sCFBundleIcons + -- the icons-related part of the plist is stored in sCFBundleIcons replace "${BUNDLE_ICONS}" with sCFBundleIcons in pPlist -- MM-2014-09-30: [[ iOS8 Support ]] Added new iOS 7 style entries for the splash screens @@ -1780,7 +1780,10 @@ private command revCreateMobilePlist pSettings, pAppBundle, pTarget, pFonts, pPl // On iOS 11+ we need a new key NSLocationAlwaysAndWhenInUseUsageDescription AND the old NSLocationWhenInUseUsageDescription key, in case // we want the app to access Location Services when it is used. If we want to access Location Services always, we need the old NSLocationAlwaysUsageDescription // key too (i.e. 3 keys in total). Moreover, NSLocationAlwaysUsageDescription is required for backwards compatibility - if revIDEDeployIOSGetSDKVersions() contains "11" then + local tSdkVersion + put revIDEDeployIOSGetSDKVersions() into tSdkVersion + set the itemDel to "." + if item 1 of tSdkVersion >= 11 then get "NSLocationAlwaysAndWhenInUseUsageDescriptionThis application requires access to Location Services" & CR \ & "NSLocationWhenInUseUsageDescriptionThis application requires access to Location Services when in use" From 4d253bf06008b7dff6369e33eb22c63b91c999ba Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Wed, 21 Nov 2018 10:33:12 +0200 Subject: [PATCH 0065/1134] [21706] Added bugfix note --- docs/notes/bugfix-21706.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/notes/bugfix-21706.md diff --git a/docs/notes/bugfix-21706.md b/docs/notes/bugfix-21706.md new file mode 100644 index 00000000000..8051b16fb7d --- /dev/null +++ b/docs/notes/bugfix-21706.md @@ -0,0 +1 @@ +# Ensure location services work when the standalone is built with the iOS 12 SDK From 504f734c81aeeeff581fc96ef3677526f1bfbadb Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Wed, 21 Nov 2018 16:20:51 +0200 Subject: [PATCH 0066/1134] [21393] Ensure drawing lib works on mobile --- ide-support/revsaveasiosstandalone.livecodescript | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ide-support/revsaveasiosstandalone.livecodescript b/ide-support/revsaveasiosstandalone.livecodescript index e1d89b6e37c..b8946356a51 100644 --- a/ide-support/revsaveasiosstandalone.livecodescript +++ b/ide-support/revsaveasiosstandalone.livecodescript @@ -338,6 +338,7 @@ private command revSaveAsMobileStandaloneMain pStack, pAppBundle, pTarget, pSett -- MM-2012-09-18: Use the new copied externals array instead of the copy files. -- local tDeployExternals, tLibraryMappings + put pSettings["ios,library"] & return after tLibraryMappings repeat for each key tExternalName in tCopiedExternals local tExternalRec put tCopiedExternals[tExternalName] into tExternalRec @@ -665,7 +666,7 @@ private command revSaveAsMobileStandaloneMain pStack, pAppBundle, pTarget, pSett -- delete the last LF delete last char of tDeploy["fontmappings"] - + -- Make sure the standalone is generated with a unique uuid put uuid() into tDeploy["uuid"] From 3fc99b94eff79ac56a0e3a8ad1def3998d476d45 Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Wed, 21 Nov 2018 16:22:33 +0200 Subject: [PATCH 0067/1134] [21393] Added bugfix note --- docs/notes/bugfix-21393.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/notes/bugfix-21393.md diff --git a/docs/notes/bugfix-21393.md b/docs/notes/bugfix-21393.md new file mode 100644 index 00000000000..459457914f5 --- /dev/null +++ b/docs/notes/bugfix-21393.md @@ -0,0 +1 @@ +# Ensure drawing lib works on mobile From 4991e2307da031fee9fbfde64ac2c9720474e0f2 Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Wed, 21 Nov 2018 16:37:22 +0200 Subject: [PATCH 0068/1134] [21393] Fix same problem on Android --- ide-support/revsaveasandroidstandalone.livecodescript | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ide-support/revsaveasandroidstandalone.livecodescript b/ide-support/revsaveasandroidstandalone.livecodescript index a4ae86494b5..1a991f28211 100644 --- a/ide-support/revsaveasandroidstandalone.livecodescript +++ b/ide-support/revsaveasandroidstandalone.livecodescript @@ -789,7 +789,11 @@ private command revSaveAsMobileStandaloneMain pStack, pApkFile, pTarget, pSettin put tExternals into pSettings["externals"] - put "revsecurity:./librevsecurity" into pSettings["android,library"] + if pSettings["android,library"] is empty then + put "revsecurity:./librevsecurity" into pSettings["android,library"] + else + put return & "revsecurity:./librevsecurity" after pSettings["android,library"] + end if repeat for each line tEntry in tExternals put return & tEntry & ":" & "./lib" & tEntry after pSettings["android,library"] end repeat From b7538b0893c25a91ee358ba71f5b4ce63ef4c14c Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Wed, 21 Nov 2018 16:40:40 +0200 Subject: [PATCH 0069/1134] [21393] Check if existing library mappings are empty --- ide-support/revsaveasiosstandalone.livecodescript | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ide-support/revsaveasiosstandalone.livecodescript b/ide-support/revsaveasiosstandalone.livecodescript index b8946356a51..e4fb4bcd922 100644 --- a/ide-support/revsaveasiosstandalone.livecodescript +++ b/ide-support/revsaveasiosstandalone.livecodescript @@ -338,7 +338,9 @@ private command revSaveAsMobileStandaloneMain pStack, pAppBundle, pTarget, pSett -- MM-2012-09-18: Use the new copied externals array instead of the copy files. -- local tDeployExternals, tLibraryMappings - put pSettings["ios,library"] & return after tLibraryMappings + if pSettings["ios,library"] is not empty then + put pSettings["ios,library"] & return after tLibraryMappings + end if repeat for each key tExternalName in tCopiedExternals local tExternalRec put tCopiedExternals[tExternalName] into tExternalRec From e0c6653d315c47233893816e7a4f56bafd31953a Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Thu, 22 Nov 2018 12:32:27 +0200 Subject: [PATCH 0070/1134] [21707] Ensure datagrids with decimal keys can scroll --- docs/notes/bugfix-21707.md | 1 + engine/src/exec-array.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 docs/notes/bugfix-21707.md diff --git a/docs/notes/bugfix-21707.md b/docs/notes/bugfix-21707.md new file mode 100644 index 00000000000..4926f69f56b --- /dev/null +++ b/docs/notes/bugfix-21707.md @@ -0,0 +1 @@ +# Ensure DataGrids with decimal keys can scroll diff --git a/engine/src/exec-array.cpp b/engine/src/exec-array.cpp index c9aac46bd9d..f94f52bf564 100644 --- a/engine/src/exec-array.cpp +++ b/engine/src/exec-array.cpp @@ -970,8 +970,10 @@ bool MCArraysSplitIndexes(MCNameRef p_key, integer_t*& r_indexes, uindex_t& r_co return false; MCAutoNumberRef t_number; - +#ifdef FIX_ANOMALY_21476_STRICT_EXTENTS if (!MCNumberParseInteger(*t_substring, &t_number)) +#endif + if (!MCNumberParse(*t_substring, &t_number)) { if (!t_indexes . Push(0)) return false; From 9f7c2bd008bdf6b8c7d0ef5d0a26bf13afb7f40b Mon Sep 17 00:00:00 2001 From: livecodesam Date: Thu, 22 Nov 2018 10:36:56 +0000 Subject: [PATCH 0071/1134] [Dictionary] revGoToFramePaused to revNumberofRecords --- docs/dictionary/command/revGoToFramePaused.lcdoc | 15 +++++++-------- docs/dictionary/command/revGoURL.lcdoc | 9 +++++---- .../command/revInitializeVideoGrabber.lcdoc | 15 +++++++-------- docs/dictionary/command/revMailUnicode.lcdoc | 6 +++--- docs/dictionary/command/revMoveFolder.lcdoc | 16 ++++++++-------- .../command/revMoveToFirstRecord.lcdoc | 6 ++---- .../dictionary/command/revMoveToLastRecord.lcdoc | 5 ++--- .../dictionary/command/revMoveToNextRecord.lcdoc | 6 ++---- .../command/revMoveToPreviousRecord.lcdoc | 5 ++--- docs/dictionary/command/revMoveToRecord.lcdoc | 7 +++++-- docs/dictionary/function/revIsSpeaking.lcdoc | 4 ++-- docs/dictionary/function/revLoadedStacks.lcdoc | 10 ++++++---- .../dictionary/function/revNumberOfRecords.lcdoc | 11 +++++------ 13 files changed, 56 insertions(+), 59 deletions(-) diff --git a/docs/dictionary/command/revGoToFramePaused.lcdoc b/docs/dictionary/command/revGoToFramePaused.lcdoc index 5ea999728a6..0d20067f70f 100644 --- a/docs/dictionary/command/revGoToFramePaused.lcdoc +++ b/docs/dictionary/command/revGoToFramePaused.lcdoc @@ -52,9 +52,8 @@ revGoToFramePause repeatedly for each frame, using the : on goNextFrame theFrame -- 1 frame every 20th of a second - revGoToFramePaused "My Animation",theFrame - send ("goNextFrame" && (theFrame + 1)) to me in 3 ticks - + revGoToFramePaused "My Animation",theFrame + send ("goNextFrame" && (theFrame + 1)) to me in 3 ticks end goNextFrame @@ -67,14 +66,14 @@ revGoToFramePause repeatedly for each frame, using the > library checkbox is checked. References: revStopAnimation (command), group (command), -current card (glossary), main stack (glossary), handler (glossary), -frame (glossary), message (glossary), +send (command), current card (glossary), main stack (glossary), +handler (glossary), frame (glossary), message (glossary), Standalone Application Settings (glossary), standalone application (glossary), command (glossary), application (glossary), LiveCode custom library (glossary), -Animation library (library), send (library), library (library), -startup (message), openBackground (message), preOpenStack (message), -openStack (message), preOpenCard (message), defaultStack (property) +Animation library (library), library (library), startup (message), +openBackground (message), preOpenStack (message), openStack (message), +preOpenCard (message), defaultStack (property) Tags: multimedia diff --git a/docs/dictionary/command/revGoURL.lcdoc b/docs/dictionary/command/revGoURL.lcdoc index 11f37d4cf01..ff109c4bcc6 100644 --- a/docs/dictionary/command/revGoURL.lcdoc +++ b/docs/dictionary/command/revGoURL.lcdoc @@ -54,7 +54,9 @@ browser, and so on. > folder inside the Extensions folder. (This is installed by the > Internet Access installer on the 8.0 installation CD.) The > is not supported for versions before 8.0. -Important:If the contains quotes, it is necessary either to + + +>*Important:* If the contains quotes, it is necessary either to it or to replace the quotes with "%22", or unexpected behavior may be experienced. @@ -80,9 +82,8 @@ handler (glossary), message (glossary), group (glossary), Mac OS (glossary), standalone application (glossary), Apple Event (glossary), command (glossary), browser (glossary), URL (keyword), file (keyword), Common library (library), -launch url command (library), library (library), startup (message), -openBackground (message), preOpenStack (message), openStack (message), -stack (object) +library (library), startup (message), openBackground (message), +preOpenStack (message), openStack (message), stack (object) Tags: networking diff --git a/docs/dictionary/command/revInitializeVideoGrabber.lcdoc b/docs/dictionary/command/revInitializeVideoGrabber.lcdoc index 25592fd848f..94787fe109a 100644 --- a/docs/dictionary/command/revInitializeVideoGrabber.lcdoc +++ b/docs/dictionary/command/revInitializeVideoGrabber.lcdoc @@ -34,20 +34,20 @@ separated by commas: the left, top, right, and bottom edges of the video grabber, in absolute (screen) coordinates. Description: -Use the to start up