public DependencyWidget (IConnectedService service, IConnectedServiceDependency dependency)
		{
			Dependency = dependency;
			Service = service;

			iconView = new ImageView (dependency.Icon.WithSize (Xwt.IconSize.Small));
			nameLabel = new Label (dependency.DisplayName);

			statusIconView = new ImageView ();
			statusLabel = new Label ();
			statusLabel.LinkClicked += (sender, e) => {
				if (dependency.Status == Status.NotAdded)
					dependency.AddToProject (CancellationToken.None);
				e.SetHandled ();
			};

			container = new HBox ();
			container.PackStart (iconView);
			container.PackStart (nameLabel);
			container.PackStart (statusIconView);
			container.PackStart (statusLabel);

			Content = container;
			Update ();

			dependency.StatusChanged += HandleDependencyStatusChange;
			service.StatusChanged += HandleServiceStatusChanged;
		}
		public DependenciesSectionWidget (IConfigurationSection section) 
		{
			this.section = section;

			widget = new VBox ();

			if (this.section.Service.Dependencies.Length == 0) {
				widget.PackStart (new Label { Text = GettextCatalog.GetString ("This service has no dependencies") });
				return;
			}

			bool firstCategory = true;

			foreach (var category in this.section.Service.Dependencies.Select (d => d.Category).Distinct ()) {
				var categoryIcon = new ImageView (category.Icon.WithSize (IconSize.Small));
				var categoryLabel = new Label (category.Name);
				var categoryBox = new HBox ();

				if (!firstCategory)
					categoryBox.MarginTop += 5;

				categoryBox.PackStart (categoryIcon);
				categoryBox.PackStart (categoryLabel);
				widget.PackStart (categoryBox);

				foreach (var dependency in this.section.Service.Dependencies.Where (d => d.Category == category)) {
					widget.PackStart (new DependencyWidget (section.Service, dependency) {
						MarginLeft = category.Icon.Size.Width / 2
					});
				}

				if (firstCategory)
					firstCategory = false;
			}
		}
예제 #3
0
        public LoginView(LauncherWindow window)
        {
            Window = window;
            this.MinWidth = 250;

            ErrorLabel = new Label("Username or password incorrect")
            {
                TextColor = Color.FromBytes(255, 0, 0),
                TextAlignment = Alignment.Center,
                Visible = false
            };
            UsernameText = new TextEntry();
            PasswordText = new PasswordEntry();
            LogInButton = new Button("Log In");
            RegisterButton = new Button("Register");
            RememberCheckBox = new CheckBox("Remember Me");
            UsernameText.Text = UserSettings.Local.Username;
            if (UserSettings.Local.AutoLogin)
            {
                PasswordText.Password = UserSettings.Local.Password;
                RememberCheckBox.Active = true;
            }

            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TrueCraft.Launcher.Content.truecraft-logo.png"))
                TrueCraftLogoImage = new ImageView(Image.FromStream(stream));

            UsernameText.PlaceholderText = "Username";
            PasswordText.PlaceholderText = "Password";
            PasswordText.KeyReleased += (sender, e) =>
            {
                if (e.Key == Key.Return || e.Key == Key.NumPadEnter)
                    LogInButton_Clicked(sender, e);
            };
            UsernameText.KeyReleased += (sender, e) =>
            {
                if (e.Key == Key.Return || e.Key == Key.NumPadEnter)
                    LogInButton_Clicked(sender, e);
            };
            RegisterButton.Clicked += (sender, e) =>
            {
                if (RegisterButton.Label == "Register")
                    Window.WebView.Url = "http://truecraft.io/register";
                else
                {
                    Window.User.Username = UsernameText.Text;
                    Window.User.SessionId = "-";
                    Window.MainContainer.Remove(this);
                    Window.MainContainer.PackEnd(Window.MainMenuView = new MainMenuView(Window));
                }
            };
            LogInButton.Clicked += LogInButton_Clicked;

            this.PackStart(TrueCraftLogoImage);
            this.PackEnd(RegisterButton);
            this.PackEnd(LogInButton);
            this.PackEnd(RememberCheckBox);
            this.PackEnd(PasswordText);
            this.PackEnd(UsernameText);
            this.PackEnd(ErrorLabel);
        }
예제 #4
0
        private void InitializeComponent()
        {
            Width = 550;
            Height = 600;
            //Location = WindowLocation.CenterScreen;

            vbox2 = new VBox();
            vbox2.Visible = true;
            vbox2.Spacing = 3;

            notebook1 = new Notebook();
            notebook1.Visible = true;
            notebook1.CanGetFocus = true;

            image1 = new ImageView();
            string file = FileHelper.FindSupportFile("bygfoot_splash.png", false);
            image1.Image = Image.FromFile(file);

            treeview_splash_contributors = new TreeView();

            scrolledwindow2 = new ScrollView();
            scrolledwindow2.Content = treeview_splash_contributors;

            notebook1.Add(image1, "");
            notebook1.Add(scrolledwindow2, "");
            vbox2.PackStart(notebook1);

            Content = vbox2;
        }
예제 #5
0
        public Splash()
        {
            Decorated = false;
            ShowInTaskbar = false;
            box = new VBox {
                Margin = -2,
            };
            imageView = new ImageView {
                Image = Image.FromResource (Resources.Splash),
            };
            progressBar = new ProgressBar {
                Indeterminate = true,
                TooltipText = Catalog.GetString ("Loading..."),
            };
            info = new Label {
                Text = Catalog.GetString ("Loading..."),
                TextAlignment = Alignment.Center,
            };
            box.PackStart (imageView);
            box.PackEnd (progressBar);
            box.PackEnd (info);

            Content = box;

            InitialLocation = WindowLocation.CenterScreen;
        }
		public InformationPopoverWidget ()
		{
			severity = TaskSeverity.Information;
			imageView = new Xwt.ImageView ();
			Content = imageView;
			UpdateIcon ();
		}
예제 #7
0
 public InformationPopoverWidget()
 {
     severity  = TaskSeverity.Information;
     imageView = new Xwt.ImageView();
     Content   = imageView;
     UpdateIcon();
 }
예제 #8
0
        public LauncherWindow()
        {
            this.Title = "TrueCraft Launcher";
            this.Width = 1200;
            this.Height = 576;
            this.User = new TrueCraftUser();

            MainContainer = new HBox();
            WebScrollView = new ScrollView();
            WebView = new WebView("http://truecraft.io/updates");
            LoginView = new LoginView(this);
            OptionView = new OptionView(this);
            MultiplayerView = new MultiplayerView(this);
            SingleplayerView = new SingleplayerView(this);
            InteractionBox = new VBox();

            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TrueCraft.Launcher.Content.truecraft_logo.svg"))
                TrueCraftLogoImage = new ImageView(Image.FromStream(stream));

            WebScrollView.Content = WebView;
            MainContainer.PackStart(WebScrollView, true);
            InteractionBox.PackStart(TrueCraftLogoImage);
            InteractionBox.PackEnd(LoginView);
            MainContainer.PackEnd(InteractionBox);

            this.Content = MainContainer;
        }
예제 #9
0
        public ThemedImages()
        {
            Context.RegisterStyles ("dark", "sel");

            var img = Image.FromResource ("zoom-in-16.png");
            var img_sel = Image.FromResource ("zoom-in-16.png").WithStyles("sel");
            var img_dark = Image.FromResource ("zoom-in-16.png").WithStyles("dark");
            var img_dark_sel = Image.FromResource ("zoom-in-16.png").WithStyles("dark", "sel");

            var img_row = new HBox ();
            ImageView imgv = new ImageView () { Image = img };
            ImageView imgv_sel = new ImageView () { Image = img_sel };
            ImageView imgv_dark = new ImageView () { Image = img_dark };
            ImageView imgv_dark_sel = new ImageView () { Image = img_dark_sel };
            img_row.PackStart (imgv);
            img_row.PackStart (imgv_sel);
            img_row.PackStart (imgv_dark);
            img_row.PackStart (imgv_dark_sel);
            PackStart (img_row);

            var btn_row = new HBox ();
            Button btn = new Button (img);
            Button btn_sel = new Button (img_sel);
            Button btn_dark = new Button (img_dark);
            Button btn_dark_sel = new Button (img_dark_sel);
            btn_row.PackStart (btn);
            btn_row.PackStart (btn_sel);
            btn_row.PackStart (btn_dark);
            btn_row.PackStart (btn_dark_sel);
            PackStart (btn_row);
        }
예제 #10
0
        private void Build()
        {
            this.Icon = Xwt.Drawing.Image.FromResource("URMSimulator.Resources.urm.png");
            this.Title = "About";
            this.Resizable = false;
            this.Buttons.Add(new DialogButton(Command.Close));

            vbox1 = new VBox();

            image1 = new ImageView();
            image1.WidthRequest = 320;
            image1.HeightRequest = 270;
            vbox1.PackStart(image1);

            labelProgramName = new Label();
            labelProgramName.TextAlignment = Alignment.Center;
            vbox1.PackStart(labelProgramName);

            labelComments = new Label();
            labelComments.TextAlignment = Alignment.Center;
            vbox1.PackStart(labelComments);

            hbox1 = new HBox();

            hbox1.PackStart(new HBox(), true);

            labelWebsite = new LinkLabel();
            labelWebsite.TextAlignment = Alignment.Center; //text aligment doesn't work with Xwt.WPF
            hbox1.PackStart(labelWebsite, false);

            hbox1.PackStart(new HBox(), true);
            vbox1.PackStart(hbox1);

            this.Content = vbox1;
        }
예제 #11
0
		public MDSpinner (Gtk.IconSize size, Image idleImage = null)
		{
			Content = imageView = new Xwt.ImageView ();
			if (size == Gtk.IconSize.Menu)
				spinner = ImageService.GetAnimatedIcon ("md-spinner-16", size);
			else
				spinner = ImageService.GetAnimatedIcon ("md-spinner-18", size);
			IdleImage = idleImage;
		}
예제 #12
0
 public InformationPopoverWidget()
 {
     severity  = TaskSeverity.Information;
     imageView = new Xwt.ImageView();
     imageView.Accessible.Role = Xwt.Accessibility.Role.Filler;
     UpdateIcon();
     Content     = imageView;
     CanGetFocus = true;
 }
예제 #13
0
            public ImageViewWithTooltip(Xwt.Drawing.Image icon)
            {
                this.icon    = icon;
                image        = new Xwt.ImageView(icon);
                this.Content = image;

                MouseEntered += HandleEnterNotifyEvent;
                MouseExited  += HandleLeaveNotifyEvent;
            }
예제 #14
0
        public ReferenceImageVerifierDialog()
        {
            Width = 500;
            Height = 300;

            Table table = new Table ();
            table.DefaultRowSpacing = table.DefaultColumnSpacing = 6;

            table.Add (nameLabel = new Label (), 0, 0, hexpand:true);
            table.Add (new Label ("Reference Image"), 0, 1, hexpand:true);
            table.Add (new Label ("Test Image"), 1, 1, hexpand:true);
            nameLabel.Font = nameLabel.Font.WithWeight (Xwt.Drawing.FontWeight.Bold);

            img1 = new ImageView ();
            table.Add (img1, 0, 2, hexpand:true, vexpand:true);

            imgDiff = new ImageView ();
            table.Add (imgDiff, 1, 2, hexpand:true, vexpand:true);

            img2 = new ImageView ();
            table.Add (img2, 2, 2, hexpand:true, vexpand:true);

            var buttonBox = new HBox ();
            table.Add (buttonBox, 0, 3, colspan:2, hexpand:true);

            closeButton = new Button ("Close");
            validButton = new Button ("Success");
            failButton = new Button ("Failure");

            buttonBox.PackEnd (closeButton);
            buttonBox.PackEnd (failButton);
            buttonBox.PackEnd (validButton);

            closeButton.Clicked += delegate {
                Respond (Command.Ok);
            };

            failButton.Clicked += delegate {
                var info = ReferenceImageManager.ImageFailures[currentImage];
                info.Fail ();
                ShowNextImage ();
            };

            validButton.Clicked += delegate {
                var info = ReferenceImageManager.ImageFailures[currentImage];
                info.Validate ();
                ShowNextImage ();
            };

            Content = table;
            ShowNextImage ();
        }
예제 #15
0
 public MDSpinner(Gtk.IconSize size, Image idleImage = null)
 {
     Content = imageView = new Xwt.ImageView();
     if (size == Gtk.IconSize.Menu)
     {
         spinner = ImageService.GetAnimatedIcon("md-spinner-16", size);
     }
     else
     {
         spinner = ImageService.GetAnimatedIcon("md-spinner-18", size);
     }
     IdleImage = idleImage;
 }
예제 #16
0
        private void Build(string tooltipText)
        {
            hbox1 = new HBox();

            entry1 = new TextEntry();
            hbox1.PackStart(entry1, true);

            image1 = new ImageView();
            image1.Image = StockIcons.Warning;
            image1.TooltipText = tooltipText;
            hbox1.PackStart(image1);

            this.Content = hbox1;
        }
예제 #17
0
        public ScaffolderWizard(DotNetProject project, FilePath parentFolder) : base("Add New Scaffolded Item", StockIcons.Information, new ScaffolderTemplateSelectPage(args), args)
        {
            this.DefaultPageSize = new Size(500, 400);

            var rightSideImage  = new Xwt.ImageView(Image.FromResource("aspnet-wizard-page.png"));
            var rightSideWidget = new FrameBox(rightSideImage);

            rightSideWidget.BackgroundColor = Styles.Wizard.PageBackgroundColor;
            this.RightSideWidget            = new XwtControl(rightSideWidget);
            this.Completed   += (sender, e) => Task.Run(() => OnCompletedAsync());
            this.project      = project;
            this.parentFolder = parentFolder;
            args.Project      = project;
            args.ParentFolder = parentFolder;
        }
예제 #18
0
        public NoGameWidget()
        {
            HasBorder = false;

            ImageView view = new ImageView(imgError);

            AddChild(view, 15, 15);

            AddChild(new Label("No games where found"), 46, 15);
            var link = new Button(" Select Games ");
            link.Clicked += (s, e) =>
            {
                App.MainWindow.ShowGameSelector();
            };

            AddChild(link, WidthRequest - 115, 12);
        }
예제 #19
0
        public Login()
        {
            var table = new Table ();
            var image = new ImageView {
                Image = Icons.UserInfo.WithBoxSize (96),
            };
            userEntry = new TextEntry {
                PlaceholderText = Catalog.GetString ("User"),
            };
            passwordEntry = new PasswordEntry {
                PlaceholderText = Catalog.GetString ("Password"),
            };
            var userLabel = new Label {
                Text = Catalog.GetString ("User"),
                TextAlignment = Alignment.Center,
            };
            var passwordLabel = new Label {
                Text = Catalog.GetString ("Password"),
                TextAlignment = Alignment.Center,
            };
            info = new Label {
                TextAlignment = Alignment.Center,
                TextColor = new Color (1, 0, 0),
                Visible = false,
            };
            userEntry.Activated += delegate {
                passwordEntry.SetFocus ();
            };
            passwordEntry.Activated += OnAutenticate;

            table.Add (image, 0, 0, 4);
            table.Add (userLabel, 1, 0);
            table.Add (userEntry, 1, 1);
            table.Add (passwordLabel, 1, 2);
            table.Add (passwordEntry, 1, 3);
            table.Add (info, 0, 4, colspan: 2);

            Content = table;

            userEntry.SetFocus ();
            Resizable = false;
            ShowInTaskbar = false;
            Title = Catalog.GetString ("Login");
            Icon = Image.FromResource (GetType (), Resources.Icon);
        }
예제 #20
0
        public ScaffolderWizard(DotNetProject project, FilePath parentFolder, ScaffolderTemplateSelectPage selectPage, ScaffolderArgs args) : base(GettextCatalog.GetString("Add New Scaffolding"), selectPage, args)
        {
            this.DefaultPageSize = new Size(500, 400);

            var rightSideImage  = new Xwt.ImageView(Image.FromResource("aspnet-wizard-page.png"));
            var rightSideWidget = new FrameBox(rightSideImage);

            rightSideWidget.BackgroundColor = Styles.Wizard.PageBackgroundColor;
            this.RightSideWidget            = new XwtControl(rightSideWidget);
            this.project      = project;
            this.parentFolder = parentFolder;
            this.args         = args;
            args.Project      = project;
            args.ParentFolder = parentFolder;

            this.Completed += (_, __) => Task.Run(() => OnCompletedAsync());
            selectPage.ScaffolderSelected -= ScaffolderSelected;
            selectPage.ScaffolderSelected += ScaffolderSelected;
        }
예제 #21
0
        public Welcome()
        {
            Assembly assembly = Assembly.GetEntryAssembly ();
            AssemblyName assemblyName = assembly.GetName ();
            Version version = assemblyName.Version;

            logo = new ImageView {
                Image = Image.FromResource (Resources.Logo),
            };

            primaryInfo = new Label {
                Text = string.Format (Catalog.GetString ("Welcome to {0}"), assemblyName.Name),
                TextAlignment = Alignment.Center,
                Font = Font.WithSize (15),
                MarginTop = 10,
            };
            secondaryInfo = new Label {
                Text = string.Format (Catalog.GetString ("Powered by {0}"), "Hamekoz"),
                TextAlignment = Alignment.Center,
                Font = Font.WithSize (11),
            };
            var versionLabel = new Label {
                Text = string.Format (Catalog.GetString ("Version {0}"), version),
                TextAlignment = Alignment.Center,
                MarginTop = 3,
            };
            errorInfo = new Label {
                TextColor = new Color (1, 0, 0),
                TextAlignment = Alignment.Center,
                MarginTop = 10,
            };
            PackStart (logo);
            PackStart (primaryInfo);
            PackStart (secondaryInfo);
            PackStart (versionLabel);
            PackStart (errorInfo);

            VerticalPlacement = WidgetPlacement.Center;
            HorizontalPlacement = WidgetPlacement.Center;
            ExpandHorizontal = true;
            ExpandVertical = true;
        }
예제 #22
0
        public Images()
        {
            ImageView img = new ImageView ();
            img.Image = Image.FromResource (GetType (), "cow.jpg");
            PackStart (img);

            var stockIcons = typeof (StockIcons).GetFields (BindingFlags.Public | BindingFlags.Static);
            var perRow = 6;

            HBox row = null;
            for (var i = 0; i < stockIcons.Length; i++) {
                if (stockIcons [i].FieldType != typeof (string))
                    continue;

                if ((i % perRow) == 0) {
                    if (row != null)
                        PackStart (row);
                    row = new HBox ();
                }

                var vbox = new VBox ();

                var stockId = (string)stockIcons [i].GetValue (null);
                var imageView = new ImageView ();
                var label = new Label (stockId);

                try {
                    var icon = Image.FromIcon (stockId, IconSize.Medium);
                    if (icon != null)
                        imageView.Image = icon;
                } catch { }

                vbox.PackStart (imageView);
                vbox.PackEnd (label);

                row.PackStart (vbox);
            }
            if (row != null)
                PackStart (row);
        }
예제 #23
0
        public LicensesWindow()
        {
            Icon = App.Icon;

            var vbox = new VBox();
            var scroll = new ScrollView(vbox);
            Content = scroll;

            Width = 600;
            Height = 500;

            Title = "Licenses";

            Font labelFont;
            RichTextView rtv;

            // XWT FRAMEWORK
            var lbl = new LinkLabel() { Text = "Xwt Framework", Uri = new Uri("https://github.com/mono/xwt/") };
            labelFont = lbl.Font = lbl.Font.WithScaledSize(2);
            vbox.PackStart(lbl);
            vbox.PackStart(rtv = new RichTextView() { MarginLeft = 8 });
            rtv.LoadText(@"The MIT License (MIT)

            Copyright (c) 2014 Xamarin, Inc

            Permission is hereby granted, free of charge, to any person obtaining a copy
            of this software and associated documentation files (the ""Software""), to deal
            in the Software without restriction, including without limitation the rights
            to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
            copies of the Software, and to permit persons to whom the Software is
            furnished to do so, subject to the following conditions:

            The above copyright notice and this permission notice shall be included in all
            copies or substantial portions of the Software.

            THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
            IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
            FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
            AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
            LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
            OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
            SOFTWARE.", ProperPlainTextFormat.Proper);

            //vbox.PackStart(new LinkLabel() { Font = labelFont, Text = "Splashy Icons", Uri = new Uri("http://splashyfish.com/icons/") });
            //vbox.PackStart(rtv = new RichTextView() { MarginLeft = 8 });
            //rtv.LoadText(@"It's free as in free.", ProperPlainTextFormat.Proper);

            //            vbox.PackStart(new LinkLabel() { Font = labelFont, Text = "DefaultIcon", Uri = new Uri("http://www.defaulticon.com/") });
            //            vbox.PackStart(rtv = new RichTextView() { MarginLeft = 8 });
            //            rtv.LoadText(@"Released under ""Creative Commons Attribution-No Derivative Works 3.0.""
            //No changes where made to the images.", ProperPlainTextFormat.Proper);
            //
            //            vbox.PackStart(new LinkLabel(){ MarginLeft = 14, Text="http://creativecommons.org/licenses/by-nd/3.0/", Uri = new Uri("http://creativecommons.org/licenses/by-nd/3.0/")});
            //            vbox.PackStart(new LinkLabel() { MarginLeft = 14, Text = "http://creativecommons.org/licenses/by-nd/3.0/legalcode", Uri = new Uri("http://creativecommons.org/licenses/by-nd/3.0/legalcode") });

            vbox.PackStart(new LinkLabel() { Font = labelFont, Text = "ZipStorer", Uri = new Uri("http://zipstorer.codeplex.com/") });
            vbox.PackStart(rtv = new RichTextView() { MarginLeft = 8 });
            rtv.LoadText(@"The code/library supplied is totally free for either personal or commercial use, with no warranties.
            Please use the ""Powered by ZipStorer"" logo (below) wherever is possible, pointing to this site.", ProperPlainTextFormat.Proper);
            ImageView imgView;
            vbox.PackStart(imgView = new ImageView(Resources.GetImage("zipstorer.png")));
        }
			public ImageViewWithTooltip (Xwt.Drawing.Image icon)
			{
				this.icon = icon;
				image = new Xwt.ImageView (icon);
				this.Content = image;

				MouseEntered += HandleEnterNotifyEvent;
				MouseExited += HandleLeaveNotifyEvent;
			}
예제 #25
0
        /// <summary>
        /// Set variable.
        /// </summary>
        void VariableButton_Clicked(object sender, EventArgs e)
        {
            // Test if variables are ready
            if (ParentList.ActiveScenario.customVariables.Count == 0)
            {
                MessageDialog.ShowError(Director.Properties.Resources.NoVariablesFound);
                return;
            }

            // Create Dialog window
            var expressionDialog = new Dialog()
            {
                InitialLocation = WindowLocation.CenterParent,
                Width = 370,
                Resizable = false
            };

            // Set Title
            expressionDialog.Title = Director.Properties.Resources.HeaderSettings;

            // Prepare content
            VBox t = new VBox()
            {
                ExpandHorizontal = true,
                ExpandVertical = true
            };

            // Text before
            TextBefore = new TextEntry();
            t.PackStart(new Label(Director.Properties.Resources.TextBefore + ":"));
            t.PackStart(TextBefore, false, true);

            // Variable
            Variables = new ComboBox();
            t.PackStart(new Label(Director.Properties.Resources.Variable + ":"));
            Variables.Items.Add("");
            foreach (String k in ParentList.ActiveScenario.customVariables.Keys)
                Variables.Items.Add(k);
            t.PackStart(Variables, false, true);

            // Text after
            TextAfter = new TextEntry();
            t.PackStart(new Label(Director.Properties.Resources.TextAfter + ":"));
            t.PackStart(TextAfter, false, true);

            // Example
            Example = new Label();
            t.PackStart(new Label(Director.Properties.Resources.Example + ":"));
            t.PackStart(Example, false, true);

            // Expression solver split by $$
            String value = ActiveHeader.Value;
            var arr = value.Split('$');

            if (arr.Length == 1)
            {
                TextBefore.Text = arr[0];
                Variables.SelectedIndex = 0;
                TextAfter.Text = "";
            }
            else if (arr.Length == 3)
            {
                TextBefore.Text = arr[0];
                TextAfter.Text = arr[2];
                try
                {
                    Variables.SelectedText = arr[1];
                }
                catch
                {
                    TextBefore.Text = value;
                    TextAfter.Text = "";
                    Variables.SelectedIndex = 0;
                }
            }
            else
            {
                TextBefore.Text = value;
                TextAfter.Text = "";
                Variables.SelectedIndex = 0;
            }
            Example.Text = value;

            // Set hooks
            TextBefore.Changed += ExpressionSolver;
            TextAfter.Changed += ExpressionSolver;
            Variables.SelectionChanged += ExpressionSolver;

            // Image
            HBox ContentBox = new HBox()
            {
                ExpandHorizontal = true,
                ExpandVertical = true
            };

            // Image view
            ImageView ImageIcon = new ImageView(Image.FromResource(DirectorImages.HEADER_EDIT_IMAGE))
            {
                WidthRequest = 32, HeightRequest = 32,
                Margin = 20
            };
            ContentBox.PackStart(ImageIcon, false, false);
            ContentBox.PackStart(t, true, true);

            // Set content
            expressionDialog.Content = ContentBox;

            // Prepare buttons
            expressionDialog.Buttons.Add(new DialogButton(Director.Properties.Resources.OkComand, Command.Ok));
            expressionDialog.Buttons.Add(new DialogButton(Director.Properties.Resources.Cancel, Command.Cancel));

            // Run?
            var result = expressionDialog.Run(this.ParentList.ParentWindow);

            if (result == Command.Ok)
                Values.Text = ActiveHeader.Value = Example.Text;

            // Dispose dialog
            expressionDialog.Dispose();
        }
예제 #26
0
        public HudsTFWidget(string title, string creator, string imgUrl, string hudstfUrl, string download, string website)
        {
            var downloadLower = download.ToLower();

            AddChild(ImageView = new ImageView() { WidthRequest = ImageSize.Width, HeightRequest = ImageSize.Height }, new Rectangle(1, 1, ImageSize.Width, ImageSize.Height));
            AddChild(titleLabel = new Label(title + " by " + creator) { TextColor = Colors.White }, new Rectangle(4, 0, ImageSize.Width, 40));

            titleLabel.Font = titleLabel.Font.WithScaledSize(1.5);
            titleLabel.WidthRequest = ImageSize.Width;
            titleLabel.HeightRequest = 40;
            titleLabel.QueueForReallocate();

            WidthRequest = ImageSize.Width + 2;
            HeightRequest = ImageSize.Height + 39;

            if (hudstfUrl != null)
            {
                hudstfButton = new ImageButton(57, 16, HudsTfLogo);
                hudstfButton.Click += (s, e) => { Desktop.OpenUrl(hudstfUrl); };

                AddChild(hudstfButton, ImageSize.Width - 64, ImageSize.Height + 11);
                //AddChild(hudstfButton, ImageSize.Width - 61, 24);
            }

            if (website != null)
            {
                websiteButton = new ImageButton(16, 16, QuadImageLinkButton.DefaultImage);
                websiteButton.Click += (s, e) => { Desktop.OpenUrl(website); };

                AddChild(websiteButton, ImageSize.Width - 84, ImageSize.Height + 11);
                //AddChild(websiteButton, ImageSize.Width - 81, 24);
            }

            bool hasDirectDownload = true;
            string zipLink = null;

            //string zipLink = download.Contains("github.com") || download.Contains("gitgud.net");
            if (downloadLower.Contains("github.com"))
                zipLink = download.TrimEnd('/') + "/archive/master.zip";
            else if (downloadLower.Contains("gitgud.net"))
                zipLink = download.TrimEnd('/') + "/repository/archive.zip";
            else
                hasDirectDownload = false;

            if (hasDirectDownload)
            {
                githubButton = new ImageButton(16, 16, GithubLogo);
                githubButton.Click += (s, e) => { Desktop.OpenUrl(download); };

                AddChild(githubButton, ImageSize.Width - 104, ImageSize.Height + 11);
            }

            dlButton = new Button();
            dlButton.Label = hasDirectDownload ? "Install" : "Get";
            dlButton.WidthRequest = 120;
            dlButton.HeightRequest = 24;
            //dlButton.Sensitive = downloadIsGithub;
            //https://gitgud.net/JediThug/jedihud/repository/archive.zip

            dlButton.Clicked += (s, e) =>
            {
                if (hasDirectDownload)
                {
                    DownloadHudWidget dl = new DownloadHudWidget("Fetching " + zipLink);

                    dl.DownloadFinished += (s2, e2) =>
                    {
                        try
                        {
                            if (!App.InstallZip(new MemoryStream(e2.Result), title))
                                MessageDialog.ShowError("Installing the Hud failed", "You can try to install it yourself.");
                        }
                        catch { }
                        Application.Invoke(() => { App.MainWindow.RemovePlugin(dl); });//App.MainWindow.Layout.RemoveChild(this));
                        Dispose();
                    };

                    dl.Download(zipLink);

                    App.MainWindow.Present();
                    System.Threading.Thread.Sleep(50);
                    App.MainWindow.Layout.AddChild(dl);
                }
                else
                {
                    Desktop.OpenUrl(download);
                }
            };

            AddChild(dlButton, 7, ImageSize.Height + 7);
            //AddChild(dlButton, 4, 20);

            Margin = new WidgetSpacing(4,4,4,4);

            //OnMouseExited(null);
        }
예제 #27
0
        private void InitializeUI(BaseScan scan, Image thumbnail)
        {
            mScan = scan;

            Icon = thumbnail;
            Title = scan.Name;

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

            Font fontH1 = Font.SystemFont.WithStyle(FontStyle.Oblique).WithSize(16);
            Font fontH2 = fontH1.WithStyle(FontStyle.Normal).WithSize(12);

            VBox mainLayout = new VBox();
            Content = mainLayout;

            HBox overviewLayout = new HBox();
            VBox overviewDataLayout = new VBox();

            ImageView thumbnailView = new ImageView(thumbnail.WithBoxSize(96));
            nameEntryUnedited.Text = scan.Name;
            nameEntryUnedited.Font = fontH1;

            fiberTypeEntryUnedited.Text = scan.FiberType;
            fiberTypeEntryUnedited.Font = fontH2;

            nameEntry.Text = scan.Name;
            nameEntry.Visible = false;
            nameEntry.Font = fontH1;

            fiberTypeEntry.Text = scan.FiberType;
            fiberTypeEntry.Visible = false;
            fiberTypeEntry.Font = fontH2;

            overviewDataLayout.MarginTop = 4;
            overviewDataLayout.MarginLeft = 4;
            overviewDataLayout.PackStart(nameEntryUnedited);
            overviewDataLayout.PackStart(nameEntry);
            overviewDataLayout.PackStart(fiberTypeEntryUnedited);
            overviewDataLayout.PackStart(fiberTypeEntry);

            overviewLayout.PackStart(thumbnailView);
            overviewLayout.PackStart(overviewDataLayout, true, true);

            MetadataView mView = new MetadataView();
            mView.Load(scan);

            ScrollView mViewScroller = new ScrollView { Content = mView, BorderVisible = false };

            mainLayout.PackStart(overviewLayout);
            mainLayout.PackStart(mViewScroller, true, true);
        }
예제 #28
0
        public ClipboardSample()
        {
            HBox box = new HBox ();
            var source = new TextEntry ();
            box.PackStart (source);
            Button b = new Button ("Copy");
            box.PackStart (b);
            b.Clicked += delegate {
                Clipboard.SetText (source.Text);
            };
            PackStart (box);

            box = new HBox ();
            var dest = new TextEntry ();
            box.PackStart (dest);
            b = new Button ("Paste");
            box.PackStart (b);
            b.Clicked += delegate {
                dest.Text = Clipboard.GetText ();
            };
            PackStart (box);
            PackStart (new HSeparator ());

            box = new HBox ();
            b = new Button ("Copy complex object");
            box.PackStart (b);
            int n = 0;
            b.Clicked += delegate {
                Clipboard.SetData (new ComplexObject () { Data = "Hello world " + (++n) });
            };
            PackStart (box);

            box = new HBox ();
            var destComplex = new TextEntry ();
            box.PackStart (destComplex);
            b = new Button ("Paste complex object");
            box.PackStart (b);
            b.Clicked += delegate {
                ComplexObject ob = Clipboard.GetData<ComplexObject> ();
                if (ob != null)
                    destComplex.Text = ob.Data;
                else
                    destComplex.Text = "Data not found";
            };
            PackStart (box);
            PackStart (new HSeparator ());

            var destImage = new ImageView (Image.FromResource (GetType (), "cow.jpg"));
            box = new HBox ();
            b = new Button ("Copy Image");
            box.PackStart (b);
            b.Clicked += delegate {
                Clipboard.SetData (TransferDataType.Image, destImage.Image);
            };
            b = new Button ("Paste Image");
            box.PackStart (b);
            b.Clicked += delegate {
                Image img = Clipboard.GetImage ();
                if (img != null)
                    destImage.Image = img;
            };
            PackStart (box);

            box = new HBox ();
            box.PackStart (destImage);
            PackStart (box);
        }
예제 #29
0
		void Build ()
		{
			Title = Catalog.GetString ("Add Packages");
			Width = 820;
			Height = 520;
			Padding = new WidgetSpacing ();

			// Top part of dialog:
			// Package sources and search.
			var topHBox = new HBox ();
			topHBox.Margin = new WidgetSpacing (8, 5, 6, 5);

			packageSourceComboBox = new ComboBox ();
			packageSourceComboBox.MinWidth = 200;
			topHBox.PackStart (packageSourceComboBox);

			packageSearchEntry = new SearchTextEntry ();
			packageSearchEntry.WidthRequest = 187;
			topHBox.PackEnd (packageSearchEntry);

			this.HeaderContent = topHBox;

			// Middle of dialog:
			// Packages and package information.
			var mainVBox = new VBox ();
			Content = mainVBox;

			var middleHBox = new HBox ();
			middleHBox.Spacing = 0;
			var middleFrame = new FrameBox ();
			middleFrame.Content = middleHBox;
			middleFrame.BorderWidth = new WidgetSpacing (0, 0, 0, 1);
			middleFrame.BorderColor = lineBorderColor;
			mainVBox.PackStart (middleFrame, true, true);

			// Error information.
			var packagesListVBox = new VBox ();
			packagesListVBox.Spacing = 0;
			errorMessageHBox = new HBox ();
			errorMessageHBox.Margin = new WidgetSpacing ();
			errorMessageHBox.BackgroundColor = Colors.Orange;
			errorMessageHBox.Visible = false;
			var errorImage = new ImageView ();
			errorImage.Margin = new WidgetSpacing (10, 0, 0, 0);
			errorImage.Image = ImageService.GetIcon (Stock.Warning, Gtk.IconSize.Menu);
			errorImage.HorizontalPlacement = WidgetPlacement.End;
			errorMessageHBox.PackStart (errorImage);
			errorMessageLabel = new Label ();
			errorMessageLabel.TextColor = Colors.White;
			errorMessageLabel.Margin = new WidgetSpacing (5, 5, 5, 5);
			errorMessageLabel.Wrap = WrapMode.Word;
			errorMessageHBox.PackStart (errorMessageLabel, true);
			packagesListVBox.PackStart (errorMessageHBox);

			// Packages list.
			middleHBox.PackStart (packagesListVBox, true, true);
			packagesListView = new ListView ();
			packagesListView.BorderVisible = false;
			packagesListView.HeadersVisible = false;
			packagesListVBox.PackStart (packagesListView, true, true);

			// Loading spinner.
			var loadingSpinnerHBox = new HBox ();
			loadingSpinnerHBox.HorizontalPlacement = WidgetPlacement.Center;
			var loadingSpinner = new Spinner ();
			loadingSpinner.Animate = true;
			loadingSpinner.MinWidth = 20;
			loadingSpinnerHBox.PackStart (loadingSpinner);

			loadingSpinnerLabel = new Label ();
			loadingSpinnerLabel.Text = Catalog.GetString ("Loading package list...");
			loadingSpinnerHBox.PackEnd (loadingSpinnerLabel);

			loadingSpinnerFrame = new FrameBox ();
			loadingSpinnerFrame.Visible = false;
			loadingSpinnerFrame.BackgroundColor = Colors.White;
			loadingSpinnerFrame.Content = loadingSpinnerHBox;
			loadingSpinnerFrame.BorderWidth = new WidgetSpacing ();
			packagesListVBox.PackStart (loadingSpinnerFrame, true, true);

			// No packages found label.
			var noPackagesFoundHBox = new HBox ();
			noPackagesFoundHBox.HorizontalPlacement = WidgetPlacement.Center;

			var noPackagesFoundLabel = new Label ();
			noPackagesFoundLabel.Text = Catalog.GetString ("No matching packages found.");
			noPackagesFoundHBox.PackEnd (noPackagesFoundLabel);

			noPackagesFoundFrame = new FrameBox ();
			noPackagesFoundFrame.Visible = false;
			noPackagesFoundFrame.BackgroundColor = Colors.White;
			noPackagesFoundFrame.Content = noPackagesFoundHBox;
			noPackagesFoundFrame.BorderWidth = new WidgetSpacing ();
			packagesListVBox.PackStart (noPackagesFoundFrame, true, true);

			// Package information
			packageInfoVBox = new VBox ();
			var packageInfoFrame = new FrameBox ();
			packageInfoFrame.BackgroundColor = packageInfoBackgroundColor;
			packageInfoFrame.BorderWidth = new WidgetSpacing ();
			packageInfoFrame.Content = packageInfoVBox;
			packageInfoVBox.Margin = new WidgetSpacing (15, 12, 15, 12);
			var packageInfoContainerVBox = new VBox ();
			packageInfoContainerVBox.WidthRequest = 240;
			packageInfoContainerVBox.PackStart (packageInfoFrame, true, true);

			var packageInfoScrollView = new ScrollView ();
			packageInfoScrollView.BorderVisible = false;
			packageInfoScrollView.HorizontalScrollPolicy = ScrollPolicy.Never;
			packageInfoScrollView.Content = packageInfoContainerVBox;
			packageInfoScrollView.BackgroundColor = packageInfoBackgroundColor;
			var packageInfoScrollViewFrame = new FrameBox ();
			packageInfoScrollViewFrame.BackgroundColor = packageInfoBackgroundColor;
			packageInfoScrollViewFrame.BorderWidth = new WidgetSpacing (1, 0, 0, 0);
			packageInfoScrollViewFrame.BorderColor = lineBorderColor;
			packageInfoScrollViewFrame.Content = packageInfoScrollView;
			middleHBox.PackEnd (packageInfoScrollViewFrame);

			// Package name and version.
			var packageNameHBox = new HBox ();
			packageInfoVBox.PackStart (packageNameHBox);

			packageNameLabel = new Label ();
			packageNameLabel.Ellipsize = EllipsizeMode.End;
			Font packageInfoSmallFont = packageNameLabel.Font.WithScaledSize (0.8);
			packageNameHBox.PackStart (packageNameLabel, true);

			packageVersionLabel = new Label ();
			packageVersionLabel.TextAlignment = Alignment.End;
			packageNameHBox.PackEnd (packageVersionLabel);

			// Package description.
			packageDescription = new Label ();
			packageDescription.Wrap = WrapMode.Word;
			packageDescription.Font = packageNameLabel.Font.WithScaledSize (0.9);
			packageDescription.BackgroundColor = packageInfoBackgroundColor;
			packageInfoVBox.PackStart (packageDescription);

			// Package id.
			var packageIdHBox = new HBox ();
			packageIdHBox.MarginTop = 7;
			packageInfoVBox.PackStart (packageIdHBox);

			var packageIdLabel = new Label ();
			packageIdLabel.Font = packageInfoSmallFont;
			packageIdLabel.Markup = Catalog.GetString ("<b>Id</b>");
			packageIdHBox.PackStart (packageIdLabel);

			packageId = new Label ();
			packageId.Ellipsize = EllipsizeMode.End;
			packageId.TextAlignment = Alignment.End;
			packageId.Font = packageInfoSmallFont;
			packageIdLink = new LinkLabel ();
			packageIdLink.Ellipsize = EllipsizeMode.End;
			packageIdLink.TextAlignment = Alignment.End;
			packageIdLink.Font = packageInfoSmallFont;
			packageIdHBox.PackEnd (packageIdLink, true);
			packageIdHBox.PackEnd (packageId, true);

			// Package author
			var packageAuthorHBox = new HBox ();
			packageInfoVBox.PackStart (packageAuthorHBox);

			var packageAuthorLabel = new Label ();
			packageAuthorLabel.Markup = Catalog.GetString ("<b>Author</b>");
			packageAuthorLabel.Font = packageInfoSmallFont;
			packageAuthorHBox.PackStart (packageAuthorLabel);

			packageAuthor = new Label ();
			packageAuthor.TextAlignment = Alignment.End;
			packageAuthor.Ellipsize = EllipsizeMode.End;
			packageAuthor.Font = packageInfoSmallFont;
			packageAuthorHBox.PackEnd (packageAuthor, true);

			// Package published
			var packagePublishedHBox = new HBox ();
			packageInfoVBox.PackStart (packagePublishedHBox);

			var packagePublishedLabel = new Label ();
			packagePublishedLabel.Markup = Catalog.GetString ("<b>Published</b>");
			packagePublishedLabel.Font = packageInfoSmallFont;
			packagePublishedHBox.PackStart (packagePublishedLabel);

			packagePublishedDate = new Label ();
			packagePublishedDate.Font = packageInfoSmallFont;
			packagePublishedHBox.PackEnd (packagePublishedDate);

			// Package downloads
			var packageDownloadsHBox = new HBox ();
			packageInfoVBox.PackStart (packageDownloadsHBox);

			var packageDownloadsLabel = new Label ();
			packageDownloadsLabel.Markup = Catalog.GetString ("<b>Downloads</b>");
			packageDownloadsLabel.Font = packageInfoSmallFont;
			packageDownloadsHBox.PackStart (packageDownloadsLabel);

			packageDownloads = new Label ();
			packageDownloads.Font = packageInfoSmallFont;
			packageDownloadsHBox.PackEnd (packageDownloads);

			// Package license.
			var packageLicenseHBox = new HBox ();
			packageInfoVBox.PackStart (packageLicenseHBox);

			var packageLicenseLabel = new Label ();
			packageLicenseLabel.Markup = Catalog.GetString ("<b>License</b>");
			packageLicenseLabel.Font = packageInfoSmallFont;
			packageLicenseHBox.PackStart (packageLicenseLabel);

			packageLicenseLink = new LinkLabel ();
			packageLicenseLink.Text = Catalog.GetString ("View License");
			packageLicenseLink.Font = packageInfoSmallFont;
			packageLicenseHBox.PackEnd (packageLicenseLink);

			// Package project page.
			var packageProjectPageHBox = new HBox ();
			packageInfoVBox.PackStart (packageProjectPageHBox);

			var packageProjectPageLabel = new Label ();
			packageProjectPageLabel.Markup = Catalog.GetString ("<b>Project Page</b>");
			packageProjectPageLabel.Font = packageInfoSmallFont;
			packageProjectPageHBox.PackStart (packageProjectPageLabel);

			packageProjectPageLink = new LinkLabel ();
			packageProjectPageLink.Text = Catalog.GetString ("Visit Page");
			packageProjectPageLink.Font = packageInfoSmallFont;
			packageProjectPageHBox.PackEnd (packageProjectPageLink);

			// Package dependencies
			var packageDependenciesHBox = new HBox ();
			packageInfoVBox.PackStart (packageDependenciesHBox);

			var packageDependenciesLabel = new Label ();
			packageDependenciesLabel.Markup = Catalog.GetString ("<b>Dependencies</b>");
			packageDependenciesLabel.Font = packageInfoSmallFont;
			packageDependenciesHBox.PackStart (packageDependenciesLabel);

			packageDependenciesNoneLabel = new Label ();
			packageDependenciesNoneLabel.Text = Catalog.GetString ("None");
			packageDependenciesNoneLabel.Font = packageInfoSmallFont;
			packageDependenciesHBox.PackEnd (packageDependenciesNoneLabel);

			// Package dependencies list.
			packageDependenciesListHBox = new HBox ();
			packageDependenciesListHBox.Visible = false;
			packageInfoVBox.PackStart (packageDependenciesListHBox);

			packageDependenciesList = new Label ();
			packageDependenciesList.Wrap = WrapMode.WordAndCharacter;
			packageDependenciesList.Margin = new WidgetSpacing (5);
			packageDependenciesList.Font = packageInfoSmallFont;
			packageDependenciesListHBox.PackStart (packageDependenciesList, true);

			// Bottom part of dialog:
			// Show pre-release packages and Close/Add to Project buttons.
			var bottomHBox = new HBox ();
			bottomHBox.Margin = new WidgetSpacing (8, 5, 14, 10);
			bottomHBox.Spacing = 5;
			mainVBox.PackStart (bottomHBox);

			showPrereleaseCheckBox = new CheckBox ();
			showPrereleaseCheckBox.Label = Catalog.GetString ("Show pre-release packages");
			bottomHBox.PackStart (showPrereleaseCheckBox);

			addPackagesButton = new Button ();
			addPackagesButton.MinWidth = 120;
			addPackagesButton.MinHeight = 25;
			addPackagesButton.Label = Catalog.GetString ("Add Package");
			bottomHBox.PackEnd (addPackagesButton);

			var closeButton = new Button ();
			closeButton.MinWidth = 120;
			closeButton.MinHeight = 25;
			closeButton.Label = Catalog.GetString ("Close");
			closeButton.Clicked += (sender, e) => Close ();
			bottomHBox.PackEnd (closeButton);

			packageSearchEntry.SetFocus ();
			packageInfoVBox.Visible = false;
		}
예제 #30
0
        public About()
        {
            logo = new ImageView {
                Image = Image.FromResource (Resources.Logo),
            };

            companyName = new Label {
                Text = "Hamekoz",
                TextAlignment = Alignment.Center,
                MarginTop = 10,
            };

            copyRight = new Label {
                Text = "Copyright: Hamekoz",
                TextAlignment = Alignment.Center,
                MarginTop = 10,
            };

            var aboutVBox = new VBox ();
            var aboutHBox = new HBox ();

            aboutHBox.PackStart (credits, true);
            aboutHBox.PackStart (license, true);
            aboutHBox.PackStart (close, true);

            creditsScroll.Content = creditsText;
            licenseScroll.Content = licenseText;
            panel.Panel1.Content = copyRight;
            aboutVBox.PackStart (logo);
            aboutVBox.PackStart (companyName);
            aboutVBox.PackStart (panel);
            aboutVBox.PackStart (aboutHBox);

            credits.Clicked += delegate {
                if (credits.Active) {
                    panel.Panel1.Content = creditsScroll;
                    license.Active = !credits.Active;
                }
                BothButtons ();
            };

            license.Clicked += delegate {
                if (license.Active) {
                    panel.Panel1.Content = licenseScroll;
                    credits.Active = !license.Active;
                }
                BothButtons ();
            };

            close.Clicked += delegate {
                Close ();
            };

            Icon = Image.FromResource (Resources.Icon);
            Content = aboutVBox;
            Width = 300;
        }
예제 #31
0
        /// <summary>
        /// Initializes the control bars.
        /// </summary>
        void InitializeControllerbar()
        {
            HBox controllbar = new HBox();
            controllbar.Spacing = 0;

            playButton = new ControllButton(Image.FromResource("Baimp.Resources.icoExecute-Normal.png"));
            playButton.Size = new Size(24, 24);
            playButton.TooltipText = "Execute pipeline";

            playButton.ButtonPressed += delegate {
                if (currentPipeline.Execute(project)) {
                    playButton.Disable();
                    stopButton.Enable();
                }
            };

            stopButton = new ControllButton(Image.FromResource("Baimp.Resources.icoStop-Normal.png"));
            stopButton.Size = playButton.Size;
            stopButton.TooltipText = "Stop pipeline execution";
            stopButton.ButtonPressed += delegate {
                currentPipeline.StopExecution();
                stopButton.Disable();
            };

            playStopButtonPlacement = new FrameBox();
            playStopButtonPlacement.Content = playButton;

            controllbar.PackStart(
                playStopButtonPlacement, false, WidgetPlacement.Center, WidgetPlacement.Center, 8);

            // tab bar
            tabHost = new CustomTabHost();
            tabHost.Closeable = true;
            tabHost.HeightRequest = 24;

            tabHost.TabClose += OnTabClose;

            controllbar.PackStart(tabHost, false, WidgetPlacement.End, WidgetPlacement.Start);

            // tab add worksheet
            ImageView addWorksheet = new ImageView();
            addWorksheet.Image = Image.FromResource("Baimp.Resources.btAdd.png").WithBoxSize(14);
            addWorksheet.MouseEntered += delegate {
                addWorksheet.Image = addWorksheet.Image.WithAlpha(0.8);
            };
            addWorksheet.MouseExited += delegate {
                addWorksheet.Image = addWorksheet.Image.WithAlpha(1.0);
            };
            addWorksheet.ButtonPressed += OnWorksheetAdd;

            controllbar.PackStart(addWorksheet, false, WidgetPlacement.Center, WidgetPlacement.Start);

            splitControllTab_pipelineScroller = new VBox();
            splitControllTab_pipelineScroller.Spacing = 0;
            splitControllTab_pipelineScroller.PackStart(controllbar, false, margin: 0.0);

            ReloadProjectMap();
        }
		public ConfigurationSectionWidget (IConfigurationSection section)
		{
			if (section == null)
				throw new ArgumentNullException (nameof (section));
			if (section.Service == null)
				throw new InvalidOperationException ("The service of a section is null");
			Section = section;
			Service = section.Service;

			BackgroundColor = Styles.BackgroundColor;
			InnerBackgroundColor = Styles.BaseBackgroundColor;
			BorderWidth = 0;
			Padding = new WidgetSpacing (15, 4, 15, 5);

			header = new HBox ();

			header.Spacing = 7;
			header.MarginLeft = 0;
			header.MarginRight = 15;
			header.MinHeight = 36;

			expanderImage = new ImageView (arrowRight);

			titleLabel = new Label { Text = this.Section.DisplayName };

			statusLabel = new Label (GettextCatalog.GetString ("Enabled"));
			statusLabel.TextColor = Styles.SecondaryTextColor;

			statusImage = new ImageView (ImageService.GetIcon ("md-checkmark").WithSize (IconSize.Small));

			statusBox = new HBox ();
			statusBox.MarginLeft = 10;
			statusBox.Spacing = 3;
			statusBox.PackStart (statusImage);
			statusBox.PackStart (statusLabel);

			var headerTitle = new HBox ();
			headerTitle.Spacing = 7;
			headerTitle.PackStart (expanderImage);
			headerTitle.PackStart (titleLabel);
			headerTitle.PackStart (statusBox);

			header.PackStart (headerTitle);

			addBtn = new Button (GettextCatalog.GetString ("Add to the project"));
			addBtn.MinWidth = 128;
			addBtn.MinHeight = 34;
			header.PackEnd (addBtn);
			addBtn.VerticalPlacement = WidgetPlacement.Center;
			addBtn.Clicked += this.AddBtnClicked;

			var container = new VBox ();
			sectionWidget = GetSectionWidget ();
			sectionWidget.MarginLeft = sectionWidget.MarginRight = 15;
			sectionWidget.MarginBottom = 20;
			sectionWidget.Visible = false;

			container.PackStart (header);
			container.PackStart (sectionWidget);

			Content = container;

			UpdateStatus ();
			Section.StatusChanged += HandleSectionStatusChanged;
			Service.StatusChanged += HandleServiceStatusChanged;
		}
예제 #33
0
파일: TScan.cs 프로젝트: jfreax/BAIMP
        public Widget ToWidget()
        {
            if (widget == null) {
                ImageView iv = new ImageView();

                if (scan != null) {
                    iv.Image = scan.GetAsImage(scanType, false, false);
                } // else TODO
                widget = iv;
            }

            return widget;
        }
예제 #34
0
        public ReferenceImageVerifierDialog()
        {
            Width  = 500;
            Height = 300;

            Table table = new Table();

            table.DefaultRowSpacing = table.DefaultColumnSpacing = 6;

            table.Add(nameLabel = new Label(), 0, 0, hexpand: true);
            table.Add(new Label("Reference Image"), 0, 1, hexpand: true);
            table.Add(new Label("Test Image"), 1, 1, hexpand: true);
            nameLabel.Font = nameLabel.Font.WithWeight(Xwt.Drawing.FontWeight.Bold);

            img1 = new ImageView();
            var frame = new FrameBox {
                Content     = img1,
                BorderColor = Xwt.Drawing.Colors.Gray,
                BorderWidth = 1
            };

            table.Add(frame, 0, 2, hexpand: true, vexpand: true, hpos: WidgetPlacement.Center, vpos: WidgetPlacement.Center);

            imgDiff = new ImageView();
            frame   = new FrameBox {
                Content     = imgDiff,
                BorderColor = Xwt.Drawing.Colors.Gray,
                BorderWidth = 1
            };
            table.Add(frame, 1, 2, hexpand: true, vexpand: true, hpos: WidgetPlacement.Center, vpos: WidgetPlacement.Center);

            img2  = new ImageView();
            frame = new FrameBox {
                Content     = img2,
                BorderColor = Xwt.Drawing.Colors.Gray,
                BorderWidth = 1
            };
            table.Add(frame, 2, 2, hexpand: true, vexpand: true, hpos: WidgetPlacement.Center, vpos: WidgetPlacement.Center);

            var buttonBox = new HBox();

            table.Add(buttonBox, 0, 3, colspan: 2, hexpand: true);

            closeButton = new Button("Close");
            validButton = new Button("Success");
            failButton  = new Button("Failure");

            buttonBox.PackEnd(closeButton);
            buttonBox.PackEnd(failButton);
            buttonBox.PackEnd(validButton);

            closeButton.Clicked += delegate {
                Respond(Command.Ok);
            };

            failButton.Clicked += delegate {
                var info = ReferenceImageManager.ImageFailures[currentImage];
                info.Fail();
                ShowNextImage();
            };

            validButton.Clicked += delegate {
                var info = ReferenceImageManager.ImageFailures[currentImage];
                info.Validate();
                ShowNextImage();
            };

            Content = table;
            ShowNextImage();
        }
예제 #35
0
        void Init()
        {
            _mainBox = new VBox
            {
                BackgroundColor = MonoDevelop.Ide.Gui.Styles.BackgroundColor,
                HeightRequest   = 500,
                WidthRequest    = 800
            };

            _headerFrameBox = new RoundedFrameBox
            {
                CornerRadiusTopLeft     = 6,
                CornerRadiusTopRight    = 6,
                CornerRadiusBottomLeft  = 0,
                CornerRadiusBottomRight = 0,
                BorderBottom            = false,
                BorderWidth             = 2,
                InnerBackgroundColor    = Styles.BackgroundColor
            };

            _headerBox = new HBox
            {
                HeightRequest = 36
            };

            _feedBox = new ComboBox
            {
                WidthRequest = 200
            };

            _searchEntry = new SearchTextEntry
            {
                PlaceholderText = "Filter samples",
                HeightRequest   = 24,
                WidthRequest    = 200
            };

            _contentFrameBox = new RoundedFrameBox
            {
                CornerRadius         = 0,
                BorderWidth          = 2,
                InnerBackgroundColor = Styles.BackgroundColor,
                Margin = new WidgetSpacing(0, -6, 0, 0)
            };

            _contentBox = new HBox();

            _samplesView = new TreeView
            {
                BackgroundColor         = Styles.BackgroundColor,
                GridLinesVisible        = GridLines.None,
                HeadersVisible          = false,
                BorderVisible           = false,
                UseAlternatingRowColors = true,
                WidthRequest            = 200
            };

            _nameField   = new DataField <string>();
            _sampleField = new DataField <Sample>();

            _samplesStore = new TreeStore(_nameField, _sampleField);

            _descriptionBox = new VBox
            {
                WidthRequest = 300
            };

            _titleLabel = new Label("Title")
            {
                Font   = Font.SystemFont.WithScaledSize(1.25),
                Margin = new WidgetSpacing(0, 12, 0, 0)
            };

            _titleValueLabel = new Label();

            _descriptionLabel = new Label("Description")
            {
                Font   = Font.SystemFont.WithScaledSize(1.25),
                Margin = new WidgetSpacing(0, 12, 0, 0)
            };

            _descriptionValueLabel = new Label
            {
                Wrap         = WrapMode.Word,
                WidthRequest = 150
            };

            _platformsLabel = new Label("Platforms")
            {
                Font   = Font.SystemFont.WithScaledSize(1.25),
                Margin = new WidgetSpacing(0, 12, 0, 0)
            };

            _platformsBox = new VBox();

            _tagsLabel = new Label("Tags")
            {
                Font   = Font.SystemFont.WithScaledSize(1.25),
                Margin = new WidgetSpacing(0, 12, 0, 0)
            };

            _tagsBox = new HBox();

            _authorTitleLabel = new Label("Author")
            {
                Font   = Font.SystemFont.WithScaledSize(1.25),
                Margin = new WidgetSpacing(0, 12, 0, 0)
            };

            _authorLabel = new Label();

            _previewBox = new VBox
            {
                WidthRequest = 300
            };

            _previewView = new Xwt.ImageView
            {
                BackgroundColor     = Colors.Gray,
                HorizontalPlacement = WidgetPlacement.End,
                VerticalPlacement   = WidgetPlacement.Start,
                Margin = new WidgetSpacing(2, 2, 2, 2)
            };

            _loadingSpinner = new MDSpinner
            {
                Animate = true
            };

            _buttonBox = new HBox();

            _cancelButton = new Button("Cancel");

            _continueButton = new Button("Continue")
            {
                BackgroundColor = Styles.BaseSelectionBackgroundColor,
                LabelColor      = Styles.BaseSelectionTextColor
            };
        }
 protected virtual void PopulateViewBoxWithImage(VBox vBox, IAsset asset)
 {
     try
     {
         var image = asset.GetImage();
         if (image != null)
         {
             var imageView = new ImageView(image.ToXwtImage().WithSize(250));
             vBox.PackStart(imageView);
         }
     }
     catch (Exception e)
     {
         ObjectFactory.GetInstance<ILogger>().WriteException(e);
     }
 }
예제 #37
0
		void AddPackage (PackageLicenseViewModel package)
		{
			var titleBox = new VBox ();
			titleBox.Spacing = 0;
			titleBox.MarginBottom = 4;
			titleBox.PackStart (new Label {
				Markup = string.Format ("<span weight='bold'>{0}</span> – {1}", package.Id, package.Author),
			});
			var licenseLabel = new LinkLabel (GettextCatalog.GetString ("View License"));
			licenseLabel.Uri = package.LicenseUrl;
			licenseLabel.LinkClicked += (sender, e) => DesktopService.ShowUrl (e.Target.AbsoluteUri);
			titleBox.PackStart (licenseLabel);

			var rowBox = new HBox ();
			rowBox.Margin = rowMargin;

			var icon = new ImageView (ImageService.GetIcon ("md-package", Gtk.IconSize.Dnd));

			if (package.IconUrl != null && !string.IsNullOrEmpty (package.IconUrl.AbsoluteUri))
				imageLoader.LoadFrom (package.IconUrl, icon);

			rowBox.PackStart (icon);
			rowBox.PackStart (titleBox, true);

			packagesList.PackStart (rowBox);
		}
예제 #38
0
파일: Images.cs 프로젝트: joncham/xwt
 public Images()
 {
     ImageView img = new ImageView ();
     img.Image = Image.FromResource (GetType (), "cow.jpg");
     PackStart (img);
 }