private void Icon_Click(object sender, EventArgs e) { ExtendedControls.ExtButton but = sender as ExtendedControls.ExtButton; dropdown = new ExtendedControls.ExtListBoxForm("", true); List <string> Dickeys = new List <string>(BaseUtils.Icons.IconSet.Instance.Names()); Dickeys.Sort(); List <Image> images = new List <Image>(); foreach (var x in Dickeys) { Image i = BaseUtils.Icons.IconSet.Instance.Get(x); i.Tag = x; images.Add(i); } dropdown.FitImagesToItemHeight = true; dropdown.Items = Dickeys; dropdown.ImageItems = images; dropdown.FlatStyle = FlatStyle.Popup; dropdown.PositionBelow(sender as Control); dropdown.SelectedIndexChanged += (s, ea) => { Image img = images[dropdown.SelectedIndex]; but.Image = img; }; EDDTheme.Instance.ApplyDialog(dropdown, true); dropdown.Show(this.FindForm()); }
private void buttonExtPopOut_Click(object sender, EventArgs e) { popoutdropdown = new ExtendedControls.ExtListBoxForm("", true); popoutdropdown.Items = PanelInformation.GetUserSelectablePanelDescriptions(EDDConfig.Instance.SortPanelsByName).ToList(); popoutdropdown.ImageItems = PanelInformation.GetUserSelectablePanelImages(EDDConfig.Instance.SortPanelsByName).ToList(); popoutdropdown.ItemSeperators = PanelInformation.GetUserSelectableSeperatorIndex(EDDConfig.Instance.SortPanelsByName); PanelInformation.PanelIDs[] pids = PanelInformation.GetUserSelectablePanelIDs(EDDConfig.Instance.SortPanelsByName); popoutdropdown.FlatStyle = FlatStyle.Popup; popoutdropdown.PositionBelow(buttonExtPopOut); popoutdropdown.SelectedIndexChanged += (s, ea) => { UserControlContainerResizable uccr = CreateInitPanel(PanelInformation.Create(pids[popoutdropdown.SelectedIndex])); // uccb init done above, contract states we now theme. discoveryform.theme.ApplyStd(uccr); LoadLayoutPanel(uccr, uccr.control as UserControlCommonBase, new Point((uccrlist.Count % 5) * 50, (uccrlist.Count % 5) * 50), new Size(Math.Min(300, panelPlayfield.Width - 10), Math.Min(300, panelPlayfield.Height - 10))); Select(null); uccr.Selected = true; uccr.BringToFront(); UpdateButtons(); AssignTHC(); }; discoveryform.theme.ApplyStd(popoutdropdown); popoutdropdown.SelectionBackColor = discoveryform.theme.ButtonBackColor; popoutdropdown.Show(this); }
private void buttonExtPopOut_Click(object sender, EventArgs e) { popoutdropdown = new ExtendedControls.ExtListBoxForm("", true); popoutdropdown.ItemHeight = 26; popoutdropdown.Items = PanelInformation.GetUserSelectablePanelDescriptions(EDDConfig.Instance.SortPanelsByName).ToList(); popoutdropdown.ImageItems = PanelInformation.GetUserSelectablePanelImages(EDDConfig.Instance.SortPanelsByName).ToList(); popoutdropdown.ItemSeperators = PanelInformation.GetUserSelectableSeperatorIndex(EDDConfig.Instance.SortPanelsByName); PanelInformation.PanelIDs[] pids = PanelInformation.GetUserSelectablePanelIDs(EDDConfig.Instance.SortPanelsByName); popoutdropdown.FlatStyle = FlatStyle.Popup; popoutdropdown.Activated += (s, ea) => { Point location = buttonExtPopOut.PointToScreen(new Point(0, 0)); popoutdropdown.Location = popoutdropdown.PositionWithinScreen(location.X + buttonExtPopOut.Width, location.Y); this.Invalidate(true); }; popoutdropdown.SelectedIndexChanged += (s, ea) => { UserControlContainerResizable uccr = CreatePanel(PanelInformation.Create(pids[popoutdropdown.SelectedIndex]), new Point((uccrlist.Count % 5) * 50, (uccrlist.Count % 5) * 50), new Size(Math.Min(300, panelPlayfield.Width - 10), Math.Min(300, panelPlayfield.Height - 10))); Select(null); uccr.Selected = true; uccr.BringToFront(); UpdateButtons(); AssignTHC(); }; popoutdropdown.Size = new Size(500, 26 * 20); discoveryform.theme.ApplyToControls(popoutdropdown); popoutdropdown.SelectionBackColor = discoveryform.theme.ButtonBackColor; popoutdropdown.Show(this); }
private void Icon_Click(object sender, EventArgs e) { ExtendedControls.ExtButton but = sender as ExtendedControls.ExtButton; dropdown = new ExtendedControls.ExtListBoxForm("", true); List <string> Dickeys = new List <string>(EDDiscovery.Icons.IconSet.Icons.Keys); Dickeys.Sort(); List <Image> images = (from x in Dickeys select EDDiscovery.Icons.IconSet.Icons[x]).ToList(); dropdown.ItemHeight = 26; dropdown.FitImagesToItemHeight = true; dropdown.Items = Dickeys; dropdown.ImageItems = images; dropdown.FlatStyle = FlatStyle.Popup; dropdown.Activated += (s, ea) => { Point location = (sender as Control).PointToScreen(new Point(0, 0)); dropdown.Location = dropdown.PositionWithinScreen(location.X, location.Y); this.Invalidate(true); }; dropdown.SelectedIndexChanged += (s, ea) => { Image img = images[dropdown.SelectedIndex]; but.Image = img; }; dropdown.Size = new Size(400, 800); EDDTheme.Instance.ApplyToControls(dropdown); dropdown.Show(this.FindForm()); }
private void Icon_Click(object sender, EventArgs e) { ExtendedControls.ExtButton but = sender as ExtendedControls.ExtButton; dropdown = new ExtendedControls.ExtListBoxForm("", true); List <string> Dickeys = new List <string>(EDDiscovery.Icons.IconSet.Icons.Keys); Dickeys.Sort(); List <Image> images = (from x in Dickeys select EDDiscovery.Icons.IconSet.Icons[x]).ToList(); dropdown.FitImagesToItemHeight = true; dropdown.Items = Dickeys; dropdown.ImageItems = images; dropdown.FlatStyle = FlatStyle.Popup; dropdown.PositionBelow(sender as Control); dropdown.SelectedIndexChanged += (s, ea) => { Image img = images[dropdown.SelectedIndex]; but.Image = img; }; EDDTheme.Instance.ApplyDialog(dropdown); dropdown.Show(this.FindForm()); }