public ExecutionModeSelectorDialog ()
		{
			Title = GettextCatalog.GetString ("Execution Mode Selector");
			
			Width = 500;
			Height = 400;

			var box = new VBox ();
			Content = box;

			box.PackStart (new Label (GettextCatalog.GetString ("Run Configurations:")));
		
			listConfigs = new RunConfigurationsList ();
			box.PackStart (listConfigs, true);

			box.PackStart (new Label (GettextCatalog.GetString ("Execution Modes:")));

			storeModes = new TreeStore (modeNameField, modeField, modeSetField);
			treeModes = new TreeView (storeModes);
			treeModes.HeadersVisible = false;
			treeModes.Columns.Add (GettextCatalog.GetString ("Name"), modeNameField);
			box.PackStart (treeModes, true);

			runButton = new DialogButton (new Command ("run", GettextCatalog.GetString ("Run")));

			Buttons.Add (Command.Cancel);
			Buttons.Add (runButton);

			listConfigs.SelectionChanged += (sender, e) => LoadModes ();
			treeModes.SelectionChanged += OnModeChanged;
		}
		void Build ()
		{
			Title = GettextCatalog.GetString ("Add Platform Implementation");
			Width = 420;
			Height = 220;
			Padding = new WidgetSpacing (20, 20, 20, 20);

			var mainVBox = new VBox ();
			Content = mainVBox;

			// Platforms selection.
			var platformsVBox = new VBox ();
			platformsVBox.Spacing = 0;
			mainVBox.PackStart (platformsVBox);

			var platformsLabel = new Label ();
			platformsLabel.Text = GettextCatalog.GetString ("Select the platform implementations you would like to add:");
			platformsLabel.MarginBottom = 6;
			platformsVBox.PackStart (platformsLabel);

			androidCheckBox = new CheckBox ();
			androidCheckBox.Label = "Android";
			platformsVBox.PackStart (androidCheckBox);

			iosCheckBox = new CheckBox ();
			iosCheckBox.Label = "iOS";
			platformsVBox.PackStart (iosCheckBox);

			// Use shared project.
			var sharedProjectVBox = new VBox ();
			sharedProjectVBox.Spacing = 0;
			sharedProjectVBox.MarginTop = 20;
			mainVBox.PackStart (sharedProjectVBox);

			var useSharedProjectLabel = new Label ();
			useSharedProjectLabel.Text = GettextCatalog.GetString ("Create a Shared Project from the Portable Class Library:");
			useSharedProjectLabel.MarginBottom = 6;
			sharedProjectVBox.PackStart (useSharedProjectLabel);

			useSharedProjectCheckBox = new CheckBox ();
			useSharedProjectCheckBox.Label = GettextCatalog.GetString ("Create Shared Project");
			sharedProjectVBox.PackStart (useSharedProjectCheckBox);

			var cancelButton = new DialogButton (Command.Cancel);
			Buttons.Add (cancelButton);

			okButton = new DialogButton (Command.Ok);
			Buttons.Add (okButton);
		}
		public LicenseAcceptanceDialog (LicenseAcceptanceViewModel viewModel)
		{
			Height = 350;
			Resizable = false;
			Padding = 0;
			Title = GettextCatalog.GetString ("License Acceptance");
			this.viewModel = viewModel;
			this.imageLoader = new ImageLoader ();
			this.imageLoader.Loaded += HandleImageLoaded;

			var titleLabel = new Label ();
			titleLabel.Text = GettextCatalog.GetPluralString (
				"The following package requires that you accept its license terms before installing:",
				"The following packages require that you accept their license terms before installing:",
				viewModel.HasMultiplePackages ? 2 : 1);
			var descriptionLabel = new Label ();
			descriptionLabel.Wrap = WrapMode.Word;
			descriptionLabel.Markup = GettextCatalog.GetString ("By clicking <b>Accept</b> you agree to the license terms for the packages listed above.\n" +
																	"If you do not agree to the license terms click <b>Decline</b>.");

			packagesList = new VBox ();
			packagesList.Spacing = 0;

			scroll = new ScrollView (packagesList);
			scroll.HorizontalScrollPolicy = ScrollPolicy.Never;
			scroll.VerticalScrollPolicy = ScrollPolicy.Automatic;
			scroll.BorderVisible = false;
			scroll.BackgroundColor = Ide.Gui.Styles.BackgroundColor;

			var container = new VBox ();
			container.MarginTop = container.MarginLeft = container.MarginRight = 15;
			container.PackStart (titleLabel);
			container.PackStart (scroll, true, true);
			container.PackEnd (descriptionLabel);

			Content = container;

			var declineButton = new DialogButton (GettextCatalog.GetString ("Decline"), Command.Cancel);
			var acceptButton = new DialogButton (GettextCatalog.GetString ("Accept"), Command.Ok);

			Buttons.Add (declineButton);
			Buttons.Add (acceptButton);

			AddPackages ();
		}
		public RunWithCustomParametersDialog (Project project)
		{
			this.project = project;
			runConfig = project.CreateRunConfiguration ("Custom");

			Title = GettextCatalog.GetString ("Custom Parameters");

			Width = 650;
			Height = 400;

			editor = RunConfigurationService.CreateEditorForConfiguration (runConfig);
			editor.Load (project, runConfig);

			var box = new VBox ();
			Content = box;
			var c = editor.CreateControl ().GetNativeWidget<Gtk.Widget> ();
			box.PackStart (box.Surface.ToolkitEngine.WrapWidget (c, NativeWidgetSizing.DefaultPreferredSize), true);

			box.PackStart (new HSeparator ());

			var hbox = new HBox ();
			hbox.PackStart (new Label ("Run Action: "));
			hbox.PackStart (modeCombo = new ComboBox ());
			box.PackStart (hbox);

			runButton = new DialogButton (new Command ("run", GettextCatalog.GetString ("Run")));

			Buttons.Add (Command.Cancel);
			Buttons.Add (runButton);

			LoadModes ();
			UpdateStatus ();

			editor.Changed += Editor_Changed;
			modeCombo.SelectionChanged += (s,a) => UpdateStatus ();
		}
示例#5
0
 internal void UpdateButton(DialogButton btn)
 {
     Backend.UpdateButton(btn);
 }
示例#6
0
文件: Dialog.cs 项目: m13253/xwt
			public void OnDialogButtonClicked (DialogButton btn)
			{
				btn.RaiseClicked ();
				if (btn.Command != null)
					Parent.OnCommandActivated (btn.Command);
			}
示例#7
0
文件: Dialog.cs 项目: m13253/xwt
		internal void UpdateButton (DialogButton btn)
		{
			Backend.UpdateButton (btn);
		}
		void Initialize ()
		{
			Title = GettextCatalog.GetString (be == null ? "Create a Breakpoint" : "Edit Breakpoint");
			var buttonLabel = GettextCatalog.GetString (be == null ? "Create" : "Apply");

			var actionGroup = new RadioButtonGroup ();
			breakpointActionPause.Group = actionGroup;
			breakpointActionPrint.Group = actionGroup;

			var stopGroup = new RadioButtonGroup ();
			stopOnFunction.Group = stopGroup;
			stopOnLocation.Group = stopGroup;
			stopOnException.Group = stopGroup;

			ignoreHitType.Items.Add (HitCountMode.None, GettextCatalog.GetString ("Reset condition"));
			ignoreHitType.Items.Add (HitCountMode.LessThan, GettextCatalog.GetString ("When hit count is less than"));
			ignoreHitType.Items.Add (HitCountMode.LessThanOrEqualTo, GettextCatalog.GetString ("When hit count is less than or equal to"));
			ignoreHitType.Items.Add (HitCountMode.EqualTo, GettextCatalog.GetString ("When hit count is equal to"));
			ignoreHitType.Items.Add (HitCountMode.GreaterThan, GettextCatalog.GetString ("When hit count is greater than"));
			ignoreHitType.Items.Add (HitCountMode.GreaterThanOrEqualTo, GettextCatalog.GetString ("When hit count is greater than or equal to"));
			ignoreHitType.Items.Add (HitCountMode.MultipleOf, GettextCatalog.GetString ("When hit count is a multiple of"));

			ignoreHitCount.IncrementValue = 1;
			ignoreHitCount.Digits = 0;
			ignoreHitCount.ClimbRate = 1;
			ignoreHitCount.MinimumValue = 0;
			ignoreHitCount.MaximumValue = Int32.MaxValue;


			conditionalHitType.Items.Add (ConditionalHitWhen.ResetCondition, GettextCatalog.GetString ("Reset condition"));
			conditionalHitType.Items.Add (ConditionalHitWhen.ConditionIsTrue, GettextCatalog.GetString ("And the following condition is true"));
			conditionalHitType.Items.Add (ConditionalHitWhen.ExpressionChanges, GettextCatalog.GetString ("And the following expression changes"));

			buttonOk = new DialogButton (buttonLabel, Command.Ok) {
				Sensitive = false
			};

			// Register events.
			stopGroup.ActiveRadioButtonChanged += OnUpdateControls;
			entryFunctionName.Changed += OnUpdateControls;
			entryLocationFile.Changed += OnUpdateControls;

			entryConditionalExpression.Changed += OnUpdateControls;
			ignoreHitType.SelectionChanged += OnUpdateControls;
			conditionalHitType.SelectionChanged += OnUpdateControls;
			breakpointActionPause.ActiveChanged += OnUpdateControls;
			breakpointActionPrint.ActiveChanged += OnUpdateControls;

			entryFunctionName.Changed += OnUpdateText;
			entryLocationFile.Changed += OnUpdateText;
			entryExceptionType.Changed += OnUpdateText;
			entryPrintExpression.Changed += OnUpdateText;

			buttonOk.Clicked += OnSave;

			CompletionWindowManager.WindowShown += HandleCompletionWindowShown;
			CompletionWindowManager.WindowClosed += HandleCompletionWindowClosed;
		}
		void Build ()
		{
			Width = 400;
			Title = GettextCatalog.GetString ("Add Package Source");
			int labelWidth = 80;

			var mainVBox = new VBox ();
			Content = mainVBox;

			// Package source name.
			var packageSourceNameHBox = new HBox ();
			mainVBox.PackStart (packageSourceNameHBox);

			var packageSourceNameLabel = new Label ();
			packageSourceNameLabel.Text = GettextCatalog.GetString ("Name");
			packageSourceNameLabel.TextAlignment = Alignment.End;
			packageSourceNameLabel.WidthRequest = labelWidth;
			packageSourceNameHBox.PackStart (packageSourceNameLabel);

			packageSourceNameTextEntry = new TextEntry ();
			packageSourceNameHBox.PackEnd (packageSourceNameTextEntry, true);

			// Package source URL.
			var packageSourceUrlHBox = new HBox ();
			mainVBox.PackStart (packageSourceUrlHBox);

			var packageSourceUrlLabel = new Label ();
			packageSourceUrlLabel.Text = GettextCatalog.GetString ("URL");
			packageSourceUrlLabel.TextAlignment = Alignment.End;
			packageSourceUrlLabel.WidthRequest = labelWidth;
			packageSourceUrlHBox.PackStart (packageSourceUrlLabel);

			packageSourceUrlTextEntry = new TextEntry ();
			packageSourceUrlHBox.PackEnd (packageSourceUrlTextEntry, true);

			// Package source username.
			var packageSourceUserNameHBox = new HBox ();
			mainVBox.PackStart (packageSourceUserNameHBox);

			var packageSourceUserNameLabel = new Label ();
			packageSourceUserNameLabel.Text = GettextCatalog.GetString ("Username");
			packageSourceUserNameLabel.TextAlignment = Alignment.End;
			packageSourceUserNameLabel.WidthRequest = labelWidth;
			packageSourceUserNameHBox.PackStart (packageSourceUserNameLabel);

			packageSourceUserNameTextEntry = new TextEntry ();
			packageSourceUserNameTextEntry.PlaceholderText = GettextCatalog.GetString ("Private sources only");
			packageSourceUserNameHBox.PackEnd (packageSourceUserNameTextEntry, true);

			// Package source password.
			var packageSourcePasswordHBox = new HBox ();
			mainVBox.PackStart (packageSourcePasswordHBox);

			var packageSourcePasswordLabel = new Label ();
			packageSourcePasswordLabel.Text = GettextCatalog.GetString ("Password");
			packageSourcePasswordLabel.TextAlignment = Alignment.End;
			packageSourcePasswordLabel.WidthRequest = labelWidth;
			packageSourcePasswordHBox.PackStart (packageSourcePasswordLabel);

			packageSourcePasswordTextEntry = new PasswordEntry ();
			packageSourcePasswordTextEntry.PlaceholderText = GettextCatalog.GetString ("Private sources only");
			packageSourcePasswordHBox.PackEnd (packageSourcePasswordTextEntry, true);

			// Buttons at bottom of dialog.
			var cancelButton = new DialogButton (Command.Cancel);
			Buttons.Add (cancelButton);

			addPackageSourceButton = new DialogButton (Command.Ok);
			addPackageSourceButton.Label = GettextCatalog.GetString ("Add Source");
			addPackageSourceButton.Sensitive = false;
			Buttons.Add (addPackageSourceButton);

			savePackageSourceButton = new DialogButton (Command.Apply);
			savePackageSourceButton.Label = GettextCatalog.GetString ("Save");
			savePackageSourceButton.Visible = false;
			Buttons.Add (savePackageSourceButton);
		}
		public RunConfigurationNameDialog (Xwt.WindowFrame parent, string name, Command action, IEnumerable<string> invalidNames)
		{
			TransientFor = parent;
			Resizable = false;
			Width = 300;
			this.invalidNames = invalidNames;
			mainBox = new VBox ();
			var box = new HBox ();
			mainBox.PackStart (box, true);
			box.PackStart (new Label (GettextCatalog.GetString ("Name")), false);
			entry = new TextEntry ();
			entry.Text = name ?? "";
			box.PackStart (entry, true);
			Content = mainBox;

			Buttons.Add (new DialogButton (Command.Cancel));
			Buttons.Add (okButton = new DialogButton (action));
			this.DefaultCommand = okButton.Command;
			entry.Activated += Entry_Activated;
			entry.Changed += (s, o) => UpdateControls ();
		}
示例#11
0
        private void Build(Image icon, char start, char end)
        {
            if (icon != null)
                this.Icon = icon;

            this.Title = "Character Region Selection Dialog";
            this.Padding = 0;
            this.Width = 400;
            this.Height = 300;

            vbox1 = new VBox();

            if(Toolkit.CurrentEngine.Type == ToolkitType.Wpf)
                vbox1.BackgroundColor = (new Button()).BackgroundColor;

            hbox1 = new HBox();
            hbox1.MarginTop = 6;
            hbox1.MarginRight = 6;
            hbox1.MarginLeft = 6;
            hbox1.Spacing = 8;

            vbox2 = new VBox();

            label1 = new Label("Start Character:");
            vbox2.PackStart(label1);

            char1 = new CharWidget(start);
            vbox2.PackStart(char1);

            hbox1.PackStart(vbox2, true);

            hbox1.PackStart(new VSeparator());

            vbox3 = new VBox();

            label2 = new Label("End Character:");
            vbox3.PackStart(label2);

            char2 = new CharWidget(end);
            vbox3.PackStart(char2, true);

            hbox1.PackStart(vbox3, true);

            vbox1.PackStart(hbox1);

            label3 = new Label("Preview of characters to include (Max 300):");
            label3.MarginLeft = 4;
            vbox1.PackStart(label3);

            rich1 = new RichTextView();

            scroll1 = new ScrollView();
            scroll1.Content = rich1;

            vbox1.PackStart(scroll1, true);

            this.Content = vbox1;
            rich1.SetFocus();

            buttonOk = new DialogButton(Command.Ok);
            this.Buttons.Add(buttonOk);

            buttonCancel = new DialogButton(Command.Cancel);
            this.Buttons.Add(buttonCancel);
        }