public MainWindow() { InitializeComponent(); ViewModel = new MainWindowViewModel(); this.WhenActivated(disposables => { this.Bind(ViewModel, vm => vm.FilterText, v => v.FilterTextBox.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.UseFuzzy, v => v.UseFuzzyToggleButton.IsChecked).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.GroupsView, v => v.GroupsListView.ItemsSource).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedGroup, v => v.GroupsListView.SelectedItem).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.GroupsView.Count, v => v.CurrentShowCountRun.Text).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.Groups.Count, v => v.TotalCountRun.Text).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.LoadGroups, v => v.RefreshButton).DisposeWith(disposables); Observable.Return(Unit.Default) .Where(_ => StateService.LastCacheUpdate < (DateTimeOffset.Now - TimeSpan.FromDays(5))) .InvokeCommand(ViewModel.LoadGroups) .DisposeWith(disposables); Observable.Return(Unit.Default) .Delay(TimeSpan.FromMilliseconds(100)) .ObserveOnDispatcher() .Subscribe(x => { FilterTextBox.Focus(); FilterTextBox.SelectAll(); }) .DisposeWith(disposables); }); }
public AddModPackPage(int x, int y, int width, int height) : base(x, y, width, height) { Options.Add(new ModManagerAddNameTextBox()); var modList = ModData.ModList.Keys.Where(id => id != "GilarF.ModSettingsTab"); foreach (var uniqueId in modList) { Options.Add(new ModManagerCheckBox(uniqueId)); } FilterTextBox = new FilterTextBox(this, FilterTextBox.FilterType.Options, xPositionOnScreen + width / 2 + 112, yPositionOnScreen + 40); _button = new ClickableTextureComponent("AddButton", new Rectangle( xPositionOnScreen + 80, yPositionOnScreen + height + 10, 64, 64), "", "Add", Game1.mouseCursors, new Rectangle(128, 256, 64, 64), 1f) { myID = 12233 }; }
private void Window_Loaded(object sender, RoutedEventArgs e) { _inventory = InventoryManager.DeserializeInventory(); SetItemsSource(); memosPaths = InventoryManager.GetMemosPaths(); FilterTextBox.Focus(); }
public FilterControl() { Children = new Drawable[] { new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Spacing = new Vector2(0f, 10f), Children = new Drawable[] { Search = new FilterTextBox { RelativeSizeAxes = Axes.X, Height = 40, Exit = () => ExitRequested?.Invoke(), }, new CollectionsDropdown <PlaylistCollection> { RelativeSizeAxes = Axes.X, Items = new[] { PlaylistCollection.All }, } }, }, }; Search.Current.ValueChanged += current_ValueChanged; }
private void VisibilityChangedCallback(DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs) { if ((Visibility)dependencyPropertyChangedEventArgs.NewValue == Visibility.Visible) { FilterTextBox.Focus(FocusState.Programmatic); } }
public void ChooserPanel_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.Escape: CallbackMethod(null); Dispose(); break; case Keys.Down: SelectedControl = controls[Math.Min(controls.IndexOf(selectedControl) + 1, controls.Count - 1)]; break; case Keys.Up: SelectedControl = controls[Math.Max(controls.IndexOf(selectedControl) - 1, 0)]; break; case Keys.Enter: CallbackMethod(SelectedControl); Dispose(); break; default: FilterTextBox.Focus(); SendKeys.Send(e.KeyCode.ToString()); break; } }
public void SetUp() { _control = new FilterTextBox { Style = (Style)App.Instance.FindResource(typeof(FilterTextBox)) }; _control.ApplyTemplate().Should().BeTrue(); }
/// <summary> /// Initializes a new instance of the ListPicerFullMode class /// </summary> public ListPickerFullMode() { DataContext = new ListPickerFullModeViewModel(); ((ListPickerFullModeViewModel)DataContext).Initialize(); InitializeComponent(); FilterTextBox.Focus(); }
private async void Window_Loaded(object sender, RoutedEventArgs e) { List <TreeNavigationItem> proposals = await _actionToGetProposals.Invoke(); proposalCollectionView = CollectionViewSource.GetDefaultView(proposals); _referenceWindowModelView.LoadProposals(proposals); FilterTextBox.Focus(); }
private void FilterTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == (Keys.Control | Keys.A)) { FilterTextBox.SelectAll(); e.Handled = e.SuppressKeyPress = true; } }
private void SelectedFateCountTextBlock_SizeChanged(object sender, SizeChangedEventArgs e) { double newWidth = ((Grid)FilterTextBox.Parent).ColumnDefinitions[0].ActualWidth - e.NewSize.Width - (e.NewSize.Width > 0 ? 12 : 5); FilterTextBox.BeginAnimation(WidthProperty, new DoubleAnimation { From = FilterTextBox.ActualWidth, To = newWidth, Duration = TimeSpan.FromMilliseconds(250) }); }
private void _packageList_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Up && _packageList.SelectedIndex == 0) { FilterTextBox.Focus(); e.Handled = true; } }
private void TextBox_TextChanged(object sender, EventArgs e) { FilterTextBox ft = (FilterTextBox)sender; if (ft.Text.Length == 5) { this.SelectNextControl(ft, true, true, false, false); } }
private void NewTagForm_Load(object sender, EventArgs e) { foreach (Tag entry in Dictionary.Instance) { choices.Add(entry.ToString() + " " + entry.Description, false); } LoadListBox(String.Empty); FilterTextBox.Focus(); }
private void TagForm_Load(object sender, EventArgs e) { foreach (Tag entry in Dictionary.Instance) { choices.Add(entry.ToString() + " " + entry.Description, (selection != null && Contains(selection, entry.ToString()))); } LoadListBox(String.Empty); FilterTextBox.Focus(); }
public SearchWindow() { InitializeComponent(); FilterTypeComboBox.ItemsSource = new[] { "Champion Name", "Skin Name", "Username" }; FilterTypeComboBox.SelectedIndex = 0; FilterTextBox.Focus(); }
public ModPackPage(int x, int y, int width, int height, string modPack) : base(x, y, width, height) { var opt = new List <OptionsElement>(); var mpOpt = ModManager.Options.Where(o => ((ModManagerToggle)o).ModPack.Exists(p => p == modPack)).ToList(); opt.Add(new ModManagerHeading(modPack)); opt.AddRange(mpOpt); Options = opt; FilterTextBox = new FilterTextBox(this, FilterTextBox.FilterType.Options, xPositionOnScreen + width / 2 + 112, yPositionOnScreen + 40); }
private void AddFilterButton_Click(object sender, RoutedEventArgs e) { var filter = new Filter { Pattern = FilterTextBox.Text, Type = FilterType.None }; filters.Add(filter); filter.BeginEdit(); FilterListView.ScrollIntoView(filter); FilterTextBox.Clear(); }
private FilterTextBox getTextBox(PropertyDefinitionModel field) { var ftb = new FilterTextBox(field, !this.IsPopupMode) { Padding = new Thickness(0), Width = 120 }; if (this.IsPopupMode) { ftb.Height = 26; } else { ftb.Height = 21; } ftb.SetBinding(FilterTextBox.TextProperty, getFilterValueBinding()); var faExpr = this.Filter as FltAtomExprData; if (faExpr != null && faExpr.Value.IsEmpty()) { if (field.Type == PropertyType.String) { (this.Filter as FltAtomExprData).Operator = FilterFieldOperator.Equal; } else { (this.Filter as FltAtomExprData).Operator = FilterFieldOperator.Equal; } } var operatorBinding = new Binding("Operator") { Source = this.Filter, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, Mode = BindingMode.TwoWay }; ftb.SetBinding(FilterTextBox.FilterTypeProperty, operatorBinding); ftb.SetBinding(FilterTextBox.PropertyTypeProperty, new Binding("PropertyType") { Source = this.Filter, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, Mode = BindingMode.TwoWay }); ftb.SetBinding(FilterTextBox.IsEnabledProperty, this.getIsEnabledBinding()); ftb.BorderBrush = ResourcesManager.Instance.GetBrush("IsReadOnlyBorderBrush"); ftb.KeyUp += (s, e) => { if (e.Key == Key.Enter) { activateFilter(); } }; return(ftb); }
private void ResultsView_KeyUp(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { ExecuteCommand(); } else if (e.Key == Key.Up && ResultsView.SelectedIndex == 0) { FilterTextBox.Focus(); } }
private void DisableInput() { SelectButton.Enabled = false; FindTextButton.Enabled = false; FindWithRegexButton.Enabled = false; TextToFindTextBox.Enabled = false; TextToFindWithRegexTextBox.Enabled = false; DisableEmbeddedContentCheckBox.Enabled = false; IncludePropertiesCheckBox.Enabled = false; ReadIntoMemoryCheckBox.Enabled = false; FilterTextBox.Clear(); }
private void MakeProcessList() { var processInfos = new ProcessInfos(); var myProcessId = Process.GetCurrentProcess().Id; // TODO FIX NOW maek the call to GetProcessesWithGCHeaps async. var allProcs = AllProcsCheckBox.IsChecked ?? false; m_procsWithHeaps = null; if (!allProcs && m_procsWithHeaps == null) { m_procsWithHeaps = GCHeapDump.GetProcessesWithGCHeaps(); } // Create a list of processes, exclude myself m_processList = new List <ProcessInfo>(); foreach (var process in processInfos.Processes) { // If the name is null, it is likely a system process, it will not have managed code, so don't bother. if (process.Name == null) { continue; } if (process.ProcessID == myProcessId) { continue; } // Only show processes with GC heaps. if (!allProcs && !m_procsWithHeaps.ContainsKey(process.ProcessID)) { continue; } m_processList.Add(process); } m_processList.Sort(delegate(ProcessInfo x, ProcessInfo y) { // Sort by name var ret = string.Compare(x.Name, y.Name, StringComparison.OrdinalIgnoreCase); if (ret != 0) { return(ret); } // Then by process ID return(x.ProcessID - y.ProcessID); }); Processes.ItemsSource = m_processList; FilterTextBox.Focus(); }
async void ftb_FilterTypeChanged(object sender, EventArgs e) { FilterTextBox ftb = sender as FilterTextBox; if (ftb != null) { if (ftb.Text.IsEmpty()) { return; } } await _dg.Refresh(); }
public override void OnApplyTemplate() { base.OnApplyTemplate(); _partDataSourceSearch = (FilterTextBox)GetTemplateChild(PART_DataSourceSearch); _partDataSources = (TreeView)GetTemplateChild(PART_DataSources); _partDataSources.AllowDrop = true; _partDataSources.SelectedItemChanged += PartDataSourcesOnSelectedItemChanged; _partDataSources.MouseMove += PartDataSourcesOnMouseMove; _partDataSources.DragOver += PartDataSourcesOnDragOver; _partDataSources.DragEnter += PartDataSourcesOnDragEnter; _partDataSources.DragLeave += PartDataSourcesOnDragLeave; _partDataSources.Drop += PartDataSourcesOnDrop; }
public ChooserPanel(IEnumerable <ChooserControl> controls, ProductionGraphViewer parent) : base() { InitializeComponent(); this.controls = controls.ToList(); parent.Controls.Add(this); this.Location = new Point(parent.Width / 2 - Width / 2, parent.Height / 2 - Height / 2); this.Anchor = AnchorStyles.None; this.BringToFront(); parent.PerformLayout(); FilterTextBox.Focus(); }
private void AddItemButton_Click(object sender, RoutedEventArgs e) { EditItemForm dialog = new EditItemForm(new Item(1)); dialog.Title = "Add item"; dialog.ShowDialog(); if (dialog.DialogResult.HasValue && dialog.DialogResult.Value && !string.IsNullOrWhiteSpace(dialog.Item.Name)) { _inventory.Items.Add(dialog.Item); SetItemsSource(); FilterTextBox_TextChanged(null, null); } FilterTextBox.Focus(); }
private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e) { _updateTimer.Stop(); if (e.Key == Key.Enter) { ((AbstractEntityCollectionViewModelBase)DataContext).RefreshItems(); FilterTextBox.SelectAll(); } else if (e.Key == Key.Down) { MainGrid.BackgroundFocus(); } else { _beforeText = FilterTextBox.Text; _updateTimer.Start(); } }
private void getTextColumnFilterControl() { FilterTextBox ftb = new FilterTextBox(this.PropertyDefinition, false); ftb.KeyUp += new System.Windows.Input.KeyEventHandler(ftb_KeyUp); ftb.KeyDown += new System.Windows.Input.KeyEventHandler(ftb_KeyDown); ftb.Padding = new Thickness(0.0); ftb.Margin = new Thickness(0.0); ftb.HorizontalAlignment = HorizontalAlignment.Stretch; ftb.BorderBrush = ResourcesManager.Instance.GetBrush("IsReadOnlyBorderBrush"); if (ftb.IsEnabled) { Binding tbBinding = new Binding("Collection.Filter.FieldsFilter[" + this.FieldName + "]") { Source = _dg, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged }; ftb.SetBinding(FilterTextBox.TextProperty, tbBinding); } ftb.Height = 30; ftb.FontSize = 12; Binding cbBinding = new Binding("Collection.Filter.FieldsFilter.FieldFilters[" + this.FieldName + "].Operator") { Source = _dg, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, Mode = BindingMode.TwoWay }; ftb.SetBinding(FilterTextBox.FilterTypeProperty, cbBinding); Binding typeBinding = new Binding("Collection.Filter.FieldsFilter.FieldFilters[" + this.FieldName + "].PropertyType") { Source = _dg, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, Mode = BindingMode.TwoWay }; ftb.SetBinding(FilterTextBox.PropertyTypeProperty, typeBinding); ftb.FilterTypeChanged += new EventHandler(ftb_FilterTypeChanged); ftb.PropertyChanged += Ftb_PropertyChanged; _columnFilterControl = ftb; }
private void ToggleSearch(bool?isChecked) { if (!isChecked.HasValue) { return; } var isOpen = isChecked.Value; FilterTextBox.Visibility = isOpen ? Visibility.Visible : Visibility.Collapsed; if (!isOpen) { FilterTextBox.Text = string.Empty; } else { // set focus FilterTextBox.Focus(); } }
public MainForm() { InitializeComponent(); Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); AddFiltersToComboBox(); AddGammaLutsToComboBox(); FilterComboBox.SelectedIndexChanged += FilterComboBox_SelectedIndexChanged; GammaLutComboBox.SelectedIndexChanged += GammaLutComboBox_SelectedIndexChanged; LoadLastImage(); LoadLastFilter(); LoadLastGammaLut(); FilterTextBox.Select(FilterTextBox.TextLength, 0); UpdateImage(); }
public override void OnApplyTemplate() { base.OnApplyTemplate(); _partDataSourceSearch = (FilterTextBox) GetTemplateChild(PART_DataSourceSearch); _partDataSources = (TreeView) GetTemplateChild(PART_DataSources); _partDataSources.AllowDrop = true; _partDataSources.SelectedItemChanged += PartDataSourcesOnSelectedItemChanged; _partDataSources.MouseMove += PartDataSourcesOnMouseMove; _partDataSources.DragOver += PartDataSourcesOnDragOver; _partDataSources.DragEnter += PartDataSourcesOnDragEnter; _partDataSources.DragLeave += PartDataSourcesOnDragLeave; _partDataSources.Drop += PartDataSourcesOnDrop; }
private FilterTextBox getTextBox(PropertyDefinitionModel field) { var ftb = new FilterTextBox(field) { Height = 28, Padding = new Thickness(0), Width = 120 }; ftb.IsInlineMode = true; // ftb.FilterType = (this.Filter as FltAtomExprData).Operator; ftb.SetBinding(FilterTextBox.TextProperty, getFilterValueBinding()); var faExpr = this.Filter as FltAtomExprData; if (faExpr != null && faExpr.Value.IsEmpty()) { if (field.Type == PropertyType.String) (this.Filter as FltAtomExprData).Operator = FilterFieldOperator.Contains; else (this.Filter as FltAtomExprData).Operator = FilterFieldOperator.Equal; } var operatorBinding = new Binding("Operator") { Source = this.Filter, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, Mode = BindingMode.TwoWay }; ftb.SetBinding(FilterTextBox.FilterTypeProperty, operatorBinding); ftb.SetBinding(FilterTextBox.PropertyTypeProperty, new Binding("PropertyType") { Source = this.Filter, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, Mode = BindingMode.TwoWay }); ftb.SetBinding(FilterTextBox.IsEnabledProperty, this.getIsEnabledBinding()); ftb.BorderBrush = ResourcesManager.Instance.GetBrush("IsReadOnlyBorderBrush"); ftb.KeyUp += (s, e) => { if (e.Key == Key.Enter) activateFilter(); }; return ftb; }