Example #1
0
        private void buttonSize_Click(object sender, EventArgs e)
        {
            // 128,96,64,48
            dropdown = new ExtListBoxForm("", true);

            Image[] imagelist = new Image[] { global::EDDiscovery.Icons.Controls.Scan_SizeLarge,
                                              global::EDDiscovery.Icons.Controls.Scan_SizeMedium,
                                              global::EDDiscovery.Icons.Controls.Scan_SizeSmall,
                                              global::EDDiscovery.Icons.Controls.Scan_SizeTiny,
                                              global::EDDiscovery.Icons.Controls.Scan_SizeTinyTiny,
                                              global::EDDiscovery.Icons.Controls.Scan_SizeMinuscule, };

            string[] textlist = new string[] { "128", "96", "64", "48", "32", "16" };

            dropdown.Items      = textlist.ToList();
            dropdown.ImageItems = imagelist.ToList();
            dropdown.FlatStyle  = FlatStyle.Popup;
            dropdown.PositionBelow(buttonSize);
            dropdown.SelectedIndexChanged += (s, ea) =>
            {
                int size = textlist[dropdown.SelectedIndex].InvariantParseInt(64);
                SetSizeImage(size);
                DrawSystem();
            };

            EDDTheme.Instance.ApplyStd(dropdown);

            dropdown.Show(this.FindForm());
        }
        private void DropDown(bool themeit)
        {
            var dropdown = new ExtListBoxForm("", true);

            Image[] imagelist = new Image[] {
                Properties.Resources.galaxy_black,
                Properties.Resources.galaxy_gray,
                Properties.Resources.galaxy_red,
                Properties.Resources.galaxy_white,
            };

            string[] textlist = new string[] { "256", "192", "128", "96" };

            dropdown.Items      = textlist.ToList();
            dropdown.ImageItems = imagelist.ToList();
            dropdown.FlatStyle  = FlatStyle.Popup;
            dropdown.PositionBelow(extButton11);

            if (themeit)
            {
                Theme.Current.ApplyStd(dropdown);
            }
            else
            {
                var stdtheme = new ThemeList();
                stdtheme.LoadBaseThemes();
                stdtheme.SetThemeByName("Windows Default");
                Theme.Current.ApplyStd(dropdown, true);
            }


            dropdown.Show(this.FindForm());
        }
Example #3
0
        private void buttonSize_Click(object sender, EventArgs e)
        {
            // 128,96,64,48
            dropdown = new ExtListBoxForm("", true);

            Image[] imagelist = new Image[] { global::EDDiscovery.Icons.Controls.Scan_SizeLarge,
                                              global::EDDiscovery.Icons.Controls.Scan_SizeMedium,
                                              global::EDDiscovery.Icons.Controls.Scan_SizeSmall,
                                              global::EDDiscovery.Icons.Controls.Scan_SizeTiny,
                                              global::EDDiscovery.Icons.Controls.Scan_SizeTinyTiny,
                                              global::EDDiscovery.Icons.Controls.Scan_SizeMinuscule, };

            string[] textlist = new string[] { "128", "96", "64", "48", "32", "16" };

            dropdown.ItemHeight = imagelist[0].Size.Height + 2;
            dropdown.Items      = textlist.ToList();
            dropdown.ImageItems = imagelist.ToList();
            dropdown.FlatStyle  = FlatStyle.Popup;
            dropdown.Activated += (s, ea) =>
            {
                Point location = buttonSize.PointToScreen(new Point(0, 0));
                dropdown.Location = dropdown.PositionWithinScreen(location.X, location.Y);
                this.Invalidate(true);
            };
            dropdown.SelectedIndexChanged += (s, ea) =>
            {
                int size = textlist[dropdown.SelectedIndex].InvariantParseInt(64);
                SetSizeImage(size);
                DrawSystem();
            };

            dropdown.Size = new Size(64, dropdown.ItemHeight * textlist.Length + 8);

            EDDTheme.Instance.ApplyToControls(dropdown);

            dropdown.Show(this.FindForm());
        }