gui/mapselector.cc
changeset 1800 d391ea416aa0
parent 1733 5e0d97823ba2
equal deleted inserted replaced
1:e97f4864dd80 2:8211b7d7efd8
     1 #include "mapselector.h"
     1 #include "mapselector.h"
     2 
     2 
     3 MapSelector::MapSelector(GraphDisplayerCanvas & grdispc, MapStorage & mapst, NewMapWin & newmapw, int identifier, bool edge):gdc(grdispc),ms(mapst),nmw(newmapw),id(identifier),itisedge(edge),default_state(true),node_to_update(INVALID),edge_to_update(INVALID)
     3 MapSelector::MapSelector(GraphDisplayerCanvas & grdispc, MapStorage & mapst, NewMapWin & newmapw, int identifier, bool edge):gdc(grdispc),ms(mapst),nmw(newmapw),id(identifier),itisedge(edge),default_state(true),set_new_map(false),node_to_update(INVALID),edge_to_update(INVALID)
     4 {
     4 {
     5   update_list();
     5   update_list();
     6 
     6 
     7   cbt.set_active(0);
     7   cbt.set_active(0);
     8 
     8 
    34 
    34 
    35   newbut=new Gtk::Button(Gtk::Stock::NEW);
    35   newbut=new Gtk::Button(Gtk::Stock::NEW);
    36 
    36 
    37   newbut->signal_pressed().connect
    37   newbut->signal_pressed().connect
    38     (
    38     (
    39      sigc::mem_fun(nmw, &NewMapWin::show)
    39      sigc::mem_fun(*this, &MapSelector::new_but_pressed)
    40      );
    40      );
    41 
    41 
    42   add(*label);
    42   add(*label);
    43 
    43 
    44   add(cbt);
    44   add(cbt);
    45 
    45 
    46   add(*defbut);
    46   add(*defbut);
    47   add(*newbut);
    47   add(*newbut);
       
    48 }
       
    49 
       
    50 void MapSelector::new_but_pressed()
       
    51 {
       
    52   set_new_map=true;
       
    53   nmw.showByPreChoose(itisedge);
    48 }
    54 }
    49 
    55 
    50 void MapSelector::update_list()
    56 void MapSelector::update_list()
    51 {
    57 {
    52   cbt.clear();
    58   cbt.clear();
   209 }
   215 }
   210 
   216 
   211 void MapSelector::append_text(Glib::ustring text)
   217 void MapSelector::append_text(Glib::ustring text)
   212 {
   218 {
   213   cbt.append_text(text);
   219   cbt.append_text(text);
   214 }
   220   if(set_new_map)
       
   221     {
       
   222       set_active_text(text);
       
   223       set_new_map=false;
       
   224     }
       
   225 }