Example #1
0
		private void FillView()
		{
			GedcomFamilyRecord fam = _famRecord;
			
			GedcomIndividualRecord husb = null;
			GedcomIndividualRecord wife = null;
			
			if (!string.IsNullOrEmpty(fam.Husband))
			{
				husb = _database[fam.Husband] as GedcomIndividualRecord;
				
				HusbandSpouseView.Record = husb;
			}
			else
			{
				HusbandSpouseView.Record = null;
			}
			
			if (!string.IsNullOrEmpty(fam.Wife))
			{
				wife = _database[fam.Wife] as GedcomIndividualRecord;
				
				WifeSpouseView.Record = wife;
			}
			else
			{
				WifeSpouseView.Record = null;
			}
			
			MarriageView.Record = fam;
			
			_childrenListModel = new ChildrenListModel();
			_childrenListModel.Database = _database;
			_childrenListModel.Record = fam;
			
			ChildrenTreeView.Model = _childrenListModel.Adapter;
			
			_husband = husb;
			_wife = wife;			
		}
Example #2
0
		public IndividualView()
		{
			this.Build();
			
			FactView.EventAdded += new EventHandler(OnFactView_EventAdded);
			FactView.EventRemoved += new EventHandler(OnFactView_EventRemoved);
			FactView.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnFactView_ShowSourceCitation);
			FactView.ShowScrapBook += new EventHandler<ScrapBookArgs>(OnEventScrapbookButton_Clicked);
			
			Gtk.TreeViewColumn placeCol = new Gtk.TreeViewColumn();
			Gtk.CellRenderer rend = new Gtk.CellRendererText();
			placeCol.Title = "Place";
			placeCol.PackStart(rend,true);
			placeCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderEventPlace));
			
			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;
			
			MarriageView.ShowScrapBook += new EventHandler<ScrapBookArgs>(OnMarriageScrapbookButton_Clicked);
			MarriageView.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnMarriageSourceButton_Clicked);
			MarriageView.MoreFamilyInformation += new EventHandler<FamilyArgs>(OnMarriageMoreButton_Clicked);
			
			Gtk.TreeViewColumn marriageToCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			marriageToCol.Title = "To";
			marriageToCol.PackStart(rend,true);

			marriageToCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderMarriageTo));
			
			MarriageTreeView.AppendColumn(placeCol);
			MarriageTreeView.AppendColumn(dateCol);
			MarriageTreeView.AppendColumn(marriageToCol);
			
			MarriageListModel marriageListModel = new MarriageListModel();
			MarriageTreeView.Model = marriageListModel;
			
			Gtk.TreeSelection selection = MarriageTreeView.Selection;
			selection.Changed += new EventHandler(OnMarriageSelection_Changed);
			
			_parents = new ParentsListModel();
			ParentsCombo.ListModel = _parents;
			
			_children = new ChildrenListModel();
			ChildrenCombo.ListModel = _children;
			
			_spouses = new SpouseListModel();
			SpousesCombo.ListModel = _spouses;
			
			_siblings = new SiblingsListModel();
			SiblingsCombo.ListModel = _siblings;
						
			Notebook.Page = 0;
			
		}