gui/mapselector.cc
changeset 1737 dc821d2668c1
parent 1733 5e0d97823ba2
     1.1 --- a/gui/mapselector.cc	Mon Oct 24 08:12:26 2005 +0000
     1.2 +++ b/gui/mapselector.cc	Mon Oct 24 10:15:40 2005 +0000
     1.3 @@ -1,6 +1,6 @@
     1.4  #include "mapselector.h"
     1.5  
     1.6 -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)
     1.7 +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)
     1.8  {
     1.9    update_list();
    1.10  
    1.11 @@ -36,7 +36,7 @@
    1.12  
    1.13    newbut->signal_pressed().connect
    1.14      (
    1.15 -     sigc::mem_fun(nmw, &NewMapWin::show)
    1.16 +     sigc::mem_fun(*this, &MapSelector::new_but_pressed)
    1.17       );
    1.18  
    1.19    add(*label);
    1.20 @@ -47,6 +47,12 @@
    1.21    add(*newbut);
    1.22  }
    1.23  
    1.24 +void MapSelector::new_but_pressed()
    1.25 +{
    1.26 +  set_new_map=true;
    1.27 +  nmw.showByPreChoose(itisedge);
    1.28 +}
    1.29 +
    1.30  void MapSelector::update_list()
    1.31  {
    1.32    cbt.clear();
    1.33 @@ -211,4 +217,9 @@
    1.34  void MapSelector::append_text(Glib::ustring text)
    1.35  {
    1.36    cbt.append_text(text);
    1.37 +  if(set_new_map)
    1.38 +    {
    1.39 +      set_active_text(text);
    1.40 +      set_new_map=false;
    1.41 +    }
    1.42  }