Пример #1
0
        private AnglePickerWidget CreateAnglePicker(string caption, object o, MemberInfo member, object [] attributes)
        {
            AnglePickerWidget widget = new AnglePickerWidget();

            widget.Label        = caption;
            widget.DefaultValue = (double)GetValue(member, o);

            widget.ValueChanged += delegate(object sender, EventArgs e) {
                DelayedUpdate(() => {
                    SetValue(member, o, widget.Value);
                    return(false);
                });
            };

            return(widget);
        }
Пример #2
0
        private AnglePickerWidget CreateAnglePicker(string caption, object o, MemberInfo member, object[] attributes)
        {
            var widget = new AnglePickerWidget {
                Label = caption
            };

            if (GetValue(member, o) is double d)
            {
                widget.DefaultValue = d;
            }

            widget.ValueChanged += delegate(object?sender, EventArgs e) {
                DelayedUpdate(() => {
                    SetValue(member, o, widget.Value);
                    return(false);
                });
            };

            return(widget);
        }
Пример #3
0
        private AnglePickerWidget CreateAnglePicker(string caption, object o, MemberInfo member, object[] attributes)
        {
            AnglePickerWidget widget = new AnglePickerWidget();

            widget.Label        = caption;
            widget.DefaultValue = (double)GetValue(member, o);

            widget.ValueChanged += delegate(object sender, EventArgs e) {
                if (event_delay_timeout_id != 0)
                {
                    GLib.Source.Remove(event_delay_timeout_id);
                }

                event_delay_timeout_id = GLib.Timeout.Add(event_delay_millis, () => {
                    event_delay_timeout_id = 0;
                    SetValue(member, o, widget.Value);
                    return(false);
                });
            };

            return(widget);
        }
Пример #4
0
        private AnglePickerWidget CreateAnglePicker(string caption, object o, MemberInfo member, object[] attributes)
        {
            AnglePickerWidget widget = new AnglePickerWidget ();

            widget.Label = caption;
            widget.DefaultValue = (double)GetValue (member, o);

            widget.ValueChanged += delegate (object sender, EventArgs e) {
                if (event_delay_timeout_id != 0)
                    GLib.Source.Remove (event_delay_timeout_id);

                event_delay_timeout_id = GLib.Timeout.Add (event_delay_millis, () => {
                    event_delay_timeout_id = 0;
                    SetValue (member, o, widget.Value);
                    return false;
                });
            };

            return widget;
        }