Пример #1
0
		public SourceCitationList()
		{
			this.Build();
			
			_listModel = new SourceCitationListModel();
			
			Gtk.TreeViewColumn buttonCol = new Gtk.TreeViewColumn();
			GtkCellRendererButton butRend = new GtkCellRendererButton();
			butRend.StockId = "gtk-remove";
			buttonCol.PackStart(butRend,true);
			
			Gtk.TreeViewColumn citationCountCol = new Gtk.TreeViewColumn();
			Gtk.CellRenderer rend = new Gtk.CellRendererText();
			citationCountCol.Title = "No.";
			citationCountCol.PackStart(rend,true);
			citationCountCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderCitationCount));
			
			Gtk.TreeViewColumn citationCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			citationCol.Title = "Text";
			citationCol.PackStart(rend,true);
			citationCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderSourceCitation));
			
			SourceCitationTreeView.AppendColumn(buttonCol);
			SourceCitationTreeView.AppendColumn(citationCountCol);
			SourceCitationTreeView.AppendColumn(citationCol);
					
			SourceCitationTreeView.Model = _listModel.Adapter;
			
			Gtk.TreeSelection selection = SourceCitationTreeView.Selection;
			selection.Changed += new EventHandler(OnSelection_Changed);
		}
Пример #2
0
		public NotesView()
		{
			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);
			
			Gtk.TreeViewColumn noteCountCol = new Gtk.TreeViewColumn();
			Gtk.CellRenderer rend = new Gtk.CellRendererText();
			noteCountCol.Title = "No.";
			noteCountCol.PackStart(rend,true);
			noteCountCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderNoteCount));
			
			Gtk.TreeViewColumn noteCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			noteCol.Title = "Text";
			noteCol.PackStart(rend,true);
			noteCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderNote));
			
			NotesTreeView.AppendColumn(buttonCol);
			NotesTreeView.AppendColumn(noteCountCol);
			NotesTreeView.AppendColumn(noteCol);
			
			Model = new NoteListModel();
			
			Gtk.TreeSelection selection = NotesTreeView.Selection;
			selection.Changed += new EventHandler(OnNoteSelection_Changed);
		}
Пример #3
0
		public ScrapBookView()
		{
			_recListModel = new MultimediaRecordListModel();
			_listModel = new MultimediaFileListModel();
			
			this.Build();
			
			
			Gtk.TreeViewColumn titleCol = new Gtk.TreeViewColumn();
			Gtk.CellRenderer rend = new Gtk.CellRendererText();
			titleCol.Title = "Record Title";
			titleCol.PackStart(rend,true);
			titleCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderMultimediaRecordTitle));
								
			RecordTreeView.AppendColumn(titleCol);
			
			RecordTreeView.Model = null;
			
			Gtk.TreeSelection selection = RecordTreeView.Selection;
			selection.Changed += new EventHandler(OnRecordSelection_Changed);

			Gtk.TreeViewColumn buttonCol = new Gtk.TreeViewColumn();
			GtkCellRendererButton butRend = new GtkCellRendererButton();
			butRend.StockId = "gtk-open";
			buttonCol.PackStart(butRend,true);
							
			Gtk.TreeViewColumn filenameCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			filenameCol.Title = "Filename";
			filenameCol.PackStart(rend,true);
			filenameCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderMultimediaFilename));

			Gtk.TreeViewColumn typeCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			typeCol.Title = "Type";
			typeCol.PackStart(rend,true);
			typeCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderMultimediaType));
			
			Gtk.TreeViewColumn formatCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			formatCol.Title = "Format";
			formatCol.PackStart(rend,true);
			formatCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderMultimediaFormat));
									
			FileTreeView.AppendColumn(buttonCol);
			FileTreeView.AppendColumn(filenameCol);
			FileTreeView.AppendColumn(typeCol);
			FileTreeView.AppendColumn(formatCol);
			
			FileTreeView.Model = null;
			
			selection = FileTreeView.Selection;
			selection.Changed += new EventHandler(OnSelection_Changed);
		}
Пример #4
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();
		}
Пример #5
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;
			
		}
Пример #6
0
		public FamilyView()
		{
			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 = "Name";
			nameCol.PackStart(rend,true);
			nameCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderIndividualName));
			nameCol.SortColumnId = 0;
			
			Gtk.TreeViewColumn sexCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			sexCol.Title = "Sex";
			sexCol.PackStart(rend,true);
			sexCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderIndividualSex));
			
			Gtk.TreeViewColumn dobCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			dobCol.Title = "Date of Birth";
			dobCol.PackStart(rend,true);
			dobCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderIndividualDob));
			
			Gtk.TreeViewColumn birthPlaceCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			birthPlaceCol.Title = "Birth Place";
			birthPlaceCol.PackStart(rend,true);
			birthPlaceCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderIndividualBirthPlace));
			
			Gtk.TreeViewColumn dodCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			dodCol.Title = "Date of Death";
			dodCol.PackStart(rend,true);
			dodCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderIndividualDod));
			
			Gtk.TreeViewColumn deathPlaceCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			deathPlaceCol.Title = "Death Place";
			deathPlaceCol.PackStart(rend,true);
			deathPlaceCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderIndividualDeathPlace));
			
			ChildrenTreeView.AppendColumn(buttonCol);
			ChildrenTreeView.AppendColumn(nameCol);
			ChildrenTreeView.AppendColumn(sexCol);
			ChildrenTreeView.AppendColumn(dobCol);
			ChildrenTreeView.AppendColumn(birthPlaceCol);
			ChildrenTreeView.AppendColumn(dodCol);
			ChildrenTreeView.AppendColumn(deathPlaceCol);
			
			HusbandSpouseView.AddButtonClicked += this.OnAddHusbandButton_Clicked;
			HusbandSpouseView.RemoveButtonClicked += this.OnRemoveHusbandButton_Clicked;
			HusbandSpouseView.DeleteButtonClicked += this.OnDeleteHusbandButton_Clicked;
			HusbandSpouseView.NameSourceButtonClicked += this.OnHusbandNameSourceButton_Clicked;
			HusbandSpouseView.DateBornSourceButtonClicked += this.OnHusbandDateBornSourceButton_Clicked;
			HusbandSpouseView.DateDiedSourceButtonClicked += this.OnHusbandDateDiedSourceButton_Clicked;
			HusbandSpouseView.MoreButtonClicked += this.OnHusbandMoreButton_Clicked;
			HusbandSpouseView.FamiliesButtonClicked += this.OnHusbandFamiliesButton_Clicked;
			HusbandSpouseView.ParentsButtonClicked += this.OnHusbandParentsButtonClicked;
			HusbandSpouseView.ScrapBookButtonClicked += this.OnHusbandScrapBookButtonClicked;
			HusbandSpouseView.NameButtonClicked += this.OnHusbandNameButtonClicked;
			
			WifeSpouseView.AddButtonClicked += this.OnAddWifeButton_Clicked;
			WifeSpouseView.RemoveButtonClicked += this.OnRemoveWifeButton_Clicked;
			WifeSpouseView.DeleteButtonClicked += this.OnDeleteWifeButton_Clicked;
			WifeSpouseView.NameSourceButtonClicked += this.OnWifeNameSourceButton_Clicked;
			WifeSpouseView.DateBornSourceButtonClicked += this.OnWifeDateBornSourceButton_Clicked;
			WifeSpouseView.DateDiedSourceButtonClicked += this.OnWifeDateDiedSourceButton_Clicked;
			WifeSpouseView.MoreButtonClicked += this.OnWifeMoreButton_Clicked;
			WifeSpouseView.FamiliesButtonClicked += this.OnWifeFamiliesButton_Clicked;
			WifeSpouseView.ParentsButtonClicked += this.OnWifeParentsButtonClicked;
			WifeSpouseView.ScrapBookButtonClicked += this.OnWifeScrapBookButtonClicked;
			WifeSpouseView.NameButtonClicked += this.OnWifeNameButtonClicked;
			
			MarriageView.ShowScrapBook += new EventHandler<ScrapBookArgs>(OnMarriageScrapbookButton_Clicked);
			MarriageView.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnMarriageSourceButton_Clicked);
			MarriageView.MoreFamilyInformation += new EventHandler<FamilyArgs>(OnMarriageMoreButton_Clicked);
		}
Пример #7
0
		public SourceView()
		{
			this.Build();
			
			_eventModel = new EventModel(EventModel.EventModelType.All);
			Gtk.TreeViewColumn eventNameCol = new Gtk.TreeViewColumn();
			Gtk.CellRenderer rend = new Gtk.CellRendererToggle();
			eventNameCol.Title = "Event";
			eventNameCol.PackStart(rend, false);
			eventNameCol.AddAttribute(rend, "active", (int)EventModel.Columns.Included);
			((Gtk.CellRendererToggle)rend).Activatable = true;
			((Gtk.CellRendererToggle)rend).Toggled += new Gtk.ToggledHandler(OnIncluded_Toggle);
			rend = new Gtk.CellRendererText();
			eventNameCol.PackStart(rend, true);
			eventNameCol.AddAttribute(rend, "text", (int)EventModel.Columns.Readable);

			EventTypeTreeView.AppendColumn(eventNameCol);		
			EventTypeTreeView.Model = _eventModel;

			
			Gtk.TreeViewColumn buttonCol = new Gtk.TreeViewColumn();
			GtkCellRendererButton butRend = new GtkCellRendererButton();
			butRend.StockId = "gtk-remove";
			buttonCol.PackStart(butRend,true);
			
			Gtk.TreeViewColumn noteCountCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			noteCountCol.Title = "No.";
			noteCountCol.PackStart(rend,true);
			noteCountCol.SetCellDataFunc(rend, new Gtk.TreeCellDataFunc(ListModelUtil.RenderEventRecordedCount));
		
			EventGroupTreeView.AppendColumn(buttonCol);
			EventGroupTreeView.AppendColumn(noteCountCol);

			Gtk.TreeSelection selection = EventGroupTreeView.Selection;
			selection.Changed += new EventHandler(OnEventGroupSelection_Changed);
			
			_eventGroups = new GenericListModel<GedcomRecordedEvent>();
			EventGroupTreeView.Model = _eventGroups.Adapter;
			
			Gtk.TreeViewColumn callNumberCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			callNumberCol.Title = "Call Number";
			callNumberCol.PackStart(rend,true);
			callNumberCol.AddAttribute(rend, "text", 0);
			
			Gtk.TreeViewColumn mediaTypeCol = new Gtk.TreeViewColumn();
			rend = new Gtk.CellRendererText();
			mediaTypeCol.Title = "Media Type";
			mediaTypeCol.PackStart(rend,true);
			mediaTypeCol.AddAttribute(rend, "text", 1);
			
			CallNumberTreeView.AppendColumn(callNumberCol);
			CallNumberTreeView.AppendColumn(mediaTypeCol);
			
			RepositoryCitationListModel repoCitationListModel = new RepositoryCitationListModel();
			CallNumberTreeView.Model = repoCitationListModel;
			
			selection = CallNumberTreeView.Selection;
			selection.Changed += new EventHandler(OnCallNumberSelection_Changed);
					
			// How to handle SourceMediaType.Other ?
			// don't include in initial and if the select one is SourceMediaType.Other
			// add an item into the dropdown for its value?
			// as other isn't really valid this seems like a reasonable idea
			Gtk.ListStore mediaTypes = new Gtk.ListStore(typeof(string));
			foreach (SourceMediaType mediaType in Enum.GetValues(typeof(SourceMediaType)))
			{
				if (mediaType != SourceMediaType.Other)
				{
					Gtk.TreeIter iter = mediaTypes.Append();
					mediaTypes.SetValue(iter, 0, mediaType.ToString());
				}
			}
			rend = new Gtk.CellRendererText();
			MediaTypeCombo.PackStart(rend,true);
			MediaTypeCombo.AddAttribute(rend, "text", 0);
			MediaTypeCombo.Model = mediaTypes;
			
			Notebook.Page = 0;
		}