예제 #1
0
 private void Render()
 {
     inputBoxes.Clear();
     RenderLineInputGroups();
     RenderMultiLineInputGroups();
     MultiLineContainer.Loaded += (e, c) =>
     {
         MultiLineBorder.Visibility = Visibility.Collapsed;
         OnRenderDone?.Invoke(this, null);
     };
     BindingActionResults();
     UpdateVariableAction();
     if (ActionContainer != null)
     {
         ActionContainer.ItemIndexChanged += ActionContainer_ItemIndexChanged;
     }
     RenderGlobalVariable();
     //添加操作结果变量
     AddActionResultBtn.Click += (e, c) =>
     {
         if (VariableActionComboBox.SelectedItem != null && VariableActionResultsComboBox.SelectedItem != null)
         {
             var action   = VariableActionComboBox.SelectedItem as ComBoxModel;
             var variable = VariableActionResultsComboBox.SelectedItem as ComBoxModel;
             //KeyboradFocusInputBox.AppendText($"{{{action.ID}.{variable.ID}}}");
             KeyboradFocusInputBox.SelectedText = $"{{{action.ID}.{variable.ID}}}";
             KeyboradFocusInputBox.Focus();
         }
     };
     //渲染事件变量
     RenderEventVariable();
     //验证输入
     Valid();
 }
예제 #2
0
        private void InputBox_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.Up)
            {
                MemoryScrollIndex -= 1;
                if (MemoryScrollIndex < 0)
                {
                    MemoryScrollIndex = 0;
                }
                if (MemoryScrollIndex < CommandMemory.Count)
                {
                    InputBox.Text = CommandMemory[MemoryScrollIndex];
                    InputBox.Focus();
                    InputBox.SelectAll();
                }

                e.Handled = true;
            }
            else if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.Down)
            {
                MemoryScrollIndex += 1;
                if (MemoryScrollIndex > CommandMemory.Count)
                {
                    MemoryScrollIndex = CommandMemory.Count;
                }
                if (MemoryScrollIndex < CommandMemory.Count)
                {
                    InputBox.Text = CommandMemory[MemoryScrollIndex];
                    InputBox.Focus();
                    InputBox.SelectAll();
                }

                e.Handled = true;
            }
        }
예제 #3
0
        void _listener_OnKeyPressed(object sender, KeyPressedArgs e)
        {
            // Hotkey for window
            if (e.KeyPressed.ToString() == "F8")
            {
                if (isTurn)
                {
                    ClosingMethod();
                }
                else
                {
                    Display_MainWindow();

                    // Focus on TextBox when it turns on
                    InputBox.Focus();
                }
            }

            if (e.KeyPressed.ToString() == "Escape" && isTurn == true)
            {
                ClosingMethod();
            }


            // Hotkey for command
            if (e.KeyPressed.ToString() == "Return" && isTurn == true)
            {
                CommandMethod();
            }
        }
예제 #4
0
        public static void Redraw(bool full = false)
        {
            lock (DrawLock)
            {
                if (full)
                {
                    Console.BackgroundColor = ConsoleColor.Black;
                    Console.ForegroundColor = ConsoleColor.White;
                    Console.SetCursorPosition(0, 0);

                    Console.Clear();

                    _ChannelBuffers[_CurBuffer].Render();

                    _InputBox.Render();
                }
                else
                {
                    if (CurrentChannelBuffer.NeedsRender)
                    {
                        CurrentChannelBuffer.Render();
                    }

                    var size = ConsoleHelper.Size;
                    Graphics.DrawLine(new Point(0, size.Height - 2), new Point(size.Width - 1, size.Height - 2), ' ', ConsoleColor.DarkBlue);
                    Graphics.WriteANSIString(StatusBar, new Point(0, size.Height - 2), ConsoleColor.DarkBlue, ConsoleColor.Gray);

                    _InputBox.Focus();
                }
            }
        }
예제 #5
0
        public ReadyRuleInputListWindow()
        {
            InitializeComponent();
            SizeToContent = SizeToContent.WidthAndHeight;

            InputBox.Focus();
        }
예제 #6
0
        private void GetFiles(string path)
        {
            AppList.Clear();

            var files = Directory.GetFiles(@Environment.GetFolderPath(Environment.SpecialFolder.Desktop)).ToList();

            files.AddRange(Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory)));
            if (!String.IsNullOrEmpty(path))
            {
                files.AddRange(Directory.GetFiles(path));
            }
            foreach (var file in files)
            {
                string name = Path.GetFileNameWithoutExtension(file);
                if (File.GetAttributes(file).HasFlag(FileAttributes.Hidden) || String.IsNullOrEmpty(name))
                {
                    continue;
                }
                AppList.Add(new AppItem()
                {
                    FilePath = file,
                });
            }
            InputText = String.Empty; //force filter
            InputBox.Focus();
        }
예제 #7
0
 private void SetReply()
 {
     SendButton.Text = "返神";
     InputBox.Text   = "@" + status.User.ScreenName + " ";
     InputBox.Focus();
     InputBox.Select(InputBox.Text.Length, 0);
 }
        public ConvertTextDialog()
        {
            InitializeComponent();
            MainGrid.Background      = _accentBrush;
            ConvertButton.Background = _accentBrush;
            InputBox.Focus();

            ConvertFromOption.Items.Clear();
            CoptLib.CopticFont.Fonts.Clear();

            foreach (string path in Directory.EnumerateFiles(@"C:\Users\jjask\Documents\Coptic Chanter"))
            {
                if (path.EndsWith(".fnt.xml"))
                {
                    CoptLib.CopticFont.ReadFontXml(path);
                }
                else if (path.EndsWith(".csv"))
                {
                    CoptLib.CopticFont.Fonts.Add(CoptLib.CopticFont.GenerateFromCsv(path));
                }
            }
            foreach (CoptLib.CopticFont font in CoptLib.CopticFont.Fonts)
            {
                ConvertFromOption.Items.Add(new ComboBoxItem()
                {
                    Content = font.Name
                });

                font.SaveFontXml($@"C:\Users\jjask\Documents\Coptic Chanter\{font.Name}.fnt.xml", false);
            }
        }
예제 #9
0
 public MainWindow()
 {
     InitializeComponent();
     _hkvm       = new HiraKanjiViewModel(this);
     DataContext = _hkvm;
     InputBox.Focus();
 }
예제 #10
0
        private void HellButton_Click(object sender, RoutedEventArgs e)
        {
            // Difficulty
            currentgame.WordArray = countries;

            // Hide
            DifficultyBlock.Visibility = Visibility.Hidden;
            NormalButton.Visibility    = Visibility.Hidden;
            HardButton.Visibility      = Visibility.Hidden;
            HellButton.Visibility      = Visibility.Hidden;
            BackButton.Visibility      = Visibility.Hidden;

            // Display
            LifeBlock.Visibility      = Visibility.Visible;
            ScoreBlock.Visibility     = Visibility.Visible;
            AttentionBlock.Visibility = Visibility.Visible;
            Line.Visibility           = Visibility.Visible;
            InputBox.Visibility       = Visibility.Visible;
            TimerBlock.Visibility     = Visibility.Visible;
            FallingWordA.Visibility   = Visibility.Visible;
            FallingWordB.Visibility   = Visibility.Visible;
            FallingWordC.Visibility   = Visibility.Visible;
            FallingWordD.Visibility   = Visibility.Visible;
            RestartButton.Visibility  = Visibility.Visible;

            // Focus to InputBox after Click the Hell Button
            InputBox.Focus();
        }
예제 #11
0
 private void SuggestList_PreviewKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Down)
     {
         if (SuggestList.SelectedIndex < SuggestList.Items.Count - 1)
         {
             SuggestList.SelectedIndex++;
         }
         e.Handled = true;
     }
     else if (e.Key == Key.Up)
     {
         SuggestList.SelectedIndex--;
         if (SuggestList.SelectedIndex == -1)
         {
             InputBox.Focus();
         }
         e.Handled = true;
     }
     else if (e.Key == Key.Enter)
     {
         InputBox.Text = ((ListBoxItem)((ListBox)sender).SelectedItem).Tag.ToString();
         Confirm();
         e.Handled = true;
     }
     e.Handled = true;
 }
예제 #12
0
 private void ChangeSettings()
 {
     if (streaming != null)
     {
         streaming.Stop();
     }
     if (homeStreaming != null)
     {
         homeStreaming.Stop();
     }
     hostName = Properties.Settings.Default.HostName;
     mail     = Properties.Settings.Default.UserID;
     pass     = Properties.Settings.Default.UserPass;
     TimeLineView.DefaultCellStyle.Font      = Properties.Settings.Default.FontSetting;
     TimeLineView.DefaultCellStyle.ForeColor = Properties.Settings.Default.FontColorSetting;
     InputBox.Font                                    = Properties.Settings.Default.FontSetting;
     InputBox.ForeColor                               = Properties.Settings.Default.FontColorSetting;
     this.BackColor                                   = Properties.Settings.Default.BackColorSetting;
     TimeLineView.BackgroundColor                     = Properties.Settings.Default.BackColorSetting;
     TimeLineView.DefaultCellStyle.BackColor          = Properties.Settings.Default.BackColorSetting;
     TimeLineView.DefaultCellStyle.SelectionBackColor = Properties.Settings.Default.BackColorSetting;
     TimeLineView.DefaultCellStyle.SelectionForeColor = Properties.Settings.Default.FontColorSetting;
     InputBox.BackColor                               = Properties.Settings.Default.BackColorSetting;
     InputBox.Focus();
     Run();
 }
예제 #13
0
 private void Model_PropertyChanged(object?sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "Running")
     {
         InputBox.Focus();
     }
 }
예제 #14
0
        public QuestionSearchBox()
        {
            this.InitializeComponent();
            if (!DesignMode.DesignModeEnabled)
            {
                this.WhenActivated(d =>
                {
                    this.Bind(ViewModel, vm => vm.Query, view => view.InputBox.Text)
                    .DisposeWith(d);
                    this.Bind(ViewModel, vm => vm.SuggestedQuestions, view => view.InputBox.ItemsSource)
                    .DisposeWith(d);
                    Observable.FromEventPattern <
                        TypedEventHandler <AutoSuggestBox, AutoSuggestBoxQuerySubmittedEventArgs>,
                        AutoSuggestBox,
                        AutoSuggestBoxQuerySubmittedEventArgs>(
                        h => this.InputBox.QuerySubmitted += h,
                        h => this.InputBox.QuerySubmitted -= h)
                    .Select(ep => ep.EventArgs.ChosenSuggestion)
                    .InvokeCommand(ViewModel, vm => vm.DisplayQuestion)
                    .DisposeWith(d);

                    ViewModel.FocusSearchBox.RegisterHandler(ctx =>
                    {
                        if (InputBox.Focus(FocusState.Programmatic))
                        {
                            ctx.SetOutput(Unit.Default);
                        }
                    }).DisposeWith(d);
                });
            }
        }
예제 #15
0
        public void InputBoxBackspace()
        {
            var caretIndex = InputBox.CaretIndex;

            InputBox.Text = InputBox.Text.Remove(caretIndex - 1, 1);
            InputBox.Focus();
            InputBox.CaretIndex = caretIndex - 1;
        }
예제 #16
0
 public MainWindow()
 {
     InitializeComponent();
     _mainView = DataContext as MainView;
     InputBox.Focus();
     ChoosenDay  = LastDay;
     DayBox.Text = ChoosenDay.ToString();
 }
예제 #17
0
 public ChatBox(string name)
 {
     ContactName = name;
     this.Focus();
     InputBox.Focus();
     //myStackPanel = new StackPanel();
     InitializeComponent();
 }
예제 #18
0
 //This triggers the timer when inputbox is clicked and the test starts
 private void InputBoxClick(object sender, EventArgs e)
 {
     InputBox.MaxLength = ParagraphBox.TextLength;
     InputBox.Focus();
     timer1.Start();
     InputBox.SelectionStart = InputBox.TextLength;
     label5.Visible          = false;
 }
예제 #19
0
        private void CommandLine_Shown(object sender, EventArgs e)
        {
            Thread display = new Thread(new ThreadStart(DisplayStream));

            display.Start();

            InputBox.Focus();
        }
예제 #20
0
        public void InputBoxInsert(string s)
        {
            var caretIndex = InputBox.CaretIndex;

            InputBox.Text = InputBox.Text.Insert(caretIndex, s);
            InputBox.Focus();
            InputBox.CaretIndex = caretIndex + s.Length;
        }
예제 #21
0
 private void C_Click(object sender, RoutedEventArgs e)
 {
     InputBox.Text  = "";
     ResultBox.Text = "";
     Result         = "";
     InputExp       = "";
     InputBox.Focus();
 }
예제 #22
0
		/// <summary>
		/// Copy the log to the Clipboard
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void CopyButton_Click(object sender, EventArgs e)
		{
			InputBox.Focus();

			if (LogBox.Text == null || LogBox.Text == "")
				return;

			Clipboard.SetText(LogBox.Text);
		}
예제 #23
0
        private void Grid_Loaded(object sender, RoutedEventArgs e)
        {
            ShowInTaskbar = false;
            Topmost       = true;
            InputBox.Focus();

            Top        = (SystemParameters.PrimaryScreenHeight / 6) - (Height / 2);
            Visibility = Visibility.Hidden;
        }
예제 #24
0
 protected void BtnClear_Click(object sender, EventArgs e)
 //resets the form to the starting position and clears input box and output label
 {
     FromDropDown.SelectedValue = "Celsius";
     ToDropDown.SelectedValue   = "Farenheit";
     OutputLabel.Text           = "";
     InputBox.Text = "";
     InputBox.Focus();
 }
예제 #25
0
        public void FromTray()
        {
            InputText     = String.Empty;
            InputBox.Text = string.Empty;
            InputBox.Focus();
            AppContainer.SelectedIndex = -1;

            this.Show();
            this.Activate();
        }
예제 #26
0
 public SmartShell()
 {
     Directory.SetCurrentDirectory("C:\\PyAI");
     messageQueue = new Queue <string>();
     lastResp     = "";
     LaunchCMD();
     LaunchPyAI();
     InitializeComponent();
     InputBox.Focus();
 }
예제 #27
0
        private void InputBox_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.Up)
            {
                MemoryScrollIndex -= 1;
                if (MemoryScrollIndex < 0)
                {
                    MemoryScrollIndex = 0;
                }
                if (MemoryScrollIndex < CommandMemory.Count)
                {
                    InputBox.Text = CommandMemory[MemoryScrollIndex];
                    InputBox.Focus();
                    InputBox.SelectAll();
                }

                e.Handled = true;
            }
            else if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.Down)
            {
                MemoryScrollIndex += 1;
                if (MemoryScrollIndex > CommandMemory.Count)
                {
                    MemoryScrollIndex = CommandMemory.Count;
                }
                if (MemoryScrollIndex < CommandMemory.Count)
                {
                    InputBox.Text = CommandMemory[MemoryScrollIndex];
                    InputBox.Focus();
                    InputBox.SelectAll();
                }

                e.Handled = true;
            }
            else if (e.Key == Key.Return)
            {
                var saveInput = InputBox.Text.Trim();

                try
                {
                    InputBox.Clear();
                    (OutputBox.Document as dynamic).body.innerHTML += "<font color=red>" + saveInput + "</font><br>";
                    Driver.Input(saveInput);
                    CommandMemory.Add(saveInput);
                    MemoryScrollIndex = CommandMemory.Count;
                }
                catch (Exception x)
                {
                    (OutputBox.Document as dynamic).body.innerHTML += "<br><font color=red>" + x.Message + "</font><br>";
                    InputBox.Text = saveInput;
                }

                e.Handled = true;
            }
        }
예제 #28
0
 private void PasteItem_Click(object sender, RoutedEventArgs e)
 {
     if (HistArea.IsVisible == true)
     {
         HistArea.Paste();
     }
     else if (InputBox.Focus())
     {
         InputBox.Paste();
     }
 }
예제 #29
0
        private void ConsoleControl_Loaded(object sender, RoutedEventArgs e)
        {
            WriteLine("Welcome to Git Basic!");
            WriteLine(string.Empty);

            StartCmdExe();
            Execute  = RunCommand;
            SetInput = SetInputText;
            InputBox.Focus();
            StartWatchingSelectionChange();
        }
예제 #30
0
        public void SetInputText(string text, int selectionIndex = -1)
        {
            if (selectionIndex == -1)
            {
                selectionIndex = text.Length;
            }

            InputBox.Text = text;
            InputBox.Select(selectionIndex, 0);
            InputBox.Focus();
        }