private void InitializeAction(MessageBoxAction action) { switch (action) { case MessageBoxAction.Confirm: OkButton.Visibility = Visibility.Visible; OkButton.Focus(); YesButton.Visibility = Visibility.Collapsed; NoButton.Visibility = Visibility.Collapsed; break; case MessageBoxAction.YesNo: OkButton.Visibility = Visibility.Collapsed; YesButton.Visibility = Visibility.Visible; NoButton.Visibility = Visibility.Visible; NoButton.Focus(); break; } }
private void ListaSeries_KeyDown(object sender, KeyEventArgs e) { if (e.Control == false && e.Alt == false && e.Shift == false) { switch (e.KeyCode) { case Keys.Return: if (ListaDatosSeguimiento.CheckBoxes == true && ListaDatosSeguimiento.CheckedItems.Count == 0 && ListaDatosSeguimiento.SelectedItems.Count == 1) { // Si no hay ninguno tildado, tildo el elemento seleccionado ListaDatosSeguimiento.SelectedItems[0].Checked = true; } OkButton.PerformClick(); e.Handled = true; break; } } }
private void OkButton_Click(object sender, EventArgs e) { SqlConnection newConnection = new SqlConnection(); newConnection.ConnectionString = "Data Source=MAKS-PC;Initial Catalog=PressWiz;Integrated Security=True"; SqlCommand myCommand = new SqlCommand("SELECT * FROM [UserAccounts] WHERE First_Name = '" + First_Name + "' AND Password ='******';", newConnection); SqlDataReader myReader; try { newConnection.Open(); myReader = myCommand.ExecuteReader(); int count = 0; while (myReader.Read()) { count++; } myReader.Close(); newConnection.Close(); if (count == 1) { ChangePW newChangePW = new ChangePW(First_Name); this.Hide(); newChangePW.ShowDialog(); this.Close(); } else { MessageBox.Show("Invalid Password !", First_Name, MessageBoxButtons.OK, MessageBoxIcon.Error); PWTextBox.Focus(); } } catch (InvalidOperationException ioe) { MessageBox.Show(ioe.ToString(), "Connection Error !", MessageBoxButtons.OK, MessageBoxIcon.Error); OkButton.Focus(); } catch (SqlException se) { MessageBox.Show(se.ToString(), "Connection Error !", MessageBoxButtons.OK, MessageBoxIcon.Error); OkButton.Focus(); } }
public ReleaseNotesDialog() { InitializeComponent(); Load += (sender, args) => OkButton.Select(); WebBrowser.CanGoBackChanged += (sender, args) => BackButton.Enabled = WebBrowser.CanGoBack; BackButton.Click += (sender, args) => WebBrowser.GoBack(); WebBrowser.CanGoForwardChanged += (sender, args) => ForwardButton.Enabled = WebBrowser.CanGoForward; ForwardButton.Click += (sender, args) => WebBrowser.GoForward(); OkButton.Click += (sender, args) => Close(); DonateButton.Click += (sender, args) => { OpenUriInDefaultBrowser(DonationsUri); Close(); }; }
public override void receiveLeftClick(int x, int y, bool playSound = true) { ReminderMessageTextBox.Update(); ReminderIntervalTextBox.Update(); if (OkButton.containsPoint(x, y) && IsOkButtonReady()) { HandleButtonClick(OkButton.name); OkButton.scale -= 0.25f; OkButton.scale = Math.Max(0.75f, OkButton.scale); } if (DisplayRemindersButton.containsPoint(x, y)) { Game1.activeClickableMenu = new DisplayReminders(OnChanged); } ReminderMessageTextBox.Update(); ReminderIntervalTextBox.Update(); }
void ReleaseDesignerOutlets() { if (CancelButton != null) { CancelButton.Dispose(); CancelButton = null; } if (OkButton != null) { OkButton.Dispose(); OkButton = null; } if (TokenTextView != null) { TokenTextView.Dispose(); TokenTextView = null; } }
public void BlockView_Load(object sender, EventArgs e) { if (Mode == BlockViewMode.New) { Text = "New Schedule Block"; OkButton.Text = "Create"; } if (Mode == BlockViewMode.Edit) { Text = "Edit Schedule Block"; OkButton.Text = "Edit"; } if (Mode == BlockViewMode.Show) { Text = Core.GetName(View.UserID) + "'s Block"; OkButton.Hide(); } }
public LoginDialog() : base(new Rect(0, 0, 30, 10), "Login") { Options |= OptionFlags.ofCentered; NameLine = new InputLine(new Rect(2, 2, 28, 3), 128); Insert(NameLine); PwdLine = new PasswordInput(new Rect(2, 5, 28, 6), 128); Insert(PwdLine); NameLabel = new Label(new Rect(2, 1, 7, 2), "~N~ame", NameLine); Insert(NameLabel); PwdLabel = new Label(new Rect(2, 4, 11, 5), "~P~assword", PwdLine); Insert(PwdLabel); OkButton OkButton = new OkButton(new Rect(1, 7, 14, 9)); OkButton.GrowMode = GrowModes.gfGrowHiY | GrowModes.gfGrowLoY; Insert(OkButton); CancelButton CancelButton = new CancelButton(new Rect(15, 7, 29, 9)); CancelButton.GrowMode = GrowModes.gfGrowHiY | GrowModes.gfGrowLoY; Insert(CancelButton); OkButton.Select(); }
private void Reason_Load(object sender, EventArgs e) { if (Properties.Settings.Default.ImportMatch_Location.X > 0 && Properties.Settings.Default.ImportMatch_Location.Y > 0) { this.Location = Properties.Settings.Default.SkierDoneReason_Location; } if (myCommandValue.ToLower().Equals("update")) { OkButton.Focus(); } else if (myCommandValue.ToLower().Equals("cancel")) { CancelButton.Focus(); } else { CancelButton.Focus(); } ReasonTextbox.Text = myReason; }
private void OnLoaded(object sender, RoutedEventArgs routedEventArgs) { Loaded -= OnLoaded; switch (DefaultResult) { case MessageBoxResult.OK: OkButton.Focus(); break; case MessageBoxResult.Cancel: CancelButton.Focus(); break; case MessageBoxResult.Yes: YesButton.Focus(); break; case MessageBoxResult.No: NoButton.Focus(); break; } }
void ShowViewWithAnimation() { var topLeft = this.GetCenter(CanvasView.Frame); var topRight = new CGPoint(topLeft.X + CanvasView.Frame.Width, topLeft.Y); CanvasView.Frame = new CGRect(topLeft, CanvasView.Frame.Size); CanvasView.Layer.BorderWidth = 2; CanvasView.Layer.BorderColor = UIColor.FromRGB(42, 56, 93).CGColor; CanvasView.Transform = CGAffineTransform.Scale(CGAffineTransform.MakeIdentity(), 0.001f, 0.001f); Add(CanvasView); AnimateAsync(0.2, () => { CanvasView.Transform = CGAffineTransform.Scale(CGAffineTransform.MakeIdentity(), 1, 1); }); CancelButton.SizeToFit(); CancelButton.Frame = new CGRect(new CGPoint(topLeft.X + 10, topLeft.Y - 40), CancelButton.Frame.Size); Add(CancelButton); Add(OkButton); OkButton.SizeToFit(); OkButton.Frame = new CGRect(new CGPoint(topRight.X - OkButton.Frame.Width - 10, topRight.Y - 40), OkButton.Frame.Size); }
private void Listado_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { switch (e.KeyCode) { case Keys.Up: if (Listado.Items.Count == 0) { e.Handled = true; System.Windows.Forms.SendKeys.Send("+{tab}"); } else if (Listado.SelectedItems[0].Index == 0) { e.Handled = true; System.Windows.Forms.SendKeys.Send("+{tab}"); } break; case Keys.Down: if (Listado.Items.Count == 0) { e.Handled = true; System.Windows.Forms.SendKeys.Send("{tab}"); } else if (Listado.SelectedItems.Count > 0 && Listado.SelectedItems[0].Index == Listado.Items.Count - 1) { e.Handled = true; System.Windows.Forms.SendKeys.Send("{tab}"); } break; case Keys.Return: e.Handled = true; if (OkButton.Visible && OkButton.Enabled) { OkButton.PerformClick(); } break; } }
public void GivenIHaveLaunchedApplictionWithCredentials(string login, string password, string client) { //Start application EC4 = Application.Launch(@"D:\EchoContactClient.Host.exe.lnk"); Window LoginWindow = EC4.GetWindow(SearchCriteria.ByClassName("Window"), InitializeOption.NoCache); //Set login LoginTextBox = LoginWindow.Get <TextBox>(SearchCriteria.ByAutomationId("LoginField")); LoginTextBox.SetTextToTextbox(login); //Set password PasswordField = LoginWindow.Get <TextBox>(SearchCriteria.ByAutomationId("PasswordField")); PasswordField.SetTextToTextbox(password); //Set client ClientField = LoginWindow.Get <TextBox>(SearchCriteria.ByAutomationId("ClientField")); ClientField.SetTextToTextbox(client); //Check if remember me check box isn't selected RememberMeCheckBox = LoginWindow.Get <CheckBox>(SearchCriteria.ByClassName("CheckBox")); if (!RememberMeCheckBox.Checked) { RememberMeCheckBox.Click(); } //Click Login button to open Desk selection window LoginButton = LoginWindow.Get <Button>(SearchCriteria.ByAutomationId("LoginButton")); LoginButton.Click(); //Wait till desk selection window appears Thread.Sleep(40000); DeskSelection = LoginWindow.Get <ComboBox>(SearchCriteria.ByAutomationId("deskSelectionCombobox")); //Select make me immediatly available option MakeMeImmediatlyAvailable = LoginWindow.Get <CheckBox>(SearchCriteria.ByAutomationId("makeMeImmediatelyAvailableCheckBox")); if (!MakeMeImmediatlyAvailable.Checked) { MakeMeImmediatlyAvailable.Click(); } //Click OK to open agent dashboard window OkButton = LoginWindow.Get <Button>(SearchCriteria.ByAutomationId("OkButton")); OkButton.Click(); Thread.Sleep(2000); }
private void DrawButton_Click(object sender, EventArgs e) { bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height); g = Graphics.FromImage(bmp); pictureBox1.Image = bmp; Points.Clear(); mode = "draw"; TransformationButton.Enabled = false; DefinitionButton.Enabled = false; ResultLabel.Hide(); comboBox1.Hide(); textBox1.Hide(); textBox2.Hide(); label1.Hide(); label2.Hide(); OkButton.Hide(); GetPrimitive form = new GetPrimitive(); form.Owner = this; form.ShowDialog(); }
public override void LayoutSubviews() { base.LayoutSubviews(); OkButton.NextToThisView(this, 5); if (OkButton.Superview == null) { Superview.Add(OkButton); } DeleteButton.NextToThisView(this, 5) .BelowThisView(OkButton, 10); if (DeleteButton.Superview == null) { Superview.Add(DeleteButton); } EditSignatureButton.NextToThisView(this, 5) .BelowThisView(DeleteButton, 10); if (EditSignatureButton.Superview == null) { Superview.Add(EditSignatureButton); } }
private Prompt(string title, string description, string defaultValue, string placeholder, string toolTip, bool multiline, bool passwordMode, bool required, int maxLength, IEnumerable <string> suggestions, bool suggestionsFixed, string comment, Func <string, Task <IEnumerable <string> > > suggestionsCallback = null, Func <string, Task <string> > verificationCallback = null, bool suggestionsAsList = false) { DataContext = new ViewModel(description, defaultValue, placeholder, toolTip, required) { SuggestionsCallback = suggestionsCallback, VerificationCallback = verificationCallback, }; if (Model.SuggestionsCallback != null) { Model.UpdateSuggestionsAsync().Ignore(); } InitializeComponent(); Buttons = new[] { OkButton, CancelButton }; _multiline = multiline; var suggestionsList = new Lazy <List <string> >(suggestions.ToList); if (required) { OkButton.SetBinding(IsEnabledProperty, new Binding { Source = DataContext, Path = new PropertyPath(nameof(ViewModel.Text)), Converter = this }); } if (comment != null) { ButtonsRowContent = new BbCodeBlock { Text = comment, Style = (Style)FindResource(@"BbCodeBlock.Small") }; ButtonsRowContentAlignment = HorizontalAlignment.Left; } Title = title; FrameworkElement element; if (passwordMode) { var passwordBox = new ProperPasswordBox(); passwordBox.SetBinding(ProperPasswordBox.PasswordProperty, new Binding { Source = DataContext, Path = new PropertyPath(nameof(ViewModel.Text)), Mode = BindingMode.TwoWay, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged }); element = passwordBox; } else if (suggestions != null || suggestionsCallback != null) { var comboBox = new BetterComboBox { IsEditable = !suggestionsFixed, IsTextSearchEnabled = true }; if (suggestions is INotifyCollectionChanged) { comboBox.SetBinding(ItemsControl.ItemsSourceProperty, new Binding { Source = suggestions }); } else if (suggestions != null) { comboBox.ItemsSource = suggestionsList.Value; } else { Model.SuggestionsDynamic = new BetterObservableCollection <string>(); comboBox.SetBinding(ItemsControl.ItemsSourceProperty, new Binding { Source = Model.SuggestionsDynamic }); } comboBox.SetBinding(ComboBox.TextProperty, new Binding { Source = DataContext, Path = new PropertyPath(nameof(ViewModel.Text)), Mode = BindingMode.TwoWay, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, ValidatesOnDataErrors = true }); if (placeholder != null) { comboBox.Placeholder = placeholder; } element = comboBox; } else { var textBox = new BetterTextBox(); textBox.SetBinding(TextBox.TextProperty, new Binding { Source = DataContext, Path = new PropertyPath(nameof(ViewModel.Text)), Mode = BindingMode.TwoWay, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, ValidatesOnDataErrors = true }); if (maxLength != -1) { textBox.MaxLength = maxLength; } if (multiline) { textBox.AcceptsReturn = true; textBox.TextWrapping = TextWrapping.Wrap; textBox.Height = 240; } if (placeholder != null) { textBox.Placeholder = placeholder; } element = textBox; } Panel.Children.Add(element); if (suggestionsAsList) { var listBox = new ListBox { IsTextSearchEnabled = true, Height = 200 }; if (suggestions is INotifyCollectionChanged) { listBox.SetBinding(ItemsControl.ItemsSourceProperty, new Binding { Source = suggestions }); } else if (suggestions != null) { listBox.ItemsSource = suggestionsList.Value; } else { if (Model.SuggestionsDynamic == null) { Model.SuggestionsDynamic = new BetterObservableCollection <string>(); } listBox.SetBinding(ItemsControl.ItemsSourceProperty, new Binding { Source = Model.SuggestionsDynamic }); } listBox.SetBinding(Selector.SelectedItemProperty, new Binding { Source = DataContext, Path = new PropertyPath(nameof(ViewModel.TextInList)), Mode = BindingMode.TwoWay }); Panel.Children.Add(listBox); } if (toolTip != null) { element.SetValue(ToolTipProperty, toolTip); } PreviewKeyDown += OnKeyDown; element.PreviewKeyDown += OnKeyDown; _element = element; Closing += (sender, args) => { if (MessageBoxResult != MessageBoxResult.OK) { return; } Result = Model.Text; }; }
private void Ok_Executed(object sender, RoutedEventArgs e) { OkButton.Focus(); DialogResult = true; }
public ColorDialog(string APalette, ColorGroup AGroups) : base(new Rect(0, 0, 61, 18), "Colors") { Options |= OptionFlags.ofCentered; Pal = APalette; Rect R = new Rect(18, 3, 19, 14); View P = new ScrollBar(R); Insert(P); R = new Rect(3, 3, 18, 14); Groups = new ColorGroupList(R, (ScrollBar)P, AGroups); Insert(Groups); R = new Rect(2, 2, 8, 3); View V = new Label(R, "~G~roup", Groups); Insert(V); R = new Rect(41, 3, 42, 14); P = new ScrollBar(R); Insert(P); R = new Rect(21, 3, 41, 14); P = new ColorItemList(R, (ScrollBar)P, AGroups.Items); Insert(P); R = new Rect(20, 2, 25, 3); V = new Label(R, "~I~tem", P); Insert(V); R = new Rect(45, 3, 57, 7); ForSel = new ColorSelector(R, ColorSel.csForeground); Insert(ForSel); R.A.Y--; R.B.Y = R.A.Y + 1; ForLabel = new Label(R, "~F~oreground", ForSel); Insert(ForLabel); R.A.Y += 7; R.B.Y += 10; if (ColorSelector.cBackgroundBlink) { R.B.Y -= 2; } BakSel = new ColorSelector(R, ColorSel.csBackground); Insert(BakSel); R.A.Y--; R.B.Y = R.A.Y + 1; BakLabel = new Label(R, "~B~ackground", BakSel); Insert(BakLabel); R.A += new Point(-1, 6); R.B += new Point(1, 7); if (ColorSelector.cBackgroundBlink) { R.A.Y -= 2; R.B.Y -= 2; } ColorDisplay Display = new ColorDisplay(R, "Text"); Insert(Display); R = new Rect(44, 3, 59, 8); MonoSel = new MonoSelector(R); MonoSel.Hide(); Insert(MonoSel); R = new Rect(43, 2, 49, 3); (MonoLabel = new Label(R, "~C~olor", MonoSel)).Hide(); Insert(MonoLabel); if ((AGroups != null) && (AGroups.Items != null)) { if (AGroups.Items.Index < Pal.Length) { Display.SetColor((byte)Pal[AGroups.Items.Index - 1]); } else { Display.SetColor(0); } } R = new Rect(16, 15, 26, 17); ((P = new OkButton(R)) as Button).MakeDefault(true); Insert(P); R = new Rect(28, 15, 38, 17); ((P = new CancelButton(R)) as Button).MakeDefault(false); Insert(P); SelectNext(false); }
public void OkClick() { OkButton.Click(); Sleeper.Delay(500); ResetAddCustomerToQueueWindow(); }
public AlertWindow() { InitializeComponent(); OkButton.Focus(); }
public void ThenIHaveClickedOkButton() { OkButton = loginWindow.Get <Button>(SearchCriteria.ByAutomationId("OkButton")); OkButton.Click(); }
void ReleaseDesignerOutlets() { if (AddressLabel != null) { AddressLabel.Dispose(); AddressLabel = null; } if (AddressTextfield != null) { AddressTextfield.Dispose(); AddressTextfield = null; } if (CancelButton != null) { CancelButton.Dispose(); CancelButton = null; } if (CityLabel != null) { CityLabel.Dispose(); CityLabel = null; } if (CityTextfield != null) { CityTextfield.Dispose(); CityTextfield = null; } if (LatLabel != null) { LatLabel.Dispose(); LatLabel = null; } if (LatTextfield != null) { LatTextfield.Dispose(); LatTextfield = null; } if (LongLabel != null) { LongLabel.Dispose(); LongLabel = null; } if (LongTextfield != null) { LongTextfield.Dispose(); LongTextfield = null; } if (OkButton != null) { OkButton.Dispose(); OkButton = null; } if (PostalCodeLabel != null) { PostalCodeLabel.Dispose(); PostalCodeLabel = null; } if (PostalCodeTexfield != null) { PostalCodeTexfield.Dispose(); PostalCodeTexfield = null; } if (TitleLabel != null) { TitleLabel.Dispose(); TitleLabel = null; } if (WifiNameLabel != null) { WifiNameLabel.Dispose(); WifiNameLabel = null; } if (WifiNameTextfield != null) { WifiNameTextfield.Dispose(); WifiNameTextfield = null; } }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { switch (comboBox1.SelectedItem.ToString()) { case "Смещение": { if (current_transformation == "find point" && Points.Count == 4) { draw_point(Points[2].X, Points[2].Y, this.pictureBox1.BackColor); draw_point(Points[3].X, Points[3].Y, this.pictureBox1.BackColor); g.DrawLine(new Pen(this.pictureBox1.BackColor, 3), Points[2], Points[3]); Points.Remove(Points[3]); Points.Remove(Points[2]); g.DrawLine(new Pen(Color.Black, 3), Points[0], Points[1]); pictureBox1.Image = bmp; } current_transformation = "shift"; OkButton.Show(); textBox1.Show(); textBox2.Show(); label1.Show(); label2.Show(); label1.Text = "Введите сдвиг по X: "; label2.Text = "Введите сдвиг по Y: "; textBox1.Text = "0"; textBox2.Text = "0"; break; } case "Поворот примитива": { if (current_transformation == "find point" && Points.Count == 4) { draw_point(Points[2].X, Points[2].Y, this.pictureBox1.BackColor); draw_point(Points[3].X, Points[3].Y, this.pictureBox1.BackColor); g.DrawLine(new Pen(this.pictureBox1.BackColor, 3), Points[2], Points[3]); Points.Remove(Points[3]); Points.Remove(Points[2]); g.DrawLine(new Pen(Color.Black, 3), Points[0], Points[1]); pictureBox1.Image = bmp; } current_transformation = "rotation"; OkButton.Show(); textBox1.Show(); textBox2.Hide(); label1.Show(); label2.Hide(); label1.Text = "Введите угол поворота: "; textBox1.Text = "0"; break; } case "Поворот ребра": { if (current_transformation == "find point" && Points.Count == 4) { draw_point(Points[2].X, Points[2].Y, this.pictureBox1.BackColor); draw_point(Points[3].X, Points[3].Y, this.pictureBox1.BackColor); g.DrawLine(new Pen(this.pictureBox1.BackColor, 3), Points[2], Points[3]); Points.Remove(Points[3]); Points.Remove(Points[2]); g.DrawLine(new Pen(Color.Black, 3), Points[0], Points[1]); pictureBox1.Image = bmp; } if (current_primitive != "Edge") { OkButton.Hide(); textBox1.Hide(); textBox2.Hide(); label1.Hide(); label2.Hide(); MessageBox.Show("Выбран неправильный примитив", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } current_transformation = "edge rotation"; OkButton.Show(); textBox1.Hide(); textBox2.Hide(); label1.Hide(); label2.Hide(); break; } case "Масштабирование": { if (current_transformation == "find point" && Points.Count == 4) { draw_point(Points[2].X, Points[2].Y, this.pictureBox1.BackColor); draw_point(Points[3].X, Points[3].Y, this.pictureBox1.BackColor); g.DrawLine(new Pen(this.pictureBox1.BackColor, 3), Points[2], Points[3]); Points.Remove(Points[3]); Points.Remove(Points[2]); g.DrawLine(new Pen(Color.Black, 3), Points[0], Points[1]); pictureBox1.Image = bmp; } current_transformation = "scale"; OkButton.Show(); textBox1.Show(); textBox2.Show(); label1.Show(); label2.Show(); label1.Text = "Введите коэффициент по X: "; label2.Text = "Введите коэффициент по Y: "; textBox1.Text = "0"; textBox2.Text = "0"; break; } case "Поиск точки пересечения": { if (current_primitive != "Edge") { OkButton.Hide(); textBox1.Hide(); textBox2.Hide(); label1.Hide(); label2.Hide(); MessageBox.Show("Выбран неправильный примитив", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } current_transformation = "find point"; OkButton.Show(); textBox1.Hide(); textBox2.Hide(); label1.Show(); label2.Hide(); label1.Text = "Нарисуйте второе ребро"; break; } } }
void ReleaseDesignerOutlets() { if (BorderFromField != null) { BorderFromField.Dispose(); BorderFromField = null; } if (BorderToField != null) { BorderToField.Dispose(); BorderToField = null; } if (ChancelButton != null) { ChancelButton.Dispose(); ChancelButton = null; } if (CountersButton != null) { CountersButton.Dispose(); CountersButton = null; } if (DivisionLabel != null) { DivisionLabel.Dispose(); DivisionLabel = null; } if (HoursField != null) { HoursField.Dispose(); HoursField = null; } if (InventoryIDLabel != null) { InventoryIDLabel.Dispose(); InventoryIDLabel = null; } if (MachineIcon != null) { MachineIcon.Dispose(); MachineIcon = null; } if (MachineNameLabel != null) { MachineNameLabel.Dispose(); MachineNameLabel = null; } if (MinutesField != null) { MinutesField.Dispose(); MinutesField = null; } if (OkButton != null) { OkButton.Dispose(); OkButton = null; } if (PhotoButton != null) { PhotoButton.Dispose(); PhotoButton = null; } if (SecondsField != null) { SecondsField.Dispose(); SecondsField = null; } if (SensorIcon != null) { SensorIcon.Dispose(); SensorIcon = null; } if (SensorsButton != null) { SensorsButton.Dispose(); SensorsButton = null; } if (ValueSymbolFromLabel != null) { ValueSymbolFromLabel.Dispose(); ValueSymbolFromLabel = null; } if (ValueSymbolToLabel != null) { ValueSymbolToLabel.Dispose(); ValueSymbolToLabel = null; } }
public void NewText(List <string> lines, bool resetIndex = true) { if (resetIndex) { _index = 0; CurrentLines = lines; UpdatePositionBar(); } if (resetIndex) { if (Index != -1) { MaximumLines = 19; if (lines.Count > MaximumLines) { UpButton.Visible = true; DownButton.Visible = true; PositionBar.Visible = true; } else { UpButton.Visible = false; DownButton.Visible = false; PositionBar.Visible = false; } } else { MaximumLines = 19; UpButton.Visible = false; DownButton.Visible = false; PositionBar.Visible = false; } } for (int i = 0; i < TextButtons.Count; i++) { TextButtons[i].Dispose(); } for (int i = 0; i < TextLabel.Length; i++) { if (TextLabel[i] != null) { TextLabel[i].Text = ""; } } TextButtons.Clear(); int lastLine = lines.Count > MaximumLines ? ((MaximumLines + _index) > lines.Count ? lines.Count : (MaximumLines + _index)) : lines.Count; for (int i = _index; i < lastLine; i++) { TextLabel[i] = new MirLabel { Font = font, DrawFormat = TextFormatFlags.WordBreak, Visible = true, Parent = this, Size = new Size(420, 20), Location = new Point(40, 64 + (i - _index) * 20), NotControl = true }; if (i >= lines.Count) { TextLabel[i].Text = string.Empty; continue; } string currentLine = lines[i]; List <Match> matchList = R.Matches(currentLine).Cast <Match>().ToList(); matchList.AddRange(C.Matches(currentLine).Cast <Match>()); int oldLength = currentLine.Length; foreach (Match match in matchList.OrderBy(o => o.Index).ToList()) { int offSet = oldLength - currentLine.Length; Capture capture = match.Groups[1].Captures[0]; string[] values = capture.Value.Split('/'); currentLine = currentLine.Remove(capture.Index - 1 - offSet, capture.Length + 2).Insert(capture.Index - 1 - offSet, values[0]); string text = currentLine.Substring(0, capture.Index - 1 - offSet) + " "; Size size = TextRenderer.MeasureText(CMain.Graphics, text, TextLabel[i].Font, TextLabel[i].Size, TextFormatFlags.TextBoxControl); if (R.Match(match.Value).Success) { string link = GetLinkFromString(values[0], values[1]); NewButton(values[0], values[1], TextLabel[i].Location.Add(new Point(size.Width - 11, 0)), link); } if (C.Match(match.Value).Success) { NewColour(values[0], values[1], TextLabel[i].Location.Add(new Point(size.Width - 11, 0))); } } TextLabel[i].Text = currentLine; TextLabel[i].MouseWheel += LoginNoticeDialog_MouseWheel; } OkButton.BringToFront(); }
void ReleaseDesignerOutlets() { if (SelectionLabelTrailingConstraint != null) { SelectionLabelTrailingConstraint.Dispose(); SelectionLabelTrailingConstraint = null; } if (SelectionlabelLeadingConstraint != null) { SelectionlabelLeadingConstraint.Dispose(); SelectionlabelLeadingConstraint = null; } if (ErrorTextView != null) { ErrorTextView.Dispose(); ErrorTextView = null; } if (OkButton != null) { OkButton.Dispose(); OkButton = null; } if (OkButtonBottomConstraint != null) { OkButtonBottomConstraint.Dispose(); OkButtonBottomConstraint = null; } if (PageSubtitleText != null) { PageSubtitleText.Dispose(); PageSubtitleText = null; } if (PageSubtitleTopConstraint != null) { PageSubtitleTopConstraint.Dispose(); PageSubtitleTopConstraint = null; } if (PageTitleLabel != null) { PageTitleLabel.Dispose(); PageTitleLabel = null; } if (PageTitleTopConstraint != null) { PageTitleTopConstraint.Dispose(); PageTitleTopConstraint = null; } if (SearchContainer != null) { SearchContainer.Dispose(); SearchContainer = null; } if (SearchResultTableView != null) { SearchResultTableView.Dispose(); SearchResultTableView = null; } if (SearchText != null) { SearchText.Dispose(); SearchText = null; } if (SelectionLabel != null) { SelectionLabel.Dispose(); SelectionLabel = null; } if (SelectionLabelTopConstraint != null) { SelectionLabelTopConstraint.Dispose(); SelectionLabelTopConstraint = null; } if (TableViewBottomConstraint != null) { TableViewBottomConstraint.Dispose(); TableViewBottomConstraint = null; } }
public TextInputView() { InitializeComponent(); Loaded += (sender, e) => OkButton.Focus(); }
private void KontragentGroupGridView_DoubleClick(object sender, EventArgs e) { OkButton.PerformClick(); }
public void ClickOkButton() { OkButton.Click(); }
/// <summary> /// Warning popup Ok button click. /// </summary> /// <returns></returns> public QuotePage OkOnErrorMessage() { WaitHelpers.WaitForElementToBecomeVisibleWithinTimeout(driver, OkButton, 60); OkButton.Clickme(driver); return(this); }