protected void OnDeleteIndividual(object sender, IndividualArgs e) { DeleteIndividualDialog deleteDialog = new DeleteIndividualDialog(e.Indi); if (sender is Gtk.Dialog) { deleteDialog.TransientFor = (Gtk.Window)sender; } else { deleteDialog.TransientFor = this; } deleteDialog.Modal = true; switch (deleteDialog.Run()) { case (int)Gtk.ResponseType.Ok: e.Indi.Delete(); // FIXME: select new individual if (e.Indi == _record) { _record = _database.Individuals[0]; if (_currentView != null) { _currentView.Record = _record; } } // or just refresh the current view else { RefreshView(); } break; } deleteDialog.Destroy(); }
protected void OnSelectNewSpouse(object sender, IndividualArgs e) { IndividualListDialog listDialog = new IndividualListDialog(); IndividualListModel listModel = new IndividualListModel(); if (sender is Gtk.Dialog) { listDialog.TransientFor = (Gtk.Window)sender; } else { listDialog.TransientFor = this; } listModel.Database = _database; 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) { e.Indi = listDialog.Record as GedcomIndividualRecord; } else if (response == (int)Gtk.ResponseType.Ok) { // Create new indi GedcomIndividualRecord indi = new GedcomIndividualRecord(_database); e.Indi = indi; } listDialog.Destroy(); }
protected void OnShowName(object sender, IndividualArgs e) { NameDialog nameDialog = new NameDialog(); if (sender is Gtk.Dialog) { nameDialog.TransientFor = (Gtk.Window)sender; } else { nameDialog.TransientFor = this; } nameDialog.Database = _database; nameDialog.Record = e.Indi; nameDialog.Title = "Name(s)"; nameDialog.Response += OnShowName_Response; nameDialog.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation); nameDialog.SelectNewNote += new System.EventHandler<NoteArgs>(OnSelectNewNote); nameDialog.Run(); }
private void PedigreeBox_SelectIndividual(object sender, IndividualArgs e) { Record = e.Indi; }
protected void OnMoreInformation(object sender, IndividualArgs e) { GedcomIndividualRecord indi = e.Indi; IndividualMoreDialog moreDialog = new IndividualMoreDialog(); if (sender is Gtk.Dialog) { moreDialog.TransientFor = (Gtk.Window)sender; } else { moreDialog.TransientFor = this; } moreDialog.Database = _database; moreDialog.Record = indi; moreDialog.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation); moreDialog.ShowScrapBook += new EventHandler<ScrapBookArgs>(OnShowScrapBook); moreDialog.ShowName += new EventHandler<IndividualArgs>(OnShowName); moreDialog.DeleteIndividual += new EventHandler<IndividualArgs>(OnDeleteIndividual); moreDialog.MoreFactInformation += new EventHandler<FactArgs>(OnMoreFactInformation); moreDialog.SelectNewNote += new System.EventHandler<NoteArgs>(OnSelectNewNote); moreDialog.Response += new Gtk.ResponseHandler(OnMoreInformation_Response); moreDialog.ShowAll(); }
protected virtual void OnDeleteWifeButton_Clicked(object sender, System.EventArgs e) { if (_wife != null) { GedcomIndividualRecord indi = _wife; if (DeleteIndividual != null) { IndividualArgs args = new IndividualArgs(); args.Indi = indi; DeleteIndividual(this, args); } } }
protected virtual void OnWifeNameButtonClicked(object sender, EventArgs e) { SaveView(); if (ShowName != null) { IndividualArgs args = new IndividualArgs(); args.Indi = _wife; ShowName(this, args); } }
protected virtual void OnAddChildButton_Clicked(object sender, System.EventArgs e) { SaveView(); if (SelectNewChild != null) { IndividualArgs args = new IndividualArgs(); SelectNewChild(this, args); GedcomIndividualRecord indi = args.Indi; if (_famRecord.AddChild(indi)) { // GedcomFamilyRecord contains a list of children ids, // _childrenListModel is a list of GedcomIndividualRecords built from that, // so we still need to update the list _childrenListModel.List.Add(indi); _childrenListModel.ItemInserted(); } } }
protected virtual void OnAddWifeButton_Clicked(object sender, System.EventArgs e) { if (SelectNewSpouse != null) { SaveView(); IndividualArgs args = new IndividualArgs(); SelectNewSpouse(this, args); if (args.Indi != null) { if (_wife == _record) { _record = args.Indi; } _famRecord.ChangeWife(args.Indi); } FillView(); } }
protected virtual void OnWifeMoreButton_Clicked(object sender, System.EventArgs e) { IndividualArgs args = new IndividualArgs(); args.Indi = _wife; SaveView(); if (MoreInformation != null) { MoreInformation(this, args); } }
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; } } } } } } }
protected override bool OnButtonPressEvent (Gdk.EventButton evnt) { bool ret = base.OnButtonPressEvent (evnt); if (evnt.Button == 1 && evnt.Type == Gdk.EventType.TwoButtonPress && _person != null) { IndividualArgs args = new IndividualArgs(); args.Indi = _person; if (SelectIndividual != null) { SelectIndividual(this, args); } ret = false; } return ret; }
protected virtual void OnIndividualView_ShowName (object sender, IndividualArgs e) { if (ShowName != null) { ShowName(this, e); } }
protected virtual void OnIndividualView_DeleteIndividual (object sender, IndividualArgs e) { if (DeleteIndividual != null) { DeleteIndividual(this, e); } }
protected virtual void OnDeleteButton_Clicked(object sender, System.EventArgs e) { SaveView(); if (_record != null) { if (DeleteIndividual != null) { IndividualArgs args = new IndividualArgs(); args.Indi = (GedcomIndividualRecord)_record; DeleteIndividual(this, args); } } }
protected virtual void OnNameButton_Clicked(object sender, System.EventArgs e) { SaveView(); if (ShowName != null) { IndividualArgs args = new IndividualArgs(); args.Indi = (GedcomIndividualRecord)_record; ShowName(this, args); } }