Exemplo n.º 1
0
			void HandleTextInput (object sender, TextInputEventArgs e)
			{
				text += e.Text;
				e.Handled = true;

				QueueDraw ();
			}
Exemplo n.º 2
0
        void HandleImCommitEvent(object o, Gtk.CommitArgs args)
        {
            if (String.IsNullOrEmpty (args.Str))
                return;

            var pargs = new TextInputEventArgs (args.Str);
            ApplicationContext.InvokeUserCode (delegate {
                EventSink.OnTextInput (pargs);
            });

            if (pargs.Handled)
                args.RetVal = true;
        }
Exemplo n.º 3
0
        void HandleTextInserted(object o, Gtk.TextInsertedArgs args)
        {
            if (String.IsNullOrEmpty (args.GetText ()))
                return;

            var pargs = new TextInputEventArgs (args.GetText ());
            ApplicationContext.InvokeUserCode (delegate {
                EventSink.OnTextInput (pargs);
            });

            if (pargs.Handled)
                ((GLib.Object)o).StopSignal ("insert-text");
        }
Exemplo n.º 4
0
        void HandleTextInputKeyPressEvent(object o, Gtk.KeyPressEventArgs args)
        {
            if (IMContext != null)
                IMContext.FilterKeypress (args.Event);

            // new lines are not triggered by im, handle them here
            if (args.Event.Key == Gdk.Key.Return ||
                args.Event.Key == Gdk.Key.ISO_Enter ||
                args.Event.Key == Gdk.Key.KP_Enter) {
                var pargs = new TextInputEventArgs (Environment.NewLine);
                ApplicationContext.InvokeUserCode (delegate {
                    EventSink.OnTextInput (pargs);
                });
            }
        }
Exemplo n.º 5
0
        internal void HandleTextInput(object sender, TextInputEventArgs args)
        {
            base.OnTextInput(args);

            InsertText(args.Text);

            editor.ResetCaretState();

            args.Handled = true;
        }