示例#1
0
		protected virtual void OnHeaderView_ShowSourceCitation (object sender, SourceCitationArgs e)
		{
			if (ShowSourceCitation != null)
			{
				ShowSourceCitation(this, e);
			}
		}
示例#2
0
		protected virtual void OnFactDetails_ShowSourceCitation (object sender, SourceCitationArgs e)
		{
			if (ShowSourceCitation != null)
			{
				ShowSourceCitation(this, e);
			}
		}
示例#3
0
		protected virtual void OnNameSourceButton_Clicked (object sender, System.EventArgs e)
		{
			if (ShowSourceCitation != null)
			{
				SourceCitationArgs args = new SourceCitationArgs();
				args.Record = _name;
				ShowSourceCitation(this,args);
			}
		}
示例#4
0
	protected void OnShowSourceCitation(object sender, SourceCitationArgs e)
	{
		if (e.Record == null)
		{
			// FIXME: do something
		}
		else
		{
			SourceCitationsDialog citationDialog = new SourceCitationsDialog();
					
			if (sender is Gtk.Dialog)
			{
				citationDialog.TransientFor = (Gtk.Window)sender;
			}
			else
			{
				citationDialog.TransientFor = this;
			}
			
			citationDialog.Database = _database;
			citationDialog.Record = e.Record;
			
			citationDialog.Response += new Gtk.ResponseHandler(OnShowSourceCitation_Response);
			citationDialog.ViewMasterSource += new EventHandler(OnViewMasterSource);
			citationDialog.ShowScrapBook += new EventHandler<ScrapBookArgs>(OnShowScrapBook);
			citationDialog.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
			citationDialog.SelectNewNote += new System.EventHandler<Gedcom.UI.Common.NoteArgs>(OnSelectNewNote);

			citationDialog.Show();
		}
	}
示例#5
0
		protected virtual void OnScrapBookList_ShowSourceCitation (object sender, SourceCitationArgs e)
		{
			if (ShowSourceCitation != null)
			{
				ShowSourceCitation(this, e);
			}
		}
示例#6
0
		protected virtual void OnMarriageSourceButton_Clicked(object sender, System.EventArgs e)
		{
			Save();
			
			if (ShowSourceCitation != null)
			{
				SourceCitationArgs args = new SourceCitationArgs();
				args.Record = _famRecord.Marriage;
			
				ShowSourceCitation(this,args);
			}
		}
示例#7
0
		protected virtual void OnMarriageSourceButton_Clicked(object sender, SourceCitationArgs e)
		{
			SaveView();
			
			if (ShowSourceCitation != null)
			{
				ShowSourceCitation(this, e);
			}
		}
示例#8
0
		protected virtual void OnWifeDateDiedSourceButton_Clicked(object sender, System.EventArgs e)
		{
			SaveView();
			
			if (ShowSourceCitation != null)
			{
				SourceCitationArgs args = new SourceCitationArgs();
				args.Record = _wife.Death;
				ShowSourceCitation(this,args);
			}
		}
示例#9
0
		protected virtual void OnHusbandDateBornSourceButton_Clicked(object sender, System.EventArgs e)
		{
			SaveView();
			
			if (ShowSourceCitation != null)
			{
				SourceCitationArgs args = new SourceCitationArgs();
				args.Record = _husband.Birth;
				ShowSourceCitation(this,args);
			}
		}
示例#10
0
		protected virtual void OnChildrenTreeView_ButtonPressEvent(object sender, Gtk.ButtonPressEventArgs e)
		{
			Gdk.EventButton ev = e.Event;
			
			if (ev.Button == 1)
			{
				int x = (int)ev.X;
				int y = (int)ev.Y;
				Gtk.TreePath path;
												
				if (ChildrenTreeView.GetPathAtPos(x, y, out path))
				{
					Gtk.TreeViewColumn buttonCol = ChildrenTreeView.Columns[0];
					if (x < buttonCol.Width)
					{
						Gtk.TreeIter iter;
						Gtk.CellRenderer[] rends = buttonCol.CellRenderers;
						
						if (_childrenListModel.GetIter(out iter, path))
						{
							GedcomIndividualRecord child = _childrenListModel.GetValue(iter, 0) as GedcomIndividualRecord;
							
							int i = 0;
							bool buttonClicked = false;
							foreach (GtkCellRendererButton rend in rends)
							{
								if (x >= rend.X && x <= rend.X + rend.Width)
								{
									buttonClicked = true;
									break;
								}
								i ++;
							}
							if (buttonClicked)
							{
								switch (i)
								{
									// source citation column
									case 0:
										if (ShowSourceCitation != null)
										{
											SourceCitationArgs args = new SourceCitationArgs();
											args.Record = child.Birth;
											ShowSourceCitation(this,args);
										}
										break;
									// remove column
									case 1:
										RemoveChild(iter);	
										break;
									// more info column
									case 2:
										IndividualArgs args = new IndividualArgs();
										args.Indi = child;
									
										SaveView();
									
										if (MoreInformation != null)
										{
											MoreInformation(this, args);	
										}
										break;
								}
							}
						}
					}
				}
			}
		}
示例#11
0
		protected virtual void OnFactsTreeView_ButtonPressEvent(object sender, Gtk.ButtonPressEventArgs e)
		{
			Gdk.EventButton eb = e.Event;
			
			if (eb.Button == 1)
			{
				int x = (int)eb.X;
				int y = (int)eb.Y;
				Gtk.TreePath path;
								
				if (FactsTreeView.GetPathAtPos(x, y, out path))
				{
					Gtk.TreeViewColumn buttonCol = FactsTreeView.Columns[0];
					if (x < buttonCol.Width)
					{
						Gtk.TreeIter iter;
						Gtk.CellRenderer[] rends = buttonCol.CellRenderers;
						
						EventListModel events = FactsTreeView.Model as EventListModel;
						
						if (events.GetIter(out iter, path))
						{
							GedcomEvent ev = _event;
							
							_event = events.GetValue(iter, 0) as GedcomEvent;
							
							int i = 0;
							bool buttonClicked = false;
							foreach (GtkCellRendererButton rend in rends)
							{
								if (x >= rend.X && x <= rend.X + rend.Width)
								{
									buttonClicked = true;
									break;
								}
								i ++;
							}
							if (buttonClicked)
							{
								switch (i)
								{
									// source button
									case 0:
										if (ShowSourceCitation != null)
										{
											SourceCitationArgs args = new SourceCitationArgs();
											args.Record = _event;
											ShowSourceCitation(this,args);
										}
										break;
									// remove button
									case 1:
										GedcomIndividualRecord indi = _record as GedcomIndividualRecord;
										GedcomFamilyRecord fam = _record as GedcomFamilyRecord;
									
										if (EventRemoved != null)
										{
											EventRemoved(this, EventArgs.Empty);
										}
													
										events.Remove(ref iter);
							
										if (indi != null)
										{
											if (indi.Events.Contains((GedcomIndividualEvent)_event))
											{
												indi.Events.Remove((GedcomIndividualEvent)_event);
											}
											else if (indi.Attributes.Contains((GedcomIndividualEvent)_event))
											{
												indi.Attributes.Remove((GedcomIndividualEvent)_event);
											}
										}
										else if (fam != null)
										{
											fam.Events.Remove((GedcomFamilyEvent)_event);	
										}
										
										if (ev == _event)
										{
											ev = null;	
										}
										
										break;
									// more button
									case 2:
										if (_event == ev)
										{
											Save();
										}
																				
										if (MoreInformation != null)
										{
											_moreInfoArgs.Event = _event;
											_event = ev;
											MoreInformation(this, _moreInfoArgs);
										}
										break;
								}
							}
							SetEventFromSelected();
						}
					}
				}
			}
		}
示例#12
0
		protected virtual void OnFactSourceButton_Clicked(object sender, System.EventArgs e)
		{
			SourceCitationArgs args = new SourceCitationArgs();
			args.Record = _event;
			ShowSourceCitation(this,args);
		}
示例#13
0
		protected virtual void OnNotesTreeView_ButtonPressEvent(object sender, Gtk.ButtonPressEventArgs e)
		{
			Gdk.EventButton ev = e.Event;
			
			if (ev.Button == 1)
			{
				int x = (int)ev.X;
				int y = (int)ev.Y;
				Gtk.TreePath path;
								
				if (NotesTreeView.GetPathAtPos(x, y, out path))
				{
					Gtk.TreeViewColumn buttonCol = NotesTreeView.Columns[0];
					if (x < buttonCol.Width)
					{
						Gtk.TreeIter iter;
						Gtk.CellRenderer[] rends = buttonCol.CellRenderers;
						
						if (_model.GetIter(out iter, path))
						{
							GedcomNoteRecord note = _model.GetValue(iter, 0) as GedcomNoteRecord;
									
							int i = 0;
							bool buttonClicked = false;
							foreach (GtkCellRendererButton rend in rends)
							{
								if (x >= rend.X && x <= rend.X + rend.Width)
								{
									buttonClicked = true;
									break;
								}
								i ++;
							}
							if (buttonClicked)
							{
								switch (i)
								{
									// source citation column
									case 0:
										if (ShowSourceCitation != null)
										{
											SourceCitationArgs args = new SourceCitationArgs();
											args.Record = note;
											ShowSourceCitation(this,args);
										}
										break;
										
									// remove column
									case 1:
										if (_record.RecordType != GedcomRecordType.Source || !_dataNotes)
										{
											_record.Notes.Remove(note.XRefID);
										}
										else
										{
											GedcomSourceRecord sourceRecord = (GedcomSourceRecord)_record;
											sourceRecord.DataNotes.Remove(note.XRefID);
										}
										
										note.Delete();
										
										_model.Remove(ref iter);
										break;
								}
							}
							
						}
					}
				}
			}
		}
示例#14
0
		protected virtual void OnResiTreeView_ButtonPressEvent (object o, Gtk.ButtonPressEventArgs e)
		{
			Gdk.EventButton ev = e.Event;
			
			if (ev.Button == 1)
			{
				int x = (int)ev.X;
				int y = (int)ev.Y;
				Gtk.TreePath path;
				
				if (ResiTreeView.GetPathAtPos(x, y, out path))
				{
					Gtk.TreeViewColumn buttonCol = ResiTreeView.Columns[0];
					if (x < buttonCol.Width)
					{
						Gtk.TreeIter iter;
						Gtk.CellRenderer[] rends = buttonCol.CellRenderers;
						
						if (_eventListModel.GetIter(out iter, path))
						{
							GedcomEvent resiEv = (GedcomEvent)_eventListModel.GetValue(iter, 0);
														
							int i = 0;
							bool buttonClicked = false;
							foreach (GtkCellRendererButton rend in rends)
							{
								if (x >= rend.X && x <= rend.X + rend.Width)
								{
									buttonClicked = true;
									break;
								}
								i ++;
							}
							if (buttonClicked)
							{
								switch (i)
								{
									// source citation column
									case 0:
										if (ShowSourceCitation != null)
										{
											SourceCitationArgs args = new SourceCitationArgs();
											args.Record = resiEv;
											ShowSourceCitation(this,args);
										}
										break;
									// remove column
									case 1:
										if (resiEv == _resi)
										{
											ClearView();
										}
										
										if (resiEv is Gedcom.GedcomIndividualEvent)
										{
											GedcomIndividualEvent indiEv = (GedcomIndividualEvent)resiEv;
											
											GedcomIndividualRecord indi = indiEv.IndiRecord;
											indi.Events.Remove(indiEv);
										}
										else if (resiEv is Gedcom.GedcomFamilyEvent)
										{
											GedcomFamilyEvent famEv = (GedcomFamilyEvent )resiEv;
											
											GedcomFamilyRecord fam = famEv.FamRecord;
											fam.Events.Remove(famEv);	
										}
										
										if (EventRemoved != null)
										{
											EventRemoved(this, EventArgs.Empty);
										}
													
										_eventListModel.Remove(ref iter);
																										
										break;
									// more info column
									case 2:
										FactArgs args = new FactArgs();
										args.Event = resiEv;
									
										SaveView();
									
										if (MoreFactInformation != null)
										{
											MoreFactInformation(this, args);	
										}
										break;
								}
							}
						}
					}
				}
			}
		}
示例#15
0
		protected virtual void OnNotesView_ShowSourceCitation (object sender, SourceCitationArgs e)
		{
			SaveView();
			
			if (ShowSourceCitation != null)
			{
				ShowSourceCitation(this, e);
			}
		}