public ImageInfo () : base (null, null) { store = new TreeStore ((int)TypeFundamentals.TypeString, (int)TypeFundamentals.TypeString); tv = new TreeView (store); tv.HeadersVisible = true; TreeViewColumn NameCol = new TreeViewColumn (); CellRenderer NameRenderer = new CellRendererText (); NameCol.Title = "Name"; NameCol.PackStart (NameRenderer, true); NameCol.AddAttribute (NameRenderer, "markup", 0); tv.AppendColumn (NameCol); TreeViewColumn ValueCol = new TreeViewColumn (); CellRenderer ValueRenderer = new CellRendererText (); ValueCol.Title = "Value"; ValueCol.PackStart (ValueRenderer, false); ValueCol.AddAttribute (ValueRenderer, "text", 1); tv.AppendColumn (ValueCol); // // Populate tree // TreeIter iter = new TreeIter (); PopulateGeneral (out iter); PopulateDetails (out iter); Add (tv); }
private void SetupTreeView() { { var column = new TreeViewColumn(); var cell = new CellRendererText(); column.Title = "Customer ID"; column.PackStart(cell, true); column.AddAttribute(cell, "text", (int)Column.CustomerID); this.treeview1.AppendColumn(column); } { var column = new TreeViewColumn(); var cell = new CellRendererText(); column.Title = "First Name"; column.PackStart(cell, true); column.AddAttribute(cell, "text", (int)Column.FirstName); this.treeview1.AppendColumn(column); } { var column = new TreeViewColumn(); var cell = new CellRendererText(); column.Title = "Last Name"; column.PackStart(cell, true); column.AddAttribute(cell, "text", (int)Column.LastName); this.treeview1.AppendColumn(column); } this.treeStore1 = (TreeStore)this.SetupTreeViewModel(); this.treeview1.Model = this.treeStore1; this.treeview1.ExpandAll(); }
public GtkSharpVectorViewer(string[] args) { XML glade = new XML (null, "svg-viewer.glade", "MainWindow", null); glade.Autoconnect (this); glade["bgEventBox"].ModifyBg(StateType.Normal, glade["MainWindow"].Style.Background (Gtk.StateType.Active)); svgWidget = new SvgImageWidget(); // mainPaned.Add2 (svgWidget); // mainPaned.Pack2 (svgWidget, false, false); // mainHBox.PackStart (svgWidget, true, true, 0); (glade["svgViewport"] as Viewport).Add(svgWidget); svgWidget.Show(); testsStore = new TreeStore(typeof(string)); testsTreeView.Model = testsStore; testsTreeView.AppendColumn("Test Name", new CellRendererText(), "text", 0); if (args.Length > 0) { LoadUri (new Uri(args[0])); } AddW3CTests (); }
/// <summary> /// Initializes a new instance of the <see cref="Sharpend.Xwt.XwtTreeList"/> class. /// </summary> /// <param name='tree'> /// Tree. /// </param> /// <param name='xml'> /// xml definition for the grid or the resource name for the xml /// </param> /// <param name='isResource'> /// if true param xml is a resourcename /// </param> public XwtTreeList(TreeView tree,String xml, bool isResource=true) : this(tree) { Fields = createDataFields(xml,isResource); navigators = new Dictionary<TreeNavigator, VirtualGridRow>(100); //create the treestore IDataField[] df = new IDataField[Fields.Length+1]; for (int i=0;i<Fields.Length;i++) { df[i] = Fields[i].Field; } df[Fields.Length] = new DataField<VirtualTreeRow>(); DataStore = new TreeStore(df); //add columns to the tree //foreach (DatafieldContainer dc in Fields) for (int i=0;i<(Fields.Length-1);i++) { DatafieldContainer dc = Fields[i]; Tree.Columns.Add(dc.Title,dc.Field); //tree. //Tree.Columns.Add(itm); //Tree.ButtonPressed += HandleButtonPressed; } Tree.DataSource = DataStore; }
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; }
public RelayTournamentsView(ICSClient c) { client = c; tournamentIter = TreeIter.Zero; store = new TreeStore (typeof (int), typeof (string), typeof (string)); create_tree (); refreshButton = new Button (Stock.Refresh); refreshButton.Clicked += OnClicked; infoLabel = new Label (); infoLabel.UseMarkup = true; infoLabel.Xalign = 0; infoLabel.Xpad = 4; //infoLabel.Yalign = 0; //infoLabel.Ypad = 4; HBox box = new HBox (); box.PackStart (infoLabel, true, true, 4); box.PackStart (refreshButton, false, false, 4); PackStart (box, false, true, 4); ScrolledWindow scroll = new ScrolledWindow (); scroll.HscrollbarPolicy = scroll.VscrollbarPolicy = PolicyType.Automatic; scroll.Add (tree); PackStart (scroll, true, true, 4); client.AuthEvent += OnAuth; ShowAll (); }
public Tree(string[] args) { Application.Init (); store = new TreeStore (typeof (string), typeof (string)); Glade.XML gxml = new Glade.XML(null, "tree.glade", "window", null ); gxml.Autoconnect( this ); window.Resize(500, 400 ); // eventos window.DeleteEvent += new DeleteEventHandler( Salir ); b_agregar.Clicked += new EventHandler( Agregar ); b_eliminar.Clicked += new EventHandler( Borrar ); b_limpiar.Clicked += new EventHandler( Limpiar ); b_salir.Clicked += new EventHandler( Cerrar ); // crear arbol tv = new TreeView (); tv.Model = store; tv.HeadersVisible = true; tv.AppendColumn ("Nombre", new CellRendererText (), "text", 0); tv.AppendColumn ("Apellidos", new CellRendererText (), "text", 1); scrolledwindow1.Add (tv); window.ShowAll (); Application.Run (); }
/// <summary> /// Initializes a new instance of the <see cref="Baimp.AlgorithmTreeView"/> class. /// </summary> public AlgorithmTreeView(ScanCollection scanCollection) { nameCol = new DataField<object>(); store = new TreeStore(nameCol); Type baseType = typeof(BaseAlgorithm); IEnumerable<Type> algorithms = AppDomain.CurrentDomain.GetAssemblies() .SelectMany(s => s.GetTypes()) .Where(t => t.BaseType == baseType); algorithmCollection = new Dictionary<string, List<BaseAlgorithm>>(); foreach (Type algorithm in algorithms) { BaseAlgorithm instance = Activator.CreateInstance(algorithm, (PipelineNode) null, scanCollection) as BaseAlgorithm; string algorithmType = instance.AlgorithmType.ToString(); if (!algorithmCollection.ContainsKey(algorithmType)) { algorithmCollection[algorithmType] = new List<BaseAlgorithm>(); } algorithmCollection[algorithmType].Add(instance); } InitializeUI(); }
public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); this.c_ProjectTreeView.AppendColumn("Icon", new CellRendererPixbuf(), "pixbuf", 0); this.c_ProjectTreeView.AppendColumn("Project", new CellRendererText(), "text", 1); this.m_Store = new TreeStore(typeof(Pixbuf), typeof(string), typeof(object)); this.c_ProjectTreeView.Model = this.m_Store; this.c_ProjectTreeView.HeadersVisible = false; // Register events. this.c_RegenerateAction.Activated += (object sender, EventArgs e) => { Actions.ResyncProjects(this.Module); }; this.c_ProjectTreeView.RowActivated += (object o, RowActivatedArgs args) => { TreeIter iter; this.m_Store.GetIter(out iter, args.Path); var result = this.m_Store.GetValue(iter, 2); Actions.Open(this.Module, result, this.Update); }; }
//Load the tree store from a simple file list (not json) public static TreeStore LoadTreeStoreFromSimpleManifest(string manifestSimple) { TreeStore ts = new TreeStore(); string curFileName = ""; try { string[] lineArray = manifestSimple.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); foreach (var line in lineArray.ToList<String>()) { string[] treeArray = line.Split(';'); curFileName = treeArray[0]; TextAsset treeText = Resources.Load<TextAsset>(treeArray[0]); ITree tempTree = SimpleTreeParser.getTreeFromString(treeText.text, (TreeType)Int32.Parse(treeArray[1]), ts.globalFlags); tempTree.treeName = treeArray[2]; ts.treeDictionary.Add(Int32.Parse(treeArray[3]), tempTree); } } catch (Exception ex) { Debug.Log(curFileName + ex.Message + ex.StackTrace); string error = ex.Message + ex.StackTrace; return null; } //select the first manifest item as current tree index ts.currentTreeIndex = ts.treeDictionary.Keys.ToList()[0]; return ts; }
public MainWindow() { this.Examples = ExampleLibrary.Examples.GetList().OrderBy(e => e.Category).ToList(); this.plotView = new PlotView(); this.plotView.MinHeight = 554; this.plotView.MinWidth = 625; this.plotView.DefaultTrackerSettings.Enabled = true; this.plotView.DefaultTrackerSettings.Background = Xwt.Drawing.Colors.AliceBlue.WithAlpha (0.9).ToOxyColor(); this.treeView = new TreeView(); this.treeView.MinWidth = 314; this.treeView.Visible = true; var treeModel = new TreeStore(nameCol); TreePosition categoryNode = null; string categoryName = null; foreach (var ex in this.Examples) { if (categoryName == null || categoryName != ex.Category) { categoryNode = treeModel.AddNode ().SetValue (nameCol, ex.Category).CurrentPosition; categoryName = ex.Category; } treeModel.AddNode (categoryNode).SetValue (nameCol, ex.Title); } treeView.Columns.Add ("Example", nameCol); this.treeView.DataSource = treeModel; this.treeView.SelectionChanged += (s, e) => { if (treeView.SelectedRow != null) { var sample = treeModel.GetNavigatorAt (treeView.SelectedRow).GetValue (nameCol); var info = this.Examples.FirstOrDefault(ex => ex.Title == sample); if (info != null) { this.SelectedExample = info; } } }; var hbox = new HBox(); hbox.Spacing = 6; hbox.MinHeight = 554; hbox.MinWidth = 943; hbox.PackStart(this.treeView); hbox.PackStart(this.plotView, true); Content = hbox; this.SelectedExample = this.Examples.FirstOrDefault(); this.Title = "OxyPlot.Xwt Example Browser"; this.CloseRequested += (s, a) => Application.Exit (); }
public ProjectSelectDialog(Microsoft.TeamFoundation.Client.ProjectCollection projectCollection) { this.projectCollection = projectCollection; _treeStore = new TreeStore(_name, _path); BuildGui(); FillTreeView(); }
public MainWindow() { Menu menu = new Menu (); var file = new MenuItem ("File"); file.SubMenu = new Menu (); file.SubMenu.Items.Add (new MenuItem ("Open")); file.SubMenu.Items.Add (new MenuItem ("New")); file.SubMenu.Items.Add (new MenuItem ("Close")); menu.Items.Add (file); var edit = new MenuItem ("Edit"); edit.SubMenu = new Menu (); edit.SubMenu.Items.Add (new MenuItem ("Copy")); edit.SubMenu.Items.Add (new MenuItem ("Cut")); edit.SubMenu.Items.Add (new MenuItem ("Paste")); menu.Items.Add (edit); MainMenu = menu; HBox box = new HBox (); icon = Image.FromResource (typeof(App), "class.png"); store = new TreeStore (nameCol, iconCol, widgetCol); samplesTree = new TreeView (); samplesTree.Columns.Add ("Name", iconCol, nameCol); AddSample (null, "Boxes", typeof(Boxes)); AddSample (null, "Buttons", typeof(ButtonSample)); AddSample (null, "ComboBox", typeof(ComboBoxes)); // AddSample (null, "Designer", typeof(Designer)); AddSample (null, "Drag & Drop", typeof(DragDrop)); var n = AddSample (null, "Drawing", null); AddSample (n, "Canvas with Widget", typeof(CanvasWithWidget)); AddSample (n, "Chart", typeof(ChartSample)); AddSample (n, "Transformations", typeof(DrawingTransforms)); AddSample (null, "Images", typeof(Images)); AddSample (null, "List View", typeof(ListView1)); AddSample (null, "Notebook", typeof(NotebookSample)); // AddSample (null, "Scroll View", typeof(ScrollWindowSample)); AddSample (null, "Text Entry", typeof(TextEntries)); AddSample (null, "Windows", typeof(Windows)); samplesTree.DataSource = store; box.PackStart (samplesTree); sampleBox = new VBox (); title = new Label ("Sample:"); sampleBox.PackStart (title, BoxMode.None); box.PackStart (sampleBox, BoxMode.FillAndExpand); Content = box; samplesTree.SelectionChanged += HandleSamplesTreeSelectionChanged; }
public TreeViewPersons(Gtk.TreeView treeview) { this.treeview = treeview; store = getStore(2); string [] columnsString = { "ID", Catalog.GetString("person")}; treeview.Model = store; prepareHeaders(columnsString); }
private void OnTilesetChanged(Level level) { Tileset tileset = level.Tileset; TreeStore store = new TreeStore(typeof(Tilegroup)); foreach(Tilegroup group in tileset.Tilegroups.Values) { store.AppendValues(group); } Model = store; }
public TreeViewPersons(Gtk.TreeView treeview, int restSeconds) { this.treeview = treeview; RestSecondsMark = restSeconds; store = getStore(3); string [] columnsString = { "ID", Catalog.GetString("person"), Catalog.GetString("Rest")}; treeview.Model = store; prepareHeaders(columnsString); }
public ChooseProjectsDialog(TeamFoundationServer server) { collectionStore = new ListStore(collectionName, collectionItem); projectsStore = new TreeStore(isProjectSelected, projectName, projectItem); BuildGui(); if (server.ProjectCollections == null) SelectedProjects = new List<ProjectInfo>(); else SelectedProjects = new List<ProjectInfo>(server.ProjectCollections.SelectMany(pc => pc.Projects)); LoadData(server); }
/// <summary> /// Fills the values into the emulator browser tree /// </summary> public void UpdateTree() { TreeStore listStore = new TreeStore (typeof(Emulator), typeof(Game)); foreach (Emulator emu in EmulatorController.emulators.OrderBy(o=>o.name)) { TreeIter iter = listStore.AppendValues (emu); foreach (Game game in emu.games) listStore.AppendValues (iter, game); } LibraryTreeView.Model = listStore; }
public override IScrollableWidget CreateScrollableWidget () { DataField<string> text = new DataField<string> (); TreeStore s = new TreeStore (text); var list = new TreeView (s); list.Columns.Add ("Hi", text); for (int n = 0; n < 100; n++) { var r = s.AddNode (); r.SetValue (text, n + new string ('.',100)); } return list; }
public CodeIssuePadControl () { runButton.Clicked += StartAnalyzation; PackStart (runButton, BoxMode.None); store = new TreeStore (text, region); view.DataSource = store; view.HeadersVisible = false; view.Columns.Add ("Name", text); PackStart (view, BoxMode.FillAndExpand); }
protected void buildLinksTree() { //defind datatype of data in the TreeStore ts = new TreeStore (typeof(string), typeof(string), typeof(string), typeof(string)); tv = new TreeView (ts); tv.HeadersVisible = true; //this tree has 3 columns Title, Link and Flag tv.AppendColumn ("Title", new CellRendererText (), "text", 0); tv.AppendColumn ("Flag", new CellRendererText (), "text", 1); tv.AppendColumn ("Link", new CellRendererText (), "text", 2); swLinks.Add (tv); swLinks.ShowAll (); tv.RowActivated += tvRowActivated; }
public CodeIssuePadControl () { var buttonRow = new HBox(); runButton.Clicked += StartAnalyzation; buttonRow.PackStart (runButton); cancelButton.Clicked += StopAnalyzation; cancelButton.Sensitive = false; buttonRow.PackStart (cancelButton); var groupingProvider = new CategoryGroupingProvider { Next = new ProviderGroupingProvider() }; rootGroup = new IssueGroup (groupingProvider, "root group"); var groupingProviderControl = new GroupingProviderChainControl (rootGroup, groupingProviders); buttonRow.PackStart (groupingProviderControl); PackStart (buttonRow); store = new TreeStore (textField, nodeField); view.DataSource = store; view.HeadersVisible = false; view.Columns.Add ("Name", textField); view.SelectionMode = SelectionMode.Multiple; view.RowActivated += OnRowActivated; view.RowExpanding += OnRowExpanding; view.ButtonPressed += HandleButtonPressed; view.ButtonReleased += HandleButtonReleased; PackStart (view, true); IIssueTreeNode node = rootGroup; node.ChildrenInvalidated += (sender, group) => { Application.Invoke (delegate { ClearSiblingNodes (store.GetFirstNode ()); store.Clear (); SyncStateToUi (runner.State); foreach(var child in ((IIssueTreeNode)rootGroup).Children) { var navigator = store.AddNode (); SetNode (navigator, child); SyncNode (navigator); } }); }; node.ChildAdded += HandleRootChildAdded; runner.IssueSink = rootGroup; runner.AnalysisStateChanged += HandleAnalysisStateChanged; }
private static void PopulateStore() { if (store != null) return; store = new TreeStore (typeof (string), typeof (string)); foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies ()) { UpdateDialog ("Loading {0}", asm.GetName ().Name); TreeIter iter = store.AppendValues (asm.GetName ().Name, "Assembly"); ProcessAssembly (iter, asm); } }
public void BindProviderTree() { accountStore = new TreeStore (typeof(string), typeof(Int64)); foreach (var provider in Providers) { TreeIter iter = accountStore.AppendValues (provider.Name); var accounts = accountService.GetByProvider (provider.Id); foreach (var account in accounts) { accountStore.AppendValues (iter, account.Name, account.Id); } } TreeviewAccounts.Model = accountStore; TreeviewAccounts.ButtonPressEvent += new ButtonPressEventHandler (OnItemButtonPressed); }
public TreeViews() { TreeView view = new TreeView (); TreeStore store = new TreeStore (text, desc); view.Columns.Add ("Item", text); view.Columns.Add ("Desc", desc); store.AddNode ().SetValue (text, "One").SetValue (desc, "First"); store.AddNode ().SetValue (text, "Two").SetValue (desc, "Second").AddChild () .SetValue (text, "Sub two").SetValue (desc, "Sub second"); store.AddNode ().SetValue (text, "Three").SetValue (desc, "Third").AddChild () .SetValue (text, "Sub three").SetValue (desc, "Sub third"); PackStart (view); view.DataSource = store; Label la = new Label (); PackStart (la); view.SetDragDropTarget (DragDropAction.All, TransferDataType.Text); view.SetDragSource (DragDropAction.All, TransferDataType.Text); view.DragDrop += delegate(object sender, DragEventArgs e) { TreePosition node; RowDropPosition pos; view.GetDropTargetRow (e.Position.X, e.Position.Y, out pos, out node); var nav = store.GetNavigatorAt (node); la.Text += "Dropped \"" + e.Data.Text + "\" into \"" + nav.GetValue (text) + "\" " + pos + "\n"; e.Success = true; }; view.DragOver += delegate(object sender, DragOverEventArgs e) { TreePosition node; RowDropPosition pos; view.GetDropTargetRow (e.Position.X, e.Position.Y, out pos, out node); if (pos == RowDropPosition.Into) e.AllowedAction = DragDropAction.None; else e.AllowedAction = e.Action; }; view.DragStarted += delegate(object sender, DragStartedEventArgs e) { var val = store.GetNavigatorAt (view.SelectedRow).GetValue (text); e.DragOperation.Data.AddValue (val); e.DragOperation.Finished += delegate(object s, DragFinishedEventArgs args) { Console.WriteLine ("D:" + args.DeleteSource); }; }; }
public BorrowerList(Database database) { this.database = database; store = new TreeStore (typeof(Borrower)); this.Model = store; this.AppendColumn ("Borrowers", new CellRendererText (), new TreeCellDataFunc (ItemCellDataFunc)); this.HeadersVisible = false; this.RulesHint = false; this.Visible = true; this.Selection.Changed += OnSelectionChanged; Fill (); this.ShowAll(); }
private TreeModel SetupTreeViewModel() { TreeIter iter; var model = new TreeStore(typeof(string), typeof(string), typeof(string)); iter = model.AppendValues("Last Name starting with D"); model.AppendValues(iter, "4", "Basia", "Dunlap"); model.AppendValues(iter, "5", "Madaline", "Durham"); iter = model.AppendValues("Last Name starting with N"); model.AppendValues(iter, "2", "Ryan", "Nieves"); iter = model.AppendValues("Last Name starting with S"); model.AppendValues(iter, "1", "Bert", "Sanders"); model.AppendValues(iter, "3", "Cruz", "Strong"); return model; }
public CoursesController(TreeView treeView, Button btnAddSubject, Button btnAddLesson) { this.treeView = treeView; imageCol = new DataField<Xwt.Drawing.Image>(); nameCol = new DataField<string>(); subjectCol = new DataField<Subject>(); lessonCol = new DataField<Lesson>(); store = new TreeStore(imageCol, nameCol, subjectCol, lessonCol); treeView.DataSource = store; treeView.Columns.Add("", imageCol, nameCol); UpdateView(); treeView.SelectionChanged += OnTreeSelectionChanged; this.btnAddLesson = btnAddLesson; btnAddSubject.Clicked += CreateSubject; btnAddLesson.Clicked += CreateLesson; }
public TreeViewEvent(Gtk.TreeView treeview, int newPrefsDigitsNumber, ExpandStates expandState) { this.treeview = treeview; this.pDN = newPrefsDigitsNumber; this.expandState = expandState; //orientative values, used for Run class treeviewHasTwoLevels = false; dataLineNamePosition = 0; dataLineTypePosition = 4; allEventsName = ""; eventIDColumn = 4; columnsString = new string[0]; store = getStore(columnsString.Length +1); //+1 because, eventID is not show in last col treeview.Model = store; prepareHeaders(columnsString); }
public void HiddenTree () { var f = new DataField<string> (); TreeStore ts = new TreeStore (f); var node = ts.AddNode ().SetValue (f, "1").AddChild ().SetValue (f, "2").AddChild ().SetValue (f, "3"); var tree = new TreeView (ts); Window w = new Window (); Notebook nb = new Notebook (); nb.Add (new Label ("Hi"), "One"); nb.Add (tree, "Two"); w.Content = nb; ShowWindow (w); tree.ScrollToRow (node.CurrentPosition); tree.Columns.Add ("Hi", f); tree.ScrollToRow (node.CurrentPosition); }
public KeyBindingsPanel() { this.Build(); keyStore = new TreeStore(typeof(Command), typeof(string), typeof(string), typeof(string), typeof(int), typeof(string), typeof(bool), typeof(bool)); keyTreeView.Model = filterModel = new TreeModelFilter(keyStore, null); filterModel.VisibleColumn = visibleCol; TreeViewColumn col = new TreeViewColumn(); col.Title = GettextCatalog.GetString("Command"); col.Spacing = 4; CellRendererImage crp = new CellRendererImage(); col.PackStart(crp, false); col.AddAttribute(crp, "stock-id", iconCol); col.AddAttribute(crp, "visible", iconVisibleCol); CellRendererText crt = new CellRendererText(); col.PackStart(crt, true); col.AddAttribute(crt, "text", labelCol); col.AddAttribute(crt, "weight", boldCol); keyTreeView.AppendColumn(col); bindingTVCol = new TreeViewColumn(); bindingTVCol.Title = GettextCatalog.GetString("Key Binding"); CellRendererKeyButtons bindingRenderer = new CellRendererKeyButtons(this); bindingRenderer.KeyBindingSelected += BindingRenderer_KeyBindingSelected; bindingTVCol.PackStart(bindingRenderer, false); bindingTVCol.AddAttribute(bindingRenderer, "text", bindingCol); bindingTVCol.AddAttribute(bindingRenderer, "command", commandCol); keyTreeView.AppendColumn(bindingTVCol); keyTreeView.AppendColumn(GettextCatalog.GetString("Description"), new CellRendererText(), "text", descCol); keyTreeView.Selection.Changed += OnKeysTreeViewSelectionChange; accelEntry.KeyPressEvent += OnAccelEntryKeyPress; accelEntry.KeyReleaseEvent += OnAccelEntryKeyRelease; accelEntry.Changed += delegate { UpdateWarningLabel(); }; updateButton.Clicked += OnUpdateButtonClick; addButton.Clicked += OnAddRemoveButtonClick; currentBindings = KeyBindingService.CurrentKeyBindingSet.Clone(); schemes = new List <KeyBindingScheme> (KeyBindingService.Schemes); foreach (KeyBindingScheme s in schemes) { schemeCombo.AppendText(s.Name); } if (schemes.Count > 0) { schemeCombo.RowSeparatorFunc = (TreeModel model, TreeIter iter) => { if (model.GetValue(iter, 0) as string == "---") { return(true); } return(false); }; schemeCombo.AppendText("---"); } schemeCombo.AppendText(GettextCatalog.GetString("Custom")); SelectCurrentScheme(); schemeCombo.Changed += OnKeyBindingSchemeChanged; searchEntry.Ready = true; searchEntry.Visible = true; searchEntry.Changed += delegate { processedFilterTerms = searchEntry.Entry.Text.ToLower().Split(new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries); filterChanged = true; if (!filterTimeoutRunning) { filterTimeoutRunning = true; GLib.Timeout.Add(50, delegate { if (!filterChanged) { if (filterTimeoutRunning) { Refilter(); } filterTimeoutRunning = false; return(false); } filterChanged = false; return(true); }); } ; }; keyTreeView.SearchColumn = -1; // disable the interactive search //HACK: workaround for MD Bug 608021: Stetic loses values assigned to "new" properties of custom widget conflicButton.Label = GettextCatalog.GetString("_View Conflicts"); conflicButton.UseUnderline = true; }
public MainWindow() { Menu menu = new Menu(); var file = new MenuItem("File"); file.SubMenu = new Menu(); file.SubMenu.Items.Add(new MenuItem("Open")); file.SubMenu.Items.Add(new MenuItem("New")); file.SubMenu.Items.Add(new MenuItem("Close")); menu.Items.Add(file); var edit = new MenuItem("Edit"); edit.SubMenu = new Menu(); edit.SubMenu.Items.Add(new MenuItem("Copy")); edit.SubMenu.Items.Add(new MenuItem("Cut")); edit.SubMenu.Items.Add(new MenuItem("Paste")); menu.Items.Add(edit); MainMenu = menu; HBox box = new HBox(); icon = Image.FromResource(typeof(App), "class.png"); store = new TreeStore(nameCol, iconCol, widgetCol); samplesTree = new TreeView(); samplesTree.Columns.Add("Name", iconCol, nameCol); AddSample(null, "Boxes", typeof(Boxes)); AddSample(null, "Buttons", typeof(ButtonSample)); AddSample(null, "ComboBox", typeof(ComboBoxes)); // AddSample (null, "Designer", typeof(Designer)); AddSample(null, "Drag & Drop", typeof(DragDrop)); var n = AddSample(null, "Drawing", null); AddSample(n, "Canvas with Widget", typeof(CanvasWithWidget)); AddSample(n, "Chart", typeof(ChartSample)); AddSample(n, "Transformations", typeof(DrawingTransforms)); AddSample(null, "Images", typeof(Images)); AddSample(null, "List View", typeof(ListView1)); AddSample(null, "Notebook", typeof(NotebookSample)); // AddSample (null, "Scroll View", typeof(ScrollWindowSample)); AddSample(null, "Text Entry", typeof(TextEntries)); AddSample(null, "Windows", typeof(Windows)); samplesTree.DataSource = store; box.PackStart(samplesTree); sampleBox = new VBox(); title = new Label("Sample:"); sampleBox.PackStart(title, BoxMode.None); box.PackStart(sampleBox, BoxMode.FillAndExpand); Content = box; samplesTree.SelectionChanged += HandleSamplesTreeSelectionChanged; }
public MainWindow() { Title = "Xwt Demo Application"; Width = 500; Height = 400; try { statusIcon = Application.CreateStatusIcon(); statusIcon.Menu = new Menu(); statusIcon.Menu.Items.Add(new MenuItem("Test")); statusIcon.Image = Image.FromResource(GetType(), "package.png"); } catch { Console.WriteLine("Status icon could not be shown"); } Menu menu = new Menu(); var file = new MenuItem("File"); file.SubMenu = new Menu(); file.SubMenu.Items.Add(new MenuItem("Open")); file.SubMenu.Items.Add(new MenuItem("New")); MenuItem mi = new MenuItem("Close"); mi.Clicked += delegate { Application.Exit(); }; file.SubMenu.Items.Add(mi); menu.Items.Add(file); var edit = new MenuItem("Edit"); edit.SubMenu = new Menu(); edit.SubMenu.Items.Add(new MenuItem("Copy")); edit.SubMenu.Items.Add(new MenuItem("Cut")); edit.SubMenu.Items.Add(new MenuItem("Paste")); menu.Items.Add(edit); MainMenu = menu; HPaned box = new HPaned(); icon = Image.FromResource(typeof(App), "document-generic.png"); store = new TreeStore(nameCol, iconCol, widgetCol); samplesTree = new TreeView(); samplesTree.Columns.Add("Name", iconCol, nameCol); AddSample(null, "Boxes", typeof(Boxes)); AddSample(null, "Buttons", typeof(ButtonSample)); AddSample(null, "CheckBox", typeof(Checkboxes)); AddSample(null, "Clipboard", typeof(ClipboardSample)); AddSample(null, "ColorSelector", typeof(ColorSelectorSample)); AddSample(null, "ComboBox", typeof(ComboBoxes)); // AddSample (null, "Designer", typeof(Designer)); AddSample(null, "Drag & Drop", typeof(DragDrop)); var n = AddSample(null, "Drawing", null); AddSample(n, "Canvas with Widget (Linear)", typeof(CanvasWithWidget_Linear)); AddSample(n, "Canvas with Widget (Radial)", typeof(CanvasWithWidget_Radial)); AddSample(n, "Chart", typeof(ChartSample)); AddSample(n, "Colors", typeof(ColorsSample)); AddSample(n, "Figures", typeof(DrawingFigures)); AddSample(n, "Transformations", typeof(DrawingTransforms)); AddSample(n, "Images and Patterns", typeof(DrawingPatternsAndImages)); AddSample(n, "Text", typeof(DrawingText)); AddSample(n, "Partial Images", typeof(PartialImages)); AddSample(n, "Custom Drawn Image", typeof(ImageScaling)); AddSample(n, "Widget Rendering", typeof(WidgetRendering)); AddSample(null, "Expander", typeof(ExpanderSample)); AddSample(null, "Progress bars", typeof(ProgressBarSample)); AddSample(null, "Frames", typeof(Frames)); AddSample(null, "Images", typeof(Images)); AddSample(null, "Labels", typeof(Labels)); AddSample(null, "ListBox", typeof(ListBoxSample)); AddSample(null, "LinkLabels", typeof(LinkLabels)); AddSample(null, "ListView", typeof(ListView1)); AddSample(null, "Markdown", typeof(MarkDownSample)); AddSample(null, "Menu", typeof(MenuSamples)); AddSample(null, "Notebook", typeof(NotebookSample)); AddSample(null, "Paneds", typeof(PanedViews)); AddSample(null, "Popover", typeof(PopoverSample)); AddSample(null, "RadioButton", typeof(RadioButtonSample)); AddSample(null, "ReliefFrame", typeof(ReliefFrameSample)); AddSample(null, "Screens", typeof(ScreensSample)); AddSample(null, "Scroll View", typeof(ScrollWindowSample)); AddSample(null, "Scrollbar", typeof(ScrollbarSample)); AddSample(null, "Spinners", typeof(Spinners)); AddSample(null, "Tables", typeof(Tables)); AddSample(null, "Text Entry", typeof(TextEntries)); AddSample(null, "Tooltips", typeof(Tooltips)); AddSample(null, "TreeView", typeof(TreeViews)); AddSample(null, "WidgetEvents", typeof(WidgetEvents)); AddSample(null, "Windows", typeof(Windows)); samplesTree.DataSource = store; box.Panel1.Content = samplesTree; sampleBox = new VBox(); title = new Label("Sample:"); sampleBox.PackStart(title); box.Panel2.Content = sampleBox; box.Panel2.Resize = true; box.Position = 160; Content = box; samplesTree.SelectionChanged += HandleSamplesTreeSelectionChanged; CloseRequested += HandleCloseRequested; }
void crea_treeview_ocupacion() { treeViewEngineocupacion = new TreeStore(typeof(string), //0 typeof(string), //1 typeof(string), //2 typeof(string), //3 typeof(string), //3 typeof(string), //4 typeof(string), //5 typeof(string), //6 typeof(string), //7 typeof(string), //8 typeof(string), //9 typeof(string)); //10 lista_ocupacion.Model = treeViewEngineocupacion; lista_ocupacion.RulesHint = true; TreeViewColumn col_nombre = new TreeViewColumn(); CellRendererText cellrt0 = new CellRendererText(); col_nombre.Title = "NOMBRE"; // titulo de la cabecera de la columna, si está visible col_nombre.PackStart(cellrt0, true); col_nombre.AddAttribute(cellrt0, "text", 0); // la siguiente columna será 1 col_nombre.SortColumnId = (int)Col_ocupacion.col_nombre; col_nombre.Resizable = true; cellrt0.Width = 200; TreeViewColumn col_folio = new TreeViewColumn(); CellRendererText cellrt1 = new CellRendererText(); col_folio.Title = "Folio"; col_folio.PackStart(cellrt1, true); col_folio.AddAttribute(cellrt1, "text", 1); // la siguiente columna será 2 col_folio.SortColumnId = (int)Col_ocupacion.col_folio; TreeViewColumn col_pid = new TreeViewColumn(); CellRendererText cellrt2 = new CellRendererText(); col_pid.Title = "PID"; col_pid.PackStart(cellrt2, true); col_pid.AddAttribute(cellrt2, "text", 2); // la siguiente columna será 3 col_pid.SortColumnId = (int)Col_ocupacion.col_pid; TreeViewColumn col_fecha = new TreeViewColumn(); CellRendererText cellrt11 = new CellRendererText(); col_fecha.Title = "Fecha de Ingreso"; col_fecha.PackStart(cellrt11, true); col_fecha.AddAttribute(cellrt11, "text", 3); // la siguiente columna será 3 col_fecha.SortColumnId = (int)Col_ocupacion.col_fecha; TreeViewColumn col_saldo = new TreeViewColumn(); CellRendererText cellrt3 = new CellRendererText(); col_saldo.Title = "Saldo"; col_saldo.PackStart(cellrt3, true); col_saldo.AddAttribute(cellrt3, "text", 4); // la siguiente columna será 4 col_saldo.SortColumnId = (int)Col_ocupacion.col_saldo; TreeViewColumn col_abono = new TreeViewColumn(); CellRendererText cellrt4 = new CellRendererText(); col_abono.Title = "Abonos"; col_abono.PackStart(cellrt4, true); col_abono.AddAttribute(cellrt4, "text", 5); // la siguiente columna será 5 col_abono.SortColumnId = (int)Col_ocupacion.col_abono; TreeViewColumn col_paga = new TreeViewColumn(); CellRendererText cellrt5 = new CellRendererText(); col_paga.Title = "A Pagar"; col_paga.PackStart(cellrt5, true); col_paga.AddAttribute(cellrt5, "text", 6); // la siguiente columna será 7 col_paga.SortColumnId = (int)Col_ocupacion.col_paga; TreeViewColumn col_medico = new TreeViewColumn(); CellRendererText cellrt6 = new CellRendererText(); col_medico.Title = "Medico Tratante"; col_medico.PackStart(cellrt6, true); col_medico.AddAttribute(cellrt6, "text", 7); // la siguiente columna será 6 col_medico.SortColumnId = (int)Col_ocupacion.col_medico; col_medico.Resizable = true; cellrt6.Width = 200; TreeViewColumn col_cuarto = new TreeViewColumn(); CellRendererText cellrt7 = new CellRendererText(); col_cuarto.Title = "Habitacion"; col_cuarto.PackStart(cellrt7, true); col_cuarto.AddAttribute(cellrt7, "text", 8); // la siguiente columna será 7 col_cuarto.SortColumnId = (int)Col_ocupacion.col_cuarto; TreeViewColumn col_diag = new TreeViewColumn(); CellRendererText cellrt8 = new CellRendererText(); col_diag.Title = "Diagnostico"; col_diag.PackStart(cellrt8, true); col_diag.AddAttribute(cellrt8, "text", 9); // la siguiente columna será 7 col_diag.SortColumnId = (int)Col_ocupacion.col_diag; col_diag.Resizable = true; cellrt8.Width = 300; TreeViewColumn col_tipopac = new TreeViewColumn(); CellRendererText cellrt9 = new CellRendererText(); col_tipopac.Title = "Tipo Paciente"; col_tipopac.PackStart(cellrt9, true); col_tipopac.AddAttribute(cellrt9, "text", 10); // la siguiente columna será 7 col_tipopac.SortColumnId = (int)Col_ocupacion.col_tipopac; //col_tipopac.Resizable = true; //cellrt8.Width = 300; TreeViewColumn col_asegu_empresa = new TreeViewColumn(); CellRendererText cellrt10 = new CellRendererText(); col_asegu_empresa.Title = "Empresa/Aseguradora"; col_asegu_empresa.PackStart(cellrt10, true); col_asegu_empresa.AddAttribute(cellrt10, "text", 11); // la siguiente columna será 7 col_asegu_empresa.SortColumnId = (int)Col_ocupacion.col_asegu_empresa; lista_ocupacion.AppendColumn(col_nombre); lista_ocupacion.AppendColumn(col_folio); lista_ocupacion.AppendColumn(col_pid); lista_ocupacion.AppendColumn(col_fecha); lista_ocupacion.AppendColumn(col_saldo); lista_ocupacion.AppendColumn(col_abono); lista_ocupacion.AppendColumn(col_paga); lista_ocupacion.AppendColumn(col_medico); lista_ocupacion.AppendColumn(col_cuarto); lista_ocupacion.AppendColumn(col_diag); lista_ocupacion.AppendColumn(col_tipopac); lista_ocupacion.AppendColumn(col_asegu_empresa); }
public OverridesImplementsDialog(MonoDevelop.Ide.Gui.Document editor, IType cls) { this.Build(); this.editor = editor; this.cls = cls; // FIXME: title Title = GettextCatalog.GetString("Override and/or implement members"); store = new TreeStore(typeof(bool), typeof(Gdk.Pixbuf), typeof(string), typeof(bool), typeof(IMember)); // Column #1 TreeViewColumn nameCol = new TreeViewColumn(); nameCol.Title = GettextCatalog.GetString("Name"); nameCol.Expand = true; nameCol.Resizable = true; CellRendererToggle cbRenderer = new CellRendererToggle(); cbRenderer.Activatable = true; cbRenderer.Toggled += OnSelectToggled; nameCol.PackStart(cbRenderer, false); nameCol.AddAttribute(cbRenderer, "active", colCheckedIndex); CellRendererPixbuf iconRenderer = new CellRendererPixbuf(); nameCol.PackStart(iconRenderer, false); nameCol.AddAttribute(iconRenderer, "pixbuf", colIconIndex); CellRendererText nameRenderer = new CellRendererText(); nameRenderer.Ellipsize = Pango.EllipsizeMode.End; nameCol.PackStart(nameRenderer, true); nameCol.AddAttribute(nameRenderer, "text", colNameIndex); treeview.AppendColumn(nameCol); // Column #2 CellRendererToggle explicitRenderer = new CellRendererToggle(); explicitRenderer.Activatable = true; explicitRenderer.Xalign = 0.0f; explicitRenderer.Toggled += OnExplicitToggled; TreeViewColumn explicitCol = new TreeViewColumn(); explicitCol.Title = GettextCatalog.GetString("Explicit"); explicitCol.PackStart(explicitRenderer, true); explicitCol.SetCellDataFunc(explicitRenderer, new TreeCellDataFunc(RenderExplicitCheckbox)); explicitCol.AddAttribute(explicitRenderer, "active", colExplicitIndex); treeview.AppendColumn(explicitCol); store.SetSortColumnId(colNameIndex, SortType.Ascending); treeview.Model = store; buttonCancel.Clicked += OnCancelClicked; buttonOk.Clicked += OnOKClicked; buttonSelectAll.Clicked += delegate { SelectAll(true); }; buttonUnselectAll.Clicked += delegate { SelectAll(false); }; refactorer = IdeApp.Workspace.GetCodeRefactorer(IdeApp.ProjectOperations.CurrentSelectedSolution); ambience = AmbienceService.GetAmbienceForFile(cls.GetDefinition().Region.FileName); PopulateTreeView(); UpdateOKButton(); }
public OptionsDialog(MonoDevelop.Components.Window parentWindow, object dataObject, string extensionPath, bool removeEmptySections) { buttonCancel = new Gtk.Button(Gtk.Stock.Cancel); buttonCancel.Accessible.Name = "Dialogs.Options.Cancel"; buttonCancel.Accessible.Description = GettextCatalog.GetString("Close the options dialog and discard any changes"); AddActionWidget(this.buttonCancel, ResponseType.Cancel); buttonOk = new Gtk.Button(Gtk.Stock.Ok); buttonOk.Accessible.Name = "Dialogs.Options.Ok"; buttonOk.Accessible.Description = GettextCatalog.GetString("Close the options dialog and keep the changes"); this.ActionArea.PackStart(buttonOk); buttonOk.Clicked += OnButtonOkClicked; mainHBox = new HBox(); mainHBox.Accessible.SetShouldIgnore(true); tree = new TreeView(); tree.Accessible.Name = "Dialogs.Options.Categories"; tree.Accessible.Description = GettextCatalog.GetString("The categories of options that are available in this dialog"); var sw = new ScrolledWindow(); sw.Accessible.SetShouldIgnore(true); sw.Add(tree); sw.HscrollbarPolicy = PolicyType.Never; sw.VscrollbarPolicy = PolicyType.Automatic; sw.ShadowType = ShadowType.None; var fboxTree = new HeaderBox(); fboxTree.Accessible.SetShouldIgnore(true); fboxTree.SetMargins(0, 1, 0, 1); fboxTree.SetPadding(0, 0, 0, 0); fboxTree.BackgroundColor = new Gdk.Color(255, 255, 255); fboxTree.Add(sw); mainHBox.PackStart(fboxTree, false, false, 0); Realized += delegate { fboxTree.BackgroundColor = tree.Style.Base(Gtk.StateType.Normal); }; var vbox = new VBox(); vbox.Accessible.SetShouldIgnore(true); mainHBox.PackStart(vbox, true, true, 0); var headerBox = new HBox(false, 6); headerBox.Accessible.SetShouldIgnore(true); labelTitle = new Label(); labelTitle.Accessible.Name = "Dialogs.Options.PageTitle"; labelTitle.Xalign = 0; textHeader = new Alignment(0, 0, 1, 1); textHeader.Accessible.SetShouldIgnore(true); textHeader.Add(labelTitle); textHeader.BorderWidth = 12; headerBox.PackStart(textHeader, true, true, 0); imageHeader = new OptionsDialogHeader(); imageHeader.Hide(); var imageHeaderWidget = imageHeader.ToGtkWidget(); imageHeaderWidget.Accessible.SetShouldIgnore(true); headerBox.PackStart(imageHeaderWidget); var fboxHeader = new HeaderBox(); fboxHeader.Accessible.SetShouldIgnore(true); fboxHeader.SetMargins(0, 1, 0, 0); fboxHeader.Add(headerBox); // fbox.GradientBackround = true; // fbox.BackgroundColor = new Gdk.Color (255, 255, 255); Realized += delegate { var c = Style.Background(Gtk.StateType.Normal).ToXwtColor(); c.Light += 0.09; fboxHeader.BackgroundColor = c.ToGdkColor(); }; StyleSet += delegate { if (IsRealized) { var c = Style.Background(Gtk.StateType.Normal).ToXwtColor(); c.Light += 0.09; fboxHeader.BackgroundColor = c.ToGdkColor(); } }; vbox.PackStart(fboxHeader, false, false, 0); pageFrame = new HBox(); pageFrame.Accessible.SetShouldIgnore(true); var fbox = new HeaderBox(); fbox.Accessible.SetShouldIgnore(true); fbox.SetMargins(0, 1, 0, 0); fbox.ShowTopShadow = true; fbox.Add(pageFrame); vbox.PackStart(fbox, true, true, 0); this.VBox.PackStart(mainHBox, true, true, 0); this.removeEmptySections = removeEmptySections; extensionContext = AddinManager.CreateExtensionContext(); this.mainDataObject = dataObject; this.extensionPath = extensionPath; ImageService.EnsureStockIconIsLoaded(emptyCategoryIcon); store = new TreeStore(typeof(OptionsDialogSection)); tree.Model = store; tree.HeadersVisible = false; // Column 0 is used to add some padding at the left of the expander TreeViewColumn col0 = new TreeViewColumn(); col0.MinWidth = 6; tree.AppendColumn(col0); TreeViewColumn col = new TreeViewColumn(); var crp = new CellRendererImage(); col.PackStart(crp, false); col.SetCellDataFunc(crp, PixbufCellDataFunc); var crt = new CellRendererText(); col.PackStart(crt, true); col.SetCellDataFunc(crt, TextCellDataFunc); tree.AppendColumn(col); tree.ExpanderColumn = col; tree.Selection.Changed += OnSelectionChanged; Child.ShowAll(); InitializeContext(extensionContext); FillTree(); ExpandCategories(); RestoreLastPanel(); this.DefaultResponse = Gtk.ResponseType.Ok; buttonOk.CanDefault = true; buttonOk.GrabDefault(); DefaultWidth = 960; DefaultHeight = 680; }
public LogWidget(VersionControlDocumentInfo info) { this.Build(); this.info = info; if (info.Document != null) { this.preselectFile = info.Item.Path; } var separator = new HeaderBox(); separator.SetMargins(1, 0, 0, 0); separator.HeightRequest = 4; separator.ShowAll(); hpaned1 = hpaned1.ReplaceWithWidget(new HPanedThin(), true); vpaned1 = vpaned1.ReplaceWithWidget(new VPanedThin() { HandleWidget = separator }, true); revertButton = new DocumentToolButton("vc-revert-command", GettextCatalog.GetString("Revert changes from this revision")); revertButton.GetNativeWidget <Gtk.Widget> ().Sensitive = false; revertButton.Clicked += new EventHandler(RevertRevisionClicked); revertToButton = new DocumentToolButton("vc-revert-command", GettextCatalog.GetString("Revert to this revision")); revertToButton.GetNativeWidget <Gtk.Widget> ().Sensitive = false; revertToButton.Clicked += new EventHandler(RevertToRevisionClicked); refreshButton = new DocumentToolButton(Gtk.Stock.Refresh, GettextCatalog.GetString("Refresh")); refreshButton.Clicked += new EventHandler(RefreshClicked); searchEntry = new SearchEntry(); searchEntry.WidthRequest = 200; searchEntry.ForceFilterButtonVisible = true; searchEntry.EmptyMessage = GettextCatalog.GetString("Search"); searchEntry.Changed += HandleSearchEntryFilterChanged; searchEntry.Ready = true; searchEntry.Show(); messageRenderer.Ellipsize = Pango.EllipsizeMode.End; TreeViewColumn colRevMessage = new TreeViewColumn(); colRevMessage.Title = GettextCatalog.GetString("Message"); var graphRenderer = new RevisionGraphCellRenderer(); colRevMessage.PackStart(graphRenderer, false); colRevMessage.SetCellDataFunc(graphRenderer, GraphFunc); colRevMessage.PackStart(messageRenderer, true); colRevMessage.SetCellDataFunc(messageRenderer, MessageFunc); colRevMessage.Sizing = TreeViewColumnSizing.Autosize; treeviewLog.AppendColumn(colRevMessage); colRevMessage.MinWidth = 350; colRevMessage.Resizable = true; TreeViewColumn colRevDate = new TreeViewColumn(GettextCatalog.GetString("Date"), textRenderer); colRevDate.SetCellDataFunc(textRenderer, DateFunc); colRevDate.Resizable = true; treeviewLog.AppendColumn(colRevDate); TreeViewColumn colRevAuthor = new TreeViewColumn(); colRevAuthor.Title = GettextCatalog.GetString("Author"); colRevAuthor.PackStart(pixRenderer, false); colRevAuthor.PackStart(textRenderer, true); colRevAuthor.SetCellDataFunc(textRenderer, AuthorFunc); colRevAuthor.SetCellDataFunc(pixRenderer, AuthorIconFunc); colRevAuthor.Resizable = true; treeviewLog.AppendColumn(colRevAuthor); TreeViewColumn colRevNum = new TreeViewColumn(GettextCatalog.GetString("Revision"), textRenderer); colRevNum.SetCellDataFunc(textRenderer, RevisionFunc); colRevNum.Resizable = true; treeviewLog.AppendColumn(colRevNum); treeviewLog.Model = logstore; treeviewLog.Selection.Changed += TreeSelectionChanged; treeviewFiles = new FileTreeView(); treeviewFiles.DiffLineActivated += HandleTreeviewFilesDiffLineActivated; scrolledwindowFiles.Child = treeviewFiles; scrolledwindowFiles.ShowAll(); changedpathstore = new TreeStore(typeof(Xwt.Drawing.Image), typeof(string), // icon/file name typeof(Xwt.Drawing.Image), typeof(string), // icon/operation typeof(string), // path typeof(string), // revision path (invisible) typeof(string []) // diff ); TreeViewColumn colChangedFile = new TreeViewColumn(); var crp = new CellRendererImage(); var crt = new CellRendererText(); colChangedFile.Title = GettextCatalog.GetString("File"); colChangedFile.PackStart(crp, false); colChangedFile.PackStart(crt, true); colChangedFile.AddAttribute(crp, "image", 2); colChangedFile.AddAttribute(crt, "text", 3); treeviewFiles.AppendColumn(colChangedFile); TreeViewColumn colOperation = new TreeViewColumn(); colOperation.Title = GettextCatalog.GetString("Operation"); colOperation.PackStart(crp, false); colOperation.PackStart(crt, true); colOperation.AddAttribute(crp, "image", 0); colOperation.AddAttribute(crt, "text", 1); treeviewFiles.AppendColumn(colOperation); TreeViewColumn colChangedPath = new TreeViewColumn(); colChangedPath.Title = GettextCatalog.GetString("Path"); diffRenderer.DrawLeft = true; colChangedPath.PackStart(diffRenderer, true); colChangedPath.SetCellDataFunc(diffRenderer, SetDiffCellData); treeviewFiles.AppendColumn(colChangedPath); treeviewFiles.Model = changedpathstore; treeviewFiles.TestExpandRow += HandleTreeviewFilesTestExpandRow; treeviewFiles.Events |= Gdk.EventMask.PointerMotionMask; textviewDetails.WrapMode = Gtk.WrapMode.Word; labelAuthor.Text = ""; labelDate.Text = ""; labelRevision.Text = ""; vbox2.Remove(scrolledwindow1); HeaderBox tb = new HeaderBox(); tb.Show(); tb.SetMargins(1, 0, 0, 0); tb.ShowTopShadow = true; tb.ShadowSize = 4; tb.SetPadding(8, 8, 8, 8); tb.UseChildBackgroundColor = true; tb.Add(scrolledwindow1); vbox2.PackStart(tb, true, true, 0); UpdateStyle(); Ide.Gui.Styles.Changed += HandleStylesChanged; }
void CreateView() { store = new TreeStore(itemField, descriptionField, propertyNameField, propertiesField, notificationPreferenceField, notificationPreferencesField); treeView = new TreeView(store); treeView.SelectionChanged += (object sender, EventArgs e) => { if (treeView.SelectedRow != null) { var item = store.GetNavigatorAt(treeView.SelectedRow)?.GetValue(itemField) as AbstractCodeStyleOptionViewModel; if (item != null) { this.viewModel.SetOptionAndUpdatePreview(item.SelectedPreference.IsChecked, item.Option, item.GetPreview()); return; } } return; }; var col = treeView.Columns.Add(GettextCatalog.GetString("Description"), descriptionField); col.Expands = true; var propertyCellView = new ComboBoxCellView(propertyNameField); propertyCellView.Editable = true; propertyCellView.ItemsField = propertiesField; propertyCellView.SelectionChanged += delegate(object sender, WidgetEventArgs e) { var treeNavigator = store.GetNavigatorAt(treeView.CurrentEventRow); if (treeNavigator == null) { return; } var item = treeNavigator.GetValue(itemField); if (item == null) { return; } var text2 = treeNavigator.GetValue(propertyNameField); GLib.Timeout.Add(10, delegate { var text = treeNavigator.GetValue(propertyNameField); foreach (var pref in item.Preferences) { if (pref.Name == text) { item.SelectedPreference = pref; this.viewModel.SetOptionAndUpdatePreview(pref.IsChecked, item.Option, item.GetPreview()); } } return(false); }); }; col = new ListViewColumn(GettextCatalog.GetString("Property"), propertyCellView); col.Expands = true; treeView.Columns.Add(col); var severityCellView = new ComboBoxCellView(notificationPreferenceField); severityCellView.Editable = true; severityCellView.ItemsField = notificationPreferencesField; col = new ListViewColumn(GettextCatalog.GetString("Severity"), severityCellView); treeView.Columns.Add(col); this.PackStart(treeView, true, true); var wrappedEditor = Xwt.Toolkit.CurrentEngine.WrapWidget((Gtk.Widget)viewModel.TextViewHost, Xwt.NativeWidgetSizing.DefaultPreferredSize); this.PackEnd(wrappedEditor, true, true); FillTreeStore(); }
public TreeViews() { TreeView view = new TreeView(); TreeStore store = new TreeStore(text, desc); view.Columns.Add("Item", text); view.Columns.Add("Desc", desc); store.AddNode().SetValue(text, "One").SetValue(desc, "First"); store.AddNode().SetValue(text, "Two").SetValue(desc, "Second").AddChild() .SetValue(text, "Sub two").SetValue(desc, "Sub second"); store.AddNode().SetValue(text, "Three").SetValue(desc, "Third").AddChild() .SetValue(text, "Sub three").SetValue(desc, "Sub third"); PackStart(view, BoxMode.FillAndExpand); view.DataSource = store; Label la = new Label(); PackStart(la); view.SetDragDropTarget(DragDropAction.All, TransferDataType.Text); view.SetDragSource(DragDropAction.All, TransferDataType.Text); view.DragDrop += delegate(object sender, DragEventArgs e) { TreePosition node; RowDropPosition pos; view.GetDropTargetRow(e.Position.X, e.Position.Y, out pos, out node); var nav = store.GetNavigatorAt(node); la.Text += "Dropped \"" + e.Data.Text + "\" into \"" + nav.GetValue(text) + "\" " + pos + "\n"; e.Success = true; }; view.DragOver += delegate(object sender, DragOverEventArgs e) { TreePosition node; RowDropPosition pos; view.GetDropTargetRow(e.Position.X, e.Position.Y, out pos, out node); if (pos == RowDropPosition.Into) { e.AllowedAction = DragDropAction.None; } else { e.AllowedAction = e.Action; } }; view.DragStarted += delegate(object sender, DragStartedEventArgs e) { var val = store.GetNavigatorAt(view.SelectedRow).GetValue(text); e.DragOperation.Data.AddValue(val); e.DragOperation.Finished += delegate(object s, DragFinishedEventArgs args) { Console.WriteLine("D:" + args.DeleteSource); }; }; Button addButton = new Button("Add"); addButton.Clicked += delegate(object sender, EventArgs e) { store.AddNode().SetValue(text, "Added").SetValue(desc, "Desc"); }; PackStart(addButton); Button removeButton = new Button("Remove Selection"); removeButton.Clicked += delegate(object sender, EventArgs e) { foreach (TreePosition row in view.SelectedRows) { store.GetNavigatorAt(row).Remove(); } }; PackStart(removeButton); var label = new Label(); PackStart(label); view.RowExpanded += (sender, e) => label.Text = "Row expanded: " + store.GetNavigatorAt(e.Position).GetValue(text); }
void CreateControl() { control = new HPaned(); store = new Gtk.TreeStore(typeof(Xwt.Drawing.Image), // image - type typeof(bool), // read? typeof(TaskListEntry), // read? -- use Pango weight typeof(string)); SemanticModelAttribute modelAttr = new SemanticModelAttribute("store__Type", "store__Read", "store__Task", "store__Description"); TypeDescriptor.AddAttributes(store, modelAttr); TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc(FilterTasks); filter = new TreeModelFilter(store, null); filter.VisibleFunc = filterFunct; sort = new TreeModelSort(filter); sort.SetSortFunc(VisibleColumns.Type, SeverityIterSort); sort.SetSortFunc(VisibleColumns.Project, ProjectIterSort); sort.SetSortFunc(VisibleColumns.File, FileIterSort); sort.SetSortFunc(VisibleColumns.Category, CategoryIterSort); view = new PadTreeView(sort); view.Selection.Mode = SelectionMode.Multiple; view.ShowExpanders = true; view.RulesHint = true; view.DoPopupMenu += ShowPopup; AddColumns(); LoadColumnsVisibility(); view.Columns [VisibleColumns.Type].SortColumnId = VisibleColumns.Type; view.Columns [VisibleColumns.Project].SortColumnId = VisibleColumns.Project; view.Columns [VisibleColumns.File].SortColumnId = VisibleColumns.File; view.Columns [VisibleColumns.Category].SortColumnId = VisibleColumns.Category; sw = new MonoDevelop.Components.CompactScrolledWindow(); sw.ShadowType = ShadowType.None; sw.Add(view); IdeServices.TaskService.Errors.TasksRemoved += ShowResults; IdeServices.TaskService.Errors.TasksAdded += TaskAdded; IdeServices.TaskService.Errors.TasksChanged += TaskChanged; IdeServices.TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged; IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen; IdeApp.Workspace.LastWorkspaceItemClosed += OnCombineClosed; view.RowActivated += OnRowActivated; iconWarning = ImageService.GetIcon(Ide.Gui.Stock.Warning, Gtk.IconSize.Menu); iconError = ImageService.GetIcon(Ide.Gui.Stock.Error, Gtk.IconSize.Menu); iconInfo = ImageService.GetIcon(Ide.Gui.Stock.Information, Gtk.IconSize.Menu); iconEmpty = ImageService.GetIcon(Ide.Gui.Stock.Empty, Gtk.IconSize.Menu); control.Add1(sw); logView = new LogView { Name = "buildOutput" }; control.Add2(logView); control.ShowAll(); control.SizeAllocated += HandleControlSizeAllocated; sw.SizeAllocated += HandleSwSizeAllocated; logView.Visible = OutputViewVisible; logBtn.Active = OutputViewVisible; // Load existing tasks foreach (TaskListEntry t in IdeServices.TaskService.Errors) { AddTask(t); } }
public AddinLoadErrorDialog(AddinError[] errors, bool warning) { Build(); Title = BrandingService.ApplicationName; TreeStore store = new TreeStore(typeof(string)); errorTree.AppendColumn("Addin", new CellRendererText(), "text", 0); errorTree.Model = store; bool fatal = false; foreach (AddinError err in errors) { string msg = err.Message; if (string.IsNullOrEmpty(msg) && err.Exception != null) { msg = err.Exception.Message; } string name = System.IO.Path.GetFileNameWithoutExtension(err.AddinFile); if (err.Fatal) { name += " (Fatal error)"; } TreeIter it = store.AppendValues(name); store.AppendValues(it, "Full Path: " + err.AddinFile); store.AppendValues(it, "Error: " + msg); if (err.Exception != null) { it = store.AppendValues(it, "Exception: " + err.Exception.GetType() + ": " + err.Exception.Message); store.AppendValues(it, err.Exception.StackTrace.ToString()); } if (err.Fatal) { fatal = true; } } if (fatal) { noButton.Hide(); yesButton.Hide(); closeButton.Show(); messageLabel.Text = GettextCatalog.GetString( "{0} cannot start because a fatal error has been detected.", BrandingService.ApplicationName ); } else if (warning) { noButton.Hide(); yesButton.Hide(); closeButton.Show(); messageLabel.Text = GettextCatalog.GetString( "{0} can run without these add-ins, but the functionality they provide will be missing.", BrandingService.ApplicationName ); } else { messageLabel.Text = GettextCatalog.GetString( "You can start {0} without these add-ins, but the functionality they " + "provide will be missing. Do you wish to continue?", BrandingService.ApplicationName ); } }
public GitConfigurationDialog(GitRepository repo) { this.Build(); this.repo = repo; this.HasSeparator = false; this.UseNativeContextMenus(); // Branches list storeBranches = new ListStore(typeof(Branch), typeof(string), typeof(string), typeof(string)); listBranches.Model = storeBranches; listBranches.HeadersVisible = true; SemanticModelAttribute modelAttr = new SemanticModelAttribute("storeBranches__Branch", "storeBranches__DisplayName", "storeBranches__Tracking", "storeBranches__Name"); TypeDescriptor.AddAttributes(storeBranches, modelAttr); listBranches.AppendColumn(GettextCatalog.GetString("Branch"), new CellRendererText(), "markup", 1); listBranches.AppendColumn(GettextCatalog.GetString("Tracking"), new CellRendererText(), "text", 2); listBranches.Selection.Changed += delegate { TreeIter it; bool anythingSelected = buttonRemoveBranch.Sensitive = buttonEditBranch.Sensitive = buttonSetDefaultBranch.Sensitive = listBranches.Selection.GetSelected(out it); if (!anythingSelected) { return; } string currentBranch = repo.GetCurrentBranch(); var b = (Branch)storeBranches.GetValue(it, 0); buttonRemoveBranch.Sensitive = b.FriendlyName != currentBranch; buttonSetDefaultBranch.Sensitive = !b.IsCurrentRepositoryHead; }; buttonRemoveBranch.Sensitive = buttonEditBranch.Sensitive = buttonSetDefaultBranch.Sensitive = false; // Sources tree storeRemotes = new TreeStore(typeof(Remote), typeof(string), typeof(string), typeof(string), typeof(string)); treeRemotes.Model = storeRemotes; treeRemotes.HeadersVisible = true; SemanticModelAttribute remotesModelAttr = new SemanticModelAttribute("storeRemotes__Remote", "storeRemotes__Name", "storeRemotes__Url", "storeRemotes__BranchName", "storeRemotes__FullName"); TypeDescriptor.AddAttributes(storeRemotes, remotesModelAttr); treeRemotes.AppendColumn(GettextCatalog.GetString("Remote Source / Branch"), new CellRendererText(), "markup", 1); treeRemotes.AppendColumn(GettextCatalog.GetString("Url"), new CellRendererText(), "text", 2); treeRemotes.Selection.Changed += delegate { TreeIter it; bool anythingSelected = treeRemotes.Selection.GetSelected(out it); buttonTrackRemote.Sensitive = false; buttonFetch.Sensitive = buttonEditRemote.Sensitive = buttonRemoveRemote.Sensitive = anythingSelected; if (!anythingSelected) { return; } string branchName = (string)storeRemotes.GetValue(it, 3); if (branchName != null) { buttonTrackRemote.Sensitive = true; } }; buttonTrackRemote.Sensitive = buttonFetch.Sensitive = buttonEditRemote.Sensitive = buttonRemoveRemote.Sensitive = false; // Tags list storeTags = new ListStore(typeof(string)); listTags.Model = storeTags; listTags.HeadersVisible = true; SemanticModelAttribute tagsModelAttr = new SemanticModelAttribute("storeTags__Name"); TypeDescriptor.AddAttributes(storeTags, tagsModelAttr); listTags.AppendColumn(GettextCatalog.GetString("Tag"), new CellRendererText(), "text", 0); listTags.Selection.Changed += delegate { TreeIter it; buttonRemoveTag.Sensitive = buttonPushTag.Sensitive = listTags.Selection.GetSelected(out it); }; buttonRemoveTag.Sensitive = buttonPushTag.Sensitive = false; // Fill data FillBranches(); FillRemotes(); FillTags(); }
public NamespaceItem(TreeStore store, TreeItem parent, CoverageItem model, string title) : base(store, parent, model, title) { }
public RegexToolkitWindow() : base(Gtk.WindowType.Toplevel) { this.Build(); this.TransientFor = IdeApp.Workbench.RootWindow; optionsStore = new ListStore(typeof(bool), typeof(string), typeof(Options)); resultStore = new Gtk.TreeStore(typeof(string), typeof(string), typeof(int), typeof(int)); FillOptionsBox(); this.buttonCancel.Clicked += delegate { this.Destroy(); }; var isWindows = System.IO.Path.DirectorySeparatorChar == '\\'; this.buttonLibrary.Visible = !isWindows; this.buttonStart.Sensitive = false; this.entryRegEx.Changed += UpdateStartButtonSensitivity; this.inputTextview.Buffer.Changed += UpdateStartButtonSensitivity; this.buttonStart.Clicked += delegate { if (regexThread != null && regexThread.IsAlive) { regexThread.Abort(); regexThread.Join(); SetButtonStart(GettextCatalog.GetString("_Start Regular Expression"), "gtk-media-play"); regexThread = null; return; } regexThread = new Thread(delegate() { PerformQuery(inputTextview.Buffer.Text, this.entryRegEx.Text, this.entryReplace.Text, GetOptions()); }); regexThread.IsBackground = true; regexThread.Name = "regex thread"; regexThread.Start(); SetButtonStart(GettextCatalog.GetString("_Stop execution"), "gtk-media-stop"); SetFindMode(!checkbuttonReplace.Active); }; this.buttonLibrary.Clicked += delegate { if (regexLib == null) { regexLib = new RegexLibraryWindow(); regexLib.TransientFor = this; regexLib.Destroyed += delegate { regexLib = null; }; regexLib.Show(); } }; SetFindMode(true); var cellRendText = new CellRendererText(); cellRendText.Ellipsize = Pango.EllipsizeMode.End; var pix = new CellRendererPixbuf(); this.optionsTreeview.Model = this.optionsStore; this.optionsTreeview.HeadersVisible = false; CellRendererToggle cellRendToggle = new CellRendererToggle(); cellRendToggle.Toggled += new ToggledHandler(OptionToggled); cellRendToggle.Activatable = true; this.optionsTreeview.AppendColumn("", cellRendToggle, "active", 0); this.optionsTreeview.AppendColumn("", cellRendText, "text", 1); this.resultsTreeview.Model = this.resultStore; this.resultsTreeview.HeadersVisible = false; var col = new TreeViewColumn(); this.resultsTreeview.AppendColumn(col); col.PackStart(pix, false); col.AddAttribute(pix, "stock_id", 0); col.PackStart(cellRendText, true); col.AddAttribute(cellRendText, "text", 1); this.resultsTreeview.RowActivated += delegate(object sender, RowActivatedArgs e) { Gtk.TreeIter iter; if (resultStore.GetIter(out iter, e.Path)) { int index = (int)resultStore.GetValue(iter, 2); int length = (int)resultStore.GetValue(iter, 3); if (index >= 0) { this.inputTextview.Buffer.SelectRange(this.inputTextview.Buffer.GetIterAtOffset(index), this.inputTextview.Buffer.GetIterAtOffset(index + length)); } else { this.inputTextview.Buffer.SelectRange(this.inputTextview.Buffer.GetIterAtOffset(0), this.inputTextview.Buffer.GetIterAtOffset(0)); } } }; elementsStore = new Gtk.TreeStore(typeof(string), typeof(string), typeof(string), typeof(string)); this.elementsTreeview.Model = this.elementsStore; this.elementsTreeview.HeadersVisible = false; this.elementsTreeview.Selection.Mode = SelectionMode.Browse; col = new TreeViewColumn(); this.elementsTreeview.AppendColumn(col); col.PackStart(pix, false); col.AddAttribute(pix, "stock_id", 0); col.PackStart(cellRendText, true); col.AddAttribute(cellRendText, "text", 1); var cellRendText2 = new CellRendererText(); col.PackStart(cellRendText2, false); col.SetCellDataFunc(cellRendText2, ElementDescriptionFunc); this.elementsTreeview.Selection.Changed += delegate { ShowTooltipForSelectedEntry(); }; this.LeaveNotifyEvent += delegate { this.HideTooltipWindow(); }; this.elementsTreeview.MotionNotifyEvent += HandleMotionNotifyEvent; this.elementsTreeview.RowActivated += delegate(object sender, RowActivatedArgs e) { Gtk.TreeIter iter; if (elementsStore.GetIter(out iter, e.Path)) { string text = elementsStore.GetValue(iter, 3) as string; if (!System.String.IsNullOrEmpty(text)) { this.entryRegEx.InsertText(text); } } }; this.entryReplace.Sensitive = this.checkbuttonReplace.Active = false; this.checkbuttonReplace.Toggled += delegate { this.entryReplace.Sensitive = this.checkbuttonReplace.Active; }; FillElementsBox(); this.vbox4.Hide(); }
public KeyBindingsPanel() { this.Build(); keyStore = new TreeStore(typeof(Command), typeof(string), typeof(string), typeof(string), typeof(int), typeof(string), typeof(bool), typeof(bool)); keyTreeView.Model = filterModel = new TreeModelFilter(keyStore, null); filterModel.VisibleColumn = visibleCol; TreeViewColumn col = new TreeViewColumn(); col.Title = GettextCatalog.GetString("Command"); col.Spacing = 4; CellRendererIcon crp = new CellRendererIcon(); col.PackStart(crp, false); col.AddAttribute(crp, "stock-id", iconCol); col.AddAttribute(crp, "visible", iconVisibleCol); CellRendererText crt = new CellRendererText(); col.PackStart(crt, true); col.AddAttribute(crt, "text", labelCol); col.AddAttribute(crt, "weight", boldCol); keyTreeView.AppendColumn(col); TreeViewColumn bindingTVCol = new TreeViewColumn(); bindingTVCol.Title = GettextCatalog.GetString("Key Binding"); CellRendererText bindingRenderer = new CellRendererText(); bindingTVCol.PackStart(bindingRenderer, false); bindingTVCol.SetCellDataFunc(bindingRenderer, delegate(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) { string binding = (model.GetValue(iter, bindingCol) as string) ?? ""; ((CellRendererText)cell).Text = binding.Length > 0 ? KeyBindingManager.BindingToDisplayLabel(binding, false) : binding; }); keyTreeView.AppendColumn(bindingTVCol); keyTreeView.AppendColumn(GettextCatalog.GetString("Description"), new CellRendererText(), "text", descCol); keyTreeView.Selection.Changed += OnKeysTreeViewSelectionChange; accelEntry.KeyPressEvent += OnAccelEntryKeyPress; accelEntry.KeyReleaseEvent += OnAccelEntryKeyRelease; accelEntry.Changed += delegate { UpdateWarningLabel(); }; updateButton.Clicked += OnUpdateButtonClick; currentBindings = KeyBindingService.CurrentKeyBindingSet.Clone(); schemes = new List <KeyBindingScheme> (KeyBindingService.Schemes); schemeCombo.AppendText(GettextCatalog.GetString("Custom")); foreach (KeyBindingScheme s in schemes) { schemeCombo.AppendText(s.Name); } SelectCurrentScheme(); schemeCombo.Changed += OnKeyBindingSchemeChanged; searchEntry.Changed += delegate { processedFilterTerms = searchEntry.Text.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries) .Select(s => s.ToLower()).ToArray();; filterChanged = true; if (!filterTimeoutRunning) { filterTimeoutRunning = true; GLib.Timeout.Add(300, delegate { if (!filterChanged) { if (filterTimeoutRunning) { Refilter(); } filterTimeoutRunning = false; return(false); } filterChanged = false; return(true); }); } ; }; clearFilterButton.Clicked += ClearFilter; //HACK: workaround for MD Bug 608021: Stetic loses values assigned to "new" properties of custom widget conflicButton.Label = GettextCatalog.GetString("_View Conflicts"); conflicButton.UseUnderline = true; }
Widget IOutlinedDocument.GetOutlineWidget() { if (outlineTreeView != null) { return(outlineTreeView); } outlineTreeStore = new TreeStore(typeof(object)); outlineTreeModelSort = new TreeModelSort(outlineTreeStore); settings = OutlineSettings.Load(); comparer = new OutlineNodeComparer(new AstAmbience(TypeSystemService.Workspace.Options), settings, outlineTreeModelSort); outlineTreeModelSort.SetSortFunc(0, comparer.CompareNodes); outlineTreeModelSort.SetSortColumnId(0, SortType.Ascending); outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView(outlineTreeStore); var pixRenderer = new CellRendererImage(); pixRenderer.Xpad = 0; pixRenderer.Ypad = 0; outlineTreeView.TextRenderer.Xpad = 0; outlineTreeView.TextRenderer.Ypad = 0; TreeViewColumn treeCol = new TreeViewColumn(); treeCol.PackStart(pixRenderer, false); treeCol.SetCellDataFunc(pixRenderer, new TreeCellDataFunc(OutlineTreeIconFunc)); treeCol.PackStart(outlineTreeView.TextRenderer, true); treeCol.SetCellDataFunc(outlineTreeView.TextRenderer, new TreeCellDataFunc(OutlineTreeTextFunc)); outlineTreeView.AppendColumn(treeCol); outlineTreeView.HeadersVisible = false; outlineTreeView.Selection.Changed += delegate { JumpToDeclaration(false); }; outlineTreeView.RowActivated += delegate { JumpToDeclaration(true); }; var analysisDocument = DocumentContext.ParsedDocument; if (analysisDocument != null) { lastCU = analysisDocument.GetAst <SemanticModel> (); } outlineTreeView.Realized += delegate { RefillOutlineStore(); }; UpdateSorting(); var sw = new CompactScrolledWindow(); sw.Add(outlineTreeView); sw.ShowAll(); return(sw); }
public OptionsDialog(Gtk.Window parentWindow, object dataObject, string extensionPath, bool removeEmptySections) { buttonCancel = new Gtk.Button(Gtk.Stock.Cancel); AddActionWidget(this.buttonCancel, ResponseType.Cancel); buttonOk = new Gtk.Button(Gtk.Stock.Ok); this.ActionArea.PackStart(buttonOk); buttonOk.Clicked += OnButtonOkClicked; mainHBox = new HBox(); tree = new TreeView(); var sw = new ScrolledWindow(); sw.Add(tree); sw.HscrollbarPolicy = PolicyType.Never; sw.VscrollbarPolicy = PolicyType.Automatic; sw.ShadowType = ShadowType.None; var fboxTree = new HeaderBox(); fboxTree.SetMargins(0, 1, 0, 1); fboxTree.SetPadding(0, 0, 0, 0); fboxTree.BackgroundColor = new Gdk.Color(255, 255, 255); fboxTree.Add(sw); mainHBox.PackStart(fboxTree, false, false, 0); Realized += delegate { fboxTree.BackgroundColor = tree.Style.Base(Gtk.StateType.Normal); }; var vbox = new VBox(); mainHBox.PackStart(vbox, true, true, 0); var headerBox = new HBox(false, 6); image = new Image(); // headerBox.PackStart (image, false, false, 0); labelTitle = new Label(); labelTitle.Xalign = 0; textHeader = new Alignment(0, 0, 1, 1); textHeader.Add(labelTitle); textHeader.BorderWidth = 12; headerBox.PackStart(textHeader, true, true, 0); imageHeader = new OptionsDialogHeader(); imageHeader.Hide(); headerBox.PackStart(imageHeader.ToGtkWidget()); var fboxHeader = new HeaderBox(); fboxHeader.SetMargins(0, 1, 0, 0); fboxHeader.Add(headerBox); // fbox.GradientBackround = true; // fbox.BackgroundColor = new Gdk.Color (255, 255, 255); Realized += delegate { var c = new HslColor(Style.Background(Gtk.StateType.Normal)); c.L += 0.09; fboxHeader.BackgroundColor = c; }; vbox.PackStart(fboxHeader, false, false, 0); pageFrame = new HBox(); var fbox = new HeaderBox(); fbox.SetMargins(0, 1, 0, 0); fbox.ShowTopShadow = true; fbox.Add(pageFrame); vbox.PackStart(fbox, true, true, 0); this.VBox.PackStart(mainHBox, true, true, 0); this.removeEmptySections = removeEmptySections; extensionContext = AddinManager.CreateExtensionContext(); this.mainDataObject = dataObject; this.extensionPath = extensionPath; if (parentWindow != null) { TransientFor = parentWindow; } ImageService.EnsureStockIconIsLoaded(emptyCategoryIcon, treeIconSize); ImageService.EnsureStockIconIsLoaded(emptyCategoryIcon, headerIconSize); store = new TreeStore(typeof(OptionsDialogSection)); tree.Model = store; tree.HeadersVisible = false; // Column 0 is used to add some padding at the left of the expander TreeViewColumn col0 = new TreeViewColumn(); col0.MinWidth = 6; tree.AppendColumn(col0); TreeViewColumn col = new TreeViewColumn(); var crp = new CellRendererPixbuf(); col.PackStart(crp, false); col.SetCellDataFunc(crp, PixbufCellDataFunc); var crt = new CellRendererText(); col.PackStart(crt, true); col.SetCellDataFunc(crt, TextCellDataFunc); tree.AppendColumn(col); tree.ExpanderColumn = col; tree.Selection.Changed += OnSelectionChanged; Child.ShowAll(); InitializeContext(extensionContext); FillTree(); ExpandCategories(); this.DefaultResponse = Gtk.ResponseType.Ok; DefaultWidth = 722; DefaultHeight = 502; }
void crea_treeview_busqueda_empleado() { treeViewEngineBusca = new TreeStore(typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string)); treeview_reportelista.Model = treeViewEngineBusca; treeview_reportelista.RulesHint = true; treeview_reportelista.RowActivated += on_selecciona_empleado_clicked; // Doble click selecciono paciente TreeViewColumn nom_Empleado = new TreeViewColumn(); CellRendererText cellr0 = new CellRendererText(); nom_Empleado.Title = "Empleado"; // titulo de la cabecera de la columna, si está visible nom_Empleado.PackStart(cellr0, true); nom_Empleado.AddAttribute(cellr0, "text", 0); // la siguiente columna será 1 en vez de 1 nom_Empleado.SortColumnId = (int)Column.nom_Empleado; TreeViewColumn col_Empleado = new TreeViewColumn(); CellRendererText cellr1 = new CellRendererText(); col_Empleado.Title = "ID"; // titulo de la cabecera de la columna, si está visible col_Empleado.PackStart(cellr1, true); col_Empleado.AddAttribute(cellr1, "text", 1); // la siguiente columna será 1 en vez de 1 col_Empleado.SortColumnId = (int)Column.col_Empleado; // Permite edita este campo TreeViewColumn col_fecha = new TreeViewColumn(); CellRendererText cellrt2 = new CellRendererText(); col_fecha.Title = "Fecha de contrato"; col_fecha.PackStart(cellrt2, true); col_fecha.AddAttribute(cellrt2, "text", 2); // la siguiente columna será 1 en vez de 2 col_fecha.SortColumnId = (int)Column.col_fecha; TreeViewColumn col_tipo = new TreeViewColumn(); CellRendererText cellrt3 = new CellRendererText(); col_tipo.Title = "Tipo de contrato"; col_tipo.PackStart(cellrt3, true); col_tipo.AddAttribute(cellrt3, "text", 3); // la siguiente columna será 2 en vez de 3 col_tipo.SortColumnId = (int)Column.col_tipo; TreeViewColumn col_sueldo = new TreeViewColumn(); CellRendererText cellrt4 = new CellRendererText(); col_sueldo.Title = "Sueldo"; col_sueldo.PackStart(cellrt4, true); col_sueldo.AddAttribute(cellrt4, "text", 4); // la siguiente columna será 2 en vez de 3 col_sueldo.SortColumnId = (int)Column.col_sueldo; TreeViewColumn col_depto = new TreeViewColumn(); CellRendererText cellrt5 = new CellRendererText(); col_depto.Title = "Departamento"; col_depto.PackStart(cellrt5, true); col_depto.AddAttribute(cellrt5, "text", 5); // la siguiente columna será 2 en vez de 3 col_depto.SortColumnId = (int)Column.col_depto; TreeViewColumn col_puesto = new TreeViewColumn(); CellRendererText cellrt6 = new CellRendererText(); col_puesto.Title = "Puesto"; col_puesto.PackStart(cellrt6, true); col_puesto.AddAttribute(cellrt6, "text", 6); // la siguiente columna será 2 en vez de 3 col_puesto.SortColumnId = (int)Column.col_puesto; TreeViewColumn col_jornada = new TreeViewColumn(); CellRendererText cellrt7 = new CellRendererText(); col_jornada.Title = "Jornada"; col_jornada.PackStart(cellrt7, true); col_jornada.AddAttribute(cellrt7, "text", 7); // la siguiente columna será 2 en vez de 3 col_jornada.SortColumnId = (int)Column.col_jornada; TreeViewColumn col_tipofuncion = new TreeViewColumn(); CellRendererText cellrt8 = new CellRendererText(); col_tipofuncion.Title = "Tipo de Función"; col_tipofuncion.PackStart(cellrt8, true); col_tipofuncion.AddAttribute(cellrt8, "text", 8); // la siguiente columna será 2 en vez de 3 col_tipofuncion.SortColumnId = (int)Column.col_tipofuncion; TreeViewColumn col_tipopago = new TreeViewColumn(); CellRendererText cellrt9 = new CellRendererText(); col_tipopago.Title = "Tipo de Pago"; col_tipopago.PackStart(cellrt9, true); col_tipopago.AddAttribute(cellrt9, "text", 9); // la siguiente columna será 2 en vez de 3 col_tipopago.SortColumnId = (int)Column.col_tipopago; TreeViewColumn col_tipocomida = new TreeViewColumn(); CellRendererText cellrt10 = new CellRendererText(); col_tipocomida.Title = "tiempo comida"; col_tipocomida.PackStart(cellrt10, true); col_tipocomida.AddAttribute(cellrt10, "text", 10); // la siguiente columna será 2 en vez de 3 col_tipocomida.SortColumnId = (int)Column.col_tipocomida; col_tipocomida.Visible = false; TreeViewColumn col_edad = new TreeViewColumn(); CellRendererText cellrt11 = new CellRendererText(); col_edad.Title = "Edad"; col_edad.PackStart(cellrt11, true); col_edad.AddAttribute(cellrt11, "text", 11); // la siguiente columna será 2 en vez de 3 col_edad.SortColumnId = (int)Column.col_edad; col_edad.Visible = false; treeview_reportelista.AppendColumn(nom_Empleado); treeview_reportelista.AppendColumn(col_Empleado); treeview_reportelista.AppendColumn(col_fecha); treeview_reportelista.AppendColumn(col_tipo); treeview_reportelista.AppendColumn(col_sueldo); treeview_reportelista.AppendColumn(col_depto); treeview_reportelista.AppendColumn(col_puesto); treeview_reportelista.AppendColumn(col_jornada); treeview_reportelista.AppendColumn(col_tipofuncion); treeview_reportelista.AppendColumn(col_tipopago); treeview_reportelista.AppendColumn(col_tipocomida); treeview_reportelista.AppendColumn(col_edad); }
public RegexToolkitWidget() { this.Build(); optionsStore = new ListStore(typeof(bool), typeof(string), typeof(Options)); resultStore = new Gtk.TreeStore(typeof(string), typeof(string), typeof(int), typeof(int)); FillOptionsBox(); this.buttonStart.Sensitive = false; this.entryRegEx.Changed += UpdateStartButtonSensitivity; this.inputTextview.Buffer.Changed += UpdateStartButtonSensitivity; this.buttonStart.Clicked += delegate { if (regexThread != null && regexThread.IsAlive) { regexThread.Abort(); regexThread.Join(); SetButtonStart(GettextCatalog.GetString("Start Regular E_xpression"), "gtk-execute"); regexThread = null; return; } regexThread = new Thread(delegate() { PerformQuery(inputTextview.Buffer.Text, this.entryRegEx.Text, this.entryReplace.Text, GetOptions()); }); regexThread.IsBackground = true; regexThread.Name = "regex thread"; regexThread.Start(); SetButtonStart(GettextCatalog.GetString("Stop e_xecution"), "gtk-media-stop"); SetFindMode(!checkbuttonReplace.Active); }; SetFindMode(true); var cellRendText = new CellRendererText(); cellRendText.Ellipsize = Pango.EllipsizeMode.End; this.optionsTreeview.Model = this.optionsStore; this.optionsTreeview.HeadersVisible = false; CellRendererToggle cellRendToggle = new CellRendererToggle(); cellRendToggle.Toggled += new ToggledHandler(OptionToggled); cellRendToggle.Activatable = true; this.optionsTreeview.AppendColumn("", cellRendToggle, "active", 0); this.optionsTreeview.AppendColumn("", cellRendText, "text", 1); this.resultsTreeview.Model = this.resultStore; this.resultsTreeview.HeadersVisible = false; var col = new TreeViewColumn(); this.resultsTreeview.AppendColumn(col); var pix = new CellRendererImage(); col.PackStart(pix, false); col.AddAttribute(pix, "stock_id", 0); col.PackStart(cellRendText, true); col.AddAttribute(cellRendText, "text", 1); this.resultsTreeview.RowActivated += delegate(object sender, RowActivatedArgs e) { Gtk.TreeIter iter; if (resultStore.GetIter(out iter, e.Path)) { int index = (int)resultStore.GetValue(iter, 2); int length = (int)resultStore.GetValue(iter, 3); if (index >= 0) { this.inputTextview.Buffer.SelectRange(this.inputTextview.Buffer.GetIterAtOffset(index), this.inputTextview.Buffer.GetIterAtOffset(index + length)); } else { this.inputTextview.Buffer.SelectRange(this.inputTextview.Buffer.GetIterAtOffset(0), this.inputTextview.Buffer.GetIterAtOffset(0)); } } }; this.entryReplace.Sensitive = this.checkbuttonReplace.Active = false; this.checkbuttonReplace.Toggled += delegate { this.entryReplace.Sensitive = this.checkbuttonReplace.Active; }; this.vbox4.WidthRequest = 380; this.scrolledwindow5.HeightRequest = 150; this.scrolledwindow1.HeightRequest = 150; Show(); }
public void RemoveSelectedRow() { store = UtilGtk.RemoveRow(treeview, store); }
public TreeVisitor(TreeStore store, TreeIter curIter) : base(SyntaxWalkerDepth.Trivia) { this.store = store; this.curIter = curIter; }
public void GetStore(out TreeStore store, out int SongCount) { CreateTreeStore(); store = this.store; SongCount = this.SongCount; }
private void CreateTreeStore() { store = new TreeStore(typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string)); }
void InitializeComponents() { iconView = new TemplateView(); iconView.ShowAll(); boxTemplates.PackStart(iconView, true, true, 0); catStore = new TreeStore(typeof(string), typeof(List <Category>), typeof(List <TemplateItem>)); TreeViewColumn treeViewColumn = new TreeViewColumn(); treeViewColumn.Title = "categories"; CellRenderer cellRenderer = new CellRendererText(); treeViewColumn.PackStart(cellRenderer, true); treeViewColumn.AddAttribute(cellRenderer, "text", 0); catView.AppendColumn(treeViewColumn); catStore.SetSortColumnId(0, SortType.Ascending); catView.Model = catStore; okButton.Clicked += new EventHandler(OpenEvent); cancelButton.Clicked += new EventHandler(cancelClicked); nameEntry.Changed += new EventHandler(NameChanged); nameEntry.Activated += new EventHandler(OpenEvent); infoLabel.Text = string.Empty; labelTemplateTitle.Text = string.Empty; Project[] projects = null; if (parentProject == null) { projects = IdeApp.Workspace.GetAllProjects().ToArray(); } if (projects != null && projects.Length > 0) { Project curProject = IdeApp.ProjectOperations.CurrentSelectedProject; boxProject.Visible = true; projectAddCheckbox.Active = curProject != null; projectAddCheckbox.Toggled += new EventHandler(AddToProjectToggled); projectNames = new string[projects.Length]; projectRefs = new Project[projects.Length]; int i = 0; bool singleSolution = IdeApp.Workspace.Items.Count == 1 && IdeApp.Workspace.Items[0] is Solution; foreach (Project project in projects) { projectRefs[i] = project; if (singleSolution) { projectNames[i++] = project.Name; } else { projectNames[i++] = project.ParentSolution.Name + "/" + project.Name; } } Array.Sort(projectNames, projectRefs); i = Array.IndexOf(projectRefs, curProject); foreach (string pn in projectNames) { projectAddCombo.AppendText(pn); } projectAddCombo.Active = i != -1 ? i : 0; projectAddCombo.Sensitive = projectAddCheckbox.Active; projectAddCombo.Changed += new EventHandler(AddToProjectComboChanged); projectPathLabel.Sensitive = projectAddCheckbox.Active; projectFolderEntry.Sensitive = projectAddCheckbox.Active; if (curProject != null) { projectFolderEntry.Path = curProject.BaseDirectory; } projectFolderEntry.PathChanged += new EventHandler(AddToProjectPathChanged); if (curProject != null) { basePath = curProject.BaseDirectory; parentProject = curProject; } } else { boxProject.Visible = false; } catView.Selection.Changed += new EventHandler(CategoryChange); catView.RowActivated += new RowActivatedHandler(CategoryActivated); iconView.SelectionChanged += new EventHandler(SelectedTemplateChanged); iconView.DoubleClicked += new EventHandler(OpenEvent); InitializeDialog(false); InitializeView(); UpdateOkStatus(); }
void crea_treeview_busqueda_bajas() { treeViewEngineBusca = new TreeStore(typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string)); treeview_reportelista.Model = treeViewEngineBusca; treeview_reportelista.RulesHint = true; TreeViewColumn col_idEmpleado = new TreeViewColumn(); CellRendererText cellr0 = new CellRendererText(); col_idEmpleado.Title = "Empleado"; // titulo de la cabecera de la columna, si está visible col_idEmpleado.PackStart(cellr0, true); col_idEmpleado.AddAttribute(cellr0, "text", 0); // la siguiente columna será 1 en vez de 1 col_idEmpleado.SortColumnId = (int)Column2.col_idEmpleado; TreeViewColumn col_Empleado = new TreeViewColumn(); CellRendererText cellr1 = new CellRendererText(); col_Empleado.Title = "ID"; // titulo de la cabecera de la columna, si está visible col_Empleado.PackStart(cellr1, true); col_Empleado.AddAttribute(cellr1, "text", 1); // la siguiente columna será 1 en vez de 1 col_Empleado.SortColumnId = (int)Column2.col_Empleado; // Permite edita este campo TreeViewColumn col_fecha = new TreeViewColumn(); CellRendererText cellrt2 = new CellRendererText(); col_fecha.Title = "Fecha de Baja"; col_fecha.PackStart(cellrt2, true); col_fecha.AddAttribute(cellrt2, "text", 2); // la siguiente columna será 1 en vez de 2 col_fecha.SortColumnId = (int)Column2.col_fecha; TreeViewColumn col_causa = new TreeViewColumn(); CellRendererText cellrt3 = new CellRendererText(); col_causa.Title = "Causa Baja"; col_causa.PackStart(cellrt3, true); col_causa.AddAttribute(cellrt3, "text", 3); // la siguiente columna será 2 en vez de 3 col_causa.SortColumnId = (int)Column2.col_causa; TreeViewColumn col_puesto = new TreeViewColumn(); CellRendererText cellrt4 = new CellRendererText(); col_puesto.Title = "Puesto"; col_puesto.PackStart(cellrt4, true); col_puesto.AddAttribute(cellrt4, "text", 4); // la siguiente columna será 2 en vez de 3 col_puesto.SortColumnId = (int)Column2.col_puesto; TreeViewColumn col_depto = new TreeViewColumn(); CellRendererText cellrt5 = new CellRendererText(); col_depto.Title = "Departamento"; col_depto.PackStart(cellrt5, true); col_depto.AddAttribute(cellrt5, "text", 5); // la siguiente columna será 2 en vez de 3 col_depto.SortColumnId = (int)Column2.col_depto; treeview_reportelista.AppendColumn(col_idEmpleado); treeview_reportelista.AppendColumn(col_Empleado); treeview_reportelista.AppendColumn(col_fecha); treeview_reportelista.AppendColumn(col_causa); treeview_reportelista.AppendColumn(col_puesto); treeview_reportelista.AppendColumn(col_depto); }
private void InitializeComponent() { this.plotView = new OxyPlot.GtkSharp.PlotView(); this.plotView.SetSizeRequest(300, 300); this.treeView = new TreeView(); this.treeView.Visible = true; var treeModel = new TreeStore(typeof(string), typeof(string)); var iter = new TreeIter(); string last = null; foreach (var ex in this.Examples) { if (last == null || last != ex.Category) { iter = treeModel.AppendValues(ex.Category); last = ex.Category; } treeModel.AppendValues(iter, ex.Title, ex.Category); } this.treeView.Model = treeModel; var exampleNameColumn = new TreeViewColumn { Title = "Example" }; var exampleNameCell = new CellRendererText(); exampleNameColumn.PackStart(exampleNameCell, true); this.treeView.AppendColumn(exampleNameColumn); exampleNameColumn.AddAttribute(exampleNameCell, "text", 0); this.treeView.Selection.Changed += (s, e) => { TreeIter selectedNode; TreeModel selectedModel; if (treeView.Selection.GetSelected(out selectedModel, out selectedNode)) { string val1 = (string)selectedModel.GetValue(selectedNode, 0); string val2 = (string)selectedModel.GetValue(selectedNode, 1); this.SelectedExample = this.Examples.FirstOrDefault(ex => ex.Category == val2 && ex.Title == val1); } }; var scrollwin = new ScrolledWindow(); scrollwin.Add(this.treeView); scrollwin.SetSizeRequest(250, 300); var txtSearch = new Entry(); treeView.SearchEntry = txtSearch; var treeVbox = new VBox(false, 0); treeVbox.BorderWidth = 6; treeVbox.PackStart(txtSearch, false, true, 0); treeVbox.PackStart(scrollwin, true, true, 0); this.paned = new HPaned(); this.paned.Pack1(treeVbox, false, false); this.paned.Pack2(this.plotView, true, false); this.paned.Position = 300; this.Add(this.paned); //this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); //this.AutoScaleMode = Gtk.AutoScaleMode.Font; //this.ClientSize = new System.Drawing.Size(943, 554); this.Title = "OxyPlot.GtkSharp Example Browser"; this.DeleteEvent += (s, a) => { Application.Quit(); a.RetVal = true; }; }
public LogWidget(VersionControlDocumentInfo info) { this.Build(); this.info = info; if (info.Document != null) { this.preselectFile = info.Item.Path; } revertButton = new Gtk.ToolButton(new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString("Revert changes from this revision")); revertButton.IsImportant = true; // revertButton.Sensitive = false; revertButton.Clicked += new EventHandler(RevertRevisionClicked); CommandBar.Insert(revertButton, -1); revertToButton = new Gtk.ToolButton(new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString("Revert to this revision")); revertToButton.IsImportant = true; // revertToButton.Sensitive = false; revertToButton.Clicked += new EventHandler(RevertToRevisionClicked); CommandBar.Insert(revertToButton, -1); Gtk.ToolItem item = new Gtk.ToolItem(); Gtk.HBox a = new Gtk.HBox(); item.Add(a); searchEntry = new SearchEntry(); searchEntry.WidthRequest = 200; searchEntry.ForceFilterButtonVisible = true; searchEntry.EmptyMessage = GettextCatalog.GetString("Search"); searchEntry.Changed += HandleSearchEntryFilterChanged; searchEntry.Ready = true; searchEntry.Show(); a.PackEnd(searchEntry, false, false, 0); CommandBar.Insert(item, -1); ((Gtk.Toolbar.ToolbarChild)CommandBar[item]).Expand = true; CommandBar.ShowAll(); messageRenderer.Ellipsize = Pango.EllipsizeMode.End; TreeViewColumn colRevMessage = new TreeViewColumn(); colRevMessage.Title = GettextCatalog.GetString("Message"); var graphRenderer = new RevisionGraphCellRenderer(); colRevMessage.PackStart(graphRenderer, false); colRevMessage.SetCellDataFunc(graphRenderer, GraphFunc); colRevMessage.PackStart(messageRenderer, true); colRevMessage.SetCellDataFunc(messageRenderer, MessageFunc); colRevMessage.Sizing = TreeViewColumnSizing.Autosize; treeviewLog.AppendColumn(colRevMessage); colRevMessage.MinWidth = 350; colRevMessage.Resizable = true; TreeViewColumn colRevDate = new TreeViewColumn(GettextCatalog.GetString("Date"), textRenderer); colRevDate.SetCellDataFunc(textRenderer, DateFunc); colRevDate.Resizable = true; treeviewLog.AppendColumn(colRevDate); TreeViewColumn colRevAuthor = new TreeViewColumn(); colRevAuthor.Title = GettextCatalog.GetString("Author"); colRevAuthor.PackStart(pixRenderer, false); colRevAuthor.PackStart(textRenderer, true); colRevAuthor.SetCellDataFunc(textRenderer, AuthorFunc); colRevAuthor.SetCellDataFunc(pixRenderer, AuthorIconFunc); colRevAuthor.Resizable = true; treeviewLog.AppendColumn(colRevAuthor); TreeViewColumn colRevNum = new TreeViewColumn(GettextCatalog.GetString("Revision"), textRenderer); colRevNum.SetCellDataFunc(textRenderer, RevisionFunc); colRevNum.Resizable = true; treeviewLog.AppendColumn(colRevNum); treeviewLog.Model = logstore; treeviewLog.Selection.Changed += TreeSelectionChanged; treeviewFiles = new FileTreeView(); treeviewFiles.DiffLineActivated += HandleTreeviewFilesDiffLineActivated; scrolledwindowFiles.Child = treeviewFiles; scrolledwindowFiles.ShowAll(); changedpathstore = new TreeStore(typeof(Gdk.Pixbuf), typeof(string), // icon/file name typeof(Gdk.Pixbuf), typeof(string), // icon/operation typeof(string), // path typeof(string), // revision path (invisible) typeof(string[]) // diff ); TreeViewColumn colChangedFile = new TreeViewColumn(); var crp = new CellRendererPixbuf(); var crt = new CellRendererText(); colChangedFile.Title = GettextCatalog.GetString("File"); colChangedFile.PackStart(crp, false); colChangedFile.PackStart(crt, true); colChangedFile.AddAttribute(crp, "pixbuf", 2); colChangedFile.AddAttribute(crt, "text", 3); treeviewFiles.AppendColumn(colChangedFile); TreeViewColumn colOperation = new TreeViewColumn(); colOperation.Title = GettextCatalog.GetString("Operation"); colOperation.PackStart(crp, false); colOperation.PackStart(crt, true); colOperation.AddAttribute(crp, "pixbuf", 0); colOperation.AddAttribute(crt, "text", 1); treeviewFiles.AppendColumn(colOperation); TreeViewColumn colChangedPath = new TreeViewColumn(); colChangedPath.Title = GettextCatalog.GetString("Path"); diffRenderer.DrawLeft = true; colChangedPath.PackStart(diffRenderer, true); colChangedPath.SetCellDataFunc(diffRenderer, SetDiffCellData); treeviewFiles.AppendColumn(colChangedPath); treeviewFiles.Model = changedpathstore; treeviewFiles.TestExpandRow += HandleTreeviewFilesTestExpandRow; treeviewFiles.Events |= Gdk.EventMask.PointerMotionMask; textviewDetails.WrapMode = Gtk.WrapMode.Word; labelAuthor.Text = ""; labelDate.Text = ""; labelRevision.Text = ""; }
void Init() { main = new VBox(false, 6); widget = main; buttonCommit = new Gtk.Button() { Image = new Gtk.Image("vc-commit", Gtk.IconSize.Menu), Label = GettextCatalog.GetString("Commit...") }; buttonCommit.Image.Show(); buttonRevert = new Gtk.Button() { Image = new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), Label = GettextCatalog.GetString("Revert") }; buttonRevert.Image.Show(); showRemoteStatus = new Gtk.Button() { Image = new Gtk.Image("vc-remote-status", Gtk.IconSize.Menu), Label = GettextCatalog.GetString("Show Remote Status") }; showRemoteStatus.Image.Show(); status = new Label(""); main.PackStart(status, false, false, 0); scroller = new ScrolledWindow(); scroller.ShadowType = Gtk.ShadowType.None; filelist = new FileTreeView(); filelist.Selection.Mode = Gtk.SelectionMode.Multiple; scroller.Add(filelist); scroller.HscrollbarPolicy = PolicyType.Automatic; scroller.VscrollbarPolicy = PolicyType.Automatic; filelist.RowActivated += OnRowActivated; filelist.DiffLineActivated += OnDiffLineActivated; CellRendererToggle cellToggle = new CellRendererToggle(); cellToggle.Toggled += new ToggledHandler(OnCommitToggledHandler); var crc = new CellRendererIcon(); crc.StockId = "vc-comment"; colCommit = new TreeViewColumn(); colCommit.Spacing = 2; colCommit.Widget = new Gtk.Image("vc-commit", Gtk.IconSize.Menu); colCommit.Widget.Show(); colCommit.PackStart(cellToggle, false); colCommit.PackStart(crc, false); colCommit.AddAttribute(cellToggle, "active", ColCommit); colCommit.AddAttribute(cellToggle, "visible", ColShowToggle); colCommit.AddAttribute(crc, "visible", ColShowComment); CellRendererText crt = new CellRendererText(); var crp = new CellRendererPixbuf(); TreeViewColumn colStatus = new TreeViewColumn(); colStatus.Title = GettextCatalog.GetString("Status"); colStatus.PackStart(crp, false); colStatus.PackStart(crt, true); colStatus.AddAttribute(crp, "pixbuf", ColIcon); colStatus.AddAttribute(crp, "visible", ColShowStatus); colStatus.AddAttribute(crt, "text", ColStatus); colStatus.AddAttribute(crt, "foreground", ColStatusColor); TreeViewColumn colFile = new TreeViewColumn(); colFile.Title = GettextCatalog.GetString("File"); colFile.Spacing = 2; crp = new CellRendererPixbuf(); diffRenderer = new CellRendererDiff(); colFile.PackStart(crp, false); colFile.PackStart(diffRenderer, true); colFile.AddAttribute(crp, "pixbuf", ColIconFile); colFile.AddAttribute(crp, "visible", ColShowStatus); colFile.SetCellDataFunc(diffRenderer, new TreeCellDataFunc(SetDiffCellData)); crt = new CellRendererText(); crp = new CellRendererPixbuf(); colRemote = new TreeViewColumn(); colRemote.Title = GettextCatalog.GetString("Remote Status"); colRemote.PackStart(crp, false); colRemote.PackStart(crt, true); colRemote.AddAttribute(crp, "pixbuf", ColRemoteIcon); colRemote.AddAttribute(crt, "text", ColRemoteStatus); colRemote.AddAttribute(crt, "foreground", ColStatusColor); filelist.AppendColumn(colStatus); filelist.AppendColumn(colRemote); filelist.AppendColumn(colCommit); filelist.AppendColumn(colFile); colRemote.Visible = false; filestore = new TreeStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string[]), typeof(string), typeof(bool), typeof(bool), typeof(string), typeof(bool), typeof(bool), typeof(Gdk.Pixbuf), typeof(bool), typeof(Gdk.Pixbuf), typeof(string), typeof(bool), typeof(bool)); filelist.Model = filestore; filelist.TestExpandRow += new Gtk.TestExpandRowHandler(OnTestExpandRow); commitBox = new VBox(); HeaderBox commitMessageLabelBox = new HeaderBox(); commitMessageLabelBox.SetPadding(6, 6, 6, 6); commitMessageLabelBox.SetMargins(1, 1, 0, 0); HBox labBox = new HBox(); labelCommit = new Gtk.Label(GettextCatalog.GetString("Commit message:")); labelCommit.Xalign = 0; labBox.PackStart(new Gtk.Image("vc-comment", Gtk.IconSize.Menu), false, false, 0); labBox.PackStart(labelCommit, true, true, 3); commitMessageLabelBox.Add(labBox); commitMessageLabelBox.ShowAll(); //commitBox.PackStart (commitMessageLabelBox, false, false, 0); Gtk.ScrolledWindow frame = new Gtk.ScrolledWindow(); frame.HeightRequest = 75; frame.ShadowType = ShadowType.None; commitText = new TextView(); commitText.WrapMode = WrapMode.WordChar; commitText.Buffer.Changed += OnCommitTextChanged; frame.Add(commitText); commitBox.PackStart(frame, true, true, 0); var paned = new VPanedThin(); paned.HandleWidget = commitMessageLabelBox; paned.Pack1(scroller, true, true); paned.Pack2(commitBox, false, false); main.PackStart(paned, true, true, 0); main.ShowAll(); status.Visible = false; filelist.Selection.Changed += new EventHandler(OnCursorChanged); VersionControlService.FileStatusChanged += OnFileStatusChanged; filelist.HeadersClickable = true; filestore.SetSortFunc(0, CompareNodes); colStatus.SortColumnId = 0; filestore.SetSortFunc(1, CompareNodes); colRemote.SortColumnId = 1; filestore.SetSortFunc(2, CompareNodes); colCommit.SortColumnId = 2; filestore.SetSortFunc(3, CompareNodes); colFile.SortColumnId = 3; filestore.SetSortColumnId(3, Gtk.SortType.Ascending); filelist.DoPopupMenu = DoPopupMenu; StartUpdate(); }
public ChangeSetView() { ShadowType = Gtk.ShadowType.In; filelist = new FileTreeView(); filelist.Selection.Mode = SelectionMode.Multiple; Add(filelist); HscrollbarPolicy = PolicyType.Automatic; VscrollbarPolicy = PolicyType.Automatic; filelist.RowActivated += OnRowActivated; filelist.DiffLineActivated += OnDiffLineActivated; CellRendererToggle cellToggle = new CellRendererToggle(); // cellToggle.Toggled += new ToggledHandler(OnCommitToggledHandler); var crc = new CellRendererImage(); crc.StockId = "vc-comment"; colCommit = new TreeViewColumn(); colCommit.Spacing = 2; colCommit.Widget = new Xwt.ImageView(Xwt.Drawing.Image.FromResource("commit-light-16.png")).ToGtkWidget(); colCommit.Widget.Show(); colCommit.PackStart(cellToggle, false); colCommit.PackStart(crc, false); colCommit.AddAttribute(cellToggle, "active", ColCommit); colCommit.AddAttribute(cellToggle, "visible", ColShowToggle); colCommit.AddAttribute(crc, "visible", ColShowComment); colCommit.Visible = false; CellRendererText crt = new CellRendererText(); var crp = new CellRendererImage(); TreeViewColumn colStatus = new TreeViewColumn(); colStatus.Title = GettextCatalog.GetString("Status"); colStatus.PackStart(crp, false); colStatus.PackStart(crt, true); colStatus.AddAttribute(crp, "image", ColIcon); colStatus.AddAttribute(crp, "visible", ColShowStatus); colStatus.AddAttribute(crt, "text", ColStatus); colStatus.AddAttribute(crt, "foreground", ColStatusColor); TreeViewColumn colFile = new TreeViewColumn(); colFile.Title = GettextCatalog.GetString("File"); colFile.Spacing = 2; crp = new CellRendererImage(); diffRenderer = new CellRendererDiff(); colFile.PackStart(crp, false); colFile.PackStart(diffRenderer, true); colFile.AddAttribute(crp, "image", ColIconFile); colFile.AddAttribute(crp, "visible", ColShowStatus); colFile.SetCellDataFunc(diffRenderer, new TreeCellDataFunc(SetDiffCellData)); filelist.AppendColumn(colStatus); filelist.AppendColumn(colCommit); filelist.AppendColumn(colFile); filestore = new TreeStore(typeof(Xwt.Drawing.Image), typeof(string), typeof(string[]), typeof(bool), typeof(bool), typeof(string), typeof(bool), typeof(bool), typeof(Xwt.Drawing.Image), typeof(bool), typeof(string)); filelist.Model = filestore; filelist.TestExpandRow += new Gtk.TestExpandRowHandler(OnTestExpandRow); ShowAll(); filelist.Selection.Changed += new EventHandler(OnCursorChanged); filelist.HeadersClickable = true; filestore.SetSortFunc(0, CompareNodes); colStatus.SortColumnId = 0; filestore.SetSortFunc(1, CompareNodes); colCommit.SortColumnId = 1; filestore.SetSortFunc(2, CompareNodes); colFile.SortColumnId = 2; filestore.SetSortColumnId(2, Gtk.SortType.Ascending); }
//if confirmed deletion, this will be called public void Delete_row_accepted() { //remove selected row from treeview store = UtilGtk.RemoveRow(treeview, store); menuCtx.Popdown(); }