Beispiel #1
0
        public void ShowModal()
        {
            Control.Modal = true;
            Control.ShowAll();

            if (DefaultButton != null)
            {
                var widget = DefaultButton.GetContainerWidget();
                if (widget != null)
                {
#if GTK2
                    widget.SetFlag(Gtk.WidgetFlags.CanDefault);
#else
                    widget.CanDefault = true;
#endif
                    Control.Default = widget;
                }
            }

            do
            {
                Control.Run();
            } while (!WasClosed && !CloseWindow());

            WasClosed = false;
            Control.Hide();
        }
Beispiel #2
0
        public DialogResult ShowDialog(Control parent)
        {
            if (parent != null)
            {
                Control.TransientFor = ((Gtk.Window)(parent.ParentWindow).ControlObject);
                Control.Modal        = true;
            }
            Control.ShowAll();

            if (DefaultButton != null)
            {
                var widget = DefaultButton.GetContainerWidget();
                if (widget != null)
                {
#if GTK2
                    widget.SetFlag(Gtk.WidgetFlags.CanDefault);
#else
                    widget.CanDefault = true;
#endif
                    Control.Default = widget;
                }
            }
            // TODO: implement cancel button somehow?

            Control.Run();
            Control.Hide();

            return(Widget.DialogResult);
        }
Beispiel #3
0
        public void ShowModal(Control parent)
        {
            if (parent != null)
            {
                Control.TransientFor = ((Gtk.Window)(parent.ParentWindow).ControlObject);
                Control.Modal        = true;
            }
            Control.ShowAll();

            if (DefaultButton != null)
            {
                var widget = DefaultButton.GetContainerWidget();
                if (widget != null)
                {
#if GTK2
                    widget.SetFlag(Gtk.WidgetFlags.CanDefault);
#else
                    widget.CanDefault = true;
#endif
                    Control.Default = widget;
                }
            }
            // TODO: implement cancel button somehow?

            do
            {
                Control.Run();
            } while (!WasClosed && !CloseWindow());

            WasClosed = false;
            Control.Hide();
        }