示例#1
0
文件: TextInput.cs 项目: m13253/xwt
			void HandleTextInput (object sender, TextInputEventArgs e)
			{
				text += e.Text;
				e.Handled = true;

				QueueDraw ();
			}
示例#2
0
文件: WidgetBackend.cs 项目: mono/xwt
        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;
        }
示例#3
0
文件: WidgetBackend.cs 项目: mono/xwt
        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");
        }
示例#4
0
文件: WidgetBackend.cs 项目: mono/xwt
        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);
                });
            }
        }
示例#5
0
        internal void HandleTextInput(object sender, TextInputEventArgs args)
        {
            base.OnTextInput(args);

            InsertText(args.Text);

            editor.ResetCaretState();

            args.Handled = true;
        }