/// <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); }
/// <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); }