/[ghosts]/ghosts/gedcomviewer/src/MMIglade/src/MMIChildToFamilyLink.cc
ViewVC logotype

Diff of /ghosts/gedcomviewer/src/MMIglade/src/MMIChildToFamilyLink.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by cpcp, Tue Oct 1 15:08:32 2002 UTC revision 1.2 by cpcp, Sun Feb 23 17:59:22 2003 UTC
# Line 9  Line 9 
9  #include "MMIChildToFamilyLink.hh"  #include "MMIChildToFamilyLink.hh"
10  #include <libgnome/libgnome.h>  #include <libgnome/libgnome.h>
11  #include "../string_utility/Converter.hh"  #include "../string_utility/Converter.hh"
12    #include <iostream>
13    #include "MMIMenuFamily.hh"
14    
15  MMIChildToFamilyLink::MMIChildToFamilyLink(  MMIChildToFamilyLink::MMIChildToFamilyLink(
16  ) : MMIChildToFamilyLink_glade()  ) : MMIChildToFamilyLink_glade(),
17        _cpt_family(0),
18        _family_added()
19  {    {  
20    _child_to_family_links->pages().clear();    _child_to_family_links->pages().clear();
21    _cpt_family = 0;    button_press_event.connect(slot(this, &MMIChildToFamilyLink::button_pressed));
22    }
23    
24    SigC::Signal0<void> &MMIChildToFamilyLink::FamilyAdded(void)
25    {
26      return _family_added;
27    }
28    
29    int MMIChildToFamilyLink::button_pressed(GdkEventButton * event)
30    {
31      if (event->button == 3)
32        {
33          MMIMenuFamily * popup_menu = manage(new MMIMenuFamily());
34          popup_menu->getAddItem()->activate.connect(slot(this, &MMIChildToFamilyLink::menu_add_activated));
35          popup_menu->getDeleteItem()->activate.connect(slot(this, &MMIChildToFamilyLink::menu_delete_activated));
36          guint button = 3;
37          guint32 activate_time = 0;
38          popup_menu->popup(button, activate_time);
39        }
40      return 1;
41    }
42    
43    void MMIChildToFamilyLink::menu_add_activated(void)
44    {
45      addChildToFamilyLink("","");
46      _family_added.emit();
47      return;
48    }
49    
50    void MMIChildToFamilyLink::menu_delete_activated(void)
51    {
52      deleteChildToFamilyLink();
53      return;
54    }
55    
56    void MMIChildToFamilyLink::deleteChildToFamilyLink(void)
57    {
58      _cpt_family--;
59      Gtk::Notebook_Helpers::PageList pages = _child_to_family_links->pages();
60      Gtk::Notebook_Helpers::PageList::iterator page_iter = pages.find(_child_to_family_links->get_current());
61      if (page_iter != pages.end())
62        {
63          pages.erase(page_iter);
64        }
65      return;
66  }  }
67    
68  OneChildToFamilyLink * MMIChildToFamilyLink::addChildToFamilyLink(std::string const &father, std::string const &mother, SigC::Slot0<void> * slot_father = 0, SigC::Slot0<void> * slot_mother = 0 )  OneChildToFamilyLink * MMIChildToFamilyLink::addChildToFamilyLink(std::string const &father, std::string const &mother, SigC::Slot0<void> * slot_father = 0, SigC::Slot0<void> * slot_mother = 0 )

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26