Inheritance: Xwt.Widget
		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 ();
		}
Ejemplo n.º 2
0
 public FolderSelectorSample()
 {
     FolderSelector fsel;
     Label label;
     PackStart (new Label ("An open file selector:"));
     PackStart (fsel = new FolderSelector ());
     PackStart (label = new Label ());
     fsel.FolderChanged += (sender, e) => { label.Text = "Folder changed: " + fsel.Folder; };
 }
		public DotNetRunConfigurationEditorWidget ()
		{
			VBox mainBox = new VBox ();

			mainBox.Margin = 12;
			mainBox.PackStart (new Label { Markup = GettextCatalog.GetString ("Start Action") });
			var table = new Table ();
			
			table.Add (radioStartProject = new RadioButton (GettextCatalog.GetString ("Start project")), 0, 0);
			table.Add (radioStartApp = new RadioButton (GettextCatalog.GetString ("Start external program:")), 0, 1);
			table.Add (appEntry = new Xwt.FileSelector (), 1, 1, hexpand: true);
			table.Add (appEntryInfoIcon = new InformationPopoverWidget (), 2, 1);
			appEntryInfoIcon.Hide ();
			radioStartProject.Group = radioStartApp.Group;
			table.MarginLeft = 12;
			mainBox.PackStart (table);

			mainBox.PackStart (new HSeparator () { MarginTop = 8, MarginBottom = 8 });
			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);

			Add (mainBox, GettextCatalog.GetString ("General"));

			var adBox = new VBox ();
			adBox.Margin = 12;

			table = new Table ();
			table.Add (new Label (GettextCatalog.GetString ("Execute in .NET Runtime:")), 0, 0);
			table.Add (runtimesCombo = new ComboBox (), 1, 0, hexpand:true);

			table.Add (new Label (GettextCatalog.GetString ("Mono runtime settings:")), 0, 1);

			var box = new HBox ();
			Button monoSettingsButton = new Button (GettextCatalog.GetString ("..."));
			box.PackStart (monoSettingsEntry = new TextEntry { PlaceholderText = GettextCatalog.GetString ("Default settings")}, true);
			box.PackStart (monoSettingsButton);
			monoSettingsEntry.ReadOnly = true;
			table.Add (box, 1, 1, hexpand: true);
			adBox.PackStart (table);

			Add (adBox, GettextCatalog.GetString ("Advanced"));

			monoSettingsButton.Clicked += EditRuntimeClicked;
			radioStartProject.ActiveChanged += (sender, e) => UpdateStatus ();
			externalConsole.Toggled += (sender, e) => UpdateStatus ();

			LoadRuntimes ();

			appEntry.FileChanged += (sender, e) => NotifyChanged ();
			argumentsEntry.Changed += (sender, e) => NotifyChanged ();
			workingDir.FolderChanged += (sender, e) => NotifyChanged ();
			envVars.Changed += (sender, e) => NotifyChanged ();
			externalConsole.Toggled += (sender, e) => NotifyChanged ();
			pauseConsole.Toggled += (sender, e) => NotifyChanged ();
			runtimesCombo.SelectionChanged += (sender, e) => NotifyChanged ();
			monoSettingsEntry.Changed += (sender, e) => NotifyChanged ();

		}