map_win.cc
branchgui
changeset 100 ad84ee331106
parent 95 628c0b383d2f
child 114 0ace7edbb06f
equal deleted inserted replaced
20:da33cc0a9429 21:7796adfb3c43
     3 
     3 
     4 bool MapWin::closeIfEscapeIsPressed(GdkEventKey* e)
     4 bool MapWin::closeIfEscapeIsPressed(GdkEventKey* e)
     5 {
     5 {
     6   if(e->keyval==GDK_Escape)
     6   if(e->keyval==GDK_Escape)
     7   {
     7   {
     8     mainwin.closeMapWin();
     8     mytab.closeMapWin();
     9     //    hide();
     9     //    hide();
    10   }
    10   }
    11   return true;
    11   return true;
    12 }
    12 }
    13 
    13 
    14 MapWin::MapWin(const std::string& title, std::vector<std::string> eml, std::vector<std::string> nml, MainWin & mw):mainwin(mw)
    14 MapWin::MapWin(const std::string& title, std::vector<std::string> eml, std::vector<std::string> nml, NoteBookTab & mw):mytab(mw)
    15 {
    15 {
    16   set_title(title);
    16   set_title(title);
    17   set_default_size(200, 50);
    17   set_default_size(200, 50);
    18 
    18 
    19   signal_key_press_event().connect(sigc::mem_fun(*this, &MapWin::closeIfEscapeIsPressed));
    19   signal_key_press_event().connect(sigc::mem_fun(*this, &MapWin::closeIfEscapeIsPressed));
    22 
    22 
    23   table=new Gtk::Table(EDGE_PROPERTY_NUM, 1, false);
    23   table=new Gtk::Table(EDGE_PROPERTY_NUM, 1, false);
    24 
    24 
    25   for(int i=0;i<EDGE_PROPERTY_NUM;i++)
    25   for(int i=0;i<EDGE_PROPERTY_NUM;i++)
    26   {
    26   {
    27     e_combo_array[i]=new MapSelector(eml, mainwin.getActiveEdgeMap(i), i, true);
    27     e_combo_array[i]=new MapSelector(eml, mytab.getActiveEdgeMap(i), i, true);
    28 
    28 
    29     (*table).attach((*(e_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
    29     (*table).attach((*(e_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
    30 
    30 
    31     e_combo_array[i]->signal_cbt_ch().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::edgeMapChanged), i));
    31     e_combo_array[i]->signal_cbt_ch().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::edgeMapChanged), i));
    32     e_combo_array[i]->signal_newmapwin_needed().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::newMapWinNeeded), i));
    32     e_combo_array[i]->signal_newmapwin_needed().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::newMapWinNeeded), i));
    42 
    42 
    43   table=new Gtk::Table(NODE_PROPERTY_NUM, 1, false);
    43   table=new Gtk::Table(NODE_PROPERTY_NUM, 1, false);
    44 
    44 
    45   for(int i=0;i<NODE_PROPERTY_NUM;i++)
    45   for(int i=0;i<NODE_PROPERTY_NUM;i++)
    46   {
    46   {
    47     n_combo_array[i]=new MapSelector(nml, mainwin.getActiveNodeMap(i), i, false);
    47     n_combo_array[i]=new MapSelector(nml, mytab.getActiveNodeMap(i), i, false);
    48 
    48 
    49     (*table).attach((*(n_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
    49     (*table).attach((*(n_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
    50 
    50 
    51     n_combo_array[i]->signal_cbt_ch().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::nodeMapChanged), i));
    51     n_combo_array[i]->signal_cbt_ch().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::nodeMapChanged), i));
    52     n_combo_array[i]->signal_newmapwin_needed().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::newMapWinNeeded), i));
    52     n_combo_array[i]->signal_newmapwin_needed().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::newMapWinNeeded), i));
    66 {
    66 {
    67 }
    67 }
    68 
    68 
    69 void MapWin::nodeMapChanged(std::string mapname, int prop)
    69 void MapWin::nodeMapChanged(std::string mapname, int prop)
    70 {
    70 {
    71   mainwin.propertyChange(false, prop, mapname);
    71   mytab.propertyChange(false, prop, mapname);
    72 }
    72 }
    73 
    73 
    74 void MapWin::edgeMapChanged(std::string mapname, int prop)
    74 void MapWin::edgeMapChanged(std::string mapname, int prop)
    75 {
    75 {
    76   mainwin.propertyChange(true, prop, mapname);
    76   mytab.propertyChange(true, prop, mapname);
    77 }
    77 }
    78 
    78 
    79 void MapWin::newMapWinNeeded(bool itisedge, int prop)
    79 void MapWin::newMapWinNeeded(bool itisedge, int prop)
    80 {
    80 {
    81   mainwin.popupNewMapWin(itisedge, prop);
    81   mytab.popupNewMapWin(itisedge, prop);
    82 }
    82 }
    83 
    83 
    84 void MapWin::update(std::vector<std::string> eml, std::vector<std::string> nml)
    84 void MapWin::update(std::vector<std::string> eml, std::vector<std::string> nml)
    85 {
    85 {
    86   for(int i=0;i<EDGE_PROPERTY_NUM;i++)
    86   for(int i=0;i<EDGE_PROPERTY_NUM;i++)
   113 }
   113 }
   114 
   114 
   115 bool MapWin::on_delete_event(GdkEventAny * event)
   115 bool MapWin::on_delete_event(GdkEventAny * event)
   116 {
   116 {
   117   event=event;
   117   event=event;
   118   mainwin.closeMapWin();
   118   mytab.closeMapWin();
   119   return true;
   119   return true;
   120 }
   120 }