From c2b4993253ddacdfcf5c67e4e8c211a54002614a Mon Sep 17 00:00:00 2001 From: Victor Chelaru Date: Mon, 11 Dec 2023 06:07:01 -0700 Subject: [PATCH] Added icons to right click for add folder and entity fixes #1284 --- FRBDK/Glue/Glue/Content/Icons/icon_entity.png | Bin 0 -> 1425 bytes FRBDK/Glue/Glue/Content/Icons/icon_folder.png | Bin 0 -> 1131 bytes .../Glue/Glue/FormHelpers/RightClickHelper.cs | 51 +++++++++--------- FRBDK/Glue/Glue/GlueFormsCore.csproj | 4 ++ 4 files changed, 31 insertions(+), 24 deletions(-) create mode 100644 FRBDK/Glue/Glue/Content/Icons/icon_entity.png create mode 100644 FRBDK/Glue/Glue/Content/Icons/icon_folder.png diff --git a/FRBDK/Glue/Glue/Content/Icons/icon_entity.png b/FRBDK/Glue/Glue/Content/Icons/icon_entity.png new file mode 100644 index 0000000000000000000000000000000000000000..76dbc7fa78ff1e3512ccb99fa1b9dac2c066cd0c GIT binary patch literal 1425 zcmbVMZA=qq96vzh#i6*7Idv{a-3uD7_tIWpZd5G20>u@fbkc>OT<@OJqg=0E4_k2J zWSFsqWF}*A8lx_b>_ub~BxW)YWvNJ_%nyrflMS7j(!yrC#i@rK$c@k&*gT3Tf51mKr#v`MAhs5zda^d1J_ZjTY+ zFyKK5Olv^gm<~fol4Fbc#K*NV$f(=M5kl`BMg8c^_*&!&;8%z zp^8&zv{U}mIk6+99i!shASj!;Q38Htek5g33i{eJAtI;Yw1@q+tx1A zzqhHNrY8PyQ`LcvGn)te{fxo9;*$i|c;wW0S>jjk^enpZ^@XC*j+AHgqh|S8w5jp0 zqe#Y3_Wnq_@Xdya#&XAc>KqNnUx$_p%V4s*Nro;3rZU@k?bbE-j&#~q?tFSly!uVJ zH|gY~E%z#K#Z|P9w|tiH(7v&?Z{Z-6+xpw##m-ZKuAv%Fd6B6y0s7fc@$$htADITc zo{=46L#qZ#M}FxT{&?|tBK@aj?+4Ju#L_35ecQ-T(k*mG^Mm^47kte2 z#?;q!N0$z42TMLo|0yyu*aKJe99VT{%=P=klyx|HuW+Jz5|?kmc*J$Y^y(y96mNr5 cILG8uRnSee>4$@VT%P_*+N{NNXI@p)KeZJ5wEzGB literal 0 HcmV?d00001 diff --git a/FRBDK/Glue/Glue/Content/Icons/icon_folder.png b/FRBDK/Glue/Glue/Content/Icons/icon_folder.png new file mode 100644 index 0000000000000000000000000000000000000000..9b16db1a04001d9be25cdf7d13dae54492dbdcb7 GIT binary patch literal 1131 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2nC-$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%qp275hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8Vxj;AN0R0eQAc86_nJR{Hwo z<>h+i#(Mch>H3D2mX`VkM*2oZxQ#zd*srNY7M3BRn%N zCBM8_6Rg44*UB@mxFj(zIn~p}Rtac?US?*Bm6?gTiHnJ)k+Ff9xuKz}vy-!#laq_H zfr*K$sey&DB}}hNesXDUYF-IUZwf-MF;2ap#E@G6wAm%KD6=dz#jPkmR{`v2t4!Q( zF~DgaRBsAyw;1Bos}FRHJ}739Vj3m{OgCMp6n8yc z978H@y}5aix5+@H;o-H4FOPJroMs+2v~oUv!SoG>QMb75_3*=ICv`aF#{HXaGC}Ut z?}|Ma8hkY+c{dt*F>weeI5aTK6uy0F$<}K&dFkrQqHZawc^wo2@+-W!*m zY~KIm$$I1U+ohIG`FvyXQ}G@56z}t_eDiOM4R#OXB92c&2@E;MZ7)ZJglz$3e@|CGmvv4FO#t7Ne5wEd literal 0 HcmV?d00001 diff --git a/FRBDK/Glue/Glue/FormHelpers/RightClickHelper.cs b/FRBDK/Glue/Glue/FormHelpers/RightClickHelper.cs index 14b8f291a..8bb06bf90 100644 --- a/FRBDK/Glue/Glue/FormHelpers/RightClickHelper.cs +++ b/FRBDK/Glue/Glue/FormHelpers/RightClickHelper.cs @@ -450,7 +450,7 @@ public static class RightClickHelper static GeneralToolStripMenuItem setAsStartUpScreenToolStripMenuItem; static GeneralToolStripMenuItem addObjectToolStripMenuItem; - static GeneralToolStripMenuItem addEntityToolStripMenuItem; + static GeneralToolStripMenuItem removeFromProjectToolStripMenuItem; static GeneralToolStripMenuItem editResetVariablesToolStripMenuItem; @@ -504,9 +504,12 @@ public static class RightClickHelper #region Images static System.Windows.Controls.Image BookmarkImage; - static System.Windows.Controls.Image ScreenImage; - static System.Windows.Controls.Image DerivedEntity; static System.Windows.Controls.Image CollisionRelationshipImage; + static System.Windows.Controls.Image DerivedEntity; + static System.Windows.Controls.Image EntityImage; + static System.Windows.Controls.Image FolderImage; + + static System.Windows.Controls.Image ScreenImage; static bool HasCreatedImages = false; private static void CreateImages() @@ -515,9 +518,11 @@ private static void CreateImages() { BookmarkImage = MakeImage("/Content/Icons/StarFilled.png"); - ScreenImage = MakeImage("/Content/Icons/icon_screen.png"); - DerivedEntity = MakeImage("/Content/Icons/icon_entity_derived.png"); CollisionRelationshipImage = MakeImage("/Content/Icons/icon_collisions.png"); + DerivedEntity = MakeImage("/Content/Icons/icon_entity_derived.png"); + EntityImage = MakeImage("/Content/Icons/icon_entity.png"); + FolderImage = MakeImage("/Content/Icons/icon_folder.png"); + ScreenImage = MakeImage("/Content/Icons/icon_screen.png"); HasCreatedImages = true; @@ -529,10 +534,13 @@ System.Windows.Controls.Image MakeImage(string sourceName) bitmapImage.UriSource = new Uri(sourceName, UriKind.Relative); bitmapImage.EndInit(); - return new System.Windows.Controls.Image() + var toReturn = new System.Windows.Controls.Image() { Source = bitmapImage }; + + + return toReturn; } } @@ -542,7 +550,6 @@ System.Windows.Controls.Image MakeImage(string sourceName) private static void PopulateRightClickMenuItemsShared(ITreeNode targetNode, MenuShowingAction menuShowingAction, ITreeNode draggedNode) { - CreateImages(); #region IsScreenNode @@ -595,13 +602,11 @@ private static void PopulateRightClickMenuItemsShared(ITreeNode targetNode, Menu { if (menuShowingAction == MenuShowingAction.RightButtonDrag && draggedNode.IsEntityNode()) { - var mAddEntityInstance = new GeneralToolStripMenuItem(L.Texts.EntityAddInstance); - mAddEntityInstance.Click += (not, used) => OnAddEntityInstanceClick(targetNode, draggedNode); var mAddEntityList = new GeneralToolStripMenuItem(L.Texts.EntityListAdd); mAddEntityList.Click += (not, used) => OnAddEntityListClick(targetNode, draggedNode); - AddItem(mAddEntityInstance); + Add(L.Texts.EntityAddInstance, () => OnAddEntityInstanceClick(targetNode, draggedNode)); AddItem(mAddEntityList); } else @@ -642,7 +647,7 @@ private static void PopulateRightClickMenuItemsShared(ITreeNode targetNode, Menu else if (targetNode.IsFilesContainerNode() || targetNode.IsFolderInFilesContainerNode()) { AddItem(addFileToolStripMenuItem); - Add(L.Texts.FolderAdd, () => RightClickHelper.AddFolderClick(targetNode)); + Add(L.Texts.FolderAdd, () => RightClickHelper.AddFolderClick(targetNode), image: FolderImage); AddSeparator(); Add(L.Texts.ViewInExplorer, () => RightClickHelper.ViewInExplorerClick(targetNode)); AddEvent(L.Texts.CopyPathClipboard, (_, _) => HandleCopyToClipboardClick(targetNode)); @@ -670,13 +675,10 @@ private static void PopulateRightClickMenuItemsShared(ITreeNode targetNode, Menu if (menuShowingAction == MenuShowingAction.RightButtonDrag && !isSameObject && draggedNode.IsEntityNode()) { - var mAddEntityInstance = new GeneralToolStripMenuItem(L.Texts.EntityAddInstance); - mAddEntityInstance.Click += (not, used) => OnAddEntityInstanceClick(targetNode, draggedNode); - var mAddEntityList = new GeneralToolStripMenuItem(L.Texts.EntityListAdd); mAddEntityList.Click += (not, used) => OnAddEntityListClick(targetNode, draggedNode); - AddItem(mAddEntityInstance); + Add(L.Texts.EntityAddInstance, () => OnAddEntityInstanceClick(targetNode, draggedNode)); AddItem(mAddEntityList); } else @@ -712,7 +714,7 @@ private static void PopulateRightClickMenuItemsShared(ITreeNode targetNode, Menu else if (targetNode.IsGlobalContentContainerNode()) { AddItem(addFileToolStripMenuItem); - Add(L.Texts.FolderAdd, () => RightClickHelper.AddFolderClick(targetNode)); + Add(L.Texts.FolderAdd, () => RightClickHelper.AddFolderClick(targetNode), image: FolderImage); Add(L.Texts.CodeRegenerate, () => HandleReGenerateCodeClick(targetNode)); Add(L.Texts.ViewInExplorer, () => RightClickHelper.ViewInExplorerClick(targetNode)); @@ -724,11 +726,11 @@ private static void PopulateRightClickMenuItemsShared(ITreeNode targetNode, Menu #region IsRootEntityNode else if (targetNode.IsRootEntityNode()) { - AddItem(addEntityToolStripMenuItem); + Add(L.Texts.EntityAdd, () => GlueCommands.Self.DialogCommands.ShowAddNewEntityDialog(), image: EntityImage); - Add(L.Texts.EntityImport, () => ImportElementClick(targetNode)); + Add(L.Texts.FolderAdd, () => RightClickHelper.AddFolderClick(targetNode), image: FolderImage); - Add(L.Texts.FolderAdd, () => RightClickHelper.AddFolderClick(targetNode)); + Add(L.Texts.EntityImport, () => ImportElementClick(targetNode)); } #endregion @@ -940,13 +942,15 @@ private static void PopulateRightClickMenuItemsShared(ITreeNode targetNode, Menu AddSeparator(); - Add(L.Texts.FolderAdd, () => RightClickHelper.AddFolderClick(targetNode)); + Add(L.Texts.FolderAdd, () => RightClickHelper.AddFolderClick(targetNode), image: FolderImage); bool isEntityContainingFolder = targetNode.Root.IsRootEntityNode(); if (isEntityContainingFolder) { - AddItem(addEntityToolStripMenuItem); + //AddItem(addEntityToolStripMenuItem); + + Add(L.Texts.EntityAdd, () => GlueCommands.Self.DialogCommands.ShowAddNewEntityDialog(), image: EntityImage); Add(L.Texts.EntityImport, () => ImportElementClick(targetNode)); } @@ -1147,15 +1151,14 @@ static void AddSeparator() public static void Initialize() { + CreateImages(); + setAsStartUpScreenToolStripMenuItem = new GeneralToolStripMenuItem(L.Texts.SetAsStartupScreen); setAsStartUpScreenToolStripMenuItem.Click += (not, used) => { SetStartupScreen(); }; - addEntityToolStripMenuItem = new GeneralToolStripMenuItem(L.Texts.EntityAdd); - addEntityToolStripMenuItem.Click += (not, used) => GlueCommands.Self.DialogCommands.ShowAddNewEntityDialog(); - addObjectToolStripMenuItem = new GeneralToolStripMenuItem(); addObjectToolStripMenuItem.Text = L.Texts.ObjectAdd; addObjectToolStripMenuItem.Click += (not, used) => GlueCommands.Self.DialogCommands.ShowAddNewObjectDialog(); diff --git a/FRBDK/Glue/Glue/GlueFormsCore.csproj b/FRBDK/Glue/Glue/GlueFormsCore.csproj index f3344b800..d68c79683 100644 --- a/FRBDK/Glue/Glue/GlueFormsCore.csproj +++ b/FRBDK/Glue/Glue/GlueFormsCore.csproj @@ -87,7 +87,9 @@ + + @@ -207,7 +209,9 @@ + +