Beispiel #1
0
	protected void OnSpouseSelect(object sender, SpouseSelectArgs e)
	{
		IndividualListDialog listDialog = new IndividualListDialog();
		
		SpouseListModel listModel = new SpouseListModel();
		
		if (sender is Gtk.Dialog)
		{
			listDialog.TransientFor = (Gtk.Window)sender;
		}
		else
		{
			listDialog.TransientFor = this;
		}
				
		listModel.Database = _database;
		listModel.Record = e.Indi;
		
		listDialog.Title = "Select Spouse";
		listDialog.List.ListModel = listModel;
		listDialog.Database = _database;
		listDialog.Record = e.Indi;
		
		listDialog.Modal = true;
		
		int response = listDialog.Run();
		
		if (response == (int)Gtk.ResponseType.Apply)
		{
			if (listDialog.Record != e.Indi)
			{
				e.SelectedSpouse = listDialog.Record as GedcomIndividualRecord;
				e.Family = listModel.GetFamily(e.SelectedSpouse.XRefID);
			}
		}
		else if (response == (int)Gtk.ResponseType.Ok)
		{
			// Create new indi
			GedcomIndividualRecord indi = new GedcomIndividualRecord(_database);
			GedcomFamilyRecord fam = new GedcomFamilyRecord(_database, e.Indi, indi);
	
			e.SelectedSpouse = indi;
			e.Family = fam;
		}
		
		listDialog.Destroy();
	}
Beispiel #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;
			
		}