示例#1
0
 private void Entry_TextInserted(object o, TextInsertedArgs args)
 {
     if ((int)args.Text[0] > 57 || (int)args.Text[0] < 48)
     {
         ;
     }
 }
示例#2
0
        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();
        }
 void ProjectNameTextInserted(object o, TextInsertedArgs args)
 {
     if (args.Text.IndexOf('\r') >= 0)
     {
         var textBox = (Entry)o;
         textBox.Text = textBox.Text.Replace("\r", string.Empty);
     }
 }
示例#4
0
 protected void OnEntryServerTextInserted(object o, TextInsertedArgs args)
 {
     try {
         if (entryName.Text == entryServer.Text.Remove(args.Position - 1, args.Length))
         {
             entryName.Text = entryServer.Text;
         }
     } catch {
     }
 }
示例#5
0
 void CityEntryTextInserted(object o, TextInsertedArgs args)
 {
     if (this.HasFocus && completionListStore == null && !queryIsRunning)
     {
         Thread queryThread = new Thread(fillAutocomplete);
         queryThread.IsBackground = true;
         queryIsRunning           = true;
         queryThread.Start();
     }
 }
 void PswEntry2_TextInserted(object o, TextInsertedArgs args)
 {
     if (pswEntry.Text != pswEntry2.Text)
     {
         this.submitButton.Hide();
     }
     else
     {
         this.submitButton.Show();
     }
 }
示例#7
0
 private void EntryTextChanges(object o, TextInsertedArgs args)
 {
     if (cityId != 0)
     {
         if (firstCompletion)
         {
             EmptyCompletion();
             firstCompletion = false;
         }
         streetsDataLoader.LoadStreets(cityId, Text);
     }
 }
        private void EntryTextChanges(object o, TextInsertedArgs args)
        {
            if (CityGuid != null)
            {
                if (_firstCompletion)
                {
                    EmptyCompletion();
                    _firstCompletion = false;
                }

                _streetsDataLoader.LoadStreets(CityGuid, Text);
            }
        }
示例#9
0
    protected void OnSpinNTextInserted(object o, TextInsertedArgs args)
    {
        string temp = spinN.Text;

        Console.WriteLine(DateTime.Now.ToString("[HH:mm:ss.fff] ") + "OnSpinNTextInserted Event fired");
        Console.WriteLine(DateTime.Now.ToString("[HH:mm:ss.fff] ") + "Value taken: " + temp);
        try
        {
            spinR.SetRange(0, Convert.ToDouble(temp));
        }
        catch (FormatException)
        {
        }
    }
示例#10
0
        /// <summary>
        /// Callback method executed on TextInserted event by Entry widget to force only digits
        /// </summary>
        /// <param name="sender">Entry widget</param>
        /// <param name="args">Text inserted arguments</param>
        private void OnlyNumerical(object sender, TextInsertedArgs args)
        {
            Entry entry = (Entry)sender;

            if (args.NewText.Length == 1)
            {
                char inputKey         = Convert.ToChar(args.NewText);
                int  inputKeyPosition = Convert.ToInt32(args.Position);

                if (!Char.IsNumber(inputKey) && inputKey != '.')
                {
                    entry.Text = entry.Text.Remove(inputKeyPosition - 1);
                }
            }
        }
示例#11
0
        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);
            }
        }
示例#12
0
        void OnBufferInsertText(object o, InsertTextArgs args)
        {
            var handler = TextInserted;

            if (handler != null)
            {
                var raise_args = new TextInsertedArgs {
                    Args = new object[] {
                        args.Text,
                        args.Length,
                        args.Pos.Offset
                    }
                };
                handler(this, raise_args);
            }
        }
示例#13
0
 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++;
     }
 }
示例#14
0
        private void EntryTextChanges(object o, TextInsertedArgs args)
        {
            if (string.IsNullOrWhiteSpace(Text))
            {
                _completionListStore?.Clear();
                return;
            }

            if (StreetGuid != null)
            {
                HousesDataLoader.LoadHouses(Text, StreetGuid);
                return;
            }

            if (CityGuid != null)
            {
                HousesDataLoader.LoadHouses(Text, null, CityGuid);
            }
        }
示例#15
0
        protected void OnEntVariosTextInserted(object o, TextInsertedArgs args)
        {
            float total, importe, gasolina, varios;
            int   cantidad;

            if (entCantidad.Text == "" || entImporte.Text == "" || entGasolina.Text == "" || entVarios.Text == "")
            {
                entTotal.Text = "";
            }
            else
            {
                cantidad = int.Parse(entCantidad.Text);
                importe  = float.Parse(entImporte.Text);
                gasolina = float.Parse(entGasolina.Text);
                varios   = float.Parse(entVarios.Text);

                total = cantidad + importe + gasolina + varios;

                entTotal.Text = total.ToString();
            }
        }
示例#16
0
    protected void SearchLocation(object sender, EventArgs e)
    {
        TextInsertedArgs arguments = (TextInsertedArgs)e;

        if (locationEntry.Text.Length > 3)
        {
            List <City> matchedCities = new List <City>();
            foreach (City city in cities)
            {
                if (city.name.StartsWith(locationEntry.Text, StringComparison.InvariantCulture))
                {
                    matchedCities.Add(city);
                }
            }

            foreach (City matchedCity in matchedCities)
            {
                Console.WriteLine(matchedCity.name);
            }
        }
    }
示例#17
0
 protected void InputTextInserted(object o, TextInsertedArgs args)
 {
     Calculate();
 }
示例#18
0
 void OnArgumentsTextInserted(object o, TextInsertedArgs args)
 {
     GetCommandDescriptor()._arguments = _inputArguments.Text;
 }
示例#19
0
 public void TextUpdated(object o, TextInsertedArgs args)
 {
     citiesDataLoader.LoadCities(Text);
 }
示例#20
0
 protected void OnEntryQueryTextInserted(object o, TextInsertedArgs args)
 {
     RunQuery();
 }
示例#21
0
 void OnTextInserted(object o, TextInsertedArgs args)
 {
     UndoManager.AddUndoAction(new EditableInsertAction(editable, args.Position, args.Text, args.Length));
 }
示例#22
0
 protected void OnYValBoxTextInserted(object o, TextInsertedArgs args)
 {
     try { UpdateValueBox(); }
     catch (Exception ex) { ReportError("Valuebox", ex); }
 }
示例#23
0
 private void NameEntryOnTextInserted(object o, TextInsertedArgs args)
 {
     NameTextChanged();
 }
示例#24
0
 private void OnTextInserted(object o, TextInsertedArgs args)
 {
     undo_manager.AddUndoAction(new EditableInsertAction(editable, args.Position, args.NewText, args.NewTextLength));
 }
示例#25
0
 private void EntryTextChanges(object o, TextInsertedArgs args)
 {
     _citiesDataLoader.LoadCities(Text);
 }