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

[21831] Ensure you can copy/cut/clear grouped controls from the PB #2034

Open
wants to merge 2 commits into
base: develop-9.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Toolset/libraries/revidelibrary.8.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
46 changes: 26 additions & 20 deletions Toolset/palettes/menubar/revmenubar.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions notes/bugfix-21831.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Ensure you can Copy/Cut/Clear grouped controls from the Project Browser