示例#1
0
 public int Run()
 {
     dialog.DefaultWidth  = 500;
     dialog.DefaultHeight = 400;
     dialog.ShowAll();
     return(MonoDevelop.Ide.MessageService.RunCustomDialog(dialog, parent));
 }
示例#2
0
        public void Run(object o, EventArgs e)
        {
            Console.WriteLine("EXECUTING ExiflowEditComment EXTENSION");

            xml = new Glade.XML(null, "ExiflowEditComment.glade", dialog_name, "f-spot");
            xml.Autoconnect(this);
            dialog = (Gtk.Dialog)xml.GetWidget(dialog_name);

            // collect comments of selected photos in current_comments
            ArrayList current_comments = new ArrayList();

            foreach (Photo p in App.Instance.Organizer.SelectedPhotos())
            {
                if (p.Description.Length > 0 && !current_comments.Contains(p.Description))
                {
                    current_comments.Add(p.Description);
                }
            }

            // fill text buffer with all current comments
            comment.Buffer.Text = String.Join("\n---\n", (String[])current_comments.ToArray(typeof(string)));

            dialog.Modal        = false;
            dialog.TransientFor = null;
            dialog.Response    += HandleResponse;
            dialog.ShowAll();
        }
示例#3
0
 public int Run()
 {
     dialog.DefaultWidth  = 500;
     dialog.DefaultHeight = 400;
     dialog.ShowAll();
     return(GtkExtensions.RunCustomDialog(dialog, parent));
 }
 public int Run()
 {
     dialog.DefaultWidth  = 500;
     dialog.DefaultHeight = 400;
     dialog.ShowAll();
     return(MessageService.RunCustomDialog(dialog, dialog.TransientFor));
 }
示例#5
0
        private void OnViewNotebook()
        {
            var dlg    = new Gtk.Dialog("Boxes", this, Gtk.DialogFlags.Modal);
            var nbTabs = new Gtk.Notebook();

            nbTabs.AppendPage(new Gtk.Label("Page1"), new Gtk.Label("Page1"));
            nbTabs.AppendPage(new Gtk.Label("Page2"), new Gtk.Label("Page2"));

            dlg.VBox.PackStart(nbTabs, true, true, 5);

            dlg.SetGeometryHints(
                dlg,
                new Gdk.Geometry()
            {
                MinHeight = 200,
                MinWidth  = 320
            },
                Gdk.WindowHints.MinSize
                );

            dlg.AddButton("Ok", Gtk.ResponseType.Ok);
            dlg.ShowAll();
            dlg.Run();
            dlg.Destroy();
        }
示例#6
0
        private void OnViewBoxes()
        {
            var dlg = new Gtk.Dialog( "Boxes", this, Gtk.DialogFlags.Modal );

            var hbBox1 = new Gtk.HBox( false, 5 );
            hbBox1.Add( new Gtk.Label( "This is hbox 1" ) );
            var hbBox2 = new Gtk.HBox( false, 5 );
            hbBox2.Add( new Gtk.Label( "This is hbox 2" ) );
            var hbBox3 = new Gtk.HBox( false, 5 );
            hbBox3.Add( new Gtk.Label( "This is hbox 3" ) );

            dlg.VBox.PackStart( hbBox1, true, true, 5 );
            dlg.VBox.PackStart( hbBox2, true, true, 5 );
            dlg.VBox.PackStart( hbBox3, true, true, 5 );

            dlg.SetGeometryHints(
                dlg,
                new Gdk.Geometry() {
                    MinHeight = 200,
                    MinWidth = 320
                },
                Gdk.WindowHints.MinSize
            );

            dlg.AddButton( "Ok", Gtk.ResponseType.Ok );
            dlg.ShowAll();
            dlg.Run();
            dlg.Destroy();
        }
示例#7
0
 public string Run()
 {
     pickfolder_dialog.ShowAll();
     if (pickfolder_dialog.Run() == -6)
     {
         return(pickfolder_chooser.Filename);
     }
     else
     {
         return(null);
     }
 }
示例#8
0
 void ShowImage(Pixbuf img, string title)
 {
     if (DiagnosticMode)
     {
         Gtk.Dialog Win   = new Gtk.Dialog(title, parent, Gtk.DialogFlags.Modal, Gtk.ButtonsType.Ok);
         Gtk.Image  Image = new Gtk.Image(img);
         Win.VBox.Add(Image);
         Win.ShowAll();
         Win.Run();
         Image.Pixbuf = null;
         Win.Destroy();
     }
     logger.Info(title);
 }
示例#9
0
        private void OnViewDrawing()
        {
            var dlg      = new Gtk.Dialog("Drawing", this, Gtk.DialogFlags.Modal);
            var swScroll = new Gtk.ScrolledWindow();
            var rnd      = new System.Random();

            int[][] valuesSeries = new int[3][];

            // Create series
            for (int i = 0; i < valuesSeries.Length; ++i)
            {
                valuesSeries[i] = new int[12];

                for (int j = 0; j < valuesSeries[i].Length; ++j)
                {
                    valuesSeries[i][j] = rnd.Next(50);
                }
            }

            // Drawing area
            Chart chart = new Chart(512, 512)
            {
                LegendY = "Sells (in thousands)",
                LegendX = "Months",
                Values  = valuesSeries
            };

            // Layout
            swScroll.AddWithViewport(chart);
            dlg.VBox.PackStart(swScroll, true, true, 5);
            dlg.AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close);

            // Polish
            dlg.WindowPosition = Gtk.WindowPosition.CenterOnParent;
            dlg.Resize(640, 640);
            dlg.SetGeometryHints(
                dlg,
                new Gdk.Geometry()
            {
                MinWidth  = 640,
                MinHeight = 640
            },
                Gdk.WindowHints.MinSize
                );

            dlg.ShowAll();
            dlg.Run();
            dlg.Destroy();
        }
示例#10
0
        public static void ShowHintWindow(Gtk.Widget parent, String caption, String text)
        {
            Gtk.Dialog dialog = new Gtk.Dialog();
            dialog.ParentWindow = parent.GdkWindow;
            dialog.Parent       = parent;
            dialog.Title        = caption;
            dialog.VBox.PackStart(new Gtk.Label(text), true, true, 12);

            Gtk.Button closeButton = (Gtk.Button)dialog.AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Close);
            closeButton.Clicked += delegate(object sender, EventArgs ea) { dialog.Hide(); dialog.Dispose(); };

            EventHandler showDelegate = delegate(object s, EventArgs ea) { dialog.ShowAll(); dialog.Present(); };

            Gtk.Application.Invoke(showDelegate);
        }
示例#11
0
 void ShowErrorMessage()
 {
     DBusBackgroundWorker.Request();
     DBusBackgroundWorker.InvokeGtkThread(() => {
         using (var dialog = new Gtk.Dialog()) {
             dialog.BorderWidth  = 6;
             dialog.Resizable    = false;
             dialog.HasSeparator = false;
             var message         = "<span weight=\"bold\"size=\"larger\">"
                                   + "Could not register KeebuntuAppMenu with Unity panel service."
                                   + "</span>\n\n"
                                   + "This plugin only works with Ubuntu Unity desktop."
                                   + " If you do not use Unity, you should uninstall the KeebuntuAppMenu plugin."
                                   + "\n";
             var label              = new Gtk.Label(message);
             label.UseMarkup        = true;
             label.Wrap             = true;
             label.Yalign           = 0;
             var icon               = new Gtk.Image(Gtk.Stock.DialogError, Gtk.IconSize.Dialog);
             icon.Yalign            = 0;
             var contentBox         = new Gtk.HBox();
             contentBox.Spacing     = 12;
             contentBox.BorderWidth = 6;
             contentBox.PackStart(icon);
             contentBox.PackEnd(label);
             dialog.VBox.PackStart(contentBox);
             dialog.AddButton("Don't show this again", Gtk.ResponseType.Accept);
             dialog.AddButton("OK", Gtk.ResponseType.Ok);
             dialog.DefaultResponse = Gtk.ResponseType.Ok;
             dialog.Response       += (o, args) => {
                 dialog.Destroy();
                 if (args.ResponseId == Gtk.ResponseType.Accept)
                 {
                     pluginHost.CustomConfig.SetBool(keebuntuAppMenuWarningSeenId, true);
                 }
             };
             dialog.ShowAll();
             dialog.KeepAbove = true;
             dialog.Run();
         }
     }).Wait();
     DBusBackgroundWorker.Release();
 }
示例#12
0
        static void ShowMessage(Gtk.Window parent, string title, string message)
        {
            Gtk.Dialog dialog = null;
            try
            {
                dialog = new Gtk.Dialog(title, parent,
                                        Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal,
                                        Gtk.ResponseType.Ok);
                dialog.VBox.Add(new Gtk.Label(message));
                dialog.ShowAll();

                dialog.Run();
            }
            finally
            {
                if (dialog != null)
                {
                    dialog.Destroy();
                }
            }
        }
示例#13
0
        private void OnViewBoxes()
        {
            var dlg = new Gtk.Dialog("Boxes", this, Gtk.DialogFlags.Modal);

            var hbBox1 = new Gtk.HBox(false, 5)
            {
                new Gtk.Label("This is hbox 1")
            };

            var hbBox2 = new Gtk.HBox(false, 5)
            {
                new Gtk.Label("This is hbox 2")
            };

            var hbBox3 = new Gtk.HBox(false, 5)
            {
                new Gtk.Label("This is hbox 3")
            };

            dlg.VBox.PackStart(hbBox1, true, true, 5);
            dlg.VBox.PackStart(hbBox2, true, true, 5);
            dlg.VBox.PackStart(hbBox3, true, true, 5);

            dlg.SetGeometryHints(
                dlg,
                new Gdk.Geometry()
            {
                MinHeight = 200,
                MinWidth  = 320
            },
                Gdk.WindowHints.MinSize
                );

            dlg.AddButton("Ok", Gtk.ResponseType.Ok);
            dlg.ShowAll();
            dlg.Run();
            dlg.Destroy();
        }
示例#14
0
        private void OnViewFrames()
        {
            var dlg = new Gtk.Dialog("Frames", this, Gtk.DialogFlags.Modal);

            var frame1 = new Gtk.Frame("<b>Frame1</b>");

            ((Gtk.Label)frame1.LabelWidget).UseMarkup = true;
            frame1.Add(new Gtk.Label("This is frame1"));
            var frame2 = new Gtk.Frame("<b>Frame2</b>");

            ((Gtk.Label)frame2.LabelWidget).UseMarkup = true;
            frame2.Add(new Gtk.Label("This is frame2"));
            var frame3 = new Gtk.Frame("<b>Frame3</b>");

            ((Gtk.Label)frame3.LabelWidget).UseMarkup = true;
            frame3.Add(new Gtk.Label("This is frame3"));


            dlg.VBox.PackStart(frame1, true, true, 5);
            dlg.VBox.PackStart(frame2, true, true, 5);
            dlg.VBox.PackStart(frame3, true, true, 5);

            dlg.SetGeometryHints(
                dlg,
                new Gdk.Geometry()
            {
                MinHeight = 200,
                MinWidth  = 320
            },
                Gdk.WindowHints.MinSize
                );

            dlg.AddButton("Ok", Gtk.ResponseType.Ok);
            dlg.ShowAll();
            dlg.Run();
            dlg.Destroy();
        }
示例#15
0
        public SelectIconDialog(Gtk.Window parent, Stetic.IProject project)
        {
            this.parent  = parent;
            this.project = project;

            Glade.XML xml = new Glade.XML(null, "stetic.glade", "SelectIconDialog", null);
            xml.Autoconnect(this);

            // Stock icon list

            iconList = new StockIconList();
            iconList.SelectionChanged += new EventHandler(OnIconSelectionChanged);
            iconScrolledwindow.AddWithViewport(iconList);

            // Custom icon list

            customIconList = new ProjectIconList(project, project.IconFactory);
            customIconList.SelectionChanged += new EventHandler(OnCustomIconSelectionChanged);
            customIconScrolledwindow.AddWithViewport(customIconList);
            dialog.ShowAll();

            UpdateIconSelection();
            UpdateButtons();
        }
示例#16
0
        public void Run(object o, EventArgs e)
        {
            Console.WriteLine ("EXECUTING ExiflowEditComment EXTENSION");

            xml = new Glade.XML (null,"ExiflowEditComment.glade", dialog_name, "f-spot");
            xml.Autoconnect (this);
            dialog = (Gtk.Dialog) xml.GetWidget(dialog_name);

            // collect comments of selected photos in current_comments
            ArrayList current_comments = new ArrayList ();
            foreach (Photo p in App.Instance.Organizer.SelectedPhotos ()) {
                if (p.Description.Length > 0 && ! current_comments.Contains(p.Description)) {
                    current_comments.Add(p.Description);
                }
            }

            // fill text buffer with all current comments
            comment.Buffer.Text = String.Join("\n---\n", (String[]) current_comments.ToArray(typeof(string)));

            dialog.Modal = false;
            dialog.TransientFor = null;
            dialog.Response += HandleResponse;
            dialog.ShowAll();
        }
        void GtkDBusInit()
        {
            /* setup ApplicationMenu */

            dbusMenu      = new MenuStripDBusMenu(pluginHost.MainWindow.MainMenu);
            emptyDBusMenu = new MenuStripDBusMenu(new MenuStrip());

            var sessionBus = Bus.Session;

#if DEBUG
            const string dbusBusPath    = "/org/freedesktop/DBus";
            const string dbusBusName    = "org.freedesktop.DBus";
            var          dbusObjectPath = new ObjectPath(dbusBusPath);
            var          dbusService    =
                sessionBus.GetObject <org.freedesktop.DBus.IBus>(dbusBusName, dbusObjectPath);
            dbusService.NameAcquired += (name) => Console.WriteLine("NameAcquired: " + name);
#endif
            const string registrarBusPath    = "/com/canonical/AppMenu/Registrar";
            const string registratBusName    = "com.canonical.AppMenu.Registrar";
            var          registrarObjectPath = new ObjectPath(registrarBusPath);
            unityPanelServiceBus =
                sessionBus.GetObject <com.canonical.AppMenu.Registrar.IRegistrar>(registratBusName,
                                                                                  registrarObjectPath);
            mainFormXid        = GetWindowXid(pluginHost.MainWindow);
            mainFormObjectPath = new ObjectPath(string.Format(menuPath,
                                                              mainFormXid));
            sessionBus.Register(mainFormObjectPath, dbusMenu);
            try {
                unityPanelServiceBus.RegisterWindow((uint)mainFormXid.ToInt32(),
                                                    mainFormObjectPath);
                gtkInitOk = true;
                gtkInitDoneEvent.Set();
            } catch (Exception) {
                gtkInitDoneEvent.Set();
                if (!pluginHost.CustomConfig.GetBool(keebuntuAppMenuWarningSeenId, false))
                {
                    using (var dialog = new Gtk.Dialog()) {
                        dialog.BorderWidth  = 6;
                        dialog.Resizable    = false;
                        dialog.HasSeparator = false;
                        var message = "<span weight=\"bold\"size=\"larger\">"
                                      + "Could not register KeebuntuAppMenu with Unity panel service."
                                      + "</span>\n\n"
                                      + "This plugin only works with Ubuntu Unity desktop."
                                      + " If you do not use Unity, you should uninstall the KeebuntuAppMenu plugin."
                                      + "\n";
                        var label = new Gtk.Label(message);
                        label.UseMarkup = true;
                        label.Wrap      = true;
                        label.Yalign    = 0;
                        var icon = new Gtk.Image(Gtk.Stock.DialogError, Gtk.IconSize.Dialog);
                        icon.Yalign = 0;
                        var contentBox = new Gtk.HBox();
                        contentBox.Spacing     = 12;
                        contentBox.BorderWidth = 6;
                        contentBox.PackStart(icon);
                        contentBox.PackEnd(label);
                        dialog.VBox.PackStart(contentBox);
                        dialog.AddButton("Don't show this again", Gtk.ResponseType.Accept);
                        dialog.AddButton("OK", Gtk.ResponseType.Ok);
                        dialog.DefaultResponse = Gtk.ResponseType.Ok;
                        dialog.Response       += (o, args) => {
                            dialog.Destroy();
                            if (args.ResponseId == Gtk.ResponseType.Accept)
                            {
                                pluginHost.CustomConfig.SetBool(keebuntuAppMenuWarningSeenId, true);
                            }
                        };
                        dialog.ShowAll();
                        dialog.KeepAbove = true;
                        dialog.Run();
                    }
                    DBusBackgroundWorker.Stop();
                }
            }
        }
示例#18
0
        private void OnViewFrames()
        {
            var dlg = new Gtk.Dialog( "Frames", this, Gtk.DialogFlags.Modal );

            var frame1 = new Gtk.Frame( "<b>Frame1</b>" );
            ( (Gtk.Label) frame1.LabelWidget ).UseMarkup = true;
            frame1.Add( new Gtk.Label( "This is frame1" ) );
            var frame2 = new Gtk.Frame( "<b>Frame2</b>" );
            ( (Gtk.Label) frame2.LabelWidget ).UseMarkup = true;
            frame2.Add( new Gtk.Label( "This is frame2" ) );
            var frame3 = new Gtk.Frame( "<b>Frame3</b>" );
            ( (Gtk.Label) frame3.LabelWidget ).UseMarkup = true;
            frame3.Add( new Gtk.Label( "This is frame3" ) );

            dlg.VBox.PackStart( frame1, true, true, 5 );
            dlg.VBox.PackStart( frame2, true, true, 5 );
            dlg.VBox.PackStart( frame3, true, true, 5 );

            dlg.SetGeometryHints(
                dlg,
                new Gdk.Geometry() {
                    MinHeight = 200,
                    MinWidth = 320
                },
                Gdk.WindowHints.MinSize
            );

            dlg.AddButton( "Ok", Gtk.ResponseType.Ok );
            dlg.ShowAll();
            dlg.Run();
            dlg.Destroy();
        }
示例#19
0
		private void OnAdvancedSyncConfigButton (object sender, EventArgs args)
		{
			// Get saved behavior
			SyncTitleConflictResolution savedBehavior = SyncTitleConflictResolution.Cancel;
			object dlgBehaviorPref = Preferences.Get (Preferences.SYNC_CONFIGURED_CONFLICT_BEHAVIOR);
			if (dlgBehaviorPref != null && dlgBehaviorPref is int) // TODO: Check range of this int
				savedBehavior = (SyncTitleConflictResolution)dlgBehaviorPref;

			// Create dialog
			Gtk.Dialog advancedDlg =
			        new Gtk.Dialog (Catalog.GetString ("Other Synchronization Options"),
			                        this,
			                        Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal | Gtk.DialogFlags.NoSeparator,
			                        Gtk.Stock.Close, Gtk.ResponseType.Close);
			// Populate dialog
			Gtk.Label label =
			        new Gtk.Label (Catalog.GetString ("When a conflict is detected between " +
			                                          "a local note and a note on the configured " +
			                                          "synchronization server:"));
			label.Wrap = true;
			label.Xalign = 0;

			promptOnConflictRadio =
			        new Gtk.RadioButton (Catalog.GetString ("Always ask me what to do."));
			promptOnConflictRadio.Toggled += OnConflictOptionToggle;

			renameOnConflictRadio =
			        new Gtk.RadioButton (promptOnConflictRadio, Catalog.GetString ("Rename my local note."));
			renameOnConflictRadio.Toggled += OnConflictOptionToggle;

			overwriteOnConflictRadio =
			        new Gtk.RadioButton (promptOnConflictRadio, Catalog.GetString ("Replace my local note with the server's update."));
			overwriteOnConflictRadio.Toggled += OnConflictOptionToggle;

			switch (savedBehavior) {
			case SyncTitleConflictResolution.RenameExistingNoUpdate:
				renameOnConflictRadio.Active = true;
				break;
			case SyncTitleConflictResolution.OverwriteExisting:
				overwriteOnConflictRadio.Active = true;
				break;
			default:
				promptOnConflictRadio.Active = true;
				break;
			}

			Gtk.VBox vbox = new Gtk.VBox ();
			vbox.BorderWidth = 18;

			vbox.PackStart (promptOnConflictRadio);
			vbox.PackStart (renameOnConflictRadio);
			vbox.PackStart (overwriteOnConflictRadio);

			advancedDlg.VBox.PackStart (label, false, false, 6);
			advancedDlg.VBox.PackStart (vbox, false, false, 0);

			advancedDlg.ShowAll ();

			// Run dialog
			advancedDlg.Run ();
			advancedDlg.Destroy ();
		}
 public int Run()
 {
     dialog.ShowAll();
     dialog.TransientFor = parent;
     return(dialog.Run());
 }
示例#21
0
        static void ShowEvalDialog()
        {
            string evalTitle   = GettextCatalog.GetString("Evaluation Version");
            string evalHeader  = GettextCatalog.GetString("Feature Not Available In Evaluation Version");
            string evalMessage = GettextCatalog.GetString(
                "Upgrade to the full version of Mono for Android to deploy\n" +
                "to devices, and to enable your applications to be distributed.");
            string continueMessage = GettextCatalog.GetString("Continue evaluation");

            var dialog = new Gtk.Dialog()
            {
                Title = evalTitle,
            };

            dialog.VBox.PackStart(
                new Gtk.Label("<b><big>" + evalHeader + "</big></b>")
            {
                Xalign    = 0.5f,
                UseMarkup = true
            }, true, false, 12);

            var align = new Gtk.Alignment(0.5f, 0.5f, 1.0f, 1.0f)
            {
                LeftPadding = 12, RightPadding = 12
            };

            dialog.VBox.PackStart(align, true, false, 12);
            align.Add(new Gtk.Label(evalMessage)
            {
                Xalign  = 0.5f,
                Justify = Gtk.Justification.Center
            });

            align = new Gtk.Alignment(0.5f, 0.5f, 1.0f, 1.0f)
            {
                LeftPadding = 12, RightPadding = 12
            };
            dialog.VBox.PackStart(align, true, false, 12);

            string activateMessage;

            if (PropertyService.IsWindows)
            {
                activateMessage = GettextCatalog.GetString("Activate Mono for Android");
            }
            else
            {
                activateMessage = GettextCatalog.GetString("Buy Mono for Android");
            }

            var buyButton = new Gtk.Button(new Gtk.Label("<big>" + activateMessage + "</big>")
            {
                UseMarkup = true
            });

            buyButton.Clicked += delegate {
                Activate();
                dialog.Respond(Gtk.ResponseType.Accept);
            };
            align.Add(buyButton);

            dialog.AddButton(continueMessage, Gtk.ResponseType.Close);
            dialog.ShowAll();

            MessageService.ShowCustomDialog(dialog);
        }
示例#22
0
 void ShowImage(Pixbuf img, string title)
 {
     if(DiagnosticMode)
     {
         Gtk.Dialog Win = new Gtk.Dialog(title, parent, Gtk.DialogFlags.Modal, Gtk.ButtonsType.Ok);
         Gtk.Image Image = new Gtk.Image(img);
         Win.VBox.Add(Image);
         Win.ShowAll();
         Win.Run();
         Image.Pixbuf = null;
         Win.Destroy();
     }
     logger.Info(title);
 }
示例#23
0
    public static void ShowHintWindow(Gtk.Widget parent, String caption, String text)
    {
      Gtk.Dialog dialog = new Gtk.Dialog();
      dialog.ParentWindow = parent.GdkWindow;
      dialog.Parent = parent;
      dialog.Title = caption;
      dialog.VBox.PackStart(new Gtk.Label(text), true, true, 12);
      
      Gtk.Button closeButton = (Gtk.Button)dialog.AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Close);
      closeButton.Clicked += delegate(object sender, EventArgs ea) { dialog.Hide(); dialog.Dispose(); };

      EventHandler showDelegate = delegate(object s, EventArgs ea) { dialog.ShowAll(); dialog.Present(); };
      Gtk.Application.Invoke(showDelegate);
    }
示例#24
0
        private void OnViewNotebook()
        {
            var dlg = new Gtk.Dialog( "Boxes", this, Gtk.DialogFlags.Modal );
            var nbTabs = new Gtk.Notebook();

            nbTabs.AppendPage( new Gtk.Label( "Page1" ), new Gtk.Label( "Page1" ) );
            nbTabs.AppendPage( new Gtk.Label( "Page2" ), new Gtk.Label( "Page2" ) );

            dlg.VBox.PackStart( nbTabs, true, true, 5 );

            dlg.SetGeometryHints(
                dlg,
                new Gdk.Geometry() {
                    MinHeight = 200,
                    MinWidth = 320
                },
                Gdk.WindowHints.MinSize
            );

            dlg.AddButton( "Ok", Gtk.ResponseType.Ok );
            dlg.ShowAll();
            dlg.Run();
            dlg.Destroy();
        }
示例#25
0
 public void ShowAll()
 {
     mergedb_dialog.ShowAll();
 }
示例#26
0
		static void ShowEvalDialog ()
		{
			string evalTitle = GettextCatalog.GetString ("Evaluation Version");
			string evalHeader = GettextCatalog.GetString ("Feature Not Available In Evaluation Version");
			string evalMessage = GettextCatalog.GetString (
				"Upgrade to the full version of Mono for Android to deploy\n" +
				"to devices, and to enable your applications to be distributed.");
			string continueMessage = GettextCatalog.GetString ("Continue evaluation");
			
			var dialog = new Gtk.Dialog () {
				Title = evalTitle,
			};
			
			dialog.VBox.PackStart (
			 	new Gtk.Label ("<b><big>" + evalHeader + "</big></b>") {
					Xalign = 0.5f,
					UseMarkup = true
				}, true, false, 12);
			
			var align = new Gtk.Alignment (0.5f, 0.5f, 1.0f, 1.0f) { LeftPadding = 12, RightPadding = 12 };
			dialog.VBox.PackStart (align, true, false, 12);
			align.Add (new Gtk.Label (evalMessage) {
					Xalign = 0.5f,
					Justify = Gtk.Justification.Center
				});
			
			align = new Gtk.Alignment (0.5f, 0.5f, 1.0f, 1.0f) { LeftPadding = 12, RightPadding = 12 };
			dialog.VBox.PackStart (align, true, false, 12);
			
			string activateMessage;
			if (PropertyService.IsWindows) {
				activateMessage = GettextCatalog.GetString ("Activate Mono for Android");
			} else {
				activateMessage = GettextCatalog.GetString ("Buy Mono for Android");
			}
			
			var buyButton = new Gtk.Button (new Gtk.Label ("<big>" + activateMessage + "</big>") { UseMarkup = true } );
			buyButton.Clicked += delegate {
				Activate ();
				dialog.Respond (Gtk.ResponseType.Accept);
			};
			align.Add (buyButton);
			
			dialog.AddButton (continueMessage, Gtk.ResponseType.Close);
			dialog.ShowAll ();
			
			MessageService.ShowCustomDialog (dialog);
		}