NewMapWin has become Dialog instead of Window. Therefore it is created dynamically, when there is need for it, instead of keeping one instance in memory. This solution is slower, but more correct than before. gui
authorhegyi
Mon, 21 Nov 2005 18:03:20 +0000
branchgui
changeset 90e9f8f44f12a3
parent 89 4042761b21e3
child 91 55cf06f14981
NewMapWin has become Dialog instead of Window. Therefore it is created dynamically, when there is need for it, instead of keeping one instance in memory. This solution is slower, but more correct than before.
Doxyfile
main_win.cc
main_win.h
map_win.cc
map_win.h
mw-mapselector.cc
new_map_win.cc
new_map_win.h
     1.1 --- a/Doxyfile	Mon Nov 21 12:07:05 2005 +0000
     1.2 +++ b/Doxyfile	Mon Nov 21 18:03:20 2005 +0000
     1.3 @@ -25,7 +25,7 @@
     1.4  ALWAYS_DETAILED_SEC    = NO
     1.5  INLINE_INHERITED_MEMB  = NO
     1.6  FULL_PATH_NAMES        = YES
     1.7 -STRIP_FROM_PATH        = /home/alpar/projects/ETIK/hugo/gui/
     1.8 +STRIP_FROM_PATH        = .
     1.9  STRIP_FROM_INC_PATH    = 
    1.10  SHORT_NAMES            = NO
    1.11  JAVADOC_AUTOBRIEF      = NO
    1.12 @@ -82,7 +82,7 @@
    1.13  #---------------------------------------------------------------------------
    1.14  # configuration options related to the input files
    1.15  #---------------------------------------------------------------------------
    1.16 -INPUT                  = /home/alpar/projects/ETIK/hugo/gui
    1.17 +INPUT                  = .
    1.18  FILE_PATTERNS          = *.c \
    1.19                           *.cc \
    1.20                           *.cxx \
     2.1 --- a/main_win.cc	Mon Nov 21 12:07:05 2005 +0000
     2.2 +++ b/main_win.cc	Mon Nov 21 18:03:20 2005 +0000
     2.3 @@ -2,8 +2,7 @@
     2.4  #include "icons/guipixbufs.h"
     2.5  
     2.6  MainWin::MainWin() :
     2.7 -  newmapwin("Creating new map", gd_canvas),
     2.8 -  mapwin("Map Setup", mapstorage, gd_canvas, newmapwin),
     2.9 +  mapwin("Map Setup", mapstorage, gd_canvas),
    2.10    gd_canvas(mapstorage, mapwin, (Gtk::Window *)this)
    2.11  {
    2.12    set_title ("unsaved file - " + prog_name);
    2.13 @@ -121,7 +120,7 @@
    2.14        sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 5) );
    2.15  
    2.16    ag->add( Gtk::Action::create("AddMap", Gtk::StockID("gd-newmap")),
    2.17 -      sigc::mem_fun ( this->newmapwin, &NewMapWin::show ) );
    2.18 +      sigc::mem_fun (new NewMapWin("NewMapWin", gd_canvas), &NewMapWin::show ) );
    2.19  
    2.20    uim=Gtk::UIManager::create();
    2.21    uim->insert_action_group(ag);
     3.1 --- a/main_win.h	Mon Nov 21 12:07:05 2005 +0000
     3.2 +++ b/main_win.h	Mon Nov 21 18:03:20 2005 +0000
     3.3 @@ -25,9 +25,6 @@
     3.4    void readFile(const std::string &);
     3.5  
     3.6  protected:
     3.7 -  ///We need to store newmapwin, to be able to set the appropriate values for properties of new map.
     3.8 -  NewMapWin newmapwin;
     3.9 -
    3.10    ///Window of map-showing setup. Its type is \ref MapWin
    3.11    MapWin mapwin;
    3.12  
     4.1 --- a/map_win.cc	Mon Nov 21 12:07:05 2005 +0000
     4.2 +++ b/map_win.cc	Mon Nov 21 18:03:20 2005 +0000
     4.3 @@ -10,7 +10,7 @@
     4.4    return true;
     4.5  }
     4.6  
     4.7 -MapWin::MapWin(const std::string& title, MapStorage & mapst, GraphDisplayerCanvas & grdispc, NewMapWin & newmapwin):gdc(grdispc),ms(mapst), nmw(newmapwin)
     4.8 +MapWin::MapWin(const std::string& title, MapStorage & mapst, GraphDisplayerCanvas & grdispc):gdc(grdispc),ms(mapst)
     4.9  {
    4.10    set_title(title);
    4.11    set_default_size(200, 50);
    4.12 @@ -23,7 +23,7 @@
    4.13  
    4.14    for(int i=0;i<EDGE_PROPERTY_NUM;i++)
    4.15    {
    4.16 -    e_combo_array[i]=new MapSelector(gdc, ms, nmw, i, true);
    4.17 +    e_combo_array[i]=new MapSelector(gdc, ms, i, true);
    4.18  
    4.19      (*table).attach((*(e_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
    4.20    }
    4.21 @@ -40,7 +40,7 @@
    4.22  
    4.23    for(int i=0;i<NODE_PROPERTY_NUM;i++)
    4.24    {
    4.25 -    n_combo_array[i]=new MapSelector(gdc, ms, nmw, i, false);
    4.26 +    n_combo_array[i]=new MapSelector(gdc, ms, i, false);
    4.27  
    4.28      (*table).attach((*(n_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
    4.29    }
     5.1 --- a/map_win.h	Mon Nov 21 12:07:05 2005 +0000
     5.2 +++ b/map_win.h	Mon Nov 21 18:03:20 2005 +0000
     5.3 @@ -24,7 +24,6 @@
     5.4      GraphDisplayerCanvas & gdc;
     5.5      ///The \ref MapStorage in which the visualizable maps are stored
     5.6      MapStorage & ms;
     5.7 -    NewMapWin & nmw;
     5.8  
     5.9      int id;
    5.10  
    5.11 @@ -48,7 +47,7 @@
    5.12  
    5.13    public:
    5.14  
    5.15 -    MapSelector(GraphDisplayerCanvas &, MapStorage &, NewMapWin &, int, bool);
    5.16 +    MapSelector(GraphDisplayerCanvas &, MapStorage &, int, bool);
    5.17  
    5.18      void update_list();
    5.19  
    5.20 @@ -82,8 +81,6 @@
    5.21    ///The \ref MapStorage in which the visualizable maps are stored
    5.22    MapStorage & ms;
    5.23  
    5.24 -  NewMapWin & nmw;
    5.25 -
    5.26    Gtk::Table * table;
    5.27    
    5.28    MapSelector ** e_combo_array, ** n_combo_array;
    5.29 @@ -94,7 +91,7 @@
    5.30  
    5.31  public:
    5.32    ///Constructor of MapWin creates the widgets shown in MapWin.
    5.33 -  MapWin(const std::string& title, MapStorage &, GraphDisplayerCanvas &, NewMapWin &);
    5.34 +  MapWin(const std::string& title, MapStorage &, GraphDisplayerCanvas &);
    5.35  
    5.36    ///This function is created to set the appropriate maps on the newly created node
    5.37    void updateNode(Graph::Node);
     6.1 --- a/mw-mapselector.cc	Mon Nov 21 12:07:05 2005 +0000
     6.2 +++ b/mw-mapselector.cc	Mon Nov 21 18:03:20 2005 +0000
     6.3 @@ -1,6 +1,6 @@
     6.4  #include "map_win.h"
     6.5  
     6.6 -MapWin::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)
     6.7 +MapWin::MapSelector::MapSelector(GraphDisplayerCanvas & grdispc, MapStorage & mapst, int identifier, bool edge):gdc(grdispc),ms(mapst),id(identifier),itisedge(edge),default_state(true),set_new_map(false),node_to_update(INVALID),edge_to_update(INVALID)
     6.8  {
     6.9    update_list();
    6.10  
    6.11 @@ -50,7 +50,7 @@
    6.12  void MapWin::MapSelector::new_but_pressed()
    6.13  {
    6.14    set_new_map=true;
    6.15 -  nmw.showByPreChoose(itisedge);
    6.16 +  (new NewMapWin("NewMapWin", gdc, itisedge, false))->run();
    6.17  }
    6.18  
    6.19  void MapWin::MapSelector::update_list()
     7.1 --- a/new_map_win.cc	Mon Nov 21 12:07:05 2005 +0000
     7.2 +++ b/new_map_win.cc	Mon Nov 21 18:03:20 2005 +0000
     7.3 @@ -9,13 +9,13 @@
     7.4    return true;
     7.5  }
     7.6  
     7.7 -NewMapWin::NewMapWin(const std::string& title, GraphDisplayerCanvas & grdispc):gdc(grdispc),node("Create NodeMap"),edge("Create EdgeMap")
     7.8 +NewMapWin::NewMapWin(const std::string& title, GraphDisplayerCanvas & grdispc, bool itisedge, bool edgenode):Gtk::Dialog(title, true, true),gdc(grdispc),node("Create NodeMap"),edge("Create EdgeMap")
     7.9  {
    7.10 -  set_title(title);
    7.11    set_default_size(200, 50);
    7.12  
    7.13    signal_key_press_event().connect(sigc::mem_fun(*this, &NewMapWin::closeIfEscapeIsPressed));
    7.14  
    7.15 +  Gtk::VBox * vbox=get_vbox();
    7.16  
    7.17    //entries
    7.18    table=new Gtk::Table(3, 2, false);
    7.19 @@ -37,236 +37,229 @@
    7.20    //node vs. edge map selector
    7.21    Gtk::RadioButton::Group group = node.get_group();
    7.22    edge.set_group(group);
    7.23 +  
    7.24 +  if(edgenode)
    7.25 +    {
    7.26 +      (*table).attach(node,0,1,2,3,Gtk::SHRINK,Gtk::SHRINK,10,3);
    7.27 +      (*table).attach(edge,1,2,2,3,Gtk::SHRINK,Gtk::SHRINK,10,3);
    7.28 +    }
    7.29 +  else
    7.30 +    {
    7.31 +      if(itisedge)
    7.32 +	{
    7.33 +	  edge.set_active();
    7.34 +	}
    7.35 +      else
    7.36 +	{
    7.37 +	  node.set_active();
    7.38 +	}
    7.39 +    }
    7.40  
    7.41 -  (*table).attach(node,0,1,2,3,Gtk::SHRINK,Gtk::SHRINK,10,3);
    7.42 -  (*table).attach(edge,1,2,2,3,Gtk::SHRINK,Gtk::SHRINK,10,3);
    7.43 -
    7.44 -  vbox.pack_start(*table);
    7.45 +  vbox->pack_start(*table);
    7.46  
    7.47    //OK button
    7.48 -  button=new Gtk::Button("OK");
    7.49 -
    7.50 -  button->signal_clicked().connect
    7.51 -    (
    7.52 -     sigc::mem_fun(*this, &NewMapWin::buttonPressed)
    7.53 -    );
    7.54 -
    7.55 -
    7.56 -  vbox.pack_start(*button);
    7.57 -
    7.58 -  add(vbox);
    7.59 +  add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
    7.60  
    7.61    show_all_children();
    7.62  
    7.63  }
    7.64  
    7.65 -void NewMapWin::showByPreChoose(bool itisedge)
    7.66 +void NewMapWin::on_response(int response_id)
    7.67  {
    7.68 -  if(itisedge)
    7.69 +  if(response_id==Gtk::RESPONSE_OK)
    7.70      {
    7.71 -      edge.set_active();
    7.72 -    }
    7.73 -  else
    7.74 -    {
    7.75 -      node.set_active();
    7.76 -    }
    7.77 -  node.hide();
    7.78 -  edge.hide();
    7.79 -  show();
    7.80 -}
    7.81 +      double def_val=0;
    7.82  
    7.83 -void NewMapWin::buttonPressed()
    7.84 -{
    7.85 -  double def_val=0;
    7.86 +      //get and formulate text
    7.87 +      std::string def_val_str=default_value.get_text();
    7.88 +      std::string polishform=string2Polishform(def_val_str,edge.get_active());
    7.89  
    7.90 -  //get and formulate text
    7.91 -  std::string def_val_str=default_value.get_text();
    7.92 -  std::string polishform=string2Polishform(def_val_str,edge.get_active());
    7.93 +      //get name of text
    7.94 +      std::string mapname=name.get_text();
    7.95  
    7.96 -  //get name of text
    7.97 -  std::string mapname=name.get_text();
    7.98 +      if(!mapname.empty()&&!polishform.empty())
    7.99 +	{
   7.100 +	  int abortion=0;
   7.101 +	  if(edge.get_active())
   7.102 +	    {
   7.103 +	      //create the new map
   7.104 +	      Graph::EdgeMap<double> * emptr=new Graph::EdgeMap<double> (gdc.mapstorage.graph);
   7.105  
   7.106 -  if(!mapname.empty()&&!polishform.empty())
   7.107 -    {
   7.108 -      int abortion=0;
   7.109 -      if(edge.get_active())
   7.110 -	{
   7.111 -	  //create the new map
   7.112 -	  Graph::EdgeMap<double> * emptr=new Graph::EdgeMap<double> (gdc.mapstorage.graph);
   7.113 -
   7.114 -	  std::stack<double> polishstack;
   7.115 +	      std::stack<double> polishstack;
   7.116    
   7.117 -	  for(EdgeIt k(gdc.mapstorage.graph); k!=INVALID; ++k)
   7.118 -	    {
   7.119 -	      for(int i=0;i<(int)polishform.size();i++)
   7.120 +	      for(EdgeIt k(gdc.mapstorage.graph); k!=INVALID; ++k)
   7.121  		{
   7.122 -		  double op1, op2;
   7.123 -		  bool operation=true;
   7.124 -		  switch(polishform[i])
   7.125 +		  for(int i=0;i<(int)polishform.size();i++)
   7.126  		    {
   7.127 -		    case '+':
   7.128 -		    case '-':
   7.129 -		    case '/':
   7.130 -		    case '*':
   7.131 -		      op1=polishstack.top();
   7.132 -		      polishstack.pop();
   7.133 -		      op2=polishstack.top();
   7.134 -		      polishstack.pop();
   7.135 -		      break;
   7.136 -		    default:
   7.137 -		      //substitute variable
   7.138 -		      std::map< std::string,Graph::EdgeMap<double> * > ems=gdc.mapstorage.edgemap_storage;
   7.139 -		      bool itisvar=(ems.find(ch2var[ polishform[i] ])!=ems.end());
   7.140 -		      if(itisvar)
   7.141 -			{
   7.142 -			  polishstack.push( (*(gdc.mapstorage.edgemap_storage[ ch2var[ polishform[i] ] ]))[k]);
   7.143 -			}
   7.144 -		      else
   7.145 -			{
   7.146 -			  char * def_val_ch=new char [(int)(ch2var[ polishform[i] ].length())];
   7.147 -			  for(int j=0;j<(int)(ch2var[ polishform[i] ].length());j++)
   7.148 -			    {
   7.149 -			      def_val_ch[j]=ch2var[ polishform[i] ][j];
   7.150 -			    }
   7.151 -			  polishstack.push(atof(def_val_ch));
   7.152 -			}
   7.153 -		      operation=false;
   7.154 -		      break;
   7.155 -		    }
   7.156 -		  if(operation)
   7.157 -		    {
   7.158 -		      double res;
   7.159 +		      double op1, op2;
   7.160 +		      bool operation=true;
   7.161  		      switch(polishform[i])
   7.162  			{
   7.163  			case '+':
   7.164 -			  res=op1+op2;
   7.165 -			  break;
   7.166  			case '-':
   7.167 -			  res=op2-op1;
   7.168 -			  break;
   7.169  			case '/':
   7.170 -			  res=op2/op1;
   7.171 -			  break;
   7.172  			case '*':
   7.173 -			  res=op1*op2;
   7.174 +			  op1=polishstack.top();
   7.175 +			  polishstack.pop();
   7.176 +			  op2=polishstack.top();
   7.177 +			  polishstack.pop();
   7.178  			  break;
   7.179  			default:
   7.180 -			  std::cout << "How could we get here?" << std::endl;
   7.181 +			  //substitute variable
   7.182 +			  std::map< std::string,Graph::EdgeMap<double> * > ems=gdc.mapstorage.edgemap_storage;
   7.183 +			  bool itisvar=(ems.find(ch2var[ polishform[i] ])!=ems.end());
   7.184 +			  if(itisvar)
   7.185 +			    {
   7.186 +			      polishstack.push( (*(gdc.mapstorage.edgemap_storage[ ch2var[ polishform[i] ] ]))[k]);
   7.187 +			    }
   7.188 +			  else
   7.189 +			    {
   7.190 +			      char * def_val_ch=new char [(int)(ch2var[ polishform[i] ].length())];
   7.191 +			      for(int j=0;j<(int)(ch2var[ polishform[i] ].length());j++)
   7.192 +				{
   7.193 +				  def_val_ch[j]=ch2var[ polishform[i] ][j];
   7.194 +				}
   7.195 +			      polishstack.push(atof(def_val_ch));
   7.196 +			    }
   7.197 +			  operation=false;
   7.198  			  break;
   7.199  			}
   7.200 -		      polishstack.push(res);
   7.201 +		      if(operation)
   7.202 +			{
   7.203 +			  double res;
   7.204 +			  switch(polishform[i])
   7.205 +			    {
   7.206 +			    case '+':
   7.207 +			      res=op1+op2;
   7.208 +			      break;
   7.209 +			    case '-':
   7.210 +			      res=op2-op1;
   7.211 +			      break;
   7.212 +			    case '/':
   7.213 +			      res=op2/op1;
   7.214 +			      break;
   7.215 +			    case '*':
   7.216 +			      res=op1*op2;
   7.217 +			      break;
   7.218 +			    default:
   7.219 +			      std::cout << "How could we get here?" << std::endl;
   7.220 +			      break;
   7.221 +			    }
   7.222 +			  polishstack.push(res);
   7.223 +			}
   7.224  		    }
   7.225 +		  (*emptr)[k]=polishstack.top(); 
   7.226  		}
   7.227 -	      (*emptr)[k]=polishstack.top(); 
   7.228 +
   7.229 +	      //if addition was not successful addEdgeMap returns one.
   7.230 +	      //cause can be that there is already a map named like the new one
   7.231 +	      if(gdc.mapstorage.addEdgeMap(mapname, emptr, def_val))
   7.232 +		{
   7.233 +		  abortion=1;
   7.234 +		}
   7.235 +
   7.236 +	      //add it to the list of the displayable maps
   7.237 +	      gdc.mapwin.registerNewEdgeMap(mapname);
   7.238 +
   7.239 +	      //display it
   7.240 +	      gdc.changeEdgeText(mapname);
   7.241  	    }
   7.242 +	  else //!edge.get_active()
   7.243 +	    {
   7.244 +	      //create the new map
   7.245 +	      Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> (gdc.mapstorage.graph);
   7.246  
   7.247 -	  //if addition was not successful addEdgeMap returns one.
   7.248 -	  //cause can be that there is already a map named like the new one
   7.249 -	  if(gdc.mapstorage.addEdgeMap(mapname, emptr, def_val))
   7.250 -	    {
   7.251 -	      abortion=1;
   7.252 -	    }
   7.253 -
   7.254 -	  //add it to the list of the displayable maps
   7.255 -	  gdc.mapwin.registerNewEdgeMap(mapname);
   7.256 -
   7.257 -	  //display it
   7.258 -	  gdc.changeEdgeText(mapname);
   7.259 -	}
   7.260 -      else //!edge.get_active()
   7.261 -	{
   7.262 -	  //create the new map
   7.263 -	  Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> (gdc.mapstorage.graph);
   7.264 -
   7.265 -	  std::stack<double> polishstack;
   7.266 +	      std::stack<double> polishstack;
   7.267    
   7.268 -	  for(NodeIt k(gdc.mapstorage.graph); k!=INVALID; ++k)
   7.269 -	    {
   7.270 -	      for(int i=0;i<(int)polishform.size();i++)
   7.271 +	      for(NodeIt k(gdc.mapstorage.graph); k!=INVALID; ++k)
   7.272  		{
   7.273 -		  double op1, op2;
   7.274 -		  bool operation=true;
   7.275 -		  switch(polishform[i])
   7.276 +		  for(int i=0;i<(int)polishform.size();i++)
   7.277  		    {
   7.278 -		    case '+':
   7.279 -		    case '-':
   7.280 -		    case '/':
   7.281 -		    case '*':
   7.282 -		      op1=polishstack.top();
   7.283 -		      polishstack.pop();
   7.284 -		      op2=polishstack.top();
   7.285 -		      polishstack.pop();
   7.286 -		      break;
   7.287 -		    default:
   7.288 -		      std::map< std::string,Graph::NodeMap<double> * > nms=gdc.mapstorage.nodemap_storage;
   7.289 -		      bool itisvar=(nms.find(ch2var[ polishform[i] ])!=nms.end());
   7.290 -		      if(itisvar)
   7.291 -			{
   7.292 -			  polishstack.push( (*(gdc.mapstorage.nodemap_storage[ ch2var[ polishform[i] ] ]))[k]);
   7.293 -			}
   7.294 -		      else
   7.295 -			{
   7.296 -			  char * def_val_ch=new char [(int)(ch2var[ polishform[i] ].length())];
   7.297 -			  for(int j=0;j<(int)(ch2var[ polishform[i] ].length());j++)
   7.298 -			    {
   7.299 -			      def_val_ch[j]=ch2var[ polishform[i] ][j];
   7.300 -			    }
   7.301 -			  polishstack.push(atof(def_val_ch));
   7.302 -			}
   7.303 -		      operation=false;
   7.304 -		      break;
   7.305 -		    }
   7.306 -		  if(operation)
   7.307 -		    {
   7.308 -		      double res;
   7.309 +		      double op1, op2;
   7.310 +		      bool operation=true;
   7.311  		      switch(polishform[i])
   7.312  			{
   7.313  			case '+':
   7.314 -			  res=op1+op2;
   7.315 -			  break;
   7.316  			case '-':
   7.317 -			  res=op2-op1;
   7.318 -			  break;
   7.319  			case '/':
   7.320 -			  res=op2/op1;
   7.321 -			  break;
   7.322  			case '*':
   7.323 -			  res=op1*op2;
   7.324 +			  op1=polishstack.top();
   7.325 +			  polishstack.pop();
   7.326 +			  op2=polishstack.top();
   7.327 +			  polishstack.pop();
   7.328  			  break;
   7.329  			default:
   7.330 -			  std::cout << "How could we get here?" << std::endl;
   7.331 +			  std::map< std::string,Graph::NodeMap<double> * > nms=gdc.mapstorage.nodemap_storage;
   7.332 +			  bool itisvar=(nms.find(ch2var[ polishform[i] ])!=nms.end());
   7.333 +			  if(itisvar)
   7.334 +			    {
   7.335 +			      polishstack.push( (*(gdc.mapstorage.nodemap_storage[ ch2var[ polishform[i] ] ]))[k]);
   7.336 +			    }
   7.337 +			  else
   7.338 +			    {
   7.339 +			      char * def_val_ch=new char [(int)(ch2var[ polishform[i] ].length())];
   7.340 +			      for(int j=0;j<(int)(ch2var[ polishform[i] ].length());j++)
   7.341 +				{
   7.342 +				  def_val_ch[j]=ch2var[ polishform[i] ][j];
   7.343 +				}
   7.344 +			      polishstack.push(atof(def_val_ch));
   7.345 +			    }
   7.346 +			  operation=false;
   7.347  			  break;
   7.348  			}
   7.349 -		      polishstack.push(res);
   7.350 +		      if(operation)
   7.351 +			{
   7.352 +			  double res;
   7.353 +			  switch(polishform[i])
   7.354 +			    {
   7.355 +			    case '+':
   7.356 +			      res=op1+op2;
   7.357 +			      break;
   7.358 +			    case '-':
   7.359 +			      res=op2-op1;
   7.360 +			      break;
   7.361 +			    case '/':
   7.362 +			      res=op2/op1;
   7.363 +			      break;
   7.364 +			    case '*':
   7.365 +			      res=op1*op2;
   7.366 +			      break;
   7.367 +			    default:
   7.368 +			      std::cout << "How could we get here?" << std::endl;
   7.369 +			      break;
   7.370 +			    }
   7.371 +			  polishstack.push(res);
   7.372 +			}
   7.373  		    }
   7.374 +		  (*emptr)[k]=polishstack.top(); 
   7.375  		}
   7.376 -	      (*emptr)[k]=polishstack.top(); 
   7.377 +
   7.378 +	      //if addition was not successful addNodeMap returns one.
   7.379 +	      //cause can be that there is already a map named like the new one
   7.380 +	      if(gdc.mapstorage.addNodeMap(mapname,emptr, def_val))
   7.381 +		{
   7.382 +		  abortion=1;
   7.383 +		}
   7.384 +
   7.385 +	      //add it to the list of the displayable maps
   7.386 +	      gdc.mapwin.registerNewNodeMap(mapname);
   7.387 +
   7.388 +	      //display it
   7.389 +	      //gdc.changeNodeText(mapname);
   7.390  	    }
   7.391 -
   7.392 -	  //if addition was not successful addNodeMap returns one.
   7.393 -	  //cause can be that there is already a map named like the new one
   7.394 -	  if(gdc.mapstorage.addNodeMap(mapname,emptr, def_val))
   7.395 +	  if(!abortion)
   7.396  	    {
   7.397 -	      abortion=1;
   7.398 +	      name.set_text("");
   7.399 +	      default_value.set_text("0");
   7.400 +	      edge.show();
   7.401 +	      node.show();
   7.402 +	      hide();
   7.403  	    }
   7.404 -
   7.405 -	  //add it to the list of the displayable maps
   7.406 -	  gdc.mapwin.registerNewNodeMap(mapname);
   7.407 -
   7.408 -	  //display it
   7.409 -	  gdc.changeNodeText(mapname);
   7.410 -	}
   7.411 -      if(!abortion)
   7.412 -	{
   7.413 -	  name.set_text("");
   7.414 -	  default_value.set_text("0");
   7.415 -	  edge.show();
   7.416 -	  node.show();
   7.417 -	  hide();
   7.418  	}
   7.419      }
   7.420  }
   7.421  
   7.422 +
   7.423  std::string NewMapWin::string2Polishform(std::string rawcommand, bool itisedge)
   7.424  {
   7.425    bool valid_entry=true;
     8.1 --- a/new_map_win.h	Mon Nov 21 12:07:05 2005 +0000
     8.2 +++ b/new_map_win.h	Mon Nov 21 18:03:20 2005 +0000
     8.3 @@ -14,7 +14,7 @@
     8.4  ///This class is responsible for creating a window,
     8.5  ///on which the parameters of a new map can be set.
     8.6  
     8.7 -class NewMapWin : public Gtk::Window
     8.8 +class NewMapWin : public Gtk::Dialog
     8.9  {
    8.10    ///The \ref GraphDisplayerCanvas on which the graph will be drawn.
    8.11    ///It has to be known for this class, because
    8.12 @@ -31,16 +31,13 @@
    8.13    };
    8.14    
    8.15    ///Constructor of NewMapWin creates the widgets shown in NewMapWin.
    8.16 -  NewMapWin(const std::string& title, GraphDisplayerCanvas &);
    8.17 -
    8.18 +  NewMapWin(const std::string& title, GraphDisplayerCanvas &, bool itisedge=true, bool edgenode=true);
    8.19    
    8.20    ///Signal on button is connected to this function,
    8.21    ///Therefore this function determines whether to
    8.22    ///call the map/creatort function, and if yes, it
    8.23    //tells it the attributes.(name, default value)
    8.24 -  virtual void buttonPressed();
    8.25 -  
    8.26 -  virtual void showByPreChoose(bool);
    8.27 +  virtual void on_response(int response_id);
    8.28  
    8.29    virtual bool closeIfEscapeIsPressed(GdkEventKey*);
    8.30  
    8.31 @@ -58,10 +55,6 @@
    8.32  
    8.33    Gtk::Entry name, default_value;
    8.34  
    8.35 -  Gtk::VBox vbox;
    8.36 -
    8.37 -  Gtk::Button * button;
    8.38 -
    8.39    Gtk::Table * table;
    8.40    Gtk::Label * label;
    8.41