Exemple #1
0
        public override Control CreateWidget()
        {
            var icon  = Xwt.Drawing.Image.FromResource("lightning-16.png");
            var image = new Xwt.ImageView(icon).ToGtkWidget();

            var box = new HBox(false, 6);
            var vb  = new VBox();

            vb.PackStart(image, false, false, 0);
            box.PackStart(vb, false, false, 0);
            vb        = new VBox(false, 6);
            typeLabel = new Label {
                Xalign = 0
            };
            vb.PackStart(typeLabel);
            messageLabel = new Label {
                Xalign    = 0,
                NoShowAll = true
            };
            vb.PackStart(messageLabel);

            var detailsBtn = new Xwt.LinkLabel(GettextCatalog.GetString("Show Details"));
            var hh         = new HBox();

            detailsBtn.NavigateToUrl += (o, e) => dlg.ShowDialog();
            hh.PackStart(detailsBtn.ToGtkWidget(), false, false, 0);
            vb.PackStart(hh, false, false, 0);

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

            vb = new VBox();
            var closeButton = new ImageButton {
                InactiveImage = closeSelImage,
                Image         = closeSelOverImage
            };

            closeButton.Clicked += delegate {
                dlg.ShowMiniButton();
            };
            vb.PackStart(closeButton, false, false, 0);
            box.PackStart(vb, false, false, 0);

            exception.Changed += delegate {
                Application.Invoke(delegate {
                    LoadData();
                });
            };
            LoadData();

            var eb = new PopoverWidget();

            eb.ShowArrow       = true;
            eb.EnableAnimation = true;
            eb.PopupPosition   = PopupPosition.Left;
            eb.ContentBox.Add(box);
            eb.ShowAll();
            return(eb);
        }
        public GeneralOptionsPanel()
        {
            this.Build();

            this.comboboxLineEndings.AppendText(GettextCatalog.GetString("Always ask for conversion"));
            this.comboboxLineEndings.AppendText(GettextCatalog.GetString("Leave line endings as is"));
            this.comboboxLineEndings.AppendText(GettextCatalog.GetString("Always convert line endings"));
            this.comboboxLineEndings.Active = (int)DefaultSourceEditorOptions.Instance.LineEndingConversion;

            var newEditorOptionsBox = new Xwt.VBox();

            var newEditorLearnMoreLink = new Xwt.LinkLabel {
                MarginBottom = 6,
                MarginTop    = 6,
                Text         = GettextCatalog.GetString("Learn more about the New Editor"),
                Uri          = new Uri("https://aka.ms/vs/mac/editor/learn-more")
            };

            newEditorOptionsBox.PackStart(newEditorLearnMoreLink);

            newEditorCheckBox          = new Xwt.CheckBox(GettextCatalog.GetString("Open C# files in the New Editor"));
            newEditorCheckBox.Active   = DefaultSourceEditorOptions.Instance.EnableNewEditor;
            newEditorCheckBox.Toggled += HandleNewEditorOptionToggled;
            newEditorOptionsBox.PackStart(newEditorCheckBox);

            wordWrapCheckBox            = new Xwt.CheckBox(GettextCatalog.GetString("_Word wrap"));
            wordWrapCheckBox.MarginLeft = 18;
            wordWrapCheckBox.Active     = DefaultSourceEditorOptions.Instance.WordWrapStyle.HasFlag(WordWrapStyles.WordWrap);
            wordWrapCheckBox.Toggled   += HandleNewEditorOptionToggled;
            newEditorOptionsBox.PackStart(wordWrapCheckBox);

            wordWrapVisualGlyphsCheckBox            = new Xwt.CheckBox(GettextCatalog.GetString("Show visible glyphs for word wrap"));
            wordWrapVisualGlyphsCheckBox.MarginLeft = 36;
            wordWrapVisualGlyphsCheckBox.Active     = DefaultSourceEditorOptions.Instance.WordWrapStyle.HasFlag(WordWrapStyles.VisibleGlyphs);
            wordWrapVisualGlyphsCheckBox.Toggled   += HandleNewEditorOptionToggled;
            newEditorOptionsBox.PackStart(wordWrapVisualGlyphsCheckBox);

            if (Xwt.Toolkit.CurrentEngine.Type == Xwt.ToolkitType.Gtk)
            {
                experimentalSection.PackStart((Gtk.Widget)Xwt.Toolkit.CurrentEngine.GetNativeWidget(newEditorOptionsBox), false, false, 0);
            }
            else
            {
                LoggingService.LogError("GeneralOptionsPanel: Xwt.Toolkit.CurrentEngine.Type != Xwt.ToolkitType.Gtk - currently unsupported");
            }

            HandleNewEditorOptionToggled(this, EventArgs.Empty);

            SetupAccessibility();
        }
		public override Widget CreateWidget ()
		{
			var icon = Gdk.Pixbuf.LoadFromResource ("lightning.png");
			var image = new Gtk.Image (icon);

			HBox box = new HBox (false, 6);
			VBox vb = new VBox ();
			vb.PackStart (image, false, false, 0);
			box.PackStart (vb, false, false, 0);
			vb = new VBox (false, 6);
			vb.PackStart (new Gtk.Label () {
				Markup = GettextCatalog.GetString ("<b>{0}</b> has been thrown", exception.Type),
				Xalign = 0
			});
			messageLabel = new Gtk.Label () {
				Xalign = 0,
				NoShowAll = true
			};
			vb.PackStart (messageLabel);

			var detailsBtn = new Xwt.LinkLabel (GettextCatalog.GetString ("Show Details"));
			HBox hh = new HBox ();
			detailsBtn.NavigateToUrl += (o,e) => dlg.ShowDialog ();
			hh.PackStart (detailsBtn.ToGtkWidget (), false, false, 0);
			vb.PackStart (hh, false, false, 0);

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

			vb = new VBox ();
			var closeButton = new ImageButton () {
				InactiveImage = closeSelImage,
				Image = closeSelOverImage
			};
			closeButton.Clicked += delegate {
				dlg.ShowMiniButton ();
			};
			vb.PackStart (closeButton, false, false, 0);
			box.PackStart (vb, false, false, 0);

			exception.Changed += delegate {
				Application.Invoke (delegate {
					LoadData ();
				});
			};
			LoadData ();

			PopoverWidget eb = new PopoverWidget ();
			eb.ShowArrow = true;
			eb.EnableAnimation = true;
			eb.PopupPosition = PopupPosition.Left;
			eb.ContentBox.Add (box);
			eb.ShowAll ();
			return eb;
		}
		public override Control CreateWidget ()
		{
			var icon = Xwt.Drawing.Image.FromResource ("lightning-16.png");
			var image = new Xwt.ImageView (icon).ToGtkWidget ();

			var box = new HBox (false, 6);
			var vb = new VBox ();
			vb.PackStart (image, false, false, 0);
			box.PackStart (vb, false, false, 0);
			vb = new VBox (false, 6);
			typeLabel = new Label {
				Xalign = 0
			};
			vb.PackStart (typeLabel);
			messageLabel = new Label {
				Xalign = 0,
				NoShowAll = true
			};
			vb.PackStart (messageLabel);

			var detailsBtn = new Xwt.LinkLabel (GettextCatalog.GetString ("Show Details"));
			var hh = new HBox ();
			detailsBtn.NavigateToUrl += (o, e) => dlg.ShowDialog ();
			hh.PackStart (detailsBtn.ToGtkWidget (), false, false, 0);
			vb.PackStart (hh, false, false, 0);

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

			vb = new VBox ();
			var closeButton = new ImageButton {
				InactiveImage = closeSelImage,
				Image = closeSelOverImage
			};
			closeButton.Clicked += delegate {
				dlg.ShowMiniButton ();
			};
			vb.PackStart (closeButton, false, false, 0);
			box.PackStart (vb, false, false, 0);

			exception.Changed += delegate {
				Application.Invoke (delegate {
					LoadData ();
				});
			};
			LoadData ();

			var eb = new PopoverWidget ();
			eb.ShowArrow = true;
			eb.EnableAnimation = true;
			eb.PopupPosition = PopupPosition.Left;
			eb.ContentBox.Add (box);
			eb.ShowAll ();
			return eb;
		}
        public override Widget CreateWidget()
        {
            var icon  = Gdk.Pixbuf.LoadFromResource("lightning.png");
            var image = new Gtk.Image(icon);

            HBox box = new HBox(false, 6);
            VBox vb  = new VBox();

            vb.PackStart(image, false, false, 0);
            box.PackStart(vb, false, false, 0);
            vb = new VBox(false, 6);
            vb.PackStart(new Gtk.Label()
            {
                Markup = GettextCatalog.GetString("<b>{0}</b> has been thrown", exception.Type),
                Xalign = 0
            });
            messageLabel = new Gtk.Label()
            {
                Xalign    = 0,
                NoShowAll = true
            };
            vb.PackStart(messageLabel);

            var  detailsBtn = new Xwt.LinkLabel(GettextCatalog.GetString("Show Details"));
            HBox hh         = new HBox();

            detailsBtn.NavigateToUrl += (o, e) => dlg.ShowDialog();
            hh.PackStart(detailsBtn.ToGtkWidget(), false, false, 0);
            vb.PackStart(hh, false, false, 0);

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

            vb = new VBox();
            var closeButton = new ImageButton()
            {
                InactiveImage = closeSelImage,
                Image         = closeSelOverImage
            };

            closeButton.Clicked += delegate {
                dlg.ShowMiniButton();
            };
            vb.PackStart(closeButton, false, false, 0);
            box.PackStart(vb, false, false, 0);

            exception.Changed += delegate {
                Application.Invoke(delegate {
                    LoadData();
                });
            };
            LoadData();

            PopoverWidget eb = new PopoverWidget();

            eb.ShowArrow       = true;
            eb.EnableAnimation = true;
            eb.PopupPosition   = PopupPosition.Left;
            eb.ContentBox.Add(box);
            eb.ShowAll();
            return(eb);
        }
        public AboutMonoDevelopTabPage()
        {
            BorderWidth = 0;

            var aboutFile = BrandingService.GetFile(AboutDialogImage.Name);

            if (aboutFile != null)
            {
                imageSep = Xwt.Drawing.Image.FromFile(aboutFile);
            }
            else
            {
                imageSep = Xwt.Drawing.Image.FromResource(AboutDialogImage.Name);
            }

            var iv = new ImageView(imageSep);

            iv.SetCommonAccessibilityAttributes("AboutImage", BrandingService.ApplicationLongName, "");
            PackStart(iv, false, false, 0);

            Xwt.VBox infoBox = new Xwt.VBox()
            {
                CanGetFocus = false
            };
            Xwt.FrameBox mbox = new Xwt.FrameBox(infoBox)
            {
                CanGetFocus = false
            };

            infoBox.Spacing = 6;
            infoBox.Margin  = 12;
            PackStart(mbox.ToGtkWidget(), false, false, 0);

            infoBox.PackStart(new Xwt.Label()
            {
                Markup    = string.Format("<b>{0}</b>", GettextCatalog.GetString("Version")),
                MarginTop = 6,
            });
            infoBox.PackStart(new Xwt.Label()
            {
                Text       = IdeVersionInfo.MonoDevelopVersion,
                MarginLeft = 12
            });

            if (BrandingService.LicenseTermsUrl != null)
            {
                infoBox.PackStart(new Xwt.Label()
                {
                    Markup    = string.Format("<b>{0}</b>", GettextCatalog.GetString("License")),
                    MarginTop = 6,
                });

                var linkLabel = new Xwt.LinkLabel {
                    Markup      = "<span underline='true'>License Terms</span>",
                    Cursor      = Xwt.CursorType.Hand,
                    MarginLeft  = 12,
                    CanGetFocus = true,
                    Uri         = new Uri(BrandingService.LicenseTermsUrl),
                };
                if (IdeTheme.UserInterfaceTheme == Theme.Light)
                {
                    linkLabel.Markup = string.Format("<span color='#5C2D91'>{0}</span>", linkLabel.Markup);
                }

                infoBox.PackStart(linkLabel);

                if (BrandingService.PrivacyStatementUrl != null)
                {
                    linkLabel = new Xwt.LinkLabel {
                        Markup      = string.Format("<span underline='true'>{0}</span>", GettextCatalog.GetString("Privacy Statement")),
                        Cursor      = Xwt.CursorType.Hand,
                        MarginLeft  = 12,
                        CanGetFocus = true,
                        Uri         = new Uri(BrandingService.PrivacyStatementUrl),
                    };

                    if (IdeTheme.UserInterfaceTheme == Theme.Light)
                    {
                        linkLabel.Markup = string.Format("<span color='#5C2D91'>{0}</span>", linkLabel.Markup);
                    }

                    infoBox.PackStart(linkLabel);
                }
            }

            infoBox.PackStart(new Xwt.Label()
            {
                Markup    = string.Format("<b>{0}</b>", GettextCatalog.GetString("Copyright")),
                MarginTop = 6,
            });

            infoBox.PackStart(new Xwt.Label()
            {
                Text       = (DateTime.Now.Year == 2016 ? "© 2016" : "© 2016–" + DateTime.Now.Year) + " Microsoft Corp.",
                MarginLeft = 12
            });
            infoBox.PackStart(new Xwt.Label()
            {
                Text       = "© 2004–" + DateTime.Now.Year + " Xamarin Inc.",
                MarginLeft = 12
            });
            infoBox.PackStart(new Xwt.Label()
            {
                Text       = "© 2004–" + DateTime.Now.Year + " MonoDevelop contributors",
                MarginLeft = 12
            });

            this.ShowAll();
        }