Inheritance: Xwt.Widget
示例#1
0
        public TextEntries()
        {
            TextEntry te1 = new TextEntry ();
            PackStart (te1);

            Label la = new Label ();
            PackStart (la);
            te1.Changed += delegate {
                la.Text = "Text: " + te1.Text;
            };

            PackStart (new Label ("Entry with small font"));
            TextEntry te2 = new TextEntry ();
            te2.Font = te2.Font.WithSize (te2.Font.Size / 2);
            PackStart (te2);

            PackStart (new Label ("Entry with placeholder text"));
            TextEntry te3 = new TextEntry ();
            te3.PlaceholderText = "Placeholder text";
            PackStart (te3);

            PackStart (new Label ("Entry with no frame"));
            TextEntry te4 = new TextEntry();
            te4.ShowFrame = false;
            PackStart (te4);
        }
示例#2
0
        public TextEntries()
        {
            TextEntry te1 = new TextEntry ();
            PackStart (te1);

            Label la = new Label ();
            PackStart (la);
            te1.Changed += delegate {
                la.Text = "Text: " + te1.Text;
            };

            PackStart (new Label ("Entry with small font"));
            TextEntry te2 = new TextEntry ();
            te2.Font = te2.Font.WithScaledSize (0.5);
            PackStart (te2);

            PackStart (new Label ("Entry with placeholder text"));
            TextEntry te3 = new TextEntry ();
            te3.PlaceholderText = "Placeholder text";
            PackStart (te3);

            PackStart (new Label ("Entry with no frame"));
            TextEntry te4 = new TextEntry();
            te4.ShowFrame = false;
            PackStart (te4);

            TextEntry te5 = new TextEntry ();
            te5.Text = "I should be centered!";
            te5.TextAlignment = Alignment.Center;
            PackStart (te5);
        }
示例#3
0
        public override Xwt.Widget Makeup(IXwtWrapper Parent)
        {
            Xwt.TextEntry Target = new Xwt.TextEntry()
            {
                TextAlignment = this.Align,
                PlaceholderText = this.PlaceholderText,
                ShowFrame = this.ShowFrame,
                MultiLine = this.Multiline,
            };
            if (this.Text != "")
                Target.Text = this.Text;
            if (this.ReadOnly == true)
                Target.ReadOnly = true;
            //Binding
            WindowController.TryAttachEvent(Target, "Changed", Parent, Changed);
            WindowController.TryAttachEvent(Target, "Activated", Parent, Activated);
            if (Source != "")
            {
                Target.Text = (string)PathBind.GetValue(Source, Parent, "");
                Parent.PropertyChanged += (o, e) =>
                {
                    if (e.PropertyName == this.Source.Split('.')[0])
                        Xwt.Application.Invoke(() => Target.Text = (string)PathBind.GetValue(Source, Parent, ""));
                };
                Target.Changed += (o, e) =>
                {
                    PathBind.SetValue(Source, Parent, Target.Text);
                };
            }

            InitWidget(Target, Parent);
            return Target;
        }
		public ProcessRunConfigurationEditorWidget ()
		{
			VBox mainBox = this;

			mainBox.Margin = 12;
			var table = new Table ();

			table.Add (new Label (GettextCatalog.GetString ("Arguments:")), 0, 0);
			table.Add (argumentsEntry = new TextEntry (), 1, 0, hexpand:true);

			table.Add (new Label (GettextCatalog.GetString ("Run in directory:")), 0, 1);
			table.Add (workingDir = new FolderSelector (), 1, 1, hexpand: true);
		
			mainBox.PackStart (table);

			mainBox.PackStart (new HSeparator () { MarginTop = 8, MarginBottom = 8 });

			mainBox.PackStart (new Label (GettextCatalog.GetString ("Environment Variables")));
			envVars = new EnvironmentVariableCollectionEditor ();

			mainBox.PackStart (envVars, true);

			mainBox.PackStart (new HSeparator () { MarginTop = 8, MarginBottom = 8 });

			HBox cbox = new HBox ();
			cbox.PackStart (externalConsole = new CheckBox (GettextCatalog.GetString ("Run on external console")));
			cbox.PackStart (pauseConsole = new CheckBox (GettextCatalog.GetString ("Pause console output")));
			mainBox.PackStart (cbox);

			argumentsEntry.Changed += (s, a) => NotifyChanged ();
			workingDir.FolderChanged += (s, a) => NotifyChanged ();
			envVars.Changed += (s, a) => NotifyChanged ();
			externalConsole.Toggled += (s, a) => NotifyChanged ();
			pauseConsole.Toggled += (s, a) => NotifyChanged ();
		}
示例#5
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);
        }
        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");
                }
            });
        }
示例#7
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;
            }
        }
示例#8
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));
        }
示例#9
0
        public TextEntries()
        {
            TextEntry te = new TextEntry ();
            PackStart (te);

            Label la = new Label ();
            PackStart (la);
            te.Changed += delegate {
                la.Text = "Text: " + te.Text;
            };
        }
示例#10
0
 public InputBox(string label, string button)
     : base()
 {
     TextEntry = new TextEntry ();
     Label = new Label (label);
     Button = new Button (button);
     PackStart (Label);
     PackStart (TextEntry);
     PackStart (Button);
     Button.Sensitive = true;
 }
示例#11
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;
        }
示例#12
0
        private void CreateComponents(string field)
        {
            Title = field;
            txtEntry = new TextEntry();

            var table = new Table();
            table.Add(new Label(field + ":"), 0, 0);
            table.Add(txtEntry, 1, 0);
            Content = table;

            Buttons.Add(new DialogButton(Command.Ok));
            Buttons.Add(new DialogButton(Command.Cancel));
        }
示例#13
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public TextEntryHelper()
        {
            // Create text entry
            InnerTextEntry = new TextEntry();

            // Default bind
            InnerTextEntry.Changed += InnerTextEntry_Changed;

            // Self changed - show menu
            Changed += TextEntryHelper_Changed;

            // Key binding events
            InnerTextEntry.KeyReleased += InnerTextEntry_KeyPressed;

            // Helper
            VBox EntryHelper = new VBox();
            EntryHelper.PackStart(InnerTextEntry, true, true);

            // Create list store
            Values = new DataField<string>();
            HelperStore = new ListStore(Values);

            // Create helper list view
            HelperListView = new ListView()
            {
                MinHeight = 75,
                HeightRequest = 75,
                Visible = false,
                HeadersVisible = false,
                DataSource = HelperStore,
                SelectionMode = SelectionMode.Single
            };
            HelperListView.Columns.Add("Name", Values);

            // Click selection
            HelperListView.ButtonReleased += HelperListView_ButtonPressed;

            // Scroll view to
            EntryHelper.PackStart(HelperListView, true, true);

            // Margins
            MarginTop = 4;
            MarginBottom = 5;

            // Set as content
            Content = EntryHelper;

            // Show tree items
            InnerTextEntry.GotFocus += GotFocusHandler;
        }
示例#14
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;
        }
示例#15
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, box.Surface.GetPreferredSize().Width, 30));
			Linear = linear;

			stop1 = new Color (0, 1, 0);
			stop2 = new Color (1, 0, 0);
			xStart = xEnd = 0;
		}
示例#16
0
        public void Focus()
        {
            using (var win = new Window ()) {
                var w = CreateWidget ();

                HBox box = new HBox ();
                TextEntry e = new TextEntry ();
                box.PackStart (e);
                box.PackStart (w);
                win.Content = box;
                win.Show ();
                win.Present ();

                Application.MainLoop.DispatchPendingEvents ();

                e.SetFocus ();

                Application.MainLoop.DispatchPendingEvents ();

                Assert.IsFalse (w.HasFocus);
            //		Assert.IsTrue (w.CanGetFocus);

                int gotFocus = 0;
                w.GotFocus += delegate {
                    gotFocus++;
                };

                w.SetFocus ();

                if (w.CanGetFocus) {
                    Assert.IsTrue (w.HasFocus);
                    Assert.AreEqual (1, gotFocus);

                    int lostFocus = 0;
                    w.LostFocus += delegate {
                        lostFocus++;
                    };

                    e.SetFocus ();

                    Assert.IsFalse (w.HasFocus);
                    //			Assert.AreEqual (1, lostFocus);
                } else {
                    Assert.IsFalse (w.HasFocus);
                    Assert.AreEqual (0, gotFocus);
                }
            }
        }
示例#17
0
		public CalendarSample ()
		{
			var label = new Label ();
			var calendar = new Calendar () {
				ExpandHorizontal = false,
			};
			var entry = new TextEntry () {
				PlaceholderText = "Enter a date to change calendar",
			};
			var minimumDate = new TextEntry () {
				PlaceholderText = "Enter the minimum date of calendar",
			};
			var maximumDate = new TextEntry () {
				PlaceholderText = "Enter the maximum date of calendar",
			};

			calendar.ValueChanged += delegate {
				label.Text = string.Format ("Selected date: {0}", calendar.Date.ToShortDateString ());
				if (entry.Text != string.Empty)
					entry.Text = calendar.Date.ToShortDateString ();
			};
			label.Text = string.Format ("Selected date: {0}", calendar.Date.ToShortDateString ());

			var button = new Button () {
				Label = "Change values",
			};

			button.Clicked += delegate {
				DateTime dateMin;
				if (DateTime.TryParse (minimumDate.Text, out dateMin))
					calendar.MinimumDate = dateMin.Date;
				DateTime dateMax;
				if (DateTime.TryParse (maximumDate.Text, out dateMax))
					calendar.MaximumDate = dateMax.Date;
				DateTime date;
				if (DateTime.TryParse (entry.Text, out date))
					calendar.Date = date;
			};

			PackStart (calendar);
			PackStart (entry);
			PackStart (minimumDate);
			PackStart (maximumDate);
			PackStart (button);
			PackStart (label);
		}
示例#18
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);
		}
示例#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 CompilanceTestDialog()
        {
            backgroundWorker = new BackgroundWorker ();
            backgroundWorker.WorkerReportsProgress = false;
            backgroundWorker.WorkerSupportsCancellation = true;
            backgroundWorker.DoWork += BackgroundWorker_DoWork;
            backgroundWorker.RunWorkerCompleted += BackgroundWorker_RunWorkerCompleted;

            Icon = Image.FromResource ("UbntTools.Resources.icon-64x64.png");
            Title = string.Empty;
            Table table = new Table ();

            EntryIp = new TextEntry { Text = "192.168.1.20" };
            EntryPasswd = new PasswordEntry { TooltipText = "Device Password" };
            EntryUser = new TextEntry { Text = "ubnt" };

            table.Add (new Label ("Ip Address:: ") { TextAlignment = Alignment.End }, 0, 0);
            table.Add (EntryIp, 1, 0);
            table.Add (new Label ("User: "******"Password: "******"_Connect");
            table.Add (BtnConnect, 2, 0);

            BtnClose = new Button ("_Salir");
            table.Add (BtnClose, 2, 1);

            BtnConnect.Clicked += (sender, e) => {
                this.Content.Sensitive = false;
                this.BtnClose.Sensitive = false;
                this.BtnConnect.Sensitive = false;
                _ip = this.EntryIp.Text;
                _user = this.EntryUser.Text;
                _pwd = this.EntryPasswd.Password;

                if (!backgroundWorker.IsBusy)
                    backgroundWorker.RunWorkerAsync ();
            };

            BtnClose.Clicked += (sender, e) => { Respond (Command.Close);};

            Content = table;
        }
示例#21
0
        /// <summary>
        /// Show metadata of specified scan.
        /// </summary>
        /// <param name="scan">Scan.</param>
        public void Load(BaseScan scan)
        {
            table.Clear();

            int i = 1;
            foreach (var d in scan.Metadata) {
                table.Add(new Label(d.Key), 0, i);

                TextEntry entry = new TextEntry();
                entry.Text = d.Value.ToString();
                entry.ReadOnly = true;
                entry.ShowFrame = false;
                entry.BackgroundColor = Color.FromBytes(232, 232, 232);
                table.Add(entry, 1, i);

                i++;
            }
        }
示例#22
0
文件: WidgetFocus.cs 项目: m13253/xwt
		public WidgetFocus ()
		{
			var text = new TextEntry ();
			var check = new CheckBox ("CheckBox");
			var slider = new HSlider ();
			ListStore store = new ListStore (value);
			var list = new ListView (store);
			list.Columns.Add ("Value", value);
			list.HeadersVisible = false;
			for (int n=0; n<10; n++) {
				var r = store.AddRow ();
				store.SetValue (r, value, "Value " + n);
			}

			var btn1 = new Button ("TextEnty");
			var btn2 = new Button ("Checkbox");
			var btn3 = new Button ("Slider");
			var btn4 = new Button ("ListBox");
			var btn5 = new Button ("Button");

			btn1.Clicked += (sender, e) => text.SetFocus ();
			btn2.Clicked += (sender, e) => check.SetFocus ();
			btn3.Clicked += (sender, e) => slider.SetFocus ();
			btn4.Clicked += (sender, e) => list.SetFocus ();
			btn5.Clicked += (sender, e) => btn1.SetFocus ();

			var btnBox = new HBox ();
			btnBox.PackStart (btn1);
			btnBox.PackStart (btn2);
			btnBox.PackStart (btn3);
			btnBox.PackStart (btn4);
			btnBox.PackStart (btn5);

			var focusBox = new HBox ();
			var vbox = new VBox ();
			vbox.PackStart (text);
			vbox.PackStart (check);
			vbox.PackStart (slider);
			focusBox.PackStart (vbox);
			focusBox.PackStart (list, true);

			PackStart (btnBox);
			PackStart (focusBox, true);
		}
示例#23
0
        public TextEntries()
        {
            TextEntry te = new TextEntry ();
            PackStart (te);

            Label la = new Label ();
            PackStart (la);
            te.Changed += delegate {
                la.Text = "Text: " + te.Text;
            };

            PackStart (new Label ("Entry with small font"));
            te = new TextEntry ();
            te.Font = te.Font.WithSize (te.Font.Size / 2);
            PackStart (te);

            PackStart (new Label ("Entry with placeholder text"));
            te = new TextEntry ();
            te.PlaceholderText = "Placeholder text";
            PackStart (te);
        }
        void BuildGui()
        {
            this.Title = GettextCatalog.GetString("Browse for Folder");
            //this.Resizable = false;
            VBox content = new VBox();
            content.PackStart(new Label(GettextCatalog.GetString("Team Foundation Server") + ":"));
            content.PackStart(new TextEntry { Text = projectCollection.Server.Name + " - " + projectCollection.Name, Sensitive = false, MinWidth = 300 });

            content.PackStart(new Label(GettextCatalog.GetString("Folders") + ":"));

            treeView.Columns.Add(new ListViewColumn("Name", new TextCellView(_name) { Editable = false }));
            treeView.DataSource = _treeStore;
            treeView.MinWidth = 300;
            treeView.MinHeight = 300;
            content.PackStart(treeView, true, true);
                
            content.PackStart(new Label(GettextCatalog.GetString("Folder path") + ":"));

            TextEntry folderPathEntry = new TextEntry();
            folderPathEntry.Sensitive = false;

            treeView.SelectionChanged += (sender, e) => folderPathEntry.Text = this.SelectedPath;
            content.PackStart(folderPathEntry);

            HBox buttonBox = new HBox();

            Button nextButton = new Button(GettextCatalog.GetString("Next"));
            nextButton.MinWidth = Constants.ButtonWidth;
            nextButton.Clicked += (sender, e) => Respond(Command.Ok);
            buttonBox.PackStart(nextButton);

            Button cancelButton = new Button(GettextCatalog.GetString("Cancel"));
            cancelButton.MinWidth = Constants.ButtonWidth;
            cancelButton.Clicked += (sender, e) => Respond(Command.Cancel);
            buttonBox.PackEnd(cancelButton);

            content.PackStart(buttonBox);

            this.Content = content;
        }
示例#25
0
 public ComboBoxEntry()
 {
     entry = new CustomComboTextEntry(Backend.TextEntryBackend);
 }
示例#26
0
 public ComboBoxEntry()
 {
     entry = new CustomComboTextEntry (Backend.TextEntryBackend);
 }
示例#27
0
        private Widget CreateTopBar()
        {
            var topBox = new HBox();

            lblTitle = new Label {
                Text = Card.Title,
                Font = Font.WithWeight(FontWeight.Bold).WithSize(20),
                TextAlignment = Alignment.Center,
                Wrap = WrapMode.Word,
                Visible = false
            };
            topBox.PackStart(lblTitle, true);

            txtTitle = new TextEntry {
                Text = Card.Title,
                Font = lblTitle.Font,
                TextAlignment = Alignment.Center,
                Visible = false
            };
            topBox.PackStart(txtTitle, true);

            btnEdit = new ToggleButton(ResourcesManager.GetImage("pencil.png"));
            topBox.PackEnd(btnEdit);

            return topBox;
        }
示例#28
0
        /// <summary>
        /// Initialize components.
        /// </summary>
        public override void _initializeComponents()
        {
            Frame f = new Frame()
            {
                Label = Director.Properties.Resources.ScenarioLabel,
                Padding = 10
            };
            VBox ScenarioSettings = new VBox();

            // Create scenario name
            ScenarioName = new TextEntry();
            ScenarioName.Changed += ScenarioName_Changed;
            ScenarioSettings.PackStart(new Label(Director.Properties.Resources.ScenarioName));
            ScenarioSettings.PackStart(ScenarioName);
            ScenarioSettings.PackStart(InvalidScenarioName);
            f.Content = ScenarioSettings;
            PackStart(f);

            Frame h = new Frame()
            {
                Label = Director.Properties.Resources.RunningOptionsLabel,
                Padding = 10
            };
            VBox RunningOptionsSettings = new VBox();

            // Select scenario run
            PeriodicityRunning = new RadioButton(Director.Properties.Resources.FrequencyLabel);
            TimeDelayRunning = new RadioButton(Director.Properties.Resources.TimeDelayLabel);
            PeriodicityRunning.Group = TimeDelayRunning.Group;
            RunningOptionsSettings.PackStart(PeriodicityRunning);
            RunningOptionsSettings.PackStart(TimeDelayRunning);
            PeriodicityRunning.Group.ActiveRadioButtonChanged += ChangeFrequencyOption;

            // Frequency settings
            RunningOptionsSettings.PackStart(new Label()
            {
                Text = Director.Properties.Resources.RunningPeriodicity
            });
            FrequencyRunning = new ComboBox();
            FrequencyHelper.FillComboBox(FrequencyRunning);
            RunningOptionsSettings.PackStart(FrequencyRunning);
            FrequencyRunning.SelectedIndex = 0;
            FrequencyRunning.SelectionChanged += FrequencyRunning_SelectionChanged;

            // Time delay settings
            RunningOptionsSettings.PackStart(new Label()
            {
                Text = Director.Properties.Resources.TimeDelayInSeconds
            });
            TimeDelay = new TextEntry()
            {
                Text = "0"
            };
            TimeDelay.Changed += delegate
            {
                try
                {
                    ActiveScenario.TimeAfterPrevious = int.Parse(TimeDelay.Text);

                    InvalidTimeDelay.Visible = false;
                }
                catch
                {
                    InvalidTimeDelay.Visible = true;
                }
            };
            RunningOptionsSettings.PackStart(TimeDelay);
            RunningOptionsSettings.PackStart(InvalidTimeDelay);

            // Add to form
            h.Content = RunningOptionsSettings;
            PackStart(h);

            // Scenario information
            ScenarioInformation = new VBox();
            ScrollView ScenarioInformationScrollView = new ScrollView()
            {
                VerticalScrollPolicy = ScrollPolicy.Automatic,
                Content = ScenarioInformation
            };

            Frame si = new Frame()
            {
                Label = Director.Properties.Resources.ScenarioOverview,
                Padding = 10,
                Content = ScenarioInformationScrollView
            };
            PackStart(si, true, true);
        }
示例#29
0
	  /******************************************
			THIS IS AUTO GENERATED CODE BY GLADEBUILDER
			DO NOT EDIT
			USE THE IMPLEMENTATION CLASS INSTEAD
	  *******************************************/
	  namespace GladeBuilder
示例#30
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.Attach (hsBox, 0, 0);
            selBox.Attach (lightBox, 1, 0);

            box.PackStart (selBox);

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

            entryTable.Attach (new Label ("Color:"), 0, 0);
            entryTable.Attach (colorBox, 1, 5, 0, 1);
            entryTable.Attach (new HSeparator (), 0, 5, 1, 2);

            int r = 2;
            entryTable.Attach (new Label ("Hue:"), 0, r);
            entryTable.Attach (hueEntry = new TextEntry () { MinWidth = entryWidth }, 1, r++);

            entryTable.Attach (new Label ("Saturation:"), 0, r);
            entryTable.Attach (satEntry = new TextEntry () { MinWidth = entryWidth }, 1, r++);

            entryTable.Attach (new Label ("Light:"), 0, r);
            entryTable.Attach (lightEntry = new TextEntry () { MinWidth = entryWidth }, 1, r++);

            r = 2;
            entryTable.Attach (new Label ("Red:"), 3, r);
            entryTable.Attach (redEntry = new TextEntry () { MinWidth = entryWidth }, 4, r++);

            entryTable.Attach (new Label ("Green:"), 3, r);
            entryTable.Attach (greenEntry = new TextEntry () { MinWidth = entryWidth }, 4, r++);

            entryTable.Attach (new Label ("Blue:"), 3, r);
            entryTable.Attach (blueEntry = new TextEntry () { MinWidth = entryWidth }, 4, r++);

            Label label;
            entryTable.Attach (alphaSeparator = new HSeparator (), 0, 5, r, ++r);
            entryTable.Attach (label = new Label ("Opacity:"), 0, r);
            entryTable.Attach (alphaEntry = new TextEntry () { MinWidth = entryWidth }, 1, r);

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

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

            hsBox.SelectionChanged += delegate {
                HandleColorBoxSelectionChanged ();
            };
            lightBox.SelectionChanged += delegate {
                HandleColorBoxSelectionChanged ();
            };

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

            Color = Colors.White;
        }
示例#31
0
文件: Arff.cs 项目: jfreax/BAIMP
        public override Widget Options()
        {
            if (main != null) {
                main.Dispose();
            }

            main = new VBox();

            // filename
            HBox file = new HBox();
            filenameEntry = new TextEntry();
            filenameEntry.Text = Filename;
            filenameEntry.ReadOnly = true;
            filenameEntry.ShowFrame = false;
            filenameEntry.BackgroundColor = Color.FromBytes(232, 232, 232);

            Button browseButton = new Button("Browse...");
            browseButton.SetFocus();
            browseButton.Clicked += Browse;

            // print to std out
            HBox exportToStdOutBox = new HBox();
            CheckBox exportTSCheck = new CheckBox();

            exportToStdOutBox.PackStart(new Label("Export to standard out?"));
            exportToStdOutBox.PackEnd(exportTSCheck);
            exportTSCheck.Toggled += delegate {
                if (exportTSCheck.Active) {
                    browseButton.Style = ButtonStyle.Flat;
                    browseButton.Clicked -= Browse;
                    exportToStdOut = true;
                } else {
                    browseButton.Style = ButtonStyle.Normal;
                    browseButton.Clicked += Browse;
                    exportToStdOut = false;
                }
            };

            file.PackStart(filenameEntry, true);
            file.PackEnd(browseButton);

            main.PackEnd(file, true);
            main.PackEnd(exportToStdOutBox, true);

            return main;
        }