Example #1
0
        void Build()
        {
            Padding   = 0;
            Resizable = false;
            Width     = 320;
            Title     = GettextCatalog.GetString("New Folder");

            var mainVBox = new VBox();

            var folderNameHBox = new HBox();

            folderNameHBox.Margin = 20;
            var folderNameLabel = new Label();

            folderNameLabel.Text = GettextCatalog.GetString("Folder Name:");
            folderNameHBox.PackStart(folderNameLabel);

            folderNameTextEntry = new TextEntry();
            folderNameHBox.PackStart(folderNameTextEntry, true, true);
            folderNameTextEntry.SetCommonAccessibilityAttributes(
                "NewFolderDialog.FolderNameTextEntry",
                folderNameLabel.Text,
                GettextCatalog.GetString("Enter the name for the new folder"));

            warningPopover         = new InformationPopoverWidget();
            warningPopover.Visible = false;
            folderNameHBox.PackStart(warningPopover);

            mainVBox.PackStart(folderNameHBox);

            var cancelButton = new DialogButton(Command.Cancel);

            Buttons.Add(cancelButton);

            addButton = new DialogButton(Command.Add);
            Buttons.Add(addButton);

            DefaultCommand = addButton.Command;

            Content = mainVBox;
        }
Example #2
0
        void Build()
        {
            this.TransientFor = MessageDialog.RootWindow;
            this.Title        = GettextCatalog.GetString("Extract Interface");

            treeStore = new ListStore(symbolIncludedField, symbolField, symbolTextField, symbolIconField);
            var box = new VBox {
                Margin  = 6,
                Spacing = 6
            };

            box.PackStart(new Label {
                Markup = GettextCatalog.GetString("Name of the new interface:")
            });
            box.PackStart(entryName);
            entryName.Name = "entryName.Name";
            entryName.SetCommonAccessibilityAttributes(entryName.Name, GettextCatalog.GetString("Name of the new interface"),
                                                       GettextCatalog.GetString("The name of the new interface"));

            entryName.Changed += delegate {
                UpdateOkButton();
            };
            box.PackStart(new Label {
                Markup = GettextCatalog.GetString("File name:")
            });

            box.PackStart(entryFileName);
            entryFileName.Name = "entryFileName.Name";
            entryFileName.SetCommonAccessibilityAttributes(entryFileName.Name, GettextCatalog.GetString("Name of the new file"),
                                                           GettextCatalog.GetString("The name of the file for the new interface"));

            entryFileName.Changed += delegate {
                UpdateOkButton();
            };
            box.PackStart(new Label {
                Markup = "<b>" + GettextCatalog.GetString("Select public members for the interface:") + "</b>"
            });

            var hbox = new HBox {
                Spacing = 6
            };

            hbox.PackStart(listViewPublicMembers, true);
            listViewPublicMembers.Accessible.Description = GettextCatalog.GetString("Select the public members which are added to the interface");

            var vbox = new VBox {
                Spacing = 6
            };

            buttonSelectAll          = new Button(GettextCatalog.GetString("Select All"));
            buttonSelectAll.Clicked += delegate {
                UpdateOkButton();
            };
            vbox.PackStart(buttonSelectAll);

            buttonDeselectAll          = new Button(GettextCatalog.GetString("Clear"));
            buttonDeselectAll.Clicked += delegate {
                UpdateOkButton();
            };
            vbox.PackStart(buttonDeselectAll);

            hbox.PackStart(vbox);

            box.PackStart(hbox, true);

            Content = box;
            Buttons.Add(okButton = new DialogButton(Command.Ok));
            Buttons.Add(new DialogButton(Command.Cancel));

            this.Width     = 400;
            this.Height    = 421;
            this.Resizable = false;

            Show();
        }
        void Build()
        {
            Width = 400;
            Title = GettextCatalog.GetString("Add Package Source");
            int labelWidth = 80;

            var mainVBox = new VBox();

            mainVBox.Accessible.Role = Xwt.Accessibility.Role.Filler;
            Content = mainVBox;

            // Package source name.
            var packageSourceNameHBox = new HBox();

            packageSourceNameHBox.Accessible.Role = Xwt.Accessibility.Role.Filler;
            mainVBox.PackStart(packageSourceNameHBox);

            var packageSourceNameLabel = new Label();

            packageSourceNameLabel.Text          = GettextCatalog.GetString("Name");
            packageSourceNameLabel.TextAlignment = Alignment.End;
            packageSourceNameLabel.WidthRequest  = labelWidth;
            packageSourceNameHBox.PackStart(packageSourceNameLabel);

            packageSourceNameTextEntry = new TextEntry();
            packageSourceNameTextEntry.SetCommonAccessibilityAttributes("PackageSourceDialog.name", packageSourceNameLabel,
                                                                        GettextCatalog.GetString("Enter the name for this package source"));
            packageSourceNameHBox.PackEnd(packageSourceNameTextEntry, true);

            // Package source URL.
            var packageSourceUrlHBox = new HBox();

            packageSourceUrlHBox.Accessible.Role = Xwt.Accessibility.Role.Filler;
            mainVBox.PackStart(packageSourceUrlHBox);

            var packageSourceUrlLabel = new Label();

            packageSourceUrlLabel.Text          = GettextCatalog.GetString("Location");
            packageSourceUrlLabel.TextAlignment = Alignment.End;
            packageSourceUrlLabel.WidthRequest  = labelWidth;
            packageSourceUrlHBox.PackStart(packageSourceUrlLabel);

            packageSourceUrlTextEntry = new TextEntry();
            packageSourceUrlTextEntry.SetCommonAccessibilityAttributes("PackageSourceDialog.url", packageSourceUrlLabel,
                                                                       GettextCatalog.GetString("Enter the URL for this package source"));
            packageSourceUrlTextEntry.PlaceholderText = GettextCatalog.GetString("URL or folder");
            packageSourceUrlHBox.PackStart(packageSourceUrlTextEntry, true);

            browseButton       = new Button();
            browseButton.Label = GettextCatalog.GetString("_Browse...");
            packageSourceUrlHBox.PackStart(browseButton);

            // Package source username.
            var packageSourceUserNameHBox = new HBox();

            packageSourceUserNameHBox.Accessible.Role = Xwt.Accessibility.Role.Filler;
            mainVBox.PackStart(packageSourceUserNameHBox);

            var packageSourceUserNameLabel = new Label();

            packageSourceUserNameLabel.Text          = GettextCatalog.GetString("Username");
            packageSourceUserNameLabel.TextAlignment = Alignment.End;
            packageSourceUserNameLabel.WidthRequest  = labelWidth;
            packageSourceUserNameHBox.PackStart(packageSourceUserNameLabel);

            packageSourceUserNameTextEntry = new TextEntry();
            packageSourceUserNameTextEntry.SetCommonAccessibilityAttributes("PackageSourceDialog.username", packageSourceUserNameLabel,
                                                                            GettextCatalog.GetString("Enter the username (if required) for this package source"));
            packageSourceUserNameTextEntry.PlaceholderText = GettextCatalog.GetString("Private sources only");
            packageSourceUserNameHBox.PackEnd(packageSourceUserNameTextEntry, true);

            // Package source password.
            var packageSourcePasswordHBox = new HBox();

            packageSourcePasswordHBox.Accessible.Role = Xwt.Accessibility.Role.Filler;
            mainVBox.PackStart(packageSourcePasswordHBox);

            var packageSourcePasswordLabel = new Label();

            packageSourcePasswordLabel.Text          = GettextCatalog.GetString("Password");
            packageSourcePasswordLabel.TextAlignment = Alignment.End;
            packageSourcePasswordLabel.WidthRequest  = labelWidth;
            packageSourcePasswordHBox.PackStart(packageSourcePasswordLabel);

            packageSourcePasswordTextEntry = new PasswordEntry();
            packageSourcePasswordTextEntry.SetCommonAccessibilityAttributes("PackageSourceDialog.password", packageSourcePasswordLabel,
                                                                            GettextCatalog.GetString("Enter the password (if required) for this package source"));
            packageSourcePasswordTextEntry.PlaceholderText = GettextCatalog.GetString("Private sources only");
            packageSourcePasswordHBox.PackEnd(packageSourcePasswordTextEntry, true);

            // Buttons at bottom of dialog.
            var cancelButton = new DialogButton(Command.Cancel);

            Buttons.Add(cancelButton);

            addPackageSourceButton           = new DialogButton(Command.Ok);
            addPackageSourceButton.Label     = GettextCatalog.GetString("Add Source");
            addPackageSourceButton.Sensitive = false;
            Buttons.Add(addPackageSourceButton);

            savePackageSourceButton         = new DialogButton(Command.Apply);
            savePackageSourceButton.Label   = GettextCatalog.GetString("Save");
            savePackageSourceButton.Visible = false;
            Buttons.Add(savePackageSourceButton);
        }
Example #4
0
        void Build()
        {
            this.TransientFor = MessageDialog.RootWindow;
            this.Title        = GettextCatalog.GetString("Generate Type");

            var box = new VBox {
                Margin  = 6,
                Spacing = 6
            };

            box.PackStart(new Label {
                Markup = "<b>" + GettextCatalog.GetString("Type details:") + "</b>"
            });

            var table = new Table();

            table.Add(new Label(GettextCatalog.GetString("Access:")), 0, 0);
            table.Add(new Label(GettextCatalog.GetString("Type:")), 1, 0);
            table.Add(new Label(GettextCatalog.GetString("Name:")), 2, 0);

            table.Add(comboboxAccess, 0, 1);
            comboboxAccess.Name = "comboboxAccess.Name";
            comboboxAccess.SetCommonAccessibilityAttributes(comboboxAccess.Name, GettextCatalog.GetString("Accessibility"),
                                                            GettextCatalog.GetString("Select the accessibility for the new type."));

            table.Add(comboboxType, 1, 1);
            comboboxType.Name = "comboboxType.Name";
            comboboxType.SetCommonAccessibilityAttributes(comboboxType.Name, GettextCatalog.GetString("Type"),
                                                          GettextCatalog.GetString("Select type to be generated."));

            table.Add(entryName, 2, 1, vexpand: true);
            entryName.Name = "entry.Name";
            entryName.SetCommonAccessibilityAttributes(entryName.Name, GettextCatalog.GetString("Name"),
                                                       GettextCatalog.GetString("The name of the new type to be generated."));

            box.PackStart(table);

            box.PackStart(new Label {
                Markup = "<b>" + GettextCatalog.GetString("Save location:") + "</b>"
            });

            box.PackStart(new Label {
                Markup = "<b>" + GettextCatalog.GetString("Project:") + "</b>"
            });

            box.PackStart(comboboxProject);
            comboboxProject.Name = "comboboxProject.Name";
            comboboxProject.SetCommonAccessibilityAttributes(comboboxProject.Name, GettextCatalog.GetString("Project"),
                                                             GettextCatalog.GetString("The project new type will be generated in."));

            box.PackStart(new Label {
                Markup = "<b>" + GettextCatalog.GetString("Type details:") + "</b>"
            });

            var frameBox = new VBox {
                Spacing = 6,
                Margin  = 12
            };

            frameBox.PackStart(new Label {
                Text = GettextCatalog.GetString("File name:")
            });

            var alignment = new VBox {
                MarginLeft = 12
            };

            radiobuttonNewFile = new RadioButton(GettextCatalog.GetString("Create new file"));
            radiobuttonNewFile.Accessible.Description = GettextCatalog.GetString("Select this to create a new file for the type");
            alignment.PackStart(radiobuttonNewFile);

            alignment.PackStart(entryNewFile);
            entryNewFile.Name = "entryNewFile.Name";
            entryNewFile.SetCommonAccessibilityAttributes(entryNewFile.Name, GettextCatalog.GetString("New file"),
                                                          GettextCatalog.GetString("The name of the new file the type will be generated in."));

            radiobuttonToExistingFile = new RadioButton(GettextCatalog.GetString("Add to existing file"));
            radiobuttonToExistingFile.Accessible.Description = GettextCatalog.GetString("Select this to add the type to an existing file");
            var actionGroup = new RadioButtonGroup();

            radiobuttonNewFile.Group        = actionGroup;
            radiobuttonToExistingFile.Group = actionGroup;

            actionGroup.ActiveRadioButtonChanged += delegate {
                comboboxExistingFile.Sensitive = radiobuttonToExistingFile.Active;
                entryNewFile.Sensitive         = radiobuttonNewFile.Active;
            };
            alignment.PackStart(radiobuttonToExistingFile);

            comboboxExistingFile.WidthRequest = 350;
            alignment.PackStart(comboboxExistingFile);
            comboboxExistingFile.Name = "comboboxExistingFile.Name";
            comboboxExistingFile.SetCommonAccessibilityAttributes(comboboxExistingFile.Name, GettextCatalog.GetString("Existing file"),
                                                                  GettextCatalog.GetString("The name of the existing file the type will be generated in."));

            frameBox.PackStart(alignment);
            box.PackStart(new Frame(frameBox));

            Content = box;
            Buttons.Add(okButton = new DialogButton(GettextCatalog.GetString("OK")));
            okButton.Clicked    += delegate {
                if (TrySubmit())
                {
                    Respond(Command.Ok);
                }
            };

            Buttons.Add(new DialogButton(Command.Cancel));

            this.Width     = 400;
            this.Height    = 421;
            this.Resizable = false;

            Show();
        }
Example #5
0
        void Build()
        {
            this.TransientFor = MessageDialog.RootWindow;
            this.Title        = GettextCatalog.GetString("Extract Interface");

            treeStore = new ListStore(symbolIncludedField, symbolField, symbolTextField, symbolIconField);
            var box = new VBox {
                Margin  = 6,
                Spacing = 6
            };

            box.PackStart(new Label {
                Markup = GettextCatalog.GetString("Name of the new interface:")
            });
            box.PackStart(entryName);
            entryName.Name = "entryName.Name";
            entryName.SetCommonAccessibilityAttributes(entryName.Name, GettextCatalog.GetString("Name of the new interface"),
                                                       GettextCatalog.GetString("The name of the new interface"));

            entryName.Changed += delegate {
                UpdateOkButton();
            };

            sameFileRadio = new RadioButton(GettextCatalog.GetString("Add to current file"))
            {
                Name = "sameFileRadio.Name"
            };
            sameFileRadio.Accessible.Description = GettextCatalog.GetString("Add the new interface to the current file");

            newFileRadio = new RadioButton(GettextCatalog.GetString("File name:"))
            {
                Group = sameFileRadio.Group,
                Name  = "newFileRadio.Name"
            };
            newFileRadio.Accessible.Description = GettextCatalog.GetString("Add the new interface to a new file");
            newFileRadio.Active         = true;
            newFileRadio.ActiveChanged += (sender, e) => entryFileName.Sensitive = newFileRadio.Active;

            var fileNameBox = new HBox();

            fileNameBox.PackStart(newFileRadio);
            fileNameBox.PackStart(entryFileName, true, true);

            box.PackStart(new Label {
                Markup = GettextCatalog.GetString("Select destination")
            });
            var radioBox = new VBox {
                Margin = new WidgetSpacing(12, 4, 4, 4)
            };

            radioBox.PackStart(sameFileRadio);
            radioBox.PackStart(fileNameBox);

            entryFileName.Name = "entryFileName.Name";
            entryFileName.SetCommonAccessibilityAttributes(
                entryFileName.Name,
                GettextCatalog.GetString("Name of the new file"),
                GettextCatalog.GetString("The name of the file for the new interface"));

            entryFileName.Changed += delegate {
                UpdateOkButton();
            };
            box.PackStart(new Label {
                Markup = "<b>" + GettextCatalog.GetString("Select public members for the interface:") + "</b>"
            });

            var hbox = new HBox {
                Spacing = 6
            };

            hbox.PackStart(listViewPublicMembers, true);
            listViewPublicMembers.Accessible.Description = GettextCatalog.GetString("Select the public members which are added to the interface");

            var vbox = new VBox {
                Spacing = 6
            };

            buttonSelectAll          = new Button(GettextCatalog.GetString("Select All"));
            buttonSelectAll.Clicked += delegate {
                UpdateOkButton();
            };
            vbox.PackStart(buttonSelectAll);

            buttonDeselectAll          = new Button(GettextCatalog.GetString("Clear"));
            buttonDeselectAll.Clicked += delegate {
                UpdateOkButton();
            };
            vbox.PackStart(buttonDeselectAll);

            hbox.PackStart(vbox);

            box.PackStart(hbox, true);

            Content = box;
            Buttons.Add(okButton = new DialogButton(Command.Ok));
            Buttons.Add(new DialogButton(Command.Cancel));

            this.Width     = 400;
            this.Height    = 421;
            this.Resizable = false;
        }