From 0c6b18e47cdfb3420e34adf2a7e04f38895b378f Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Mon, 11 Feb 2019 13:24:45 +0200 Subject: [PATCH 1/2] [21831] Ensure you can copy/cut/clear grouped controls from the PB --- .../libraries/revidelibrary.8.livecodescript | 4 +- .../menubar/revmenubar.livecodescript | 46 +++++++++++-------- .../revprojectbrowserbehavior.livecodescript | 2 +- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/Toolset/libraries/revidelibrary.8.livecodescript b/Toolset/libraries/revidelibrary.8.livecodescript index eb81eb458c..a83342c779 100644 --- a/Toolset/libraries/revidelibrary.8.livecodescript +++ b/Toolset/libraries/revidelibrary.8.livecodescript @@ -6535,8 +6535,8 @@ function revIDEGetAllPlugins return tFinal end revIDEGetAllPlugins -on revIDEPopupContextualMenu pTargets - dispatch "revMenubarPopupContextualMenu" to stack revIDEPaletteToStackName("menubar") with pTargets +on revIDEPopupContextualMenu pTargets, pInProjectBrowser + dispatch "revMenubarPopupContextualMenu" to stack revIDEPaletteToStackName("menubar") with pTargets, pInProjectBrowser end revIDEPopupContextualMenu local sPluginsA diff --git a/Toolset/palettes/menubar/revmenubar.livecodescript b/Toolset/palettes/menubar/revmenubar.livecodescript index d56f2a29fc..7ebde6678f 100644 --- a/Toolset/palettes/menubar/revmenubar.livecodescript +++ b/Toolset/palettes/menubar/revmenubar.livecodescript @@ -2146,14 +2146,14 @@ function revMenuBarCardContextMenu pCard, pIndent return tText end revMenuBarCardContextMenu -function revMenuBarObjectContextMenu pExtraText, pObject, pIndent, pSelectable +function revMenuBarObjectContextMenu pExtraText, pObject, pIndent, pSelectable, pInProjectBrowser local tIndent repeat pIndent put tab after tIndent end repeat local tText - put revMenuBarStandardContextMenu(pObject, pIndent, pSelectable) & return into tText + put revMenuBarStandardContextMenu(pObject, pIndent, pSelectable, pInProjectBrowser) & return into tText repeat for each line tLine in pExtraText put tIndent & tLine & return after tText end repeat @@ -2163,7 +2163,7 @@ function revMenuBarObjectContextMenu pExtraText, pObject, pIndent, pSelectable return tText end revMenuBarObjectContextMenu -function revMenuBarStandardContextMenu pObject, pIndent, pSelectable +function revMenuBarStandardContextMenu pObject, pIndent, pSelectable, pInProjectBrowser local tIndent repeat pIndent put tab after tIndent @@ -2175,12 +2175,18 @@ function revMenuBarStandardContextMenu pObject, pIndent, pSelectable exists(the behavior of pObject)) & return after tText put tIndent & "Property Inspector" & return after tText put tIndent & "-" & return after tText - put tIndent & enableMenuItem("Cut", pSelectable) & return after tText - put tIndent & enableMenuItem("Copy", pSelectable) after tText + if pInProjectBrowser is "true" then + put tIndent & "Cut" & return after tText + put tIndent & "Copy" after tText + else + put tIndent & enableMenuItem("Cut", pSelectable) & return after tText + put tIndent & enableMenuItem("Copy", pSelectable) after tText + end if + return tText end revMenuBarStandardContextMenu -function revBuildContextSensitiveMenu pExtraText, pTarget, pType, pSelectable +function revBuildContextSensitiveMenu pExtraText, pTarget, pType, pSelectable, pInProjectBrowser local tText if word 1 of pTarget is "stack" then put revMenuBarStackContextMenu(pTarget, 0) into tText @@ -2198,9 +2204,9 @@ function revBuildContextSensitiveMenu pExtraText, pTarget, pType, pSelectable return tText end if - put revMenuBarObjectContextMenu(pExtraText, pTarget,0, pSelectable) into tText + put revMenuBarObjectContextMenu(pExtraText, pTarget,0, pSelectable, pInProjectBrowser) into tText put return & "-" after tText - put return & enableMenuItem("Clear", pSelectable) after tText + put return & enableMenuItem("Clear", pSelectable OR pInProjectBrowser) after tText put return & "-" after tText put return & "Card" after tText put return & revMenuBarCardContextMenu(the long id of this card of tTargetStack, 1) after tText @@ -2210,7 +2216,7 @@ function revBuildContextSensitiveMenu pExtraText, pTarget, pType, pSelectable return tText end revBuildContextSensitiveMenu -function revMenubarContextMenu pType, pTarget +function revMenubarContextMenu pType, pTarget, pInProjectBrowser local tSelectable put revIDEObjectsAreSelectable(sMenuTarget) into tSelectable @@ -2270,17 +2276,17 @@ function revMenubarContextMenu pType, pTarget break end switch - put revBuildContextSensitiveMenu(tText, pTarget, , tSelectable) into tText + put revBuildContextSensitiveMenu(tText, pTarget, , tSelectable, pInProjectBrowser) into tText return modifyMenu(pType, tText) end revMenubarContextMenu -on revMenubarSetContextMenu pType, pTarget - set the text of button "context" of me to revMenubarContextMenu(pType, pTarget) +on revMenubarSetContextMenu pType, pTarget, pInProjectBrowser + set the text of button "context" of me to revMenubarContextMenu(pType, pTarget, pInProjectBrowser) set the script of button "context" of me to "on menuPick pWhich; revMenubarContextMenuPick pWhich; end menuPick" end revMenubarSetContextMenu -on revMenubarPopupContextualMenu pTargets +on revMenubarPopupContextualMenu pTargets, pInProjectBrowser local tTarget if pTargets is not empty then put the long id of (line 1 of pTargets) into tTarget @@ -2301,23 +2307,23 @@ on revMenubarPopupContextualMenu pTargets end repeat if the number of lines in sMenuTarget > 1 then - revMenubarSetContextMenu "multiple", tTarget + revMenubarSetContextMenu "multiple", tTarget, pInProjectBrowser else local tType put word 1 of the name of tTarget into tType switch tType case "button" if the menuName of tTarget is not empty then - revMenubarSetContextMenu "menu", tTarget + revMenubarSetContextMenu "menu", tTarget, pInProjectBrowser else - revMenubarSetContextMenu "button", tTarget + revMenubarSetContextMenu "button", tTarget, pInProjectBrowser end if break case "graphic" if the style of tTarget is "polygon" then - revMenubarSetContextMenu "polygon", tTarget + revMenubarSetContextMenu "polygon", tTarget, pInProjectBrowser else - revMenubarSetContextMenu "standard", tTarget + revMenubarSetContextMenu "standard", tTarget, pInProjectBrowser end if break case "card" @@ -2326,10 +2332,10 @@ on revMenubarPopupContextualMenu pTargets case "field" case "player" case "widget" - revMenubarSetContextMenu tType, tTarget + revMenubarSetContextMenu tType, tTarget, pInProjectBrowser break default - revMenubarSetContextMenu "standard", tTarget + revMenubarSetContextMenu "standard", tTarget, pInProjectBrowser break end switch end if diff --git a/Toolset/palettes/project browser/revprojectbrowserbehavior.livecodescript b/Toolset/palettes/project browser/revprojectbrowserbehavior.livecodescript index 3f85105eee..005be03f7e 100644 --- a/Toolset/palettes/project browser/revprojectbrowserbehavior.livecodescript +++ b/Toolset/palettes/project browser/revprojectbrowserbehavior.livecodescript @@ -2433,7 +2433,7 @@ on pbRightClick pObject end if put pObject before tSelected - revIDEPopupContextualMenu tSelected + revIDEPopupContextualMenu tSelected, "true" end pbRightClick ## Connector creation for all row types From 4d9975324eefd37783768cf459154b8070bb3451 Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Mon, 11 Feb 2019 13:27:13 +0200 Subject: [PATCH 2/2] [21831] Added bugfix note --- notes/bugfix-21831.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 notes/bugfix-21831.md diff --git a/notes/bugfix-21831.md b/notes/bugfix-21831.md new file mode 100644 index 0000000000..5a944c03f3 --- /dev/null +++ b/notes/bugfix-21831.md @@ -0,0 +1 @@ +# Ensure you can Copy/Cut/Clear grouped controls from the Project Browser