void IOptionsPanel.Initialize (OptionsDialog dialog, object dataObject) { this.ExpandHorizontal = true; this.ExpandVertical = true; this.HeightRequest = 400; list = new ListView (); store = new ListStore (language, completeOnSpace, completeOnChars); var languageColumn = list.Columns.Add (GettextCatalog.GetString ("Language"), language); languageColumn.CanResize = true; var checkBoxCellView = new CheckBoxCellView (completeOnSpace); checkBoxCellView.Editable = true; var completeOnSpaceColumn = list.Columns.Add (GettextCatalog.GetString ("Complete on space"), checkBoxCellView); completeOnSpaceColumn.CanResize = true; var textCellView = new TextCellView (completeOnChars); textCellView.Editable = true; var doNotCompleteOnColumn = list.Columns.Add (GettextCatalog.GetString ("Do complete on"), textCellView); doNotCompleteOnColumn.CanResize = true; list.DataSource = store; PackStart (list, true, true); var hbox = new HBox (); var button = new Button ("Reset to default"); button.Clicked += delegate { FillStore (CompletionCharacters.GetDefaultCompletionCharacters ()); }; hbox.PackEnd (button, false, false); PackEnd (hbox, false, true); FillStore (CompletionCharacters.GetCompletionCharacters ()); }
public ListViewEntries() { ListView list = new ListView (); var editableTextField = new DataField<string> (); var nonEditableTextField = new DataField<string> (); ListStore store = new ListStore (editableTextField, nonEditableTextField); list.DataSource = store; list.GridLinesVisible = GridLines.Horizontal; var textCellView = new TextCellView { Editable = true, TextField = editableTextField }; list.Columns.Add (new ListViewColumn ("Editable", textCellView)); list.Columns.Add (new ListViewColumn ("Not Editable", new TextCellView { Editable = false, TextField = nonEditableTextField })); Random rand = new Random (); for (int n = 0; n < 10; n++) { var r = store.AddRow (); store.SetValue (r, editableTextField, "Editable value " + n); store.SetValue (r, nonEditableTextField, "Non-editable value " + n); } PackStart (list, true); var btn = new Button ("Add Row"); btn.Clicked += delegate { var row = store.AddRow (); store.SetValues (row, editableTextField, "New editable text", nonEditableTextField, "New non-editable text"); list.StartEditingCell (row, textCellView); }; PackStart (btn, false, hpos: WidgetPlacement.Start); }
public EnvironmentVariableCollectionEditor () { store = new ListStore (keyField, valueField); list = new ListView (store); PackStart (list, true); TextCellView crt = new TextCellView (); crt.Editable = true; crt.TextField = keyField; var col = list.Columns.Add (GettextCatalog.GetString ("Variable"), crt); col.CanResize = true; crt.TextChanged += (s,a) => NotifyChanged (); valueCell = new TextCellView (); valueCell.Editable = true; valueCell.TextField = valueField; col = list.Columns.Add (GettextCatalog.GetString ("Value"), valueCell); col.CanResize = true; valueCell.TextChanged += (s, a) => NotifyChanged (); var box = new HBox (); var btn = new Button (GettextCatalog.GetString ("Add")); btn.Clicked += delegate { var row = store.AddRow (); list.SelectRow (row); list.StartEditingCell (row, crt); crt.TextChanged += CrtTextChanged; UpdateButtons (); }; box.PackStart (btn); deleteButton = new Button (GettextCatalog.GetString ("Remove")); deleteButton.Clicked += delegate { var row = list.SelectedRow; if (row != -1) { store.RemoveRow (row); if (row < store.RowCount) list.SelectRow (row); else if (store.RowCount > 0) list.SelectRow (store.RowCount - 1); UpdateButtons (); NotifyChanged (); } }; box.PackStart (deleteButton); PackStart (box); UpdateButtons (); }
private void BuildGui() { this.Resizable = false; _nameEntry.WidthRequest = _ownerEntry.WidthRequest = _computerEntry.WidthRequest = 400; VBox content = new VBox(); Table entryTable = new Table(); entryTable.Add(new Label(GettextCatalog.GetString("Name") + ":"), 0, 0); entryTable.Add(_nameEntry, 1, 0); entryTable.Add(new Label(GettextCatalog.GetString("Owner") + ":"), 0, 1); entryTable.Add(_ownerEntry, 1, 1); entryTable.Add(new Label(GettextCatalog.GetString("Computer") + ":"), 0, 2); entryTable.Add(_computerEntry, 1, 2); // entryTable.Add(new Label(GettextCatalog.GetString("Permissions") + ":"), 0, 3); // _permissions.Items.Add(0, "Private workspace"); // _permissions.Items.Add(1, "Public workspace (limited)"); // _permissions.Items.Add(2, "Public workspace"); // entryTable.Add(_permissions, 1, 3); content.PackStart(entryTable); content.PackStart(new Label(GettextCatalog.GetString("Comment") + ":")); _commentEntry.MultiLine = true; //Not working yet content.PackStart(_commentEntry); content.PackStart(new Label(GettextCatalog.GetString("Working folders") + ":")); _workingFoldersView.DataSource = _workingFoldersStore; _workingFoldersView.MinHeight = 150; _workingFoldersView.MinWidth = 300; var tfsFolderView = new TextCellView(_tfsFolder); tfsFolderView.Editable = true; var localFolderView = new TextCellView(_localFolder); _workingFoldersView.Columns.Add(new ListViewColumn("Source Control Floder", tfsFolderView)); _workingFoldersView.Columns.Add(new ListViewColumn("Local Floder", localFolderView)); content.PackStart(_workingFoldersView); HBox buttonBox = new HBox(); Button addButton = new Button(GettextCatalog.GetString("Add")); addButton.MinWidth = Constants.ButtonWidth; addButton.Clicked += OnAddWorkingFolder; Button removeButton = new Button(GettextCatalog.GetString("Remove")); removeButton.MinWidth = Constants.ButtonWidth; removeButton.Clicked += OnRemoveWorkingFolder; Button okButton = new Button(GettextCatalog.GetString("OK")); okButton.MinWidth = Constants.ButtonWidth; okButton.Clicked += OnAddEditWorkspace; Button cancelButton = new Button(GettextCatalog.GetString("Cancel")); cancelButton.MinWidth = Constants.ButtonWidth; cancelButton.Clicked += (sender, e) => Respond(Command.Cancel); buttonBox.PackStart(addButton); buttonBox.PackStart(removeButton); buttonBox.PackEnd(okButton); buttonBox.PackEnd(cancelButton); content.PackStart(buttonBox); this.Content = content; if (_action == DialogAction.Create) { this.Title = "Add Workspace" + " - " + projectCollection.Server.Name + " - " + projectCollection.Name; FillFieldsDefault(); } else { this.Title = "Edit Workspace " + _workspace.Name + " - " + projectCollection.Server.Name + " - " + projectCollection.Name; FillFields(); FillWorkingFolders(); } }