Exemplo n.º 1
0
		private void FilterEvents(object sender, EventListModel.FilterArgs e)
		{
			bool include = true;
			switch (e.Event.EventType) 
			{
				case GedcomEvent.GedcomEventType.RESIFact:
					include = false;
					break;
				case GedcomEvent.GedcomEventType.GenericFact:
					// don't include height fact
					if (string.Compare(e.Event.EventName, "Height") == 0) 
					{
						include = false;
					}
					// or weight fact
					else if (string.Compare(e.Event.EventName, "Weight") == 0) 
					{
						include = false;
					}
					// or medical
					else if (string.Compare(e.Event.EventName, "Medical") == 0) 
					{
						include = false;
					}
					break;
			}

			e.Include = include;
		}
Exemplo n.º 2
0
		public FactView()
		{
			this.Build();
					
			FactTypeCombo.Clear();
			
			Gtk.CellRendererText rend = new Gtk.CellRendererText();
			rend.Ellipsize = Pango.EllipsizeMode.End;
			FactTypeCombo.PackStart(rend, true);
			FactTypeCombo.SetAttributes(rend, "text", EventModel.Columns.Readable);
									
			Gtk.TreeViewColumn buttonCol = new Gtk.TreeViewColumn();
			GtkCellRendererButton butRend = new GtkCellRendererButton();
			butRend.StockId = "gtk-index";
			buttonCol.PackStart(butRend,true);
			
			butRend = new GtkCellRendererButton();
			butRend.StockId = "gtk-remove";
			buttonCol.PackStart(butRend,true);
			
			butRend = new GtkCellRendererButton();
			butRend.StockId = "gtk-edit";
			buttonCol.PackStart(butRend,true);
			
			Gtk.TreeViewColumn nameCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			nameCol.Title = "Type";
			nameCol.PackStart(rend,true);
			nameCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderEventName));
			
			Gtk.TreeViewColumn dateCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			dateCol.Title = "Date";
			dateCol.PackStart(rend,true);
			dateCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderEventDate));
			dateCol.SortColumnId = 0;
			
			FactsTreeView.AppendColumn(buttonCol);
			FactsTreeView.AppendColumn(nameCol);
			FactsTreeView.AppendColumn(dateCol);
			
			_eventListModel = new EventListModel();
			// we need more complicated filtering than just the event type so
			// hookup to the event
			_eventListModel.FilterGedcomEvent += new EventHandler<EventListModel.FilterArgs>(FilterEvents);
			
			FactsTreeView.Model = _eventListModel;
			
			Gtk.TreeSelection selection = FactsTreeView.Selection;
			selection.Mode = Gtk.SelectionMode.Browse;
			selection.Changed += new EventHandler(OnFactSelection_Changed);
			
			_moreInfoArgs = new FactArgs();
		}
Exemplo n.º 3
0
		public AddressView()
		{
			this.Build();
			
			Gtk.TreeViewColumn buttonCol = new Gtk.TreeViewColumn();
			GtkCellRendererButton butRend = new GtkCellRendererButton();
			butRend.StockId = "gtk-index";
			buttonCol.PackStart(butRend,true);
			
			butRend = new GtkCellRendererButton();
			butRend.StockId = "gtk-remove";
			buttonCol.PackStart(butRend,true);
			
			butRend = new GtkCellRendererButton();
			butRend.StockId = "gtk-edit";
			buttonCol.PackStart(butRend,true);
			
			Gtk.TreeViewColumn nameCol = new Gtk.TreeViewColumn();
			Gtk.CellRenderer rend = new Gtk.CellRendererText();
			nameCol.Title = "Type";
			nameCol.PackStart(rend,true);
			nameCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderEventName));
			
			Gtk.TreeViewColumn dateCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			dateCol.Title = "Date";
			dateCol.PackStart(rend,true);
			dateCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderEventDate));
			dateCol.SortColumnId = 0;
			
			ResiTreeView.AppendColumn(buttonCol);
			ResiTreeView.AppendColumn(nameCol);
			ResiTreeView.AppendColumn(dateCol);
			
			Gtk.TreeSelection selection = ResiTreeView.Selection;
			selection.Changed += new EventHandler(OnResiSelection_Changed);
		
			// RESI event list for addresses
			_eventListModel = new EventListModel();
			_eventListModel.FilterType = GedcomEvent.GedcomEventType.RESIFact;
			
		}