protected void OnOutboxMessageTextInserted(object o, Gtk.TextInsertedArgs args) { if ((FormatType)outboxFormatCombobox.GetActiveValue() == FormatType.Hex) { if (outboxMessage.Text.Length >= outboxMessage.MaxLength) { return; } foreach (char c in args.Text) { if (!hexKeys.Contains(char.ToLower(c))) { outboxMessage.Text = outboxMessage.Text.Substring(0, outboxMessage.Text.LastIndexOf(args.Text)); Gtk.Application.Invoke(delegate { MessageDialog md = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, "\nInvalid Hex Value"); md.Icon = global::Gdk.Pixbuf.LoadFromResource(MessageDialogIconName); md.Run(); md.WindowPosition = Gtk.WindowPosition.CenterOnParent; md.Destroy(); }); break; } } } }
private void HandleEntryTextInserted (object sender, TextInsertedArgs args) { //Log.DebugFormat ("inserting {0}, ( = {1} ) = {2}", args.Text, open_parens, close_parens); //int start = args.Position - args.Length; for (int i = 0; i < args.Text.Length; i++) { char c = args.Text [i]; if (c == '(') open_parens++; else if (c == ')') close_parens++; } int pos = entry.Position + 1; int close_parens_needed = open_parens - close_parens; for (int i = 0; i < close_parens_needed; i++) { entry.TextInserted -= HandleEntryTextInserted; entry.InsertText (")", ref pos); close_parens++; entry.TextInserted += HandleEntryTextInserted; pos++; } //Log.Debugformat ("done w/ insert, {0}, ( = {1} ) = {2}", args.Text, open_parens, close_parens); last_entry_text = entry.Text; QueueUpdate (); }
private void OnBufferInsertText (object o, InsertTextArgs args) { TextInsertedHandler handler = TextInserted; if (handler != null) { TextInsertedArgs raise_args = new TextInsertedArgs (); raise_args.Args = new object [] { args.Text, args.Length, args.Pos.Offset }; handler (this, raise_args); } }
private void EntryCallBackEx_TextInserted(object o, TextInsertedArgs args) { this.canSet = false; if (this.CheckSingleValue(args.Text)) { this.canSet = true; } else { if (!this.CheckFinalValue(args.Text)) { return; } this.canSet = true; } }
private void EntryIntEx_TextInserted(object o, TextInsertedArgs args) { if (this.isReSetValue || this.allowWhip) { this.canSet = true; } else { this.canSet = false; List <char> list = this.Text.ToList <char>(); list.InsertRange(args.Position, (IEnumerable <char>)args.Text); string s = new string(list.ToArray()).Replace('。', '.').Replace('-', '-'); double result = -1.0; if (double.TryParse(s, out result)) { this.canSet = true; } if (args.Position != 0 || (int)args.Text.FirstOrDefault <char>() != 45 && (int)args.Text.FirstOrDefault <char>() != 65293) { return; } this.canSet = true; } }
void ProjectNameTextInserted (object o, TextInsertedArgs args) { if (args.Text.IndexOf ('\r') >= 0) { var textBox = (Entry)o; textBox.Text = textBox.Text.Replace ("\r", string.Empty); } }
protected void OnEntryServerTextInserted(object o, TextInsertedArgs args) { try { if (entryName.Text == entryServer.Text.Remove (args.Position - 1, args.Length)) entryName.Text = entryServer.Text; } catch { } }
private void OnlyNumber(object o, TextInsertedArgs args) { try { int number = Convert.ToInt32(((Entry)o).Text); } catch { ((Entry)o).DeleteText(args.Position - args.Text.Length, args.Position); } }
public static string GetText(this Gtk.TextInsertedArgs args) { return(args.NewText); }
protected virtual void OnTboxSearchTextInserted(object o, Gtk.TextInsertedArgs args) { Search(); }
protected void OnEntryDateTextInserted(object o, TextInsertedArgs args) { //throw new NotImplementedException (); }
protected void OnYValBoxTextInserted(object o, TextInsertedArgs args) { try { UpdateValueBox(); } catch (Exception ex) { ReportError("Valuebox", ex); } }
void CityEntryTextInserted(object o, TextInsertedArgs args) { if (this.HasFocus && completionListStore == null && !queryIsRunning) { Thread queryThread = new Thread (fillAutocomplete); queryThread.IsBackground = true; queryIsRunning = true; queryThread.Start (); } }
protected virtual void OnTxtFileNameTextInserted(object o, Gtk.TextInsertedArgs args) { btnNewFile.Sensitive = true; }
void OnEntryTextInserted(object o, TextInsertedArgs e) { double percent; if (String.IsNullOrEmpty(e.Text)) return; Double.TryParse (e.Text, out percent); Scale = percent / 100; }
protected void OnEntryDateTextInserted(object o, TextInsertedArgs args) { if(!_AutoSeparation) return; if(args.Length == 1 && (args.Position == 3 || args.Position == 6) && args.Text != System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.DateSeparator && args.Position == entryDate.Text.Length) { int Pos = args.Position - 1; entryDate.InsertText( System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.DateSeparator, ref Pos); args.Position++; } }