public Checkboxes () { var a = new CheckBox ("Normal checkbox"); var b = new CheckBox ("Disabled") { Sensitive = false }; var c = new CheckBox ("Allows mixed (with red background)") { AllowMixed = true }; c.BackgroundColor = Xwt.Drawing.Colors.Red; a.Toggled += (sender, e) => b.Sensitive = a.Active; PackStart (a); PackStart (b); PackStart (new CheckBox ("Mixed to start") { AllowMixed = true, State = CheckBoxState.Mixed }); PackStart (c); int clicks = 0, toggles = 0; Label la = new Label (); PackStart (la); c.Clicked += delegate { clicks++; la.Text = string.Format ("state:{0}, clicks:{1}, toggles:{2}", c.State, clicks, toggles); }; c.Toggled += delegate { toggles++; la.Text = string.Format ("state:{0}, clicks:{1}, toggles:{2}", c.State, clicks, toggles); }; }
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); }
public override Xwt.Widget Makeup(IXwtWrapper Parent) { Xwt.CheckBox Target = new Xwt.CheckBox() { Label = Text, State = State, AllowMixed = AllowMixed, }; //Creating layouts if (Content != null && Content.Count() > 0) Target.Content = Content[0].Makeup(Parent); //Attaching events WindowController.TryAttachEvent(Target, "Toggled", Parent, Toggled); WindowController.TryAttachEvent(Target, "Clicked", Parent, Clicked); //Making binding if (Source != "") { Target.Active = (bool)PathBind.GetValue(Source, Parent, false); Parent.PropertyChanged += (o, e) => { if (e.PropertyName == this.Source.Split('.')[0]) Xwt.Application.Invoke(() => Target.Active = (bool)PathBind.GetValue(Source, Parent, false)); }; Target.Toggled += (o, e) => { PathBind.SetValue(Source, Parent, Target.Active); }; } InitWidget(Target, Parent); return Target; }
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 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); }
public Checkboxes() { PackStart (new CheckBox ("Normal checkbox")); var b = new CheckBox ("Allows mixed") { AllowMixed = true }; PackStart (b); int clicks = 0, toggles = 0; Label la = new Label (); PackStart (la); b.Clicked += delegate { clicks++; la.Text = string.Format ("active:{0}, mixed:{1}, clicks:{2}, toggles:{3}", b.Active, b.Mixed, clicks, toggles); }; b.Toggled += delegate { toggles++; la.Text = string.Format ("active:{0}, mixed:{1}, clicks:{2}, toggles:{3}", b.Active, b.Mixed, clicks, toggles); }; }
public Checkboxes() { PackStart (new CheckBox ("Normal checkbox")); PackStart (new CheckBox ("Mixed to start") { State = CheckBoxState.Mixed }); var b = new CheckBox ("Allows mixed") { AllowMixed = true }; PackStart (b); int clicks = 0, toggles = 0; Label la = new Label (); PackStart (la); b.Clicked += delegate { clicks++; la.Text = string.Format ("state:{0}, clicks:{1}, toggles:{2}", b.State, clicks, toggles); }; b.Toggled += delegate { toggles++; la.Text = string.Format ("state:{0}, clicks:{1}, toggles:{2}", b.State, clicks, toggles); }; }
void Build () { checkProjectCodeOnly = new CheckBox (GettextCatalog.GetString ("Debug project code only; do not step into framework code.")); PackStart (checkProjectCodeOnly); checkStepOverPropertiesAndOperators = new CheckBox (GettextCatalog.GetString ("Step over properties and operators")); PackStart (checkStepOverPropertiesAndOperators); checkAllowEval = new CheckBox (GettextCatalog.GetString ("Allow implicit property evaluation and method invocation")); checkAllowEval.Toggled += OnCheckAllowEvalToggled; PackStart (checkAllowEval); checkAllowToString = new CheckBox (GettextCatalog.GetString ("Call string-conversion function on objects in variables windows")); checkAllowToString.MarginLeft = 18; PackStart (checkAllowToString); checkShowBaseGroup = new CheckBox (GettextCatalog.GetString ("Show inherited class members in a base class group")); PackStart (checkShowBaseGroup); checkGroupPrivate = new CheckBox (GettextCatalog.GetString ("Group non-public members")); PackStart (checkGroupPrivate); checkGroupStatic = new CheckBox (GettextCatalog.GetString ("Group static members")); PackStart (checkGroupStatic); var evalBox = new HBox (); evalBox.PackStart (new Label (GettextCatalog.GetString ("Evaluation Timeout:"))); spinTimeout = new SpinButton (); spinTimeout.ClimbRate = 100; spinTimeout.Digits = 0; spinTimeout.IncrementValue = 100; spinTimeout.MaximumValue = 1000000; spinTimeout.MinimumValue = 0; spinTimeout.Wrap = false; spinTimeout.WidthRequest = 80; evalBox.PackStart (spinTimeout); evalBox.PackStart (new Label (GettextCatalog.GetString ("ms"))); PackStart (evalBox); PackStart (new Label () { Markup = "<b>" + GettextCatalog.GetString ("Advanced options") + "</b>" }); enableLogging = new CheckBox (GettextCatalog.GetString ("Enable diagnostic logging", BrandingService.ApplicationName)); PackStart (enableLogging); }
void Build () { Title = Catalog.GetString ("Add Packages"); Width = 820; Height = 520; Padding = new WidgetSpacing (); // Top part of dialog: // Package sources and search. var topHBox = new HBox (); topHBox.Margin = new WidgetSpacing (8, 5, 6, 5); packageSourceComboBox = new ComboBox (); packageSourceComboBox.MinWidth = 200; topHBox.PackStart (packageSourceComboBox); packageSearchEntry = new SearchTextEntry (); packageSearchEntry.WidthRequest = 187; topHBox.PackEnd (packageSearchEntry); this.HeaderContent = topHBox; // Middle of dialog: // Packages and package information. var mainVBox = new VBox (); Content = mainVBox; var middleHBox = new HBox (); middleHBox.Spacing = 0; var middleFrame = new FrameBox (); middleFrame.Content = middleHBox; middleFrame.BorderWidth = new WidgetSpacing (0, 0, 0, 1); middleFrame.BorderColor = lineBorderColor; mainVBox.PackStart (middleFrame, true, true); // Error information. var packagesListVBox = new VBox (); packagesListVBox.Spacing = 0; errorMessageHBox = new HBox (); errorMessageHBox.Margin = new WidgetSpacing (); errorMessageHBox.BackgroundColor = Colors.Orange; errorMessageHBox.Visible = false; var errorImage = new ImageView (); errorImage.Margin = new WidgetSpacing (10, 0, 0, 0); errorImage.Image = ImageService.GetIcon (Stock.Warning, Gtk.IconSize.Menu); errorImage.HorizontalPlacement = WidgetPlacement.End; errorMessageHBox.PackStart (errorImage); errorMessageLabel = new Label (); errorMessageLabel.TextColor = Colors.White; errorMessageLabel.Margin = new WidgetSpacing (5, 5, 5, 5); errorMessageLabel.Wrap = WrapMode.Word; errorMessageHBox.PackStart (errorMessageLabel, true); packagesListVBox.PackStart (errorMessageHBox); // Packages list. middleHBox.PackStart (packagesListVBox, true, true); packagesListView = new ListView (); packagesListView.BorderVisible = false; packagesListView.HeadersVisible = false; packagesListVBox.PackStart (packagesListView, true, true); // Loading spinner. var loadingSpinnerHBox = new HBox (); loadingSpinnerHBox.HorizontalPlacement = WidgetPlacement.Center; var loadingSpinner = new Spinner (); loadingSpinner.Animate = true; loadingSpinner.MinWidth = 20; loadingSpinnerHBox.PackStart (loadingSpinner); loadingSpinnerLabel = new Label (); loadingSpinnerLabel.Text = Catalog.GetString ("Loading package list..."); loadingSpinnerHBox.PackEnd (loadingSpinnerLabel); loadingSpinnerFrame = new FrameBox (); loadingSpinnerFrame.Visible = false; loadingSpinnerFrame.BackgroundColor = Colors.White; loadingSpinnerFrame.Content = loadingSpinnerHBox; loadingSpinnerFrame.BorderWidth = new WidgetSpacing (); packagesListVBox.PackStart (loadingSpinnerFrame, true, true); // No packages found label. var noPackagesFoundHBox = new HBox (); noPackagesFoundHBox.HorizontalPlacement = WidgetPlacement.Center; var noPackagesFoundLabel = new Label (); noPackagesFoundLabel.Text = Catalog.GetString ("No matching packages found."); noPackagesFoundHBox.PackEnd (noPackagesFoundLabel); noPackagesFoundFrame = new FrameBox (); noPackagesFoundFrame.Visible = false; noPackagesFoundFrame.BackgroundColor = Colors.White; noPackagesFoundFrame.Content = noPackagesFoundHBox; noPackagesFoundFrame.BorderWidth = new WidgetSpacing (); packagesListVBox.PackStart (noPackagesFoundFrame, true, true); // Package information packageInfoVBox = new VBox (); var packageInfoFrame = new FrameBox (); packageInfoFrame.BackgroundColor = packageInfoBackgroundColor; packageInfoFrame.BorderWidth = new WidgetSpacing (); packageInfoFrame.Content = packageInfoVBox; packageInfoVBox.Margin = new WidgetSpacing (15, 12, 15, 12); var packageInfoContainerVBox = new VBox (); packageInfoContainerVBox.WidthRequest = 240; packageInfoContainerVBox.PackStart (packageInfoFrame, true, true); var packageInfoScrollView = new ScrollView (); packageInfoScrollView.BorderVisible = false; packageInfoScrollView.HorizontalScrollPolicy = ScrollPolicy.Never; packageInfoScrollView.Content = packageInfoContainerVBox; packageInfoScrollView.BackgroundColor = packageInfoBackgroundColor; var packageInfoScrollViewFrame = new FrameBox (); packageInfoScrollViewFrame.BackgroundColor = packageInfoBackgroundColor; packageInfoScrollViewFrame.BorderWidth = new WidgetSpacing (1, 0, 0, 0); packageInfoScrollViewFrame.BorderColor = lineBorderColor; packageInfoScrollViewFrame.Content = packageInfoScrollView; middleHBox.PackEnd (packageInfoScrollViewFrame); // Package name and version. var packageNameHBox = new HBox (); packageInfoVBox.PackStart (packageNameHBox); packageNameLabel = new Label (); packageNameLabel.Ellipsize = EllipsizeMode.End; Font packageInfoSmallFont = packageNameLabel.Font.WithScaledSize (0.8); packageNameHBox.PackStart (packageNameLabel, true); packageVersionLabel = new Label (); packageVersionLabel.TextAlignment = Alignment.End; packageNameHBox.PackEnd (packageVersionLabel); // Package description. packageDescription = new Label (); packageDescription.Wrap = WrapMode.Word; packageDescription.Font = packageNameLabel.Font.WithScaledSize (0.9); packageDescription.BackgroundColor = packageInfoBackgroundColor; packageInfoVBox.PackStart (packageDescription); // Package id. var packageIdHBox = new HBox (); packageIdHBox.MarginTop = 7; packageInfoVBox.PackStart (packageIdHBox); var packageIdLabel = new Label (); packageIdLabel.Font = packageInfoSmallFont; packageIdLabel.Markup = Catalog.GetString ("<b>Id</b>"); packageIdHBox.PackStart (packageIdLabel); packageId = new Label (); packageId.Ellipsize = EllipsizeMode.End; packageId.TextAlignment = Alignment.End; packageId.Font = packageInfoSmallFont; packageIdLink = new LinkLabel (); packageIdLink.Ellipsize = EllipsizeMode.End; packageIdLink.TextAlignment = Alignment.End; packageIdLink.Font = packageInfoSmallFont; packageIdHBox.PackEnd (packageIdLink, true); packageIdHBox.PackEnd (packageId, true); // Package author var packageAuthorHBox = new HBox (); packageInfoVBox.PackStart (packageAuthorHBox); var packageAuthorLabel = new Label (); packageAuthorLabel.Markup = Catalog.GetString ("<b>Author</b>"); packageAuthorLabel.Font = packageInfoSmallFont; packageAuthorHBox.PackStart (packageAuthorLabel); packageAuthor = new Label (); packageAuthor.TextAlignment = Alignment.End; packageAuthor.Ellipsize = EllipsizeMode.End; packageAuthor.Font = packageInfoSmallFont; packageAuthorHBox.PackEnd (packageAuthor, true); // Package published var packagePublishedHBox = new HBox (); packageInfoVBox.PackStart (packagePublishedHBox); var packagePublishedLabel = new Label (); packagePublishedLabel.Markup = Catalog.GetString ("<b>Published</b>"); packagePublishedLabel.Font = packageInfoSmallFont; packagePublishedHBox.PackStart (packagePublishedLabel); packagePublishedDate = new Label (); packagePublishedDate.Font = packageInfoSmallFont; packagePublishedHBox.PackEnd (packagePublishedDate); // Package downloads var packageDownloadsHBox = new HBox (); packageInfoVBox.PackStart (packageDownloadsHBox); var packageDownloadsLabel = new Label (); packageDownloadsLabel.Markup = Catalog.GetString ("<b>Downloads</b>"); packageDownloadsLabel.Font = packageInfoSmallFont; packageDownloadsHBox.PackStart (packageDownloadsLabel); packageDownloads = new Label (); packageDownloads.Font = packageInfoSmallFont; packageDownloadsHBox.PackEnd (packageDownloads); // Package license. var packageLicenseHBox = new HBox (); packageInfoVBox.PackStart (packageLicenseHBox); var packageLicenseLabel = new Label (); packageLicenseLabel.Markup = Catalog.GetString ("<b>License</b>"); packageLicenseLabel.Font = packageInfoSmallFont; packageLicenseHBox.PackStart (packageLicenseLabel); packageLicenseLink = new LinkLabel (); packageLicenseLink.Text = Catalog.GetString ("View License"); packageLicenseLink.Font = packageInfoSmallFont; packageLicenseHBox.PackEnd (packageLicenseLink); // Package project page. var packageProjectPageHBox = new HBox (); packageInfoVBox.PackStart (packageProjectPageHBox); var packageProjectPageLabel = new Label (); packageProjectPageLabel.Markup = Catalog.GetString ("<b>Project Page</b>"); packageProjectPageLabel.Font = packageInfoSmallFont; packageProjectPageHBox.PackStart (packageProjectPageLabel); packageProjectPageLink = new LinkLabel (); packageProjectPageLink.Text = Catalog.GetString ("Visit Page"); packageProjectPageLink.Font = packageInfoSmallFont; packageProjectPageHBox.PackEnd (packageProjectPageLink); // Package dependencies var packageDependenciesHBox = new HBox (); packageInfoVBox.PackStart (packageDependenciesHBox); var packageDependenciesLabel = new Label (); packageDependenciesLabel.Markup = Catalog.GetString ("<b>Dependencies</b>"); packageDependenciesLabel.Font = packageInfoSmallFont; packageDependenciesHBox.PackStart (packageDependenciesLabel); packageDependenciesNoneLabel = new Label (); packageDependenciesNoneLabel.Text = Catalog.GetString ("None"); packageDependenciesNoneLabel.Font = packageInfoSmallFont; packageDependenciesHBox.PackEnd (packageDependenciesNoneLabel); // Package dependencies list. packageDependenciesListHBox = new HBox (); packageDependenciesListHBox.Visible = false; packageInfoVBox.PackStart (packageDependenciesListHBox); packageDependenciesList = new Label (); packageDependenciesList.Wrap = WrapMode.WordAndCharacter; packageDependenciesList.Margin = new WidgetSpacing (5); packageDependenciesList.Font = packageInfoSmallFont; packageDependenciesListHBox.PackStart (packageDependenciesList, true); // Bottom part of dialog: // Show pre-release packages and Close/Add to Project buttons. var bottomHBox = new HBox (); bottomHBox.Margin = new WidgetSpacing (8, 5, 14, 10); bottomHBox.Spacing = 5; mainVBox.PackStart (bottomHBox); showPrereleaseCheckBox = new CheckBox (); showPrereleaseCheckBox.Label = Catalog.GetString ("Show pre-release packages"); bottomHBox.PackStart (showPrereleaseCheckBox); addPackagesButton = new Button (); addPackagesButton.MinWidth = 120; addPackagesButton.MinHeight = 25; addPackagesButton.Label = Catalog.GetString ("Add Package"); bottomHBox.PackEnd (addPackagesButton); var closeButton = new Button (); closeButton.MinWidth = 120; closeButton.MinHeight = 25; closeButton.Label = Catalog.GetString ("Close"); closeButton.Clicked += (sender, e) => Close (); bottomHBox.PackEnd (closeButton); packageSearchEntry.SetFocus (); packageInfoVBox.Visible = false; }
/****************************************** THIS IS AUTO GENERATED CODE BY GLADEBUILDER DO NOT EDIT USE THE IMPLEMENTATION CLASS INSTEAD *******************************************/ namespace GladeBuilder
public XwtSourcePageWidget (XwtSourceWizardPage page) { Page = page; cGitHub = new Octokit.GitHubClient (new Octokit.ProductHeaderValue ("xwt_addin")).Repository; var optBuiltIn = new RadioButton(GettextCatalog.GetString ("Local Package / GAC")) { TooltipText = GettextCatalog.GetString ( "Xwt must be installed to the GAC (Global Assembly Cache),\n" + "otherwise you will have to add a HintPath property manually.") }; var optGithub = new RadioButton(GettextCatalog.GetString ("GitHub:")) { TooltipText = GettextCatalog.GetString ( "A separate solution folder named 'Xwt' will be added to the solution.\n" + "If the solution already contains the Xwt project,\nit will be referenced instead " + "and the git checkout will be skipped.") }; var linkGithub = new Label { Markup = "(<a href='https://github.com/mono/xwt'>Official Repository</a>)", TooltipText = "https://github.com/mono/xwt" }; var optNuGet = new RadioButton(GettextCatalog.GetString ("NuGet package")) { TooltipText = GettextCatalog.GetString ("All registered NuGet repositories will be searched.") }; var sourceGroup = optBuiltIn.Group = optGithub.Group = optNuGet.Group; sourceGroup.ActiveRadioButtonChanged += (sender, e) => { if (sourceGroup.ActiveRadioButton == optGithub) Page.XwtReferenceSource = XwtSource.Github; else if (sourceGroup.ActiveRadioButton == optNuGet) Page.XwtReferenceSource = XwtSource.NuGet; else Page.XwtReferenceSource = XwtSource.Local; }; optGithub.Active = true; CheckBox chkGitSubmodule = null; if (page.Wizard.Parameters["CreateSolution"] == true.ToString ()) { chkGitSubmodule = new CheckBox(GettextCatalog.GetString ("Register Git Submodule\n(will be committed automatically)")) { TooltipText = GettextCatalog.GetString ( "Only if you enable git version control for the new project in the last creation step.\n" + "The Xwt submodule will be registered and initialized during the creation process.") }; chkGitSubmodule.MarginLeft = 30; chkGitSubmodule.Toggled += (sender, e) => Page.XwtGitSubmodule = chkGitSubmodule.Active; sourceGroup.ActiveRadioButtonChanged += (sender, e) => { if (sourceGroup.ActiveRadioButton == optGithub) chkGitSubmodule.Sensitive = true; else chkGitSubmodule.Sensitive = false; }; } var tbl = new Table (); BackgroundColor = Styles.NewProjectDialog.ProjectConfigurationLeftHandBackgroundColor; // use inner table for selection to make it easier to add more options var tblSource = new Table (); var boxGithub = new HBox (); boxGithub.PackStart (optGithub); boxGithub.PackStart (linkGithub); tblSource.Add (boxGithub, 0, 0); var tblGithubRepo = new Table (); tblGithubRepo.MarginLeft = 30; tblGithubRepo.Add (new Label (GettextCatalog.GetString ("Repository:")), 0, 0); cmbGithubRepo = new ComboBox (); cmbGithubRepo.Items.Add ("mono/xwt"); cmbGithubRepo.SelectedIndex = 0; cmbGithubRepo.SelectionChanged += (sender, e) => UpdateBranches (cmbGithubRepo.SelectedText); tblGithubRepo.Add (cmbGithubRepo, 1, 0); spinnerRepo = new Spinner { Visible = false }; tblGithubRepo.Add (spinnerRepo, 2, 0); tblGithubRepo.Add (new Label (GettextCatalog.GetString ("Branch:")), 0, 1); cmbGithubBranch = new ComboBox (); cmbGithubBranch.Items.Add ("master"); cmbGithubBranch.SelectedIndex = 0; cmbGithubBranch.SelectionChanged += (sender, e) => Page.XwtGithubBranch = cmbGithubBranch.SelectedText; tblGithubRepo.Add (cmbGithubBranch, 1, 1); spinnerBranches = new Spinner { Visible = false }; tblGithubRepo.Add (spinnerBranches, 2, 1); tblSource.Add (tblGithubRepo, 0, 1); if (chkGitSubmodule != null) tblSource.Add (chkGitSubmodule, 0, 2); tblSource.Add (optNuGet, 0, 3); tblSource.Add (optBuiltIn, 0, 4); tbl.Add (new Label (GettextCatalog.GetString ("Xwt reference source:")), 0, 0, vpos: WidgetPlacement.Start, hpos: WidgetPlacement.End); tbl.Add (tblSource, 1, 0); var rightFrame = new FrameBox (); rightFrame.BackgroundColor = Styles.NewProjectDialog.ProjectConfigurationRightHandBackgroundColor; ; rightFrame.WidthRequest = 280; Spacing = 0; PackStart (tbl, true, WidgetPlacement.Center, marginLeft: 30, marginRight: 30); PackStart (rightFrame, false, false); UpdateForks (); UpdateBranches ("mono/xwt"); }
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; }
protected override void PopulateViewBoxWithTitle(VBox vBox, IAsset asset) { base.PopulateViewBoxWithTitle(vBox, asset); var mod = asset as IModAsset; var version = new HBox(); version.PackStart(new Label("Version")); version.PackEnd(new Label(mod.Information.IsDevelopment ? "IN DEVELOPMENT" : mod.Tag) { TextAlignment = Alignment.End }); var enabled = new HBox(); enabled.PackStart(new Label("Enabled")); var enabledCheckbox = new CheckBox { Active = mod.Information.IsEnabled, Sensitive = !mod.Information.IsDevelopment }; if (!mod.Information.IsDevelopment) enabledCheckbox.Clicked += (sender, args) => { mod.Information.IsEnabled = !mod.Information.IsEnabled; mod.SaveInformation(); }; enabled.PackEnd(enabledCheckbox); vBox.PackStart(version); vBox.PackStart(enabled); }
/// <summary> /// Initialize window. /// </summary> public override void _initializeComponents() { // Server Name + URL + Periodicity window Frame f = new Frame(); f.Label = Director.Properties.Resources.ServerSettings; f.Padding = 10; // Create VBOX VBox ServerSettings = new VBox(); // Prepare text box ServerSettings.PackStart(new Label() { Text = Director.Properties.Resources.ServerName }); ServerName = new TextEntry(); ServerName.Changed += ServerName_Changed; ServerSettings.PackStart(ServerName); // Add invalid server name ServerSettings.PackStart(InvalidServerName); // Server URL ServerSettings.PackStart(new Label() { Text = Director.Properties.Resources.ServerURL }); ServerURL = new TextEntry(); ServerURL.Changed += ServerURL_Changed; ServerSettings.PackStart(ServerURL); // Invalid URL ServerSettings.PackStart(InvalidServerURL); // Frequency settings ServerSettings.PackStart(new Label() { Text = Director.Properties.Resources.RunningPeriodicity }); FrequencyRunning = new ComboBox(); FrequencyHelper.FillComboBox(FrequencyRunning); ServerSettings.PackStart(FrequencyRunning); FrequencyRunning.SelectedIndex = 0; FrequencyRunning.SelectionChanged += FrequencyRunning_SelectionChanged; // Add Frame to server settings f.Content = ServerSettings; PackStart(f); // Authorization AuthRequired = new CheckBox(Director.Properties.Resources.Authorization); AuthRequired.MarginLeft = 10; PackStart(AuthRequired); // Create Authentication Frame Authentication = new Frame() { Label = Director.Properties.Resources.AuthorizationSettings, Padding = 10 }; // Login and Password fields VBox AuthBox = new VBox(); AuthBox.PackStart(new Label() { Text = Director.Properties.Resources.Username }); AuthUserName = new TextEntry(); AuthUserName.Changed += AuthUserName_Changed; AuthBox.PackStart(AuthUserName); AuthBox.PackStart(new Label() { Text = Director.Properties.Resources.Password }); AuthUserPassword = new PasswordEntry(); AuthUserPassword.Changed += AuthUserPassword_Changed; AuthBox.PackStart(AuthUserPassword); // Authentication content Authentication.Content = AuthBox; PackStart(Authentication); // Change value AuthRequired.Toggled += AuthRequired_Toggled; // Email settings Frame EmailFrame = new Frame() { Label = Director.Properties.Resources.EmailNotifications, Padding = 10, MinHeight = 180 }; // Create EmailList widget EmailWidget = new EmailList(); EmailFrame.Content = EmailWidget; PackStart(EmailFrame, expand: true, fill: true); }
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 (); }
public override Widget ToWidget() { CheckBox checkbox = new CheckBox(); checkbox.State = val ? CheckBoxState.On : CheckBoxState.Off; return checkbox; }
/// <summary> /// Init. /// </summary> void _initializeComponents() { // Create content box VBox ContentBox = new VBox (); // Create Item count ItemCount = new RadioButton (Director.Properties.Resources.CompareItemCount); ContentBox.PackStart (ItemCount); // Create All item template AllItemsTemplate = new RadioButton (Director.Properties.Resources.CompareAllArrayItem); ContentBox.PackStart (AllItemsTemplate); // Set group ItemCount.Group = AllItemsTemplate.Group; ItemCount.Group.ActiveRadioButtonChanged += CompareTypeChanged_Event; // Type ContentBox.PackStart (new Label (Director.Properties.Resources.FormatType) { Font = Font.SystemFont.WithWeight (FontWeight.Bold) }, true, false); // Combo box FormatTypeSelect = new ComboBox (); // Add items FormatTypeSelect.Items.Add ("string", "String"); FormatTypeSelect.Items.Add ("integer", "Integer"); FormatTypeSelect.Items.Add ("real", "Real"); FormatTypeSelect.Items.Add ("boolean", "Boolean"); FormatTypeSelect.SelectionChanged += FormatTypeSelectionChanged; ContentBox.PackStart (FormatTypeSelect, true, false); // Operations ContentBox.PackStart (new Label (Director.Properties.Resources.Operation) { Font = Font.SystemFont.WithWeight (FontWeight.Bold) }, true, false); FormatOperationsSelect = new ComboBox (); FormatOperationsSelect.Items.Add("ip_", Director.Properties.Resources.PresentsTest); FormatOperationsSelect.Items.Add("eq", Director.Properties.Resources.OperationEquals); FormatOperationsSelect.Items.Add("ne", Director.Properties.Resources.OperationNotEquals); FormatOperationsSelect.Items.Add("lte", Director.Properties.Resources.OperationLessThanOrEquals); FormatOperationsSelect.Items.Add("gt", Director.Properties.Resources.OperationGreatherThan); FormatOperationsSelect.Items.Add("gte", Director.Properties.Resources.OperationGreatherThanOrEqual); FormatOperationsSelect.Items.Add("mp", Director.Properties.Resources.OperationMatchingRegex); FormatOperationsSelect.SelectedIndex = 0; // Select - fill combo box FormatTypeSelect.SelectedIndex = 0; // Add ContentBox.PackStart (FormatOperationsSelect, true, false); // Create items UseVariable = new CheckBox (Director.Properties.Resources.VariableInsteadConditionValue); ContentBox.PackStart (UseVariable, true, false); // Evaluate this if present EvalIfPresent = new CheckBox (Director.Properties.Resources.EvaluateConditionIfParameterIsPresent); ContentBox.PackStart (EvalIfPresent, true, false); // Value ContentBox.PackStart (new Label (Director.Properties.Resources.ConditionValue) { Font = Font.SystemFont.WithWeight (FontWeight.Bold) }, true, false); ConditionValue = new TextEntry (); ContentBox.PackStart (ConditionValue, true, false); // Save to variable ContentBox.PackStart (new Label (Director.Properties.Resources.SaveToVariable) { Font = Font.SystemFont.WithWeight (FontWeight.Bold) }, true, false); SaveToVariable = new TextEntry (); ContentBox.PackStart (SaveToVariable, true, false); // Set active ItemCount.Active = true; // Set content Content = ContentBox; }
private void Build() { if(Toolkit.CurrentEngine.Type == ToolkitType.Wpf) this.BackgroundColor = (new Button()).BackgroundColor; vbox1 = new VBox(); label1 = new Label("Select Font:"); label1.MarginTop = 4; label1.MarginRight = 4; label1.MarginLeft = 4; vbox1.PackStart(label1); table1 = new Table(); table1.MarginRight = 4; table1.MarginLeft = 4; radioButton1 = new RadioButton("From System: "); table1.Add(radioButton1, 0, 0); combo_font = new ComboBox(); List<string> fonts = new List<string>(); foreach (System.Drawing.FontFamily font in System.Drawing.FontFamily.Families) fonts.Add(font.Name); fonts.Sort(); foreach (string font in fonts) combo_font.Items.Add(font); if(combo_font.Items.Contains("Arial")) combo_font.SelectedText = "Arial"; else if(combo_font.Items.Count > 0) combo_font.SelectedIndex = 0; combo_font.Font = Xwt.Drawing.Font.FromName(combo_font.SelectedText).WithSize(combo_font.Font.Size); table1.Add(combo_font, 1, 0, 1, 1, true); radioButton2 = new RadioButton(); radioButton2.Label = "From File: "; radioButton2.Sensitive = true; radioButton2.Group = radioButton1.Group; table1.Add(radioButton2, 0, 1); hbox1 = new HBox(); entry_font = new TextEntry(); entry_font.Sensitive = false; hbox1.PackStart(entry_font, true); button_font = new Button("Browse"); button_font.Sensitive = false; hbox1.PackStart(button_font); table1.Add(hbox1, 1, 1); vbox1.PackStart(table1); notebook1 = new Notebook(); notebook1.ExpandHorizontal = true; notebook1.ExpandVertical = true; table2 = new Table(); table2.Margin = 4; label4 = new Label("Style:"); table2.Add(label4, 0, 0); hbox2 = new HBox(); check_bold = new CheckBox("Bold "); check_bold.BackgroundColor = Color.FromBytes(0, 0, 0, 0); hbox2.PackStart(check_bold); check_italic = new CheckBox("Italic "); check_italic.BackgroundColor = Color.FromBytes(0, 0, 0, 0); hbox2.PackStart(check_italic); check_kerning = new CheckBox("Kerning "); check_kerning.BackgroundColor = Color.FromBytes(0, 0, 0, 0); hbox2.PackStart(check_kerning); table2.Add(hbox2, 0, 1, 1, 1); label2 = new Label("Size:"); table2.Add(label2, 0, 2); entry_size = new NumericEntry("0", "WARNING: Size needs to be a number"); table2.Add(entry_size, 0, 3, 1, 1, true); label3 = new Label("Spacing:"); table2.Add(label3, 0, 4); entry_spacing = new NumericEntry("0", "WARNING: Spacing needs to be a number"); table2.Add(entry_spacing, 0, 5, 1, 1, true); check_defchar = new CheckBox("Default Character:"); check_defchar.BackgroundColor = Color.FromBytes(0, 0, 0, 0); table2.Add(check_defchar, 0, 6); entry_defchar = new TextEntry(); entry_defchar.Sensitive = false; entry_defchar.TextAlignment = Alignment.Center; table2.Add(entry_defchar, 0, 7, 1, 1, true); notebook1.Add(table2, "Global"); hbox3 = new HBox(); listView1 = new ListView(); hbox3.PackStart(listView1, true); vbox2 = new VBox(); vbox2.MarginRight = 5; vbox2.MarginTop = 5; label8 = new Label(" Main:"); vbox2.PackStart(label8); button_plus = new Button("Add"); vbox2.PackStart(button_plus); button_minus = new Button("Remove"); button_minus.Sensitive = false; vbox2.PackStart(button_minus); button_edit = new Button("Edit"); button_edit.Sensitive = false; vbox2.PackStart(button_edit); vbox2.PackStart(new HSeparator()); label9 = new Label(" Move:"); vbox2.PackStart(label9); button_up = new Button("Up"); button_up.Sensitive = false; vbox2.PackStart(button_up); button_down = new Button("Down"); button_down.Sensitive = false; vbox2.PackStart(button_down); hbox3.PackStart(vbox2); notebook1.Add(hbox3, "Characters"); var pa = new VBox(); textEditor1 = new TextEditor(); textEditor1.Document.MimeType = "application/xml"; pa.PackStart(textEditor1, true); notebook1.Add(pa, "Xml"); vbox3 = new VBox(); hbox4 = new HBox(); hbox4.Margin = 5; label5 = new Label("Font Color: "); hbox4.PackStart(label5); color_font = new ColorPicker(); color_font.Color = Color.FromBytes(0, 0, 0); color_font.SupportsAlpha = false; hbox4.PackStart(color_font); label6 = new Label("Background Color: "); hbox4.PackStart(label6); color_back = new ColorPicker(); color_back.Color = Color.FromBytes(224, 224, 209); color_back.SupportsAlpha = false; hbox4.PackStart(color_back); vbox3.PackStart(hbox4); hbox5 = new HBox(); hbox5.MarginLeft = 5; hbox5.MarginRight = 5; label7 = new Label("Text: "); hbox5.PackStart(label7); entry_text = new TextEntry(); entry_text.Text = "The quick brown fox jumps over the lazy dog"; hbox5.PackStart(entry_text, true); button_preview = new Button("Preview"); hbox5.PackStart(button_preview); vbox3.PackStart(hbox5); web1 = new WebView(); scrollView2 = new ScrollView(); scrollView2.HorizontalScrollPolicy = ScrollPolicy.Automatic; scrollView2.VerticalScrollPolicy = ScrollPolicy.Automatic; if (Toolkit.CurrentEngine.Type != ToolkitType.Gtk) scrollView2.Content = web1; vbox3.PackStart(scrollView2, true); notebook1.Add(vbox3, "Preview"); vbox1.PackStart(notebook1, true); this.Content = vbox1; }
/// <summary>Converts Xwt.CheckBox selection status into boolean value</summary> private bool BoolFromCBX(CheckBox CBX) { switch (CBX.State){ case CheckBoxState.On: return true; case CheckBoxState.Off: return false; } return false; //fallback }
/// <summary> /// Init components. /// </summary> private void _initializeComponents() { VBox ContentBox = new VBox(); // First value Value = new RadioButton(Director.Properties.Resources.JsonValue); ContentBox.PackStart(Value); // Horizontal HBox ValueBox = new HBox(); // Options ValueType = new ComboBox() { WidthRequest = 80 }; ValueType.Items.Add(DataType.TYPE_STRING, "String"); ValueType.Items.Add(DataType.TYPE_INT, "Integer"); ValueType.Items.Add(DataType.TYPE_DOUBLE, "Double"); ValueType.Items.Add(DataType.TYPE_NULL, "Null"); ValueType.Items.Add(DataType.TYPE_BOOL, "Boolean"); ValueType.SelectedIndex = 0; ValueBox.PackStart(ValueType, false, false); // Value ValueText = new TextEntry(); ValueBox.PackStart(ValueText, true, true); ContentBox.PackStart(ValueBox); // Guide Format = new RadioButton(Director.Properties.Resources.FormatGuide); ContentBox.PackStart(Format); Value.Group = Format.Group; Value.Active = true; Value.Group.ActiveRadioButtonChanged += GroupChanged_Event; // Type ContentBox.PackStart (new Label (Director.Properties.Resources.FormatType) { Font = Font.SystemFont.WithWeight (FontWeight.Bold) }, true, false); // Combo box FormatTypeSelect = new ComboBox (); // Add items FormatTypeSelect.Items.Add ("string", "String"); FormatTypeSelect.Items.Add ("integer", "Integer"); FormatTypeSelect.Items.Add ("real", "Real"); FormatTypeSelect.Items.Add ("boolean", "Boolean"); FormatTypeSelect.SelectionChanged += delegate { var selectedItem = FormatOperationsSelect.SelectedItem; FormatOperationsSelect.Items.Clear(); // Always FormatOperationsSelect.Items.Add("ip_", Director.Properties.Resources.PresentsTest); FormatOperationsSelect.Items.Add("eq", Director.Properties.Resources.OperationEquals); FormatOperationsSelect.Items.Add("ne", Director.Properties.Resources.OperationNotEquals); if (((String)FormatTypeSelect.SelectedItem) != "boolean") { FormatOperationsSelect.Items.Add ("lt", Director.Properties.Resources.OperationLessThan); FormatOperationsSelect.Items.Add("lte", Director.Properties.Resources.OperationLessThanOrEquals); FormatOperationsSelect.Items.Add("gt", Director.Properties.Resources.OperationGreatherThan); FormatOperationsSelect.Items.Add("gte", Director.Properties.Resources.OperationGreatherThanOrEqual); if (((String)FormatTypeSelect.SelectedItem) == "string") FormatOperationsSelect.Items.Add ("mp", Director.Properties.Resources.OperationMatchingRegex); } FormatOperationsSelect.SelectedItem = selectedItem; if (FormatOperationsSelect.SelectedIndex == -1) FormatOperationsSelect.SelectedIndex = 0; }; ContentBox.PackStart (FormatTypeSelect, true, false); // Operations ContentBox.PackStart (new Label (Director.Properties.Resources.Operation) { Font = Font.SystemFont.WithWeight (FontWeight.Bold) }, true, false); FormatOperationsSelect = new ComboBox (); FormatOperationsSelect.Items.Add("ip_", Director.Properties.Resources.PresentsTest); FormatOperationsSelect.Items.Add("eq", Director.Properties.Resources.OperationEquals); FormatOperationsSelect.Items.Add("ne", Director.Properties.Resources.OperationNotEquals); FormatOperationsSelect.Items.Add("lt", Director.Properties.Resources.OperationLessThan); FormatOperationsSelect.Items.Add("lte", Director.Properties.Resources.OperationLessThanOrEquals); FormatOperationsSelect.Items.Add("gt", Director.Properties.Resources.OperationGreatherThan); FormatOperationsSelect.Items.Add("gte", Director.Properties.Resources.OperationGreatherThanOrEqual); FormatOperationsSelect.Items.Add("mp", Director.Properties.Resources.OperationMatchingRegex); FormatOperationsSelect.SelectedIndex = 0; // Select - fill combo box FormatTypeSelect.SelectedIndex = 0; // Add ContentBox.PackStart (FormatOperationsSelect, true, false); // Use variable instead of value UseVariable = new CheckBox(Director.Properties.Resources.UseVarInsteadOfValue); ContentBox.PackStart (UseVariable, true, false); // Evaluate this if present EvalIfPresent = new CheckBox(Director.Properties.Resources.EvalCondIfParIsPresent); ContentBox.PackStart (EvalIfPresent, true, false); // Value ContentBox.PackStart(new Label(Director.Properties.Resources.ConditionValue) { Font = Font.SystemFont.WithWeight(FontWeight.Bold) }, true, false); ConditionValue = new TextEntry (); ContentBox.PackStart (ConditionValue, true, false); // Save to variable ContentBox.PackStart(new Label(Director.Properties.Resources.SaveToVariable) { Font = Font.SystemFont.WithWeight(FontWeight.Bold) }, true, false); SaveToVariable = new TextEntry (); ContentBox.PackStart (SaveToVariable, true, false); // Change selection FormatOperationsSelect.SelectionChanged += delegate { string item = (String)FormatOperationsSelect.SelectedItem; if (item == "ip_") { UseVariable.Sensitive = false; ConditionValue.Sensitive = false; EvalIfPresent.Sensitive = false; } else { UseVariable.Sensitive = true; ConditionValue.Sensitive = true; EvalIfPresent.Sensitive = true; } }; // Content Content = ContentBox; }
private Widget MakePanel() { var panel = new VBox(); tableCards = new Table(); tableCards.WidthRequest = 900; tableCards.BackgroundColor = LightBlue; tableCards.DefaultColumnSpacing = 20; tableCards.Margin = 5; panel.PackStart(tableCards, true, true); var bottomBar = new HBox(); showHiddenCards = new CheckBox("Show Hidden Cards"); bottomBar.PackStart(showHiddenCards); showCompletedCards = new CheckBox("Show Completed Cards"); bottomBar.PackStart(showCompletedCards); panel.PackStart(bottomBar); cardMenu = new MiniCardContextMenu(); return panel; }
public OptionView(LauncherWindow window) { _texturePacks = new List<TexturePack>(); _lastTexturePack = null; Window = window; this.MinWidth = 250; OptionLabel = new Label("Options") { Font = Font.WithSize(16), TextAlignment = Alignment.Center }; ResolutionLabel = new Label("Select a resolution..."); ResolutionComboBox = new ComboBox(); int resolutionIndex = -1; for (int i = 0; i < WindowResolution.Defaults.Length; i++) { ResolutionComboBox.Items.Add(WindowResolution.Defaults[i].ToString()); if (resolutionIndex == -1) { resolutionIndex = ((WindowResolution.Defaults[i].Width == UserSettings.Local.WindowResolution.Width) && (WindowResolution.Defaults[i].Height == UserSettings.Local.WindowResolution.Height)) ? i : -1; } } if (resolutionIndex == -1) { ResolutionComboBox.Items.Add(UserSettings.Local.WindowResolution.ToString()); resolutionIndex = ResolutionComboBox.Items.Count - 1; } ResolutionComboBox.SelectedIndex = resolutionIndex; FullscreenCheckBox = new CheckBox() { Label = "Fullscreen mode", State = (UserSettings.Local.IsFullscreen) ? CheckBoxState.On : CheckBoxState.Off }; TexturePackLabel = new Label("Select a texture pack..."); TexturePackImageField = new DataField<Image>(); TexturePackTextField = new DataField<string>(); TexturePackStore = new ListStore(TexturePackImageField, TexturePackTextField); TexturePackListView = new ListView { MinHeight = 200, SelectionMode = SelectionMode.Single, DataSource = TexturePackStore, HeadersVisible = false }; OpenFolderButton = new Button("Open texture pack folder"); BackButton = new Button("Back"); TexturePackListView.Columns.Add("Image", TexturePackImageField); TexturePackListView.Columns.Add("Text", TexturePackTextField); ResolutionComboBox.SelectionChanged += (sender, e) => { UserSettings.Local.WindowResolution = WindowResolution.FromString(ResolutionComboBox.SelectedText); UserSettings.Local.Save(); }; FullscreenCheckBox.Clicked += (sender, e) => { UserSettings.Local.IsFullscreen = !UserSettings.Local.IsFullscreen; UserSettings.Local.Save(); }; TexturePackListView.SelectionChanged += (sender, e) => { var texturePack = _texturePacks[TexturePackListView.SelectedRow]; if (_lastTexturePack != texturePack) { UserSettings.Local.SelectedTexturePack = texturePack.Name; UserSettings.Local.Save(); } }; OpenFolderButton.Clicked += (sender, e) => { var dir = new DirectoryInfo(TexturePack.TexturePackPath); Process.Start(dir.FullName); }; BackButton.Clicked += (sender, e) => { Window.MainContainer.Remove(this); Window.MainContainer.PackEnd(Window.MainMenuView); }; OfficialAssetsButton = new Button("Download Minecraft assets") { Visible = false }; OfficialAssetsButton.Clicked += OfficialAssetsButton_Clicked; OfficialAssetsProgress = new ProgressBar() { Visible = false, Indeterminate = true }; LoadTexturePacks(); this.PackStart(OptionLabel); this.PackStart(ResolutionLabel); this.PackStart(ResolutionComboBox); this.PackStart(FullscreenCheckBox); this.PackStart(TexturePackLabel); this.PackStart(TexturePackListView); this.PackStart(OfficialAssetsProgress); this.PackStart(OfficialAssetsButton); this.PackStart(OpenFolderButton); this.PackEnd(BackButton); }
/// <summary> /// Create all checkboxes in VBox layout. /// </summary> private void _initializeComponents() { // Create list ScenarioCheckboxList = new VBox(); // Create select all checkbox SelectAll = new CheckBox(Director.Properties.Resources.SelectAll); SelectAll.Toggled += SelectAll_Toggled; ScenarioCheckboxList.PackStart(SelectAll); // Create all scenarios checkboxes foreach (Scenario s in ActiveServer.Scenarios) { CheckBoxListItem c = new CheckBoxListItem() { ScenarioCheckBox = new CheckBox(s.Name), ScenarioInstance = s }; c.ScenarioCheckBox.Toggled += ScenarioList_Clicked; ScenarioCheckboxList.PackStart(c.ScenarioCheckBox); CheckBoxes.Add(c); } // Scroll view ListScrollBar = new ScrollView() { VerticalScrollPolicy = ScrollPolicy.Automatic, HorizontalScrollPolicy = ScrollPolicy.Never, Content = ScenarioCheckboxList }; // Add as content Content = ListScrollBar; }
/// <summary> /// Create list item with specific conditions. /// </summary> public EmailListItem(EmailList parent, Email s, Color bgColor) { // Set height MinHeight = EmailList.ROW_HEIGHT; HeightRequest = EmailList.ROW_HEIGHT; // Set background color BackgroundColor = DefaultColor = bgColor; // Self expand horizontal and vertical ExpandHorizontal = true; ExpandVertical = true; // No margin at all Margin = 0; // Set parent & active email ListParent = parent; ActiveEmail = s; EmailText = new TextEntry() { Text = s.UserEmail, MarginLeft = 5, HorizontalPlacement = WidgetPlacement.Fill, VerticalPlacement = WidgetPlacement.Center, MarginTop = 1, ExpandHorizontal = true, ExpandVertical = false }; EmailText.Changed += delegate { s.UserEmail = EmailText.Text; if (Email.IsValid(EmailText.Text)) { BackgroundColor = DefaultColor; } else { BackgroundColor = Colors.Red; EmailText.SetFocus(); } }; PackStart(EmailText, true, true); // Error Errors = new CheckBox() { State = (s.Errors) ? CheckBoxState.On : CheckBoxState.Off, WidthRequest = EmailList.ERROR_WIDTH, MinWidth = EmailList.ERROR_WIDTH, HorizontalPlacement = WidgetPlacement.Center, VerticalPlacement = WidgetPlacement.Center, MarginLeft = 25 }; Errors.Toggled += delegate { s.Errors = Errors.State == CheckBoxState.On; }; PackStart(Errors); // Notification Notification = new CheckBox() { State = (s.Notifications) ? CheckBoxState.On : CheckBoxState.Off, WidthRequest = EmailList.ERROR_WIDTH, MinWidth = EmailList.ERROR_WIDTH, HorizontalPlacement = WidgetPlacement.Center, VerticalPlacement = WidgetPlacement.Center }; Notification.Toggled += delegate { s.Notifications = Notification.State == CheckBoxState.On; }; PackStart(Notification); // Button RemoveEmail = new Button(Image.FromResource(DirectorImages.CROSS_ICON)) { HorizontalPlacement = WidgetPlacement.Center, VerticalPlacement = WidgetPlacement.Center, MarginRight = 20 }; RemoveEmail.Clicked += delegate { parent.RemoveEmail(ActiveEmail); }; PackStart(RemoveEmail); }
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 (); }