Skip to content

Commit 004658a

Browse files
committed
Class menu - menu Edit option to create a contextual menu
1 parent f8bc0fc commit 004658a

File tree

1 file changed

+30
-11
lines changed

1 file changed

+30
-11
lines changed

UI/Project/Sources/Classes/menu.4dm

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -929,18 +929,37 @@ Function popup($where : Variant; $x : Variant; $y : Integer) : cs:C1710.menu
929929

930930
// === === === === === === === === === === === === === === === === === === === === === === === === === ===
931931
// Standard Edit menu
932-
Function edit() : cs:C1710.menu
932+
Function edit($contextual : Boolean) : cs:C1710.menu
933933

934-
This:C1470.append(":xliff:CommonMenuItemUndo").action(ak undo:K76:51).shortcut("Z")
935-
This:C1470.append(":xliff:CommonMenuRedo").action(ak redo:K76:52).shortcut("Z"; Shift key mask:K16:3)
936-
This:C1470.line()
937-
This:C1470.append(":xliff:CommonMenuItemCut").action(ak cut:K76:53).shortcut("X")
938-
This:C1470.append(":xliff:CommonMenuItemCopy").action(ak copy:K76:54).shortcut("C")
939-
This:C1470.append(":xliff:CommonMenuItemPaste").action(ak paste:K76:55).shortcut("V")
940-
This:C1470.append(":xliff:CommonMenuItemClear").action(ak clear:K76:56)
941-
This:C1470.append(":xliff:CommonMenuItemSelectAll").action(ak select all:K76:57).shortcut("A")
942-
This:C1470.line()
943-
This:C1470.append(":xliff:CommonMenuItemShowClipboard").action(ak show clipboard:K76:58)
934+
If ($contextual)
935+
936+
var $key : Text
937+
For each ($key; [ak undo:K76:51; ak redo:K76:52; ak cut:K76:53; ak copy:K76:54; ak paste:K76:55; ak clear:K76:56; ak select all:K76:57])
938+
939+
var $o:=Action info:C1442($key; ak current form:K76:70)
940+
This:C1470.append($o.title).action($key)
941+
942+
If ($key=ak redo:K76:52)
943+
944+
This:C1470.line()
945+
946+
End if
947+
End for each
948+
949+
Else
950+
951+
This:C1470.append(":xliff:CommonMenuItemUndo").action(ak undo:K76:51).shortcut("Z")
952+
This:C1470.append(":xliff:CommonMenuRedo").action(ak redo:K76:52).shortcut("Z"; Shift key mask:K16:3)
953+
This:C1470.line()
954+
This:C1470.append(":xliff:CommonMenuItemCut").action(ak cut:K76:53).shortcut("X")
955+
This:C1470.append(":xliff:CommonMenuItemCopy").action(ak copy:K76:54).shortcut("C")
956+
This:C1470.append(":xliff:CommonMenuItemPaste").action(ak paste:K76:55).shortcut("V")
957+
This:C1470.append(":xliff:CommonMenuItemClear").action(ak clear:K76:56)
958+
This:C1470.append(":xliff:CommonMenuItemSelectAll").action(ak select all:K76:57).shortcut("A")
959+
This:C1470.line()
960+
This:C1470.append(":xliff:CommonMenuItemShowClipboard").action(ak show clipboard:K76:58)
961+
962+
End if
944963

945964
return This:C1470
946965

0 commit comments

Comments
 (0)