Exemplo n.º 1
0
        public IEnumerable <ToolStripMenuItem> GetMenuItems(ToolStripMenuItem input)
        {
            ToolStripMenuItem mnuNJLCCheck = new ToolStripMenuItem
            {
                Name  = "mnuNJLCCheck",
                Text  = "&Check Flags",
                Image = NeonJungleLC.Properties.Resources.NeutralFlags,
                ImageTransparentColor = Color.Black,
                Size = new Size(148, 22),
                Tag  = "Menu_Tools_NeonJungleLCCheckFlags"
            };

            mnuNJLCCheck.Click += mnuNJLCCheck_Click;
            mnuNJLCCheck.UpdateLightDarkMode();
            mnuNJLCCheck.TranslateToolStripItemsRecursively();
            yield return(mnuNJLCCheck);
        }
Exemplo n.º 2
0
        public ContextMenuStrip CreateContextMenuStrip(bool blnIncludeCloseOpenCharacter)
        {
            //
            // tsToggleFav
            //
            ToolStripMenuItem tsToggleFav = new ToolStripMenuItem
            {
                Image = Properties.Resources.asterisk_orange,
                Name  = "tsToggleFav",
                Size  = new Size(180, 22),
                Tag   = "Menu_ToggleFavorite"
            };

            tsToggleFav.Click += tsToggleFav_Click;
            //
            // tsSort
            //
            ToolStripMenuItem tsSort = new ToolStripMenuItem
            {
                Image = Properties.Resources.page_refresh,
                Name  = "tsSort",
                Size  = new Size(180, 22),
                Tag   = "Menu_Sort"
            };

            tsSort.Click += tsSort_Click;
            //
            // tsDelete
            //
            ToolStripMenuItem tsDelete = new ToolStripMenuItem
            {
                Image = Properties.Resources.delete,
                Name  = "tsDelete",
                Size  = new Size(180, 22),
                Tag   = "Menu_Delete"
            };

            tsDelete.Click += tsDelete_Click;
            //
            // cmsRoster
            //
            ContextMenuStrip cmsRoster = new ContextMenuStrip
            {
                Name = "cmsRoster",
                Size = new Size(181, 114)
            };

            cmsRoster.Items.AddRange(new ToolStripItem[]
            {
                tsToggleFav,
                tsSort,
                tsDelete
            });

            tsToggleFav.TranslateToolStripItemsRecursively();
            tsSort.TranslateToolStripItemsRecursively();
            tsDelete.TranslateToolStripItemsRecursively();

            if (blnIncludeCloseOpenCharacter)
            {
                //
                // tsCloseOpenCharacter
                //
                ToolStripMenuItem tsCloseOpenCharacter = new ToolStripMenuItem
                {
                    Image = Properties.Resources.door_out,
                    Name  = "tsCloseOpenCharacter",
                    Size  = new Size(180, 22),
                    Tag   = "Menu_Close"
                };
                tsCloseOpenCharacter.Click += tsCloseOpenCharacter_Click;
                cmsRoster.Items.Add(tsCloseOpenCharacter);
                tsCloseOpenCharacter.TranslateToolStripItemsRecursively();
            }

            return(cmsRoster);
        }
Exemplo n.º 3
0
        public ContextMenuStrip CreateContextMenuStrip(bool blnIncludeCloseOpenCharacter)
        {
            int intToolStripWidth  = 180;
            int intToolStripHeight = 22;

            using (Graphics g = CreateGraphics())
            {
                intToolStripWidth  = (int)(intToolStripWidth * g.DpiX / 96.0f);
                intToolStripHeight = (int)(intToolStripHeight * g.DpiY / 96.0f);
            }

            //
            // tsToggleFav
            //
            ToolStripMenuItem tsToggleFav = new ToolStripMenuItem
            {
                Image = Properties.Resources.asterisk_orange,
                Name  = "tsToggleFav",
                Size  = new Size(intToolStripWidth, intToolStripHeight),
                Tag   = "Menu_ToggleFavorite"
            };

            tsToggleFav.Click += tsToggleFav_Click;
            //
            // tsSort
            //
            ToolStripMenuItem tsSort = new ToolStripMenuItem
            {
                Image = Properties.Resources.page_refresh,
                Name  = "tsSort",
                Size  = new Size(intToolStripWidth, intToolStripHeight),
                Tag   = "Menu_Sort"
            };

            tsSort.Click += tsSort_Click;
            //
            // tsDelete
            //
            ToolStripMenuItem tsDelete = new ToolStripMenuItem
            {
                Image = Properties.Resources.delete,
                Name  = "tsDelete",
                Size  = new Size(intToolStripWidth, intToolStripHeight),
                Tag   = "Menu_Delete"
            };

            tsDelete.Click += tsDelete_Click;
            //
            // cmsRoster
            //
            ContextMenuStrip cmsRoster = new ContextMenuStrip
            {
                Name = "cmsRoster",
                Size = new Size(intToolStripWidth, intToolStripHeight * 5)
            };

            cmsRoster.Items.AddRange(new ToolStripItem[]
            {
                tsToggleFav,
                tsSort,
                tsDelete
            });

            tsToggleFav.TranslateToolStripItemsRecursively();
            tsSort.TranslateToolStripItemsRecursively();
            tsDelete.TranslateToolStripItemsRecursively();

            if (blnIncludeCloseOpenCharacter)
            {
                //
                // tsCloseOpenCharacter
                //
                ToolStripMenuItem tsCloseOpenCharacter = new ToolStripMenuItem
                {
                    Image = Properties.Resources.door_out,
                    Name  = "tsCloseOpenCharacter",
                    Size  = new Size(intToolStripWidth, intToolStripHeight),
                    Tag   = "Menu_Close"
                };
                tsCloseOpenCharacter.Click += tsCloseOpenCharacter_Click;
                cmsRoster.Items.Add(tsCloseOpenCharacter);
                tsCloseOpenCharacter.TranslateToolStripItemsRecursively();
            }
            cmsRoster.UpdateLightDarkMode();

            return(cmsRoster);
        }