public ConfirmDialogCW(string title, string message) { InitializeComponent(); Title = title; Message = message; KeyDown += new System.Windows.Input.KeyEventHandler(NewEditNeedCW_KeyDown); }
public MainWindow() { InitializeComponent(); try { resPath = GetLastDictionary(); currentFile = File.ReadAllLines(resPath); File.Create("logs.txt").Close(); if (!File.Exists(setPath)) { File.Create(setPath); } if (!File.Exists(resPath)) { File.Create(resPath).Close(); } } catch (Exception ex) { WriteToLog("Program files check/creation error.", new StackTrace(), ex); } SetDefaults(); btnLoadFile.ToolTip = "Single file would be saved to *.txt chosen"; btnChooseFolder.ToolTip = "Whole folder would be saved to *.txt chosen"; btnRestoreFiles.ToolTip = "Whole file would be restored to folder \"Images\""; btnChangeResult.ToolTip = "Changes *.txt you are using to save or load files"; KeyDown += new System.Windows.Input.KeyEventHandler(MainWindow_KeyDown); }
/// <summary> /// Initializes a new instance of the <see cref="MdiContainer"/> class. /// </summary> public MdiContainer() { Background = Brushes.DarkGray; Focusable = IsTabStop = false; Children = new ObservableCollection <MdiChild>(); Children.CollectionChanged += Children_CollectionChanged; Grid gr = new Grid(); gr.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); gr.RowDefinitions.Add(new RowDefinition()); _topPanel = new DockPanel { Background = SystemColors.MenuBrush }; _topPanel.Children.Add(_menu = new Border()); DockPanel.SetDock(_menu, Dock.Left); _topPanel.Children.Add(_buttons = new Border()); DockPanel.SetDock(_buttons, Dock.Right); _topPanel.SizeChanged += MdiContainer_SizeChanged; _topPanel.Children.Add(new UIElement()); gr.Children.Add(_topPanel); ScrollViewer sv = new ScrollViewer { Content = _windowCanvas = new Canvas(), HorizontalScrollBarVisibility = ScrollBarVisibility.Auto, VerticalScrollBarVisibility = ScrollBarVisibility.Auto }; gr.Children.Add(sv); Grid.SetRow(sv, 1); Content = gr; if (Theme == ThemeType.Generic) { if (Environment.OSVersion.Version.Major > 5 && Environment.OSVersion.Version.Minor > 1) { ThemeValueChanged(this, new DependencyPropertyChangedEventArgs(ThemeProperty, Theme, ThemeType.Windows10)); } else if (Environment.OSVersion.Version.Major > 5) { ThemeValueChanged(this, new DependencyPropertyChangedEventArgs(ThemeProperty, Theme, ThemeType.Aero)); } else { ThemeValueChanged(this, new DependencyPropertyChangedEventArgs(ThemeProperty, Theme, ThemeType.Luna)); } } Loaded += MdiContainer_Loaded; SizeChanged += MdiContainer_SizeChanged; KeyDown += new System.Windows.Input.KeyEventHandler(MdiContainer_KeyDown); }
public AutoFocusTextBox() : base() { GotFocus += new System.Windows.RoutedEventHandler(AutoFocusTextBox_GotFocus); LostFocus += new System.Windows.RoutedEventHandler(AutoFocusTextBox_LostFocus); MouseLeftButtonDown += new MouseButtonEventHandler(AutoFocusTextBox_MouseLeftButtonDown); BorderBrush = Brushes.Transparent; Background = Brushes.Transparent; KeyDown += new System.Windows.Input.KeyEventHandler(AutoFocusTextBox_KeyDown); Padding = new Thickness(0); VerticalAlignment = System.Windows.VerticalAlignment.Center; }
private void OnSuccess() { MouseDown += new MouseButtonEventHandler(Window1_MouseDown); MouseMove += new System.Windows.Input.MouseEventHandler(Window1_MouseMove); MouseUp += new MouseButtonEventHandler(Window1_MouseUp); _Canvas.Children.Add(_Image); string fname = _OpenFileDialog.FileNames[0]; _Image.Source = new BitmapImage(new Uri(fname)); _Canvas.Children.Add(_Rectangle); _Rectangle.Stroke = new SolidColorBrush(Colors.Blue); _Rectangle.StrokeThickness = 2; KeyDown += new System.Windows.Input.KeyEventHandler(Window1_KeyDown); }
private void OnSuccess() { MouseDown += new MouseButtonEventHandler(Window1_MouseDown); MouseMove += new System.Windows.Input.MouseEventHandler(Window1_MouseMove); MouseUp += new MouseButtonEventHandler(Window1_MouseUp); _Canvas.Children.Add(_Image); string fname = _OpenFileDialog.FileNames[0]; _Image.Source = new BitmapImage(new Uri(fname)); _Canvas.Children.Add(_Rectangle); _Rectangle.Stroke = new SolidColorBrush(Colors.Blue); _Rectangle.StrokeThickness = 2; KeyDown += new System.Windows.Input.KeyEventHandler(Window1_KeyDown); }
/// <summary> /// Initializes a new instance of the <see cref="MdiContainer"/> class. /// </summary> public MdiContainer() { Background = Brushes.DarkGray; Focusable = IsTabStop = false; // Icon = new BitmapImage(new Uri("pack://application:,,,/BabelResources;component/images/babelfish32.png", UriKind.Absolute)); Children = new ObservableCollection <MdiChild>(); Children.CollectionChanged += Children_CollectionChanged; Grid gr = new Grid(); gr.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); gr.RowDefinitions.Add(new RowDefinition()); _topPanel = new DockPanel(); //X { Background = SystemColors.MenuBrush }; _topPanel.Children.Add(_menu = new Border()); DockPanel.SetDock(_menu, Dock.Left); //X _topPanel.Children.Add(_buttons = new Border()); //X DockPanel.SetDock(_buttons, Dock.Right); _buttons = new Border(); _topPanel.SizeChanged += MdiContainer_SizeChanged; _topPanel.Children.Add(new UIElement()); gr.Children.Add(_topPanel); ScrollViewer sv = new ScrollViewer { Content = _windowCanvas = new Canvas(), HorizontalScrollBarVisibility = ScrollBarVisibility.Auto, VerticalScrollBarVisibility = ScrollBarVisibility.Auto }; gr.Children.Add(sv); Grid.SetRow(sv, 1); Content = gr; Loaded += MdiContainer_Loaded; SizeChanged += MdiContainer_SizeChanged; KeyDown += new System.Windows.Input.KeyEventHandler(MdiContainer_KeyDown); }
/// <summary> /// Initializes a new instance of the <see cref="MainWindow"/> class. /// </summary> public MainWindow() { InitializeComponent(); trackBarExpectedBarcodes.ValueChanged += new RoutedPropertyChangedEventHandler <double>(trackBarExpectedBarcodes_ValueChanged); trackBarScanInterval.ValueChanged += new RoutedPropertyChangedEventHandler <double>(trackBarScanInterval_ValueChanged); directionAngle45.Checked += new RoutedEventHandler(direction_CheckedChanged); directionAngle45.Unchecked += new RoutedEventHandler(direction_CheckedChanged); directionTB.Checked += new RoutedEventHandler(direction_CheckedChanged); directionTB.Unchecked += new RoutedEventHandler(direction_CheckedChanged); directionBT.Checked += new RoutedEventHandler(direction_CheckedChanged); directionBT.Unchecked += new RoutedEventHandler(direction_CheckedChanged); directionRL.Checked += new RoutedEventHandler(direction_CheckedChanged); directionRL.Unchecked += new RoutedEventHandler(direction_CheckedChanged); directionLR.Checked += new RoutedEventHandler(direction_CheckedChanged); directionLR.Unchecked += new RoutedEventHandler(direction_CheckedChanged); directionAngle45.IsChecked = false; Title = _formTitle; KeyDown += new System.Windows.Input.KeyEventHandler(MainWindow_KeyDown); KeyUp += new System.Windows.Input.KeyEventHandler(MainWindow_KeyUp); _reader = new BarcodeReader(); _reader.Progress += new EventHandler <BarcodeReaderProgressEventArgs>(reader_Progress); _reader.Settings.ScanBarcodeTypes = BarcodeType.Code128 | BarcodeType.Code39 | BarcodeType.DataMatrix; readerBarcodeTypes.SetBarcodeReaderSettings(_reader.Settings); _openDialog = new OpenFileDialog(); _openDialog.Filter = "All supported|*.bmp;*.jpg;*.jpeg;*.jpe;*.jfif;*.tif;*.tiff;*.png;*.gif;*.tga;*.wmf;*.emf;*.pdf"; try { string exampleImagesDir = GetExampleImagesDirectory(); if (exampleImagesDir != null) { _openDialog.InitialDirectory = exampleImagesDir; } } catch { } }
/// <summary> /// Initializes a new instance of the <see cref="MDIContainer"/> class. /// </summary> public MDIContainer() { Children = new ObservableCollection <MDIChild>(); Children.CollectionChanged += Children_CollectionChanged; Grid gr = new Grid(); gr.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); gr.RowDefinitions.Add(new RowDefinition()); _topPanel = new DockPanel { Background = Brushes.Transparent }; _topPanel.Children.Add(_menuBorder = new Border()); DockPanel.SetDock(_menuBorder, Dock.Left); _topPanel.Children.Add(_buttonsBorder = new Border()); DockPanel.SetDock(_buttonsBorder, Dock.Right); _topPanel.SizeChanged += MdiContainer_SizeChanged; _topPanel.Children.Add(new UIElement()); gr.Children.Add(_topPanel); ScrollViewer sv = new ScrollViewer { Content = _windowCanvas = new Canvas(), HorizontalScrollBarVisibility = ScrollBarVisibility.Auto, VerticalScrollBarVisibility = ScrollBarVisibility.Auto }; gr.Children.Add(sv); Grid.SetRow(sv, 1); Content = gr; Loaded += MdiContainer_Loaded; SizeChanged += MdiContainer_SizeChanged; KeyDown += new System.Windows.Input.KeyEventHandler(MdiContainer_KeyDown); AllowWindowStateMax = true; }
public EditableTextBox() : base() { Background = System.Windows.Media.Brushes.Transparent; TextAlignment = System.Windows.TextAlignment.Left; BorderThickness = new System.Windows.Thickness(0.0); IsReadOnly = true; Focusable = false; IsTabStop = false; IsHitTestVisible = true; Cursor = System.Windows.Input.Cursors.Arrow; Margin = new System.Windows.Thickness(5, 0, 5, 0); KeyDown += new System.Windows.Input.KeyEventHandler(ClassTextBox_KeyDown); KeyUp += new KeyEventHandler(EditableTextBox_KeyUp); LostFocus += new System.Windows.RoutedEventHandler(ClassTextBox_LostFocus); LostKeyboardFocus += new KeyboardFocusChangedEventHandler(ClassTextBox_LostKeyboardFocus); MouseEnter += new MouseEventHandler(ClassTextBox_MouseEnter); MouseLeave += new MouseEventHandler(ClassTextBox_MouseLeave); ContextMenuOpening += new ContextMenuEventHandler(ClassTextBox_ContextMenuOpening); ContextMenuClosing += new ContextMenuEventHandler(ClassTextBox_ContextMenuClosing); FocusVisualStyle = null; ResetContextMenu(); }
public MainWindow() { InitializeComponent(); textBox1.KeyDown += new KeyEventHandler(textBox1_KeyDown); Loaded += new RoutedEventHandler(MainWindow_Loaded); KeyDown += new KeyEventHandler(MainWindow_KeyDown); Deactivated += new EventHandler(MainWindow_Deactivated); WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; this.WindowStyle = System.Windows.WindowStyle.None; ShowInTaskbar = false; Topmost = true; ResizeMode = System.Windows.ResizeMode.NoResize; executeSafe(() => { //actionsModule = ActionsModule.CreateFromProject("..\\src\\Modules\\Modules.csproj", AppDomain.CurrentDomain.BaseDirectory + "\\Modules.dll"); actionsModule = new CompositeActionsModule(); var lightningDevelopmentHandle = new LightningDevelopmentHandle(/*actionsModule*/); actionsModule.Submodules.Add(ActionsModule.CreateFromDll(Configuration.Get.ModulesDllPath, lightningDevelopmentHandle)); }); }
/*/////////////////////////////////////////////////////////////////// keyboard events //////////////////////////////////////////////////////////////////*/ private void Window_Loaded(object sender, RoutedEventArgs e) { KeyDown += new System.Windows.Input.KeyEventHandler(MainWindow_KeyDown); }
public void Add(FrameworkElement element) { AddChild(element); MouseDown += new System.Windows.Input.MouseButtonEventHandler(OnMouseDown); KeyDown += new System.Windows.Input.KeyEventHandler(OnKeyDown); }
/// <summary> /// Initializes a new instance of the <see cref="MDIContainer"/> class. /// </summary> public MDIContainer() { Children = new ObservableCollection<MDIChild>(); Children.CollectionChanged += Children_CollectionChanged; Grid gr = new Grid(); gr.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); gr.RowDefinitions.Add(new RowDefinition()); _topPanel = new DockPanel { Background = Brushes.Transparent }; _topPanel.Children.Add(_menuBorder = new Border()); DockPanel.SetDock(_menuBorder, Dock.Left); _topPanel.Children.Add(_buttonsBorder = new Border()); DockPanel.SetDock(_buttonsBorder, Dock.Right); _topPanel.SizeChanged += MdiContainer_SizeChanged; _topPanel.Children.Add(new UIElement()); gr.Children.Add(_topPanel); ScrollViewer sv = new ScrollViewer { Content = _windowCanvas = new Canvas(), HorizontalScrollBarVisibility = ScrollBarVisibility.Auto, VerticalScrollBarVisibility = ScrollBarVisibility.Auto }; gr.Children.Add(sv); Grid.SetRow(sv, 1); Content = gr; Loaded += MdiContainer_Loaded; SizeChanged += MdiContainer_SizeChanged; KeyDown += new System.Windows.Input.KeyEventHandler(MdiContainer_KeyDown); AllowWindowStateMax = true; }
public void Add(FrameworkElement element) { AddChild(element); MouseDown += new System.Windows.Input.MouseButtonEventHandler(OnMouseDown); KeyDown += new System.Windows.Input.KeyEventHandler(OnKeyDown); }
public MainView() { InitializeComponent(); DevicesDataGrid.SelectionChanged += new SelectionChangedEventHandler(DataGrid_SelectionChanged); KeyUp += new System.Windows.Input.KeyEventHandler(MainView_KeyUp); }