public new void SetEnabled(bool enable) { base.SetEnabled(enable); FilterButton.SetEnabled(enable); AdvancedButton.SetEnabled(enable); SearchToolbar.SetEnabled(enable); }
private void FilterViewControllerFiltersUnapplied() { LevelsViewController.SetData(_lastPack); if (!SongBrowserTweaks.ModLoaded) { FilterButton.SetButtonText(FilterButtonText); FilterButton.SetButtonTextSize(3f); // if the clear button is shown, then that was pressed to clear filters // therefore, it should currently be highlighted if ((ClearButton as NoTransitionsButton).selectionState == NoTransitionsButton.SelectionState.Highlighted) { ClearButton.SetButtonText(ClearFilterButtonHighlightedText); } else { ClearButton.SetButtonText(ClearFilterButtonText); } } else { SongBrowserTweaks.FiltersUnapplied(); } }
/// <summary> /// Unapplies the filters in the FilterViewController, but saves their current status. /// </summary> /// <param name="songBrowserFilterSelected">Used only by the SongBrowser mod. Set this to true when another filter (Favorites/Playlist) was selected.</param> public void UnapplyFilters(bool songBrowserFilterSelected = false) { if (_filterViewController != null) { _filterViewController.UnapplyFilters(false); } if (!SongBrowserTweaks.ModLoaded) { FilterButton.SetButtonText(FilterButtonText); FilterButton.SetButtonTextSize(3f); if ((ClearButton as NoTransitionsButton).selectionState == NoTransitionsButton.SelectionState.Highlighted) { ClearButton.SetButtonText(ClearFilterButtonHighlightedText); } else { ClearButton.SetButtonText(ClearFilterButtonText); } } else if (SongBrowserTweaks.Initialized && !songBrowserFilterSelected) { LevelsViewController.SetData(_lastPack); } }
public void CreateFilterButton(Vector2 anchoredPosition, Vector2 sizeDelta, string buttonTemplate = "CancelButton") { if (FilterButton != null || ButtonParentViewController == null) { return; } FilterButton = ButtonParentViewController.CreateUIButton(buttonTemplate, anchoredPosition, sizeDelta, FilterButtonPressed, FilterButtonText); FilterButton.SetButtonTextSize(3f); FilterButton.ToggleWordWrapping(false); FilterButton.name = "EnhancedFilterButton"; // change colour of text (FilterButton as NoTransitionsButton).selectionStateDidChangeEvent += delegate(NoTransitionsButton.SelectionState selectionState) { var filterApplied = _filterViewController?.IsFilterApplied ?? false; var text = FilterButton.GetComponentInChildren <TextMeshProUGUI>(); if (selectionState == NoTransitionsButton.SelectionState.Highlighted) { text.text = filterApplied ? FilterButtonHighlightedAppliedText : FilterButtonHighlightedText; } else { text.text = filterApplied ? FilterButtonAppliedText : FilterButtonText; } }; Logger.log.Debug("Created filter button."); }
public PackageManagerToolbar() { root = Resources.GetTemplate("PackageManagerToolbar.uxml"); Add(root); root.StretchToParentSize(); FilterButton.RegisterCallback <MouseDownEvent>(OnFilterButtonMouseDown); AdvancedButton.RegisterCallback <MouseDownEvent>(OnAdvancedButtonMouseDown); }
public void FilterBy(string filterName, string firstDropdownOption, string firstFilterValue, string secondDropdownOption = "", string thirdDropdownOption = "", string secondFilterValue = "") { Driver.FindElementExtension(By.XPath($"//span[text()='{filterName}']//following-sibling::div")).ClickExtension(Js); this.SelectOptionFromDropdown(FirstDropdownList, firstDropdownOption); FilterFirstInputField.ClickClearAndSendKeys(firstFilterValue); this.SelectOptionFromDropdown(SecondDropdownList, secondDropdownOption); this.SelectOptionFromDropdown(ThirdDropdownList, thirdDropdownOption); FilteSecondInputField.ClickClearAndSendKeys(secondFilterValue); FilterButton.ClickExtension(Js); }
public static Panel getAlphabetFilter(Parameter param, DataBoundControl dbc) { Panel parent = new Panel(); //parent of FilterButtons string[] letters = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}; foreach (string letter in letters) { FilterButton fb = new FilterButton(letter, letter, param, dbc); parent.Controls.Add(fb); } return parent; }
private void FilterViewControllerSetFilteredSongs(IPreviewBeatmapLevel[] levels) { // filter application should be handled by FilterViewController calling stuff in SongBrowserTweaks if (SongBrowserTweaks.Initialized) { return; } BeatmapLevelPack levelPack = new BeatmapLevelPack("", FilteredSongsPackName, LevelsViewController.levelPack.coverImage, new BeatmapLevelCollection(levels)); LevelsViewController.SetData(levelPack); FilterButton.SetButtonText(FilterButtonAppliedText); FilterButton.SetButtonTextSize(2.3f); ClearButton.SetButtonText(ClearFilterButtonAppliedText); }
void ReleaseDesignerOutlets() { if (FilterButton != null) { FilterButton.Dispose(); FilterButton = null; } if (Grid != null) { Grid.Dispose(); Grid = null; } if (UndoFilterButton != null) { UndoFilterButton.Dispose(); UndoFilterButton = null; } }
internal void Filter(IntelliType intelliType) { IEnumerable <FilterButton> filterbuttons = this.toolStrip.Items.OfType <FilterButton>(); FilterButton filterButton = filterbuttons.Where(b => b.Visible && b.IntelliType == intelliType).FirstOrDefault(); if (filterButton is null) { return; } filterButton.Checked = !filterButton.Checked; IEnumerable <IntelliType> matchingTypes = listBox.Items.OfType <IntelliBoxItem>().Select(i => i.IntelliType).Distinct().ToArray(); if (filterbuttons.Any(x => x.Checked)) { IEnumerable <IntelliType> checkedTypes = filterbuttons.Where(x => x.Checked).Select(x => x.IntelliType).Intersect(matchingTypes); SetFilterButtonAppearance(checkedTypes); } else { SetFilterButtonAppearance(matchingTypes); } if (intelliType == IntelliType.None) { enumFilters.Clear(); } else if (enumFilters.Contains(intelliType)) { enumFilters.Remove(intelliType); } else { enumFilters.Add(intelliType); } Filter(); }
internal IntelliBox() { FilterButton[] filterButtons = Enum.GetValues <IntelliType>() .Where(i => i != IntelliType.None && i != IntelliType.Type && i != IntelliType.Parameter) .Select(i => { FilterButton filterButton = new FilterButton(i); filterButton.Click += FilterButton_Click; filterButton.MouseHover += FilterButton_MouseHover; filterButton.MouseLeave += FilterButton_MouseLeave; return(filterButton); }) .ToArray(); toolStrip.Items.AddRange(filterButtons); toolStrip.Dock = DockStyle.Bottom; toolStrip.GripStyle = ToolStripGripStyle.Hidden; toolStrip.ShowItemToolTips = false; toolStrip.MouseEnter += ToolStrip_MouseEnter; toolStrip.MouseLeave += ToolStrip_MouseLeave; listBox.Dock = DockStyle.Fill; listBox.DrawMode = DrawMode.OwnerDrawFixed; listBox.ItemHeight = UIUtil.Scale(16); listBox.BorderStyle = BorderStyle.None; listBox.DrawItem += ListBox_DrawItem; listBox.SelectedIndexChanged += ListBox_SelectedIndexChanged; listBox.DoubleClick += ListBox_DoubleClick; listBox.Click += ListBox_Click; listBox.MouseEnter += ListBox_MouseEnter; listBox.MouseLeave += ListBox_MouseLeave; this.Controls.Add(listBox); this.Controls.Add(toolStrip); this.Cursor = Cursors.Default; this.BorderStyle = BorderStyle.FixedSingle; }
private void OnTvProgramsReveived(object sender, TvProgramReceivedEventArgs e) { programList.Invoke((Action)(() => { programList.Items.Clear(); })); programs = e.Programs; DoOrderBy(ref programs); foreach (TvProgram item in programs) { programList.Invoke( (Action)(() => { AddTvProgramToList(item); }) ); } loadingLabel.Text = "Kész."; queryLabel.Text = programList.Items.Count + " műsor listázva"; if (FilterButton.InvokeRequired) { FilterButton.Invoke((Action)(() => { FilterButton.Enabled = true; })); } else { FilterButton.Enabled = true; } if (programList.InvokeRequired) { programList.Invoke((Action)(() => { programList.Enabled = true; })); } else { programList.Enabled = true; } }
void ReleaseDesignerOutlets() { if (LastUpdatedTimestamp != null) { LastUpdatedTimestamp.Dispose(); LastUpdatedTimestamp = null; } if (AccountTextField != null) { AccountTextField.Dispose(); AccountTextField = null; } if (AutoRefreshButton != null) { AutoRefreshButton.Dispose(); AutoRefreshButton = null; } if (AutoRefreshIntervalComboBox != null) { AutoRefreshIntervalComboBox.Dispose(); AutoRefreshIntervalComboBox = null; } if (ClearButton != null) { ClearButton.Dispose(); ClearButton = null; } if (CloseButton != null) { CloseButton.Dispose(); CloseButton = null; } if (CorrelationIdTextField != null) { CorrelationIdTextField.Dispose(); CorrelationIdTextField = null; } if (DurationTextField != null) { DurationTextField.Dispose(); DurationTextField = null; } if (EventCountTextField != null) { EventCountTextField.Dispose(); EventCountTextField = null; } if (EventLogActionButton != null) { EventLogActionButton.Dispose(); EventLogActionButton = null; } if (EventsCountTextField != null) { EventsCountTextField.Dispose(); EventsCountTextField = null; } if (EventsLogTableView != null) { EventsLogTableView.Dispose(); EventsLogTableView = null; } if (EventTypeTextField != null) { EventTypeTextField.Dispose(); EventTypeTextField = null; } if (ExportButton != null) { ExportButton.Dispose(); ExportButton = null; } if (FilterButton != null) { FilterButton.Dispose(); FilterButton = null; } if (FilterStatusTextField != null) { FilterStatusTextField.Dispose(); FilterStatusTextField = null; } if (FriendlyButton != null) { FriendlyButton.Dispose(); FriendlyButton = null; } if (FriendlyScrollView != null) { FriendlyScrollView.Dispose(); FriendlyScrollView = null; } if (FriendlyTextView != null) { FriendlyTextView.Dispose(); FriendlyTextView = null; } if (FriendlyWebView != null) { FriendlyWebView.Dispose(); FriendlyWebView = null; } if (ImportButton != null) { ImportButton.Dispose(); ImportButton = null; } if (JsonButton != null) { JsonButton.Dispose(); JsonButton = null; } if (JsonScrollView != null) { JsonScrollView.Dispose(); JsonScrollView = null; } if (JsonTextField != null) { JsonTextField.Dispose(); JsonTextField = null; } if (LevelIndicatorTextField != null) { LevelIndicatorTextField.Dispose(); LevelIndicatorTextField = null; } if (ProviderTextField != null) { ProviderTextField.Dispose(); ProviderTextField = null; } if (RefreshButton != null) { RefreshButton.Dispose(); RefreshButton = null; } if (StartTextField != null) { StartTextField.Dispose(); StartTextField = null; } if (StatusBannerTextField != null) { StatusBannerTextField.Dispose(); StatusBannerTextField = null; } if (StatusButton != null) { StatusButton.Dispose(); StatusButton = null; } if (StatusTextField != null) { StatusTextField.Dispose(); StatusTextField = null; } }
private void OnEnterPanel(AttachToPanelEvent evt) { FilterButton.RegisterCallback <MouseDownEvent>(OnFilterButtonMouseDown); AdvancedButton.RegisterCallback <MouseDownEvent>(OnAdvancedButtonMouseDown); }
private void OnLeavePanel(DetachFromPanelEvent evt) { FilterButton.UnregisterCallback <MouseDownEvent>(OnFilterButtonMouseDown); AdvancedButton.UnregisterCallback <MouseDownEvent>(OnAdvancedButtonMouseDown); }
public Form1() { FilterButton filterButton = new FilterButton(); this.Controls.Add(filterButton); filterButton.Click += FilterButton_Click; InitializeComponent(); // XML element létrehozása és az XML fájl betöltése string fileName = "opendata.ecdc.europa.eu.xml"; string path = Path.Combine(Environment.CurrentDirectory, @"Data\", fileName); //Teszteléshez string URL = "https://opendata.ecdc.europa.eu/covid19/casedistribution/xml"; //XML BEOLVASÁS var xml = new XmlDocument(); xml.Load(URL); foreach (XmlElement element in xml.DocumentElement) { var record = new CovidRecord(); Records.Add(record); var firstChildElement = (XmlElement)element.ChildNodes[1]; var secondChildElement = (XmlElement)element.ChildNodes[2]; var thirdChildElement = (XmlElement)element.ChildNodes[3]; var fourthChildElement = (XmlElement)element.ChildNodes[4]; var fifthChildElement = (XmlElement)element.ChildNodes[5]; var sixthChildElement = (XmlElement)element.ChildNodes[6]; var ninthChildElement = (XmlElement)element.ChildNodes[9]; var tenthChildElement = (XmlElement)element.ChildNodes[10]; var eleventhChildElement = (XmlElement)element.ChildNodes[11]; record.Day = int.Parse(firstChildElement.InnerText); record.Month = int.Parse(secondChildElement.InnerText); record.Year = int.Parse(thirdChildElement.InnerText); record.Cases = int.Parse(fourthChildElement.InnerText); record.Deaths = int.Parse(fifthChildElement.InnerText); record.Country = sixthChildElement.InnerText; long popData = 0; long.TryParse(ninthChildElement.InnerText, out popData); record.popData = popData; record.Continent = tenthChildElement.InnerText; decimal last14DaysPer1000 = 0; decimal.TryParse(eleventhChildElement.InnerText.Replace(".", ","), out last14DaysPer1000); record.last14DaysPer100000 = last14DaysPer1000; } //COMBOBOXOK ADATOKKAL VALÓ FELTÖLTÉSE var yearsList = (from r in Records group r by new { r.Year } into yearGroup select yearGroup.Key.Year).ToList(); cbYear.DataSource = SelectionSort(yearsList); var monthsList = (from r in Records group r by new { r.Month } into monthGroup select monthGroup.Key.Month).ToList(); cbMonth.DataSource = SelectionSort(monthsList); var daysList = (from r in Records group r by new { r.Day } into dayGroup select dayGroup.Key.Day).ToList(); cbDay.DataSource = SelectionSort(daysList); cbContinent.DataSource = (from r in Records group r by new { r.Continent } into continentGroup select continentGroup.Key.Continent).ToList(); //SZŰRŐK KEZDETI DEAKTIVÁLÁSA cbYear.Enabled = false; cbMonth.Enabled = false; cbDay.Enabled = false; cbContinent.Enabled = false; lbCountry.Enabled = false; }
public static Panel getAlphabetPartition(Parameter param, DataBoundControl dbc) { Panel parent = new Panel(); string[] subsetNames = {"ABCD", "EFGH", "IJKL", "MNOP", "QRST", "UVWXYZ", "123..."}; string[] subsets = { "[a-d]", "[e-h]", "[i-l]", "[m-p]", "[q-t]", "[u-z]", "[^a-zA-Z]" }; for (int i = 0; i < subsets.Length; i++ ) { FilterButton fb = new FilterButton(subsetNames[i], subsets[i], param, dbc); parent.Controls.Add(fb); } return parent; }