Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
		public ListView1 ()
		{
			PackStart (new Label ("The listview should have a red background"));
			ListView list = new ListView ();
			list.GridLinesVisible = GridLines.Both;
			ListStore store = new ListStore (name, icon, text, icon2, progress);
			list.DataSource = store;
			list.Columns.Add ("Name", icon, name);
			list.Columns.Add ("Text", icon2, text);
			list.Columns.Add ("Progress", new TextCellView () { TextField = text }, new CustomCell () { ValueField = progress });

			var png = Image.FromResource (typeof(App), "class.png");

			Random rand = new Random ();
			
			for (int n=0; n<100; n++) {
				var r = store.AddRow ();
				store.SetValue (r, icon, png);
				store.SetValue (r, name, "Value " + n);
				store.SetValue (r, icon2, png);
				store.SetValue (r, text, "Text " + n);
				store.SetValue (r, progress, new CellData { Value = rand.Next () % 100 });
			}
			PackStart (list, true);

			list.RowActivated += delegate(object sender, ListViewRowEventArgs e) {
				MessageDialog.ShowMessage ("Row " + e.RowIndex + " activated");
			};

			Menu contextMenu = new Menu ();
			contextMenu.Items.Add (new MenuItem ("Test menu"));
			list.ButtonPressed += delegate(object sender, ButtonEventArgs e) {
				int row = list.GetRowAtPosition(new Point(e.X, e.Y));
				if (e.Button == PointerButton.Right && row >= 0) {
					// Set actual row to selected
					list.SelectRow(row);
					contextMenu.Popup(list, e.X, e.Y);
				}
			};

			var but = new Button ("Scroll one line");
			but.Clicked += delegate {
				list.VerticalScrollControl.Value += list.VerticalScrollControl.StepIncrement;
			};
			PackStart (but);

			var spnValue = new SpinButton ();
			spnValue.MinimumValue = 0;
			spnValue.MaximumValue = 99;
			spnValue.IncrementValue = 1;
			spnValue.Digits = 0;
			var btnScroll = new Button ("Go!");
			btnScroll.Clicked += (sender, e) => list.ScrollToRow((int)spnValue.Value);

			HBox scrollActBox = new HBox ();
			scrollActBox.PackStart (new Label("Scroll to Value: "));
			scrollActBox.PackStart (spnValue);
			scrollActBox.PackStart (btnScroll);
			PackStart (scrollActBox);
		}
Ejemplo n.º 3
0
        public MainWindow()
        {
            this.Examples = ExampleLibrary.Examples.GetList().OrderBy(e => e.Category).ToList();

            this.plotView = new PlotView();
            this.plotView.MinHeight = 554;
            this.plotView.MinWidth = 625;
            this.plotView.DefaultTrackerSettings.Enabled = true;
            this.plotView.DefaultTrackerSettings.Background = Xwt.Drawing.Colors.AliceBlue.WithAlpha (0.9).ToOxyColor();

            this.treeView = new TreeView();
            this.treeView.MinWidth = 314;
            this.treeView.Visible = true;

            var treeModel = new TreeStore(nameCol);
            TreePosition categoryNode = null;
            string categoryName = null;
            foreach (var ex in this.Examples)
            {
                if (categoryName == null || categoryName != ex.Category)
                {
                    categoryNode = treeModel.AddNode ().SetValue (nameCol, ex.Category).CurrentPosition;
                    categoryName = ex.Category;
                }

                treeModel.AddNode (categoryNode).SetValue (nameCol, ex.Title);
            }

            treeView.Columns.Add ("Example", nameCol);
            this.treeView.DataSource = treeModel;

            this.treeView.SelectionChanged += (s, e) =>
            {

                if (treeView.SelectedRow != null) {
                    var sample = treeModel.GetNavigatorAt (treeView.SelectedRow).GetValue (nameCol);

                    var info = this.Examples.FirstOrDefault(ex => ex.Title == sample);
                    if (info != null)
                    {
                        this.SelectedExample = info;
                    }
                }
            };

            var hbox = new HBox();
            hbox.Spacing = 6;
            hbox.MinHeight = 554;
            hbox.MinWidth = 943;

            hbox.PackStart(this.treeView);
            hbox.PackStart(this.plotView, true);

            Content = hbox;

            this.SelectedExample = this.Examples.FirstOrDefault();

            this.Title = "OxyPlot.Xwt Example Browser";
            this.CloseRequested += (s, a) => Application.Exit ();
        }
		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;
			}
		}
        public MainView(IPresenterFactory presenterFactory)
        {
            _notebook = presenterFactory.InstantiatePresenter<MainNotebook>();
            _notebook.Add(presenterFactory.InstantiatePresenter<MenuPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<ModsPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<BlueprintsPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<SavegamesPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<TasksPageView>(this));

            PackStart(presenterFactory.InstantiatePresenter<MainHeaderView>());

            var sideBox = new VBox
            {
                MinWidth = 280,
                WidthRequest = 280
            };

            _sidebarContainer = new SidebarContainer();
            sideBox.PackStart(_sidebarContainer, true, true);
            var box = new HBox();

            box.PackStart(_notebook, true);
            box.PackEnd(sideBox);

            PackStart(box, true, true);

            _notebook.HandleSizeChangeOnTabChange = true;
            _notebook.HandleSizeUpdate();
        }
		void IOptionsPanel.Initialize (OptionsDialog dialog, object dataObject)
		{
			this.ExpandHorizontal = true;
			this.ExpandVertical = true;
			this.HeightRequest = 400;
			list = new ListView ();
			store = new ListStore (language, completeOnSpace, completeOnChars);

			var languageColumn = list.Columns.Add (GettextCatalog.GetString ("Language"), language);
			languageColumn.CanResize = true;

			var checkBoxCellView = new CheckBoxCellView (completeOnSpace);
			checkBoxCellView.Editable = true;
			var completeOnSpaceColumn = list.Columns.Add (GettextCatalog.GetString ("Complete on space"), checkBoxCellView);
			completeOnSpaceColumn.CanResize = true;

			var textCellView = new TextCellView (completeOnChars);
			textCellView.Editable = true;
			var doNotCompleteOnColumn = list.Columns.Add (GettextCatalog.GetString ("Do complete on"), textCellView);
			doNotCompleteOnColumn.CanResize = true;
			list.DataSource = store;
			PackStart (list, true, true);

			var hbox = new HBox ();
			var button = new Button ("Reset to default");
			button.Clicked += delegate {
				FillStore (CompletionCharacters.GetDefaultCompletionCharacters ());
			};	
			hbox.PackEnd (button, false, false);
			PackEnd (hbox, false, true);
			FillStore (CompletionCharacters.GetCompletionCharacters ());
		}
        void BuildGui()
        {
            HBox topPanel = new HBox();
            topPanel.MarginTop = 5;
            VSeparator separator = new VSeparator();
            acceptYours.WidthRequest = acceptTheirs.WidthRequest = acceptMerge.WidthRequest = viewBase.WidthRequest = viewTheir.WidthRequest = 120;
            SetButtonSensitive();

            topPanel.PackStart(acceptYours);
            topPanel.PackStart(acceptTheirs);
            topPanel.PackStart(acceptMerge);
            topPanel.PackStart(separator);
            topPanel.PackStart(viewBase);
            topPanel.PackStart(viewTheir);
            
            topPanel.MinHeight = 30;
            view.PackStart(topPanel);
            listView.Columns.Add("Conflict Type", typeField);
            listView.Columns.Add("Item Name", nameField);
            listView.Columns.Add("Base Version", versionBaseField);
            listView.Columns.Add("Server Version", versionTheirField);
            listView.Columns.Add("Your Version", versionYourField);
            listView.DataSource = listStore;

            view.PackStart(listView, true, true);
            AttachEvents();
        }
Ejemplo n.º 8
0
		public MouseCursors ()
		{
			PackStart (new Label ("Move the mouse over the labels \nto see the cursors:"));
			var cursorTypes = typeof (CursorType).GetFields (BindingFlags.Public | BindingFlags.Static);
			var perRow = 6;

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

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

				var cursor = (CursorType)cursorTypes [i].GetValue (typeof(CursorType));
				var label = new Label (cursorTypes [i].Name);
				label.BackgroundColor = Colors.White;
				label.Cursor = cursor;

				row.PackStart (label);
			}
			if (row != null)
				PackStart (row);
		}
Ejemplo n.º 9
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;
        }
Ejemplo n.º 10
0
        public ReportViewer()
        {
            // Setup layout boxes
            vboxContents = new Xwt.VBox();
            vboxToolMenu = new Xwt.HBox();

            // Setup tool button menu
            Xwt.Button buttonExport = new Xwt.Button("Export");
            buttonExport.Clicked += delegate(object sender, EventArgs e)
            {
                SaveAs();
            };
            vboxToolMenu.PackStart(buttonExport);

            Xwt.Button buttonPrint = new Xwt.Button("Print");
            vboxToolMenu.PackStart(buttonPrint);

            // Add vboxContent widgets
            vboxPages = new Xwt.VBox();
            vboxContents.PackStart(vboxToolMenu);
            vboxContents.PackStart(vboxPages);


            // Setup Controls Contents
            scrollView         = new Xwt.ScrollView();
            scrollView.Content = vboxContents;
            scrollView.VerticalScrollPolicy = ScrollPolicy.Automatic;
            scrollView.BorderVisible        = true;
            this.PackStart(scrollView, true, true);

            Parameters = new ListDictionary();

            ShowErrors = false;
        }
Ejemplo n.º 11
0
        public TaskView(IQueueableTask task)
        {
            if (task == null) throw new ArgumentNullException(nameof(task));
            Task = task;
            task.StatusChanged += Task_StatusChanged;

            _nameLabel = new Label
            {
                Font = Font.SystemFont.WithWeight(FontWeight.Bold).WithSize(15)
            };
            _descriptionlabel = new Label
            {
                Font = Font.SystemFont.WithStyle(FontStyle.Italic)
            };

            _spinner = new Spinner {Visible = false};

            var hBox = new HBox();
            hBox.PackStart(_spinner);
            hBox.PackStart(_descriptionlabel);

            PackStart(_nameLabel);
            PackStart(hBox);

            HeightRequest = 64;
            MinHeight = 64;

            UpdateLabels();
        }
Ejemplo n.º 12
0
        public ReportViewer()
        {
            // Setup layout boxes
            vboxContents = new Xwt.VBox();
            vboxToolMenu = new Xwt.HBox();

            // Setup tool button menu
            Xwt.Button buttonExport = new Xwt.Button("Export");
            buttonExport.Clicked += delegate(object sender, EventArgs e) {
                SaveAs();
            };
            vboxToolMenu.PackStart(buttonExport);

            Xwt.Button buttonPrint = new Xwt.Button("Print");
            vboxToolMenu.PackStart(buttonPrint);

            // Add vboxContent widgets
            vboxPages = new Xwt.VBox();
            vboxContents.PackStart(vboxToolMenu);
            vboxContents.PackStart(vboxPages);

            // Setup Controls Contents
            scrollView = new Xwt.ScrollView();
            scrollView.Content = vboxContents;
            scrollView.VerticalScrollPolicy = ScrollPolicy.Automatic;
            scrollView.BorderVisible = true;
            this.PackStart(scrollView, BoxMode.FillAndExpand);

            Parameters = new ListDictionary();

            ShowErrors = false;
        }
Ejemplo n.º 13
0
        public DragDrop()
        {
            HBox box = new HBox ();

            SimpleBox b1 = new SimpleBox (30);
            box.PackStart (b1, BoxMode.None);

            b2 = new Button ("Drop here");
            box.PackEnd (b2, BoxMode.None);

            b1.ButtonPressed += delegate {
                var d = b1.CreateDragOperation ();
                d.Data.AddValue ("Hola");
                var img = Image.FromResource (GetType(), "class.png");
                d.SetDragImage (img, (int)img.Size.Width, (int)img.Size.Height);
                d.AllowedActions = DragDropAction.All;
                d.Start ();
            };

            b2.SetDragDropTarget (TransferDataType.Text, TransferDataType.Uri);
            PackStart (box);

            b2.DragDrop += HandleB2DragDrop;
            b2.DragOver += HandleB2DragOver;
        }
Ejemplo n.º 14
0
        public Tables()
        {
            Table t = new Table ();

            SimpleBox b = new SimpleBox (200, 20);
            t.Attach (b, 0, 1, 0, 1);

            b = new SimpleBox (5, 20);
            t.Attach (b, 1, 2, 0, 1);

            b = new SimpleBox (250, 20);
            t.Attach (b, 0, 2, 1, 2, AttachOptions.Expand, AttachOptions.Expand);

            b = new SimpleBox (300, 20);
            t.Attach (b, 1, 3, 2, 3);

            b = new SimpleBox (100, 20);
            t.Attach (b, 2, 3, 3, 4);

            b = new SimpleBox (450, 20);
            t.Attach (b, 0, 3, 4, 5);

            PackStart (t);

            HBox box = new HBox ();
            PackStart (box);
            t = new Table ();
            t.Attach (new Label ("One:"), 0, 1, 0, 1);
            t.Attach (new TextEntry (), 1, 2, 0, 1);
            t.Attach (new Label ("Two:"), 0, 1, 1, 2);
            t.Attach (new TextEntry (), 1, 2, 1, 2);
            t.Attach (new Label ("Three:"), 0, 1, 2, 3);
            t.Attach (new TextEntry (), 1, 2, 2, 3);
            box.PackStart (t);
        }
Ejemplo n.º 15
0
        static void Main(string[] args)
        {
#if GTK
            Application.Initialize(Xwt.ToolkitType.Gtk);
#else
            Application.Initialize(Xwt.ToolkitType.XamMac);
#endif
            var mainWindow = new MacXwtAccInspectorWindow();
            mainWindow.Width  = 1024;
            mainWindow.Height = 768;
            mainWindow.Title  = "Example Debug Xwt.Mac";
            var verticalBox = new Xwt.VBox();
            mainWindow.Content = verticalBox;

            var hbox = new Xwt.HBox();
            hbox.PackStart(new Xwt.Label("First"));
            hbox.PackStart(new Xwt.Label("Second"));
            hbox.PackStart(new Xwt.TextEntry()
            {
                Text = "Text1"
            });
            hbox.PackStart(new Xwt.Button()
            {
                Label = "Button1"
            });
            verticalBox.PackStart(hbox);

            mainWindow.Show();

            Application.Run();
            mainWindow.Dispose();
        }
Ejemplo n.º 16
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;
        }
        void BuildGui()
        {
            this.Title = GettextCatalog.GetString("Select Work Item");
            VBox content = new VBox();
            HBox mainBox = new HBox();
            queryView.Columns.Add(new ListViewColumn(string.Empty, new TextCellView(titleField)));
            queryView.DataSource = queryStore;
            queryView.WidthRequest = 200;
            BuildQueryView();
            mainBox.PackStart(queryView);

            workItemList.WidthRequest = 400;
            workItemList.HeightRequest = 400;
            workItemList.ShowCheckboxes = true;

            mainBox.PackStart(workItemList, true, true);

            content.PackStart(mainBox, true, true);

            HBox buttonBox = new HBox();

            Button okButton = new Button(GettextCatalog.GetString("Ok"));
            okButton.WidthRequest = Constants.ButtonWidth;
            okButton.Clicked += (sender, e) => Respond(Command.Ok);
            buttonBox.PackEnd(okButton);

            content.PackStart(buttonBox);
            //this.Resizable = false;
            this.Content = content;

            AttachEvents();
        }
Ejemplo n.º 18
0
		public void InvalidAdd2 ()
		{
			MyContainer co = new MyContainer ();
			var c1 = new Label ("hi1");
			HBox b = new HBox ();
			b.PackStart (c1);
			co.InternalAdd (c1);
		}
Ejemplo n.º 19
0
 Widget CreateEditPane()
 {
     var hbox = new HBox();
     hbox.PackStart(new Toolpane());
     hbox.PackStart(new TileEditor());
     hbox.PackStart(new PreviewPane());
     return hbox;
 }
Ejemplo n.º 20
0
        public MainWindow()
        {
            Menu menu = new Menu ();

            var file = new MenuItem ("File");
            file.SubMenu = new Menu ();
            file.SubMenu.Items.Add (new MenuItem ("Open"));
            file.SubMenu.Items.Add (new MenuItem ("New"));
            file.SubMenu.Items.Add (new MenuItem ("Close"));
            menu.Items.Add (file);

            var edit = new MenuItem ("Edit");
            edit.SubMenu = new Menu ();
            edit.SubMenu.Items.Add (new MenuItem ("Copy"));
            edit.SubMenu.Items.Add (new MenuItem ("Cut"));
            edit.SubMenu.Items.Add (new MenuItem ("Paste"));
            menu.Items.Add (edit);

            MainMenu = menu;

            HBox box = new HBox ();

            icon = Image.FromResource (typeof(App), "class.png");

            store = new TreeStore (nameCol, iconCol, widgetCol);
            samplesTree = new TreeView ();
            samplesTree.Columns.Add ("Name", iconCol, nameCol);

            AddSample (null, "Boxes", typeof(Boxes));
            AddSample (null, "Buttons", typeof(ButtonSample));
            AddSample (null, "ComboBox", typeof(ComboBoxes));
            //			AddSample (null, "Designer", typeof(Designer));
            AddSample (null, "Drag & Drop", typeof(DragDrop));
            var n = AddSample (null, "Drawing", null);
            AddSample (n, "Canvas with Widget", typeof(CanvasWithWidget));
            AddSample (n, "Chart", typeof(ChartSample));
            AddSample (n, "Transformations", typeof(DrawingTransforms));
            AddSample (null, "Images", typeof(Images));
            AddSample (null, "List View", typeof(ListView1));
            AddSample (null, "Notebook", typeof(NotebookSample));
            //			AddSample (null, "Scroll View", typeof(ScrollWindowSample));
            AddSample (null, "Text Entry", typeof(TextEntries));
            AddSample (null, "Windows", typeof(Windows));

            samplesTree.DataSource = store;

            box.PackStart (samplesTree);

            sampleBox = new VBox ();
            title = new Label ("Sample:");
            sampleBox.PackStart (title, BoxMode.None);

            box.PackStart (sampleBox, BoxMode.FillAndExpand);

            Content = box;

            samplesTree.SelectionChanged += HandleSamplesTreeSelectionChanged;
        }
Ejemplo n.º 21
0
        public SplashWindow()
        {
            Icon = App.Icon;

            Width = 550;

            Title = "4Plug First Use";
            Resizable = false;

            VBox V = new VBox();
            Content = V;

            Label lbl;

            lbl = new Label("A small introduction.") { Font = Font.FromName("Segoe UI Light 24"), TextColor = PluginType.Vpk.GetColor() };
            V.PackStart(lbl);

            lbl = new Label("This tool allows you to quickly enable/disable mods as well as install new ones.");
            V.PackStart(lbl);

            lbl = new Label(""); V.PackStart(lbl);

            lbl = new Label("This is what a mod looks like in 4Plug!") { Font = Font.FromName("Segoe UI Light 24"), TextColor = PluginType.Unknown.GetColor() };
            V.PackStart(lbl);

            lbl = new Label("You can enable/disable mods by clicking on the image.");
            V.PackStart(lbl);

            //lbl = new Label("Uninstalled mods are saved in the \"custom_\" instead of the \"custom\" folder of you game.");
            //V.PackStart(lbl);

            lbl = new Label("");

            DummyPluginWidget dummy = new DummyPluginWidget(lbl);
            dummy.MarginTop += 16;
            dummy.MarginBottom += 8;
            V.PackStart(dummy);

            V.PackStart(lbl);

            lbl = new Label(""); V.PackStart(lbl);

            {
                HBox box = new HBox();
                Button btn;

                btn = new Button(" Got it! ");
                box.PackEnd(btn);
                btn.Clicked += (s, e) => { Close(); };

                Label lbl2;
                lbl2 = new Label(" Feel free to leave feedback (mainmenu -> submit feedback) later ");
                box.PackStart(lbl2);
                //btn.Clicked += (s, e) => { new SubmitFeedbackWindow("via Splash Window").Run(); };

                V.PackStart(box);
            }
        }
        private IEnumerable<Tile> LoadTiles()
        {
            yield return CreateTile("Visit ParkitectNexus", App.DImages["parkitectnexus_logo-64x64.png"],
                Color.FromBytes(0xf3, 0x77, 0x35), _website.Launch);

            if (OperatingSystem.Detect() == SupportedOperatingSystem.Linux)
                yield return
                    CreateTile("Download URL", App.DImages["appbar.browser.wire.png"], Color.FromBytes(0xf3, 0x77, 0x35),
                        () =>
                        {
                            var entry = new TextEntry();

                            var box = new HBox();
                            box.PackStart(new Label("URL:"));
                            box.PackStart(entry, true, true);

                            var dialog = new Dialog
                            {
                                Width = 300,
                                Icon = ParentWindow.Icon,
                                Title = "Enter URL to download",
                                Content = box
                            };
                            dialog.Buttons.Add(new DialogButton(Command.Cancel));
                            dialog.Buttons.Add(new DialogButton(Command.Ok));

                            var result = dialog.Run(ParentWindow);

                            NexusUrl url;
                            if (result.Label.ToLower() == "ok" && NexusUrl.TryParse(entry.Text, out url))
                                ObjectFactory.GetInstance<IApp>().HandleUrl(url);
                            dialog.Dispose();
                        });

            yield return
                CreateTile("Launch Parkitect", App.DImages["parkitect_logo.png"], Color.FromBytes(45, 137, 239),
                    () => { _parkitect.Launch(); });

            yield return CreateTile("Help", App.DImages["appbar.information.png"], Color.FromBytes(45, 137, 239), () =>
            {
                // Temporary help solution.
                Process.Start(
                    "https://parkitectnexus.com/forum/2/parkitectnexus-website-client/70/troubleshooting-mods-and-client");
            });

            yield return CreateTile("Donate!", App.DImages["appbar.thumbs.up.png"], Color.FromBytes(45, 137, 239), () =>
            {
                if (MessageDialog.AskQuestion("Maintaining this client and adding new features takes a lot of time.\n" +
                                              "If you appreciate our work, please consider sending a donation our way!\n" +
                                              "All donations will be used for further development of the ParkitectNexus Client and the website.\n" +
                                              "\nSelect Yes to visit PayPal and send a donation.", 1, Command.No,
                    Command.Yes) == Command.Yes)
                {
                    Process.Start("https://paypal.me/ikkentim");
                }
            });
        }
Ejemplo n.º 23
0
        public SubmitFeedbackWindow(string category)
        {
            Icon = App.Icon;
            Title = "Thanks for your feedback!";

            Resizable = false;

            VBox vbox = new VBox();

            var text = new TextEntry()
            {
                MinWidth = 500,
                MinHeight = 200,
                MultiLine = true,
                Text = ""
            };

            vbox.PackStart(text);
            {
                HBox box = new HBox();

                Button btn;
                box.PackEnd(btn = new Button(" Cancel "));
                btn.Clicked += (s, e) => { Close(); };

                box.PackEnd(btn = new Button(" Submit "));
                btn.Clicked += (s, e) =>
                {
                    string feedback = text.Text;
                    new Task(() =>
                        {
                            if (feedback.Length > 10)
                            {
                                string URL = "http://yuhrney.square7.ch/4Plug/feedback.php";
                                WebClient webClient = new WebClient();
                                webClient.Proxy = null;

                                NameValueCollection formData = new NameValueCollection();

                                formData["feedback"] = string.Format("{3} - {1} {2}\n{5}\n{4}", App.WindowTitle, Environment.OSVersion.Platform, Xwt.Toolkit.CurrentEngine.Type, DateTime.Now.ToString("dd MMM HH:mm:ss", CultureInfo.InvariantCulture), feedback, category).Trim();

                                byte[] responseBytes = webClient.UploadValues(URL, "POST", formData);
                                string responsefromserver = Encoding.UTF8.GetString(responseBytes);
                                Console.WriteLine(responsefromserver);
                                webClient.Dispose();
                            }

                        }).Start();
                    Close();
                };

                vbox.PackStart(box);

                Content = vbox;
            }
        }
Ejemplo n.º 24
0
        public MyCanvas()
        {
            var entry = new TextEntry () { ShowFrame = false };
            AddChild (entry, rect);

            var box = new HBox ();
            box.PackStart (new Button ("..."));
            box.PackStart (new TextEntry (), BoxMode.FillAndExpand);
            AddChild (box, new Rectangle (30, 70, 100, 30));
        }
Ejemplo n.º 25
0
        public MyCanvas(bool linear)
        {
            var entry = new TextEntry () { ShowFrame = false };
            AddChild (entry, rect);

            var box = new HBox ();
            box.PackStart (new Button ("..."));
            box.PackStart (new TextEntry (), true);
            AddChild (box, new Rectangle (30, 70, 100, 30));
            Linear = linear;
        }
Ejemplo n.º 26
0
        public ProgressWidget()
        {
            ProgressMonitor = new ProgressMonitor { Handler = new ProgressWidgetMonitor(this) };

            progressBar = new ProgressBar();
            text = new Label();
            var box = new HBox();
            box.PackStart(progressBar);
            box.PackStart(text, true);
            Content = box;
        }
Ejemplo n.º 27
0
        public DeviceListControl()
        {
            deviceListStoreMirror = new List <DeviceInfo> ();

            uiThreadScheduler = TaskScheduler.Current;

            //
            // Device List
            //
            deviceListStore = new ListStore(idField, enabledField, nameField);
            deviceListView  = new ListView(deviceListStore);
            var enabledColumn = new Xwt.ListViewColumn(
                "Enabled",
                new Xwt.CheckBoxCellView(enabledField)
            {
                Editable = true
            });

            deviceListView.Columns.Add(enabledColumn);
            var nameColumn = new Xwt.ListViewColumn(
                "Device",
                new Xwt.TextCellView(nameField)
            {
                Editable = false
            });

            deviceListView.Columns.Add(nameColumn);

            deviceList.CollectionChanged += (s, e) => {
                Application.Invoke(() => Devices_CollectionChanged(s, e));
            };
            PrepopulateList();
            deviceListView.ButtonPressed += DeviceListView_ButtonPressed;

            //
            // Toolbar
            //
            var toolbar = new Xwt.HBox();

            toolbar.PackStart(refreshButton);
            toolbar.PackStart(statusLabel);
            refreshButton.Clicked += RefreshButton_Clicked;

            //
            // Main UI
            //
            var vbox = new Xwt.VBox();

            vbox.PackStart(toolbar);
            vbox.PackStart(deviceListView, fill: true, expand: true);

            Widget = vbox;
        }
Ejemplo n.º 28
0
Archivo: Boxes.cs Proyecto: joncham/xwt
        public Boxes()
        {
            HBox box1 = new HBox ();

            VBox box2 = new VBox ();
            box2.PackStart (new SimpleBox (30), BoxMode.None);
            box2.PackStart (new SimpleBox (30), BoxMode.None);
            box2.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);

            box1.PackStart (box2, BoxMode.FillAndExpand);
            box1.PackStart (new SimpleBox (30), BoxMode.None);
            box1.PackStart (new SimpleBox (30), BoxMode.Expand);
            PackStart (box1, BoxMode.None);

            HBox box3 = new HBox ();
            box3.PackEnd (new SimpleBox (30));
            box3.PackStart (new SimpleBox (20) {Color = new Color (1, 0.5, 0.5)});
            box3.PackEnd (new SimpleBox (40));
            box3.PackStart (new SimpleBox (10) {Color = new Color (1, 0.5, 0.5)});
            box3.PackEnd (new SimpleBox (30));
            box3.PackStart (new SimpleBox (10) {Color = new Color (1, 0.5, 0.5)}, BoxMode.FillAndExpand);
            PackStart (box3);

            HBox box4 = new HBox ();
            Button b = new Button ("Click me");
            b.Clicked += delegate {
                b.Label = "Button has grown";
            };
            box4.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
            box4.PackStart (b);
            box4.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
            PackStart (box4);

            HBox box5 = new HBox ();
            Button b2 = new Button ("Hide / Show");
            box5.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
            var hsb = new SimpleBox (20);
            box5.PackStart (hsb, BoxMode.None);
            box5.PackStart (b2);
            box5.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
            b2.Clicked += delegate {
                hsb.Visible = !hsb.Visible;
            };
            PackStart (box5);

            HBox box6 = new HBox ();
            for (int n=0; n<15; n++) {
                var w = new Label ("TestLabel" + n);
                w.MinWidth = 10;
                box6.PackStart (w);
            }
            PackStart (box6);
        }
 void BuildGui()
 {
     this.Title = GettextCatalog.GetString("Rename item") + ": " + item.ServerPath.ItemName;
     this.Resizable = false;
     var content = new HBox();
     content.PackStart(new Label(GettextCatalog.GetString("New name") + ":"));
     nameEntry.Text = item.ServerPath.ItemName;
     nameEntry.WidthRequest = 200;
     content.PackStart(nameEntry);
     this.Buttons.Add(Command.Ok, Command.Cancel);
     this.Content = content;
 }
        void BuildGui()
        {
            this.Title = "Select Projects";
            this.Resizable = false;
            var vBox = new VBox();
            var hbox = new HBox();
            collectionsList.DataSource = collectionStore;
            collectionsList.Views.Add(new TextCellView(collectionName));
            collectionsList.MinWidth = 200;
            collectionsList.MinHeight = 300;
            hbox.PackStart(collectionsList);

            projectsList.DataSource = projectsStore;
            projectsList.MinWidth = 200;
            projectsList.MinHeight = 300;
            var checkView = new CheckBoxCellView(isProjectSelected) { Editable = true };
            checkView.Toggled += (sender, e) =>
            {
                var row = projectsList.CurrentEventRow;
                var node = projectsStore.GetNavigatorAt(row);
                var isSelected = !node.GetValue(isProjectSelected); //Xwt gives previous value
                var project = node.GetValue(projectItem);
                if (isSelected && !SelectedProjects.Any(p => string.Equals(p.Uri, project.Uri)))
                {
                    SelectedProjects.Add(project);
                }
                if (!isSelected && SelectedProjects.Any(p => string.Equals(p.Uri, project.Uri)))
                {
                    SelectedProjects.RemoveAll(p => string.Equals(p.Uri, project.Uri));
                }
            };
            projectsList.Columns.Add(new ListViewColumn("", checkView));
            projectsList.Columns.Add(new ListViewColumn("Name", new TextCellView(projectName)));
            hbox.PackEnd(projectsList);

            vBox.PackStart(hbox);

            Button ok = new Button(GettextCatalog.GetString("OK"));
            ok.Clicked += (sender, e) => Respond(Command.Ok);

            Button cancel = new Button(GettextCatalog.GetString("Cancel"));
            cancel.Clicked += (sender, e) => Respond(Command.Cancel);

            ok.MinWidth = cancel.MinWidth = Constants.ButtonWidth;

            var buttonBox = new HBox();
            buttonBox.PackEnd(ok);
            buttonBox.PackEnd(cancel);
            vBox.PackStart(buttonBox);

            this.Content = vBox;
        }
Ejemplo n.º 31
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 ();
        }
 public SidebarContainer()
 {
     _closeButtonBox = new HBox();
     _closeButton = new Button("CLOSE")
     {
         Style = ButtonStyle.Flat,
         Image = App.Images["appbar.chevron.left.png"].WithSize(32),
         Font = Font.SystemFont.WithSize(20).WithStretch(FontStretch.UltraCondensed),
         ImagePosition = ContentPosition.Left
     };
     _closeButton.Clicked += (sender, args) => Clear();
     _closeButtonBox.PackStart(_closeButton);
 }
Ejemplo n.º 33
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;
        }
Ejemplo n.º 34
0
        public RunConfigurationsPanelWidget(RunConfigurationsPanel panel, OptionsDialog dialog)
        {
            this.panel = panel;

            this.Margin = 6;
            Spacing     = 6;

            list = new RunConfigurationsList();
            this.PackStart(list, true);

            var box = new Xwt.HBox();

            box.Spacing = 6;

            var btn = new Xwt.Button(GettextCatalog.GetString("New"));

            btn.Clicked += OnAddConfiguration;
            box.PackStart(btn, false);

            copyButton          = new Xwt.Button(GettextCatalog.GetString("Duplicate"));
            copyButton.Clicked += OnCopyConfiguration;
            box.PackStart(copyButton, false);

            renameButton          = new Xwt.Button(GettextCatalog.GetString("Rename"));
            renameButton.Clicked += OnRenameConfiguration;
            box.PackStart(renameButton, false);

            removeButton          = new Xwt.Button(GettextCatalog.GetString("Remove"));
            removeButton.Clicked += OnRemoveConfiguration;
            box.PackEnd(removeButton, false);

            Fill();

            this.PackStart(box, false);

            list.SelectionChanged += (sender, e) => UpdateButtons();
            list.RowActivated     += (sender, e) => panel.ShowConfiguration((ProjectRunConfiguration)list.SelectedConfiguration);
            UpdateButtons();
        }
Ejemplo n.º 35
0
        public DefaultColorSelectorBackend()
        {
            HBox  box    = new HBox();
            Table selBox = new Table();

            hsBox                   = new HueBox();
            hsBox.Light             = 0.5;
            lightBox                = new LightBox();
            hsBox.SelectionChanged += delegate {
                lightBox.Hue        = hsBox.SelectedColor.Hue;
                lightBox.Saturation = hsBox.SelectedColor.Saturation;
            };

            colorBox = new ColorSelectionBox()
            {
                MinHeight = 20
            };

            selBox.Add(hsBox, 0, 0);
            selBox.Add(lightBox, 1, 0);

            box.PackStart(selBox);

            const int entryWidth = 40;
            VBox      entryBox   = new VBox();
            Table     entryTable = new Table();

            entryTable.Add(CreateLabel(Application.TranslationCatalog.GetString("Color:")), 0, 0);
            entryTable.Add(colorBox, 1, 0, colspan: 4);
            entryTable.Add(new HSeparator(), 0, 1, colspan: 5);

            int r        = 2;
            var hueLabel = CreateLabel();

            entryTable.Add(hueLabel, 0, r);
            entryTable.Add(hueEntry = new SpinButton()
            {
                MinWidth = entryWidth, MinimumValue = 0, MaximumValue = 360, Digits = 0, IncrementValue = 1
            }, 1, r++);
            SetupEntry(hueEntry, hueLabel, Application.TranslationCatalog.GetString("Hue"));

            var satLabel = CreateLabel();

            entryTable.Add(satLabel, 0, r);
            entryTable.Add(satEntry = new SpinButton()
            {
                MinWidth = entryWidth, MinimumValue = 0, MaximumValue = 100, Digits = 0, IncrementValue = 1
            }, 1, r++);
            SetupEntry(satEntry, satLabel, Application.TranslationCatalog.GetString("Saturation"));

            var lightLabel = CreateLabel();

            entryTable.Add(lightLabel, 0, r);
            entryTable.Add(lightEntry = new SpinButton()
            {
                MinWidth = entryWidth, MinimumValue = 0, MaximumValue = 100, Digits = 0, IncrementValue = 1
            }, 1, r++);
            SetupEntry(lightEntry, lightLabel, Application.TranslationCatalog.GetString("Light"));

            r = 2;
            var redLabel = CreateLabel();

            entryTable.Add(redLabel, 3, r);
            entryTable.Add(redEntry = new SpinButton()
            {
                MinWidth = entryWidth, MinimumValue = 0, MaximumValue = 255, Digits = 0, IncrementValue = 1
            }, 4, r++);
            SetupEntry(redEntry, redLabel, Application.TranslationCatalog.GetString("Red"));

            var greenLabel = CreateLabel();

            entryTable.Add(greenLabel, 3, r);
            entryTable.Add(greenEntry = new SpinButton()
            {
                MinWidth = entryWidth, MinimumValue = 0, MaximumValue = 255, Digits = 0, IncrementValue = 1
            }, 4, r++);
            SetupEntry(greenEntry, greenLabel, Application.TranslationCatalog.GetString("Green"));

            var blueLabel = CreateLabel();

            entryTable.Add(blueLabel, 3, r);
            entryTable.Add(blueEntry = new SpinButton()
            {
                MinWidth = entryWidth, MinimumValue = 0, MaximumValue = 255, Digits = 0, IncrementValue = 1
            }, 4, r++);
            SetupEntry(blueEntry, blueLabel, Application.TranslationCatalog.GetString("Blue"));

            entryTable.Add(alphaSeparator = new HSeparator(), 0, r++, colspan: 5);
            var alphaLabel = CreateLabel();

            entryTable.Add(alphaLabel, 0, r);
            entryTable.Add(alphaSlider = new HSlider()
            {
                MinimumValue = 0, MaximumValue = 255,
            }, 1, r, colspan: 3);
            entryTable.Add(alphaEntry = new SpinButton()
            {
                MinWidth = entryWidth, MinimumValue = 0, MaximumValue = 255, Digits = 0, IncrementValue = 1
            }, 4, r);
            SetupEntry(alphaEntry, alphaLabel, Application.TranslationCatalog.GetString("Opacity"));

            // Don't allow the slider to get keyboard focus, as it doesn't really work with the keyboard and the opacity
            // spin button takes its place
            alphaSlider.CanGetFocus      = false;
            alphaSlider.Accessible.Label = Application.TranslationCatalog.GetString("Opacity");

            alphaControls.Add(alphaSeparator);
            alphaControls.Add(alphaLabel);
            alphaControls.Add(alphaEntry);

            entryBox.PackStart(entryTable);
            box.PackStart(entryBox);
            Content = box;

            hsBox.SelectionChanged    += HandleColorBoxSelectionChanged;
            lightBox.SelectionChanged += HandleColorBoxSelectionChanged;

            hueEntry.ValueChanged    += HandleHslChanged;
            satEntry.ValueChanged    += HandleHslChanged;
            lightEntry.ValueChanged  += HandleHslChanged;
            redEntry.ValueChanged    += HandleRgbChanged;
            greenEntry.ValueChanged  += HandleRgbChanged;
            blueEntry.ValueChanged   += HandleRgbChanged;
            alphaEntry.ValueChanged  += HandleAlphaChanged;
            alphaSlider.ValueChanged += HandleAlphaChanged;

            Color = Colors.White;
        }
Ejemplo n.º 36
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();
        }