예제 #1
0
 private void InitSpinBox(HScaleSpinButtonWidget spinbox)
 {
     spinbox.DefaultValue = 16;
     spinbox.MaximumValue = 64;
     spinbox.MinimumValue = 2;
     ContentArea.Add(spinbox);
 }
예제 #2
0
        private void Build()
        {
            Resizable = false;

            ContentArea.WidthRequest = 400;
            ContentArea.BorderWidth  = 6;
            ContentArea.Spacing      = 6;

            red_spinbox       = new HScaleSpinButtonWidget();
            red_spinbox.Label = Translations.GetString("Red");
            InitSpinBox(red_spinbox);

            green_spinbox       = new HScaleSpinButtonWidget();
            green_spinbox.Label = Translations.GetString("Green");
            InitSpinBox(green_spinbox);

            blue_spinbox       = new HScaleSpinButtonWidget();
            blue_spinbox.Label = Translations.GetString("Blue");
            InitSpinBox(blue_spinbox);

            link_button        = new CheckButton(Translations.GetString("Linked"));
            link_button.Active = true;
            ContentArea.Add(link_button);

            DefaultWidth  = 400;
            DefaultHeight = 300;
            ShowAll();
        }
        private void Build()
        {
            var hbox = new HBox();

            hbox.Spacing     = 6;
            hbox.BorderWidth = 12;

            var error_icon = new Image();

            error_icon.Pixbuf = PintaCore.Resources.GetIcon(Stock.DialogError, 32);
            error_icon.Yalign = 0;
            hbox.PackStart(error_icon, false, false, 0);

            var vbox = new VBox();

            vbox.Spacing = 6;

            description_label              = new Label();
            description_label.Wrap         = true;
            description_label.WidthRequest = 500;
            description_label.Xalign       = 0;
            vbox.PackStart(description_label, false, false, 0);

            hbox.Add(vbox);
            ContentArea.Add(hbox);

            DefaultWidth  = 600;
            DefaultHeight = 150;

            ShowAll();
        }
예제 #4
0
        private void Build()
        {
            ContentArea.BorderWidth = 2;
            ContentArea.Spacing     = 6;

            label = new Label();
            ContentArea.Add(label);

            progress_bar = new ProgressBar();
            ContentArea.Add(progress_bar);

            AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);

            DefaultWidth  = 400;
            DefaultHeight = 114;
        }
예제 #5
0
        public GuideDialog(string title, string mainText, string secondaryText) : base(null, DialogFlags.Modal, MessageType.Other, ButtonsType.None, null)
        {
            Title          = title;
            Icon           = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png");
            Text           = mainText;
            SecondaryText  = secondaryText;
            WindowPosition = WindowPosition.Center;
            Response      += GtkDialog_Response;

            Button guideButton = new Button();

            guideButton.Label = "Open the Setup Guide";

            ContentArea.Add(guideButton);

            SetSizeRequest(100, 10);
            ShowAll();
        }
예제 #6
0
        public BibliographerChooseColumns(TreeViewColumn[] columns)
        {
            Title        = "Choose Columns";
            WidthRequest = 200;
            AddButton("Close", ResponseType.Close);

            ContentArea.Add(new Label("Visible Columns"));

            columnChecklistHbox = new Box(Orientation.Horizontal, 5);
            ContentArea.Add(columnChecklistHbox);

            const int rows = 8;
            int       i    = 0;
            VBox      vbox;

            vbox = new VBox();
            columnChecklistHbox.Add(vbox);
            vbox.Show();
            foreach (TreeViewColumn column in columns)
            {
                CheckButton checkbutton;

                checkbutton = new CheckButton();
                checkbutton.Data.Add("column", column);
                checkbutton.Active = column.Visible;
                checkbutton.Label  = column.Title;

                checkbutton.Clicked += OnCheckButtonClicked;

                checkbutton.Show();

                vbox.Add(checkbutton);

                if (i == rows - 1)
                {
                    vbox = new VBox();
                    columnChecklistHbox.Add(vbox);
                    vbox.Show();
                    i = 0;
                }
                i = i + 1;
            }
            ShowAll();
        }
예제 #7
0
        /// <summary>
        /// Sets up a Property control to render contents using temporary property data
        /// </summary>
        /// <param name="propertyControl"></param>
        /// <param name="contents"></param>
        private void SetupPreviewPropertyControl(Property propertyControl, IEnumerable <IContent> contents)
        {
            // Define a content area
            var contentArea = new ContentArea();

            // Add the blocks to preview
            foreach (var content in contents)
            {
                contentArea.Add(content);
            }

            // Create a temporary property for the content area
            var previewProperty = new PropertyContentArea {
                Value = contentArea, Name = "PreviewPropertyData"
            };

            // Render the temporary property using the Property control in the web form
            propertyControl.InnerProperty = previewProperty;
        }
예제 #8
0
        public AddObjectDialog()
        {
            comboBox         = new Gtk.ComboBoxText();
            descriptionLabel = new Gtk.Label();

            ContentArea.Add(comboBox);
            ContentArea.Add(descriptionLabel);
            AddButton("Add", Gtk.ResponseType.Ok);

            foreach (string s in ObjectGroupEditor.ObjectNames)
            {
                comboBox.AppendText(s);
            }
            comboBox.Active   = 0;
            comboBox.Changed += OnComboBoxChanged;

            UpdateLabel();

            this.ShowAll();
        }
예제 #9
0
        public SpinButtonEntryDialog(string title, Window parent, string label, int min, int max, int current)
            : base(title, parent, DialogFlags.Modal, Core.GtkExtensions.DialogButtonsCancelOk())
        {
            BorderWidth         = 6;
            ContentArea.Spacing = 3;
            HBox hbox = new HBox();

            hbox.Spacing = 6;

            Label lbl = new Label(label);

            lbl.Xalign = 0;
            hbox.PackStart(lbl, true, true, 0);

            spinButton       = new SpinButton(min, max, 1);
            spinButton.Value = current;
            hbox.PackStart(spinButton, true, true, 0);

            hbox.ShowAll();
            ContentArea.Add(hbox);

            DefaultResponse             = ResponseType.Ok;
            spinButton.ActivatesDefault = true;
        }
예제 #10
0
        private void Build()
        {
            IconName       = Resources.Icons.ImageResize;
            WindowPosition = WindowPosition.CenterOnParent;

            DefaultWidth  = 300;
            DefaultHeight = 200;

            percentageRadio = new RadioButton(Translations.GetString("By percentage:"));
            absoluteRadio   = new RadioButton(percentageRadio, Translations.GetString("By absolute size:"));

            percentageSpinner = new SpinButton(1, 1000, 1);
            widthSpinner      = new SpinButton(1, 10000, 1);
            heightSpinner     = new SpinButton(1, 10000, 1);

            aspectCheckbox = new CheckButton(Translations.GetString("Maintain aspect ratio"));

            const int spacing   = 6;
            var       main_vbox = new VBox()
            {
                Spacing = spacing, BorderWidth = 12
            };

            var hbox_percent = new HBox()
            {
                Spacing = spacing
            };

            hbox_percent.PackStart(percentageRadio, true, true, 0);
            hbox_percent.PackStart(percentageSpinner, false, false, 0);
            hbox_percent.PackEnd(new Label("%"), false, false, 0);
            main_vbox.PackStart(hbox_percent, false, false, 0);

            main_vbox.PackStart(absoluteRadio, false, false, 0);

            var hbox_width = new HBox()
            {
                Spacing = spacing
            };

            hbox_width.PackStart(new Label(Translations.GetString("Width:")), false, false, 0);
            hbox_width.PackStart(widthSpinner, false, false, 0);
            hbox_width.PackStart(new Label(Translations.GetString("pixels")), false, false, 0);
            main_vbox.PackStart(hbox_width, false, false, 0);

            var hbox_height = new HBox()
            {
                Spacing = spacing
            };

            hbox_height.PackStart(new Label(Translations.GetString("Height:")), false, false, 0);
            hbox_height.PackStart(heightSpinner, false, false, 0);
            hbox_height.PackStart(new Label(Translations.GetString("pixels")), false, false, 0);
            main_vbox.PackStart(hbox_height, false, false, 0);

            main_vbox.PackStart(aspectCheckbox, false, false, 0);

            ContentArea.BorderWidth = 2;
            ContentArea.Add(main_vbox);

            ShowAll();
        }
예제 #11
0
        public DapPropertiesDialog(DapSource source) : base(
                // Translators: {0} is the name assigned to a Digital Audio Player by its owner
                String.Format(Catalog.GetString("{0} Properties"), source.Name),
                null,
                DialogFlags.Modal,
                Stock.Close,
                ResponseType.Close)
        {
            this.source = source;

            HBox iconbox = new HBox();

            iconbox.Spacing = 10;
            //Image icon = new Image (source.Properties.Get<string> ("Icon.Names")[0], IconSize.Dialog);
            //icon.Yalign = 0.0f;
            //icon.Pixbuf = device.GetIcon(48);
            //iconbox.PackStart(icon, false, false, 0);

            VBox box = new VBox();

            box.Spacing = 10;

            PropertyTable table = new PropertyTable();

            table.ColumnSpacing = 10;
            table.RowSpacing    = 5;

            if (!source.IsReadOnly && source.CanRename)
            {
                nameEntry          = table.AddEntry(Catalog.GetString("Device name"), source.Name);
                nameEntry.Changed += OnEntryChanged;
            }
            else
            {
                table.AddLabel(Catalog.GetString("Device name"), source.Name);
            }

            /*if(device.ShowOwner) {
             *  if(!device.IsReadOnly && device.CanSetOwner) {
             *      ownerEntry = table.AddEntry(Catalog.GetString("Owner name"), device.Owner);
             *      ownerEntry.Changed += OnEntryChanged;
             *  } else {
             *      table.AddLabel(Catalog.GetString("Owner name"), device.Owner);
             *  }
             * }*/

            if (!source.IsReadOnly)
            {
                try {
                    VBox profile_description_box            = new VBox();
                    ProfileComboBoxConfigurable profile_box = new ProfileComboBoxConfigurable(ServiceManager.MediaProfileManager,
                                                                                              source.UniqueId, profile_description_box);
                    profile_box.Combo.MimeTypeFilter = source.AcceptableMimeTypes;
                    table.AddWidget(Catalog.GetString("Encode to"), profile_box);
                    table.AddWidget(null, profile_description_box);
                    profile_description_box.Show();

                    table.AddSeparator();
                } catch (Exception e) {
                    Console.WriteLine(e);
                }
            }

            table.AddWidget(Catalog.GetString("Capacity used"), UsedProgressBar);

            box.PackStart(table, true, true, 0);

            PropertyTable extTable = new PropertyTable();

            extTable.ColumnSpacing = 10;
            extTable.RowSpacing    = 5;

            foreach (DapSource.DapProperty property in source.DapProperties)
            {
                extTable.AddLabel(property.Name, property.Value);
            }

            Expander expander = new Expander(Catalog.GetString("Advanced details"));

            expander.Add(extTable);
            box.PackStart(expander, false, false, 0);

            BorderWidth = 10;
            Resizable   = false;
            iconbox.PackStart(box, true, true, 0);
            iconbox.ShowAll();
            ContentArea.Add(iconbox);
        }
예제 #12
0
        private void BuildWindow()
        {
            BorderWidth         = 6;
            ContentArea.Spacing = 12;

            HBox content_box = new HBox();

            content_box.BorderWidth = 6;
            content_box.Spacing     = 12;

            Table table = new Table(2, 6, false);

            table.RowSpacing    = 6;
            table.ColumnSpacing = 12;

            ArrayList labels = new ArrayList();

            Label feed_label = new Label();

            feed_label.Markup = String.Format("<b>{0}</b>", GLib.Markup.EscapeText(Catalog.GetString("Podcast:")));
            labels.Add(feed_label);

            Label pubdate_label = new Label();

            pubdate_label.Markup = String.Format("<b>{0}</b>", GLib.Markup.EscapeText(Catalog.GetString("Date:")));
            labels.Add(pubdate_label);

            Label url_label = new Label();

            url_label.Markup = String.Format("<b>{0}</b>", GLib.Markup.EscapeText(Catalog.GetString("URL:")));
            labels.Add(url_label);

            Label description_label = new Label();

            description_label.Markup = String.Format("<b>{0}</b>", GLib.Markup.EscapeText(Catalog.GetString("Description:")));
            labels.Add(description_label);

            Label feed_title_text = new Label(pi.Feed.Title);

            labels.Add(feed_title_text);

            Label pubdate_text = new Label(pi.Item.PubDate.ToString("f"));

            labels.Add(pubdate_text);

            Label url_text = new Label(pi.Item.Link);

            labels.Add(url_text);
            url_text.Wrap       = true;
            url_text.Selectable = true;
            url_text.Ellipsize  = Pango.EllipsizeMode.End;

            string description_string = (String.IsNullOrEmpty(pi.Item.Description)) ?
                                        Catalog.GetString("No description available") :
                                        pi.Item.Description;

            if (!description_string.StartsWith("\""))
            {
                description_string = "\"" + description_string;
            }

            if (!description_string.EndsWith("\""))
            {
                description_string = description_string + "\"";
            }

            Label description_text = new Label(description_string);

            description_text.Wrap       = true;
            description_text.Selectable = true;

            labels.Add(description_text);

            table.Attach(
                feed_label, 0, 1, 0, 1,
                AttachOptions.Fill, AttachOptions.Fill, 0, 0
                );

            table.Attach(
                pubdate_label, 0, 1, 1, 2,
                AttachOptions.Fill, AttachOptions.Fill, 0, 0
                );

            table.Attach(
                url_label, 0, 1, 3, 4,
                AttachOptions.Fill, AttachOptions.Fill, 0, 0
                );

            table.Attach(
                description_label, 0, 1, 5, 6,
                AttachOptions.Fill, AttachOptions.Fill, 0, 0
                );

            table.Attach(
                feed_title_text, 1, 2, 0, 1,
                AttachOptions.Fill, AttachOptions.Fill, 0, 0
                );

            table.Attach(
                pubdate_text, 1, 2, 1, 2,
                AttachOptions.Fill, AttachOptions.Fill, 0, 0
                );


            table.Attach(
                url_text, 1, 2, 3, 4,
                AttachOptions.Fill, AttachOptions.Fill, 0, 0
                );

            table.Attach(description_text, 1, 2, 5, 6,
                         AttachOptions.Expand | AttachOptions.Fill,
                         AttachOptions.Expand | AttachOptions.Fill, 0, 0
                         );

            foreach (Label l in labels)
            {
                AlignAndJustify(l);
            }

            content_box.PackStart(table, true, true, 0);

            Button ok_button = new Button(Stock.Close);

            ok_button.CanDefault = true;
            ok_button.Show();

            AddActionWidget(ok_button, ResponseType.Close);

            DefaultResponse   = ResponseType.Ok;
            ActionArea.Layout = ButtonBoxStyle.End;

            content_box.ShowAll();
            ContentArea.Add(content_box);

            Response += OnResponse;
        }
예제 #13
0
 private void AddWidget(Gtk.Widget widget)
 {
     widget.Show();
     ContentArea.Add(widget);
 }
예제 #14
0
        private void BuildWindow()
        {
            DefaultWidth = 475;

            BorderWidth         = 6;
            ContentArea.Spacing = 12;
            ActionArea.Layout   = Gtk.ButtonBoxStyle.End;

            HBox box = new HBox();

            box.BorderWidth = 6;
            box.Spacing     = 12;

            Image image = new Image(IconThemeUtils.LoadIcon(48, "podcast"));

            image.Yalign = 0.0f;

            box.PackStart(image, false, true, 0);

            VBox contentBox = new VBox();

            contentBox.Spacing = 12;

            Label header = new Label();

            header.Markup = String.Format(
                "<big><b>{0}</b></big>",
                GLib.Markup.EscapeText(Catalog.GetString("Subscribe to New Podcast"))
                );

            header.Justify = Justification.Left;
            header.SetAlignment(0.0f, 0.0f);

            var message = new WrapLabel()
            {
                Markup = Catalog.GetString(
                    "Please enter the URL of the podcast to which you would like to subscribe."
                    ),
                Wrap = true
            };

            url_entry = new Entry();
            url_entry.ActivatesDefault = true;

            // If the user has copied some text to the clipboard that starts with http, set
            // our url entry to it and select it
            Clipboard clipboard = Clipboard.Get(Gdk.Atom.Intern("CLIPBOARD", false));

            if (clipboard != null)
            {
                string pasted = clipboard.WaitForText();
                if (!String.IsNullOrEmpty(pasted))
                {
                    if (pasted.StartsWith("http"))
                    {
                        url_entry.Text = pasted.Trim();
                        url_entry.SelectRegion(0, url_entry.Text.Length);
                    }
                }
            }

            contentBox.PackStart(header, true, true, 0);
            contentBox.PackStart(message, true, true, 0);

            var url_box = new HBox()
            {
                Spacing = 12
            };

            url_box.PackStart(new Label(Catalog.GetString("URL:")), false, false, 0);
            url_box.PackStart(url_entry, true, true, 0);
            contentBox.PackStart(url_box, false, false, 0);

            var options_label = new Label()
            {
                Markup = String.Format("<b>{0}</b>", GLib.Markup.EscapeText(Catalog.GetString("Subscription Options"))),
                Xalign = 0f
            };

            download_check = new CheckButton(Catalog.GetString("Download new episodes"));
            archive_check  = new CheckButton(Catalog.GetString("Archive all episodes except the newest one"));
            var options_box = new VBox()
            {
                Spacing = 3
            };

            options_box.PackStart(options_label, false, false, 0);
            options_box.PackStart(new Gtk.Alignment(0f, 0f, 0f, 0f)
            {
                LeftPadding = 12, Child = download_check
            }, false, false, 0);
            options_box.PackStart(new Gtk.Alignment(0f, 0f, 0f, 0f)
            {
                LeftPadding = 12, Child = archive_check
            }, false, false, 0);
            contentBox.PackStart(options_box, false, false, 0);

            box.PackStart(contentBox, true, true, 0);

            AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true);
            AddButton(Catalog.GetString("Subscribe"), ResponseType.Ok, true);

            box.ShowAll();
            ContentArea.Add(box);
        }
예제 #15
0
        private void BuildDialog()
        {
            // Layout table for preset, width, and height
            var layout_grid = new Grid();

            layout_grid.RowSpacing    = 5;
            layout_grid.ColumnSpacing = 6;

            // Preset Combo
            var size_label = new Label(Translations.GetString("Preset:"))
            {
                Xalign = 1f, Yalign = .5f
            };

            var preset_entries = new List <string> ();

            if (has_clipboard)
            {
                preset_entries.Add(Translations.GetString("Clipboard"));
            }

            preset_entries.Add(Translations.GetString("Custom"));
            preset_entries.AddRange(preset_sizes.Select(p => string.Format("{0} x {1}", p.Width, p.Height)));

            preset_combo = new ComboBoxText();
            foreach (string entry in preset_entries)
            {
                preset_combo.AppendText(entry);
            }

            preset_combo.Active = 0;

            layout_grid.Attach(size_label, 0, 0, 1, 1);
            layout_grid.Attach(preset_combo, 1, 0, 1, 1);

            // Width Entry
            var width_label = new Label(Translations.GetString("Width:"))
            {
                Xalign = 1f, Yalign = .5f
            };

            width_entry = new Entry();
            width_entry.WidthRequest     = 50;
            width_entry.ActivatesDefault = true;

            var width_units = new Label(Translations.GetString("pixels"));

            var width_hbox = new HBox();

            width_hbox.PackStart(width_entry, false, false, 0);
            width_hbox.PackStart(width_units, false, false, 5);

            layout_grid.Attach(width_label, 0, 1, 1, 1);
            layout_grid.Attach(width_hbox, 1, 1, 1, 1);

            // Height Entry
            var height_label = new Label(Translations.GetString("Height:"))
            {
                Xalign = 1f, Yalign = .5f
            };

            height_entry = new Entry();
            height_entry.WidthRequest     = 50;
            height_entry.ActivatesDefault = true;

            var height_units = new Label(Translations.GetString("pixels"));

            var height_hbox = new HBox();

            height_hbox.PackStart(height_entry, false, false, 0);
            height_hbox.PackStart(height_units, false, false, 5);

            layout_grid.Attach(height_label, 0, 2, 1, 1);
            layout_grid.Attach(height_hbox, 1, 2, 1, 1);

            // Orientation Radio options
            var orientation_label = new Label(Translations.GetString("Orientation:"))
            {
                Xalign = 0f, Yalign = .5f
            };

            portrait_radio = new RadioButton(Translations.GetString("Portrait"));
            var portrait_image = new Image(PintaCore.Resources.GetIcon(Stock.OrientationPortrait, 16));

            var portrait_hbox = new HBox();

            portrait_hbox.PackStart(portrait_image, false, false, 7);
            portrait_hbox.PackStart(portrait_radio, false, false, 0);

            landscape_radio = new RadioButton(portrait_radio, Translations.GetString("Landscape"));
            var landscape_image = new Image(PintaCore.Resources.GetIcon(Stock.OrientationLandscape, 16));

            var landscape_hbox = new HBox();

            landscape_hbox.PackStart(landscape_image, false, false, 7);
            landscape_hbox.PackStart(landscape_radio, false, false, 0);

            // Orientation VBox
            var orientation_vbox = new VBox();

            orientation_vbox.PackStart(orientation_label, false, false, 4);
            orientation_vbox.PackStart(portrait_hbox, false, false, 0);
            orientation_vbox.PackStart(landscape_hbox, false, false, 0);

            // Background Color options
            var background_label = new Label(Translations.GetString("Background:"))
            {
                Xalign = 0f, Yalign = .5f
            };

            white_bg_radio = new RadioButton(Translations.GetString("White"));
            var image_white = new Image(GdkExtensions.CreateColorSwatch(16, new Gdk.Color(255, 255, 255)));

            var hbox_white = new HBox();

            hbox_white.PackStart(image_white, false, false, 7);
            hbox_white.PackStart(white_bg_radio, false, false, 0);

            secondary_bg_radio = new RadioButton(white_bg_radio, Translations.GetString("Background Color"));
            var image_bg = new Image(GdkExtensions.CreateColorSwatch(16, PintaCore.Palette.SecondaryColor.ToGdkColor()));

            var hbox_bg = new HBox();

            hbox_bg.PackStart(image_bg, false, false, 7);
            hbox_bg.PackStart(secondary_bg_radio, false, false, 0);

            trans_bg_radio = new RadioButton(secondary_bg_radio, Translations.GetString("Transparent"));
            var image_trans = new Image(GdkExtensions.CreateTransparentColorSwatch(true));

            var hbox_trans = new HBox();

            hbox_trans.PackStart(image_trans, false, false, 7);
            hbox_trans.PackStart(trans_bg_radio, false, false, 0);

            // Background VBox
            var background_vbox = new VBox();

            background_vbox.PackStart(background_label, false, false, 4);
            background_vbox.PackStart(hbox_white, false, false, 0);

            if (allow_background_color)
            {
                background_vbox.PackStart(hbox_bg, false, false, 0);
            }

            background_vbox.PackStart(hbox_trans, false, false, 0);

            // Put all the options together
            var options_vbox = new VBox();

            options_vbox.Spacing = 10;

            options_vbox.PackStart(layout_grid, false, false, 3);
            options_vbox.PackStart(orientation_vbox, false, false, 0);
            options_vbox.PackStart(background_vbox, false, false, 4);

            // Layout the preview + the options
            preview = new PreviewArea();

            var preview_label = new Label(Translations.GetString("Preview"));

            var preview_vbox = new VBox();

            preview_vbox.PackStart(preview_label, false, false, 0);
            preview_vbox.PackStart(preview, true, true, 0);


            var main_hbox = new HBox(false, 10);

            main_hbox.PackStart(options_vbox, false, false, 0);
            main_hbox.PackStart(preview_vbox, true, true, 0);

            ContentArea.Add(main_hbox);

            ShowAll();
        }
예제 #16
0
        private void Build()
        {
            IconName = Resources.Icons.ImageResizeCanvas;

            WindowPosition = WindowPosition.CenterOnParent;

            DefaultWidth  = 300;
            DefaultHeight = 200;

            percentageRadio = new RadioButton(Translations.GetString("By percentage:"));
            absoluteRadio   = new RadioButton(percentageRadio, Translations.GetString("By absolute size:"));

            percentageSpinner = new SpinButton(1, 1000, 1);
            widthSpinner      = new SpinButton(1, 10000, 1);
            heightSpinner     = new SpinButton(1, 10000, 1);

            aspectCheckbox = new CheckButton(Translations.GetString("Maintain aspect ratio"));

            const int spacing   = 6;
            var       main_vbox = new VBox()
            {
                Spacing = spacing, BorderWidth = 12
            };

            var hbox_percent = new HBox()
            {
                Spacing = spacing
            };

            hbox_percent.PackStart(percentageRadio, true, true, 0);
            hbox_percent.PackStart(percentageSpinner, false, false, 0);
            hbox_percent.PackEnd(new Label("%"), false, false, 0);
            main_vbox.PackStart(hbox_percent, false, false, 0);

            main_vbox.PackStart(absoluteRadio, false, false, 0);

            var hbox_width = new HBox()
            {
                Spacing = spacing
            };

            hbox_width.PackStart(new Label(Translations.GetString("Width:")), false, false, 0);
            hbox_width.PackStart(widthSpinner, false, false, 0);
            hbox_width.PackStart(new Label(Translations.GetString("pixels")), false, false, 0);
            main_vbox.PackStart(hbox_width, false, false, 0);

            var hbox_height = new HBox()
            {
                Spacing = spacing
            };

            hbox_height.PackStart(new Label(Translations.GetString("Height:")), false, false, 0);
            hbox_height.PackStart(heightSpinner, false, false, 0);
            hbox_height.PackStart(new Label(Translations.GetString("pixels")), false, false, 0);
            main_vbox.PackStart(hbox_height, false, false, 0);

            main_vbox.PackStart(aspectCheckbox, false, false, 0);
            main_vbox.PackStart(new HSeparator(), false, false, 0);

            var align_label = new Label(Translations.GetString("Anchor:"))
            {
                Xalign = 0
            };

            main_vbox.PackStart(align_label, false, false, 0);

            NWButton     = CreateAnchorButton();
            NButton      = CreateAnchorButton();
            NEButton     = CreateAnchorButton();
            WButton      = CreateAnchorButton();
            EButton      = CreateAnchorButton();
            CenterButton = CreateAnchorButton();
            SWButton     = CreateAnchorButton();
            SButton      = CreateAnchorButton();
            SEButton     = CreateAnchorButton();

            var grid = new Grid()
            {
                RowSpacing = spacing, ColumnSpacing = spacing
            };

            grid.Attach(NWButton, 0, 0, 1, 1);
            grid.Attach(NButton, 1, 0, 1, 1);
            grid.Attach(NEButton, 2, 0, 1, 1);
            grid.Attach(WButton, 0, 1, 1, 1);
            grid.Attach(CenterButton, 1, 1, 1, 1);
            grid.Attach(EButton, 2, 1, 1, 1);
            grid.Attach(SWButton, 0, 2, 1, 1);
            grid.Attach(SButton, 1, 2, 1, 1);
            grid.Attach(SEButton, 2, 2, 1, 1);

            var grid_align = new Alignment(0.5f, 0.5f, 0, 0);

            grid_align.Add(grid);

            main_vbox.PackStart(grid_align, false, false, 0);

            ContentArea.BorderWidth = 2;
            ContentArea.Add(main_vbox);

            ShowAll();
        }
예제 #17
0
        private void BuildWindow()
        {
            BorderWidth         = 5;
            ContentArea.Spacing = 12;
            ActionArea.Layout   = Gtk.ButtonBoxStyle.End;

            HBox box = new HBox();

            box.BorderWidth = 5;
            box.Spacing     = 15;

            Image image = new Image(Stock.Network, IconSize.Dialog);

            image.Yalign = 0.2f;
            box.PackStart(image, false, false, 0);

            VBox content_box = new VBox();

            content_box.Spacing = 12;

            Label header = new Label();

            header.Markup = "<big><b>" + GLib.Markup.EscapeText(Catalog.GetString(
                                                                    "Authentication Required")) + "</b></big>";
            header.Justify = Justification.Left;
            header.SetAlignment(0.0f, 0.5f);

            Label message = new Label(Catalog.GetString(String.Format(
                                                            "Please provide login information to access {0}.", share_name)));

            message.Wrap    = true;
            message.Justify = Justification.Left;
            message.SetAlignment(0.0f, 0.5f);

            content_box.PackStart(header, false, false, 0);
            content_box.PackStart(message, false, false, 0);

            username_entry            = new Entry();
            password_entry            = new Entry();
            password_entry.Visibility = false;

            uint yoff = show_username ? (uint)0 : (uint)1;

            Table table = new Table(2, 2, false);

            table.RowSpacing    = 5;
            table.ColumnSpacing = 10;

            if (show_username)
            {
                table.Attach(new Label(Catalog.GetString("Username:"******"Password:"******"Login"), ResponseType.Ok, true);

            box.ShowAll();
            ContentArea.Add(box);
        }