Index: Makefile.am
===================================================================
--- Makefile.am	(revision 100)
+++ Makefile.am	(revision 106)
@@ -8,4 +8,8 @@
 glemon_SOURCES = \
 	all_include.h \
+	algobox.cc \
+	algobox.h \
+	algowin.cc \
+	algowin.h \
 	gdc-broken_edge.cc \
 	graph_displayer_canvas.cc \
@@ -16,4 +20,6 @@
 	graph_displayer_canvas-zoom.cc \
 	graph-displayer.cc \
+	kruskalbox.cc \
+	kruskalbox.h \
 	main_win.cc \
 	main_win.h \
Index: algobox.cc
===================================================================
--- algobox.cc	(revision 106)
+++ algobox.cc	(revision 106)
@@ -0,0 +1,140 @@
+#include <algobox.h>
+
+enum {N_DEMO1, N_DEMO2, NODE_INPUT_NUM}; // input IDs for nodes;
+enum {E_DEMO1, EDGE_INPUT_NUM}; // input IDs for edges;
+
+AlgoBox::AlgoBox(std::vector<std::string> tabnames, std::vector<std::string> nodemapnames, std::vector<std::string> edgemapnames)
+{
+  init(tabnames, nodemapnames, edgemapnames);
+}
+
+void AlgoBox::init(std::vector<std::string> tabnames, std::vector<std::string> nodemapnames, std::vector<std::string> edgemapnames)
+{
+  set_spacing(5);
+
+  update_tablist(tabnames);
+
+  //if active tab is changed, the map names in cbt/s have to be updated
+  tabcbt.signal_changed().connect(sigc::mem_fun(*this, &AlgoBox::emit_tab_change));
+
+  pack_start(tabcbt);
+
+  build_box();
+
+  update_maplist(nodemapnames, edgemapnames);
+
+  show_all_children();
+};
+
+void AlgoBox::update_cbt(std::vector< std::string > stringlist, Gtk::ComboBoxText & cbt)
+{
+  std::string actname=cbt.get_active_text();
+  int prev_act=-1;
+
+  cbt.clear();
+  int actptr=0;
+
+  std::vector< std::string >::iterator emsi=stringlist.begin();
+  for(;emsi!=stringlist.end();emsi++)
+    {
+      if(actname==*emsi)
+	{
+	  prev_act=actptr;
+	}
+
+      cbt.append_text(*emsi);
+      actptr++;
+    }
+
+  if(prev_act!=-1)
+    {
+      cbt.set_active(prev_act);
+    }
+  else if(actptr>0) //so there is item in the list
+    {
+      cbt.set_active(0);
+    }
+}
+
+void AlgoBox::update_tablist( std::vector< std::string > tl )
+{
+  update_cbt(tl, tabcbt);
+  emit_tab_change();
+}
+
+void AlgoBox::update_maplist( std::vector< std::string > nml, std::vector< std::string > eml )
+{
+  for(int i=0;i<(int)nodemapcbts.size();i++)
+    {
+      update_cbt(nml, *(nodemapcbts[i]));
+    }
+  for(int i=0;i<(int)edgemapcbts.size();i++)
+    {
+      update_cbt(eml, *(edgemapcbts[i]));
+    }
+}
+
+void AlgoBox::run()
+{
+  std::cout << "Start algorithm." << std::endl;
+}
+
+void AlgoBox::build_box()
+{
+  pack_start(*(new Gtk::HSeparator()));
+
+  label=new Gtk::Label("Specific part for each algorithm.");
+      
+  pack_start(*label);
+  pack_start(*(new Gtk::HSeparator()));
+
+  label=new Gtk::Label("Maps in chosen tab:");
+      
+  pack_start(*label);
+
+  nodemapcbts.resize(NODE_INPUT_NUM);
+  for(int i=0;i<(int)nodemapcbts.size();i++)
+    {
+      Gtk::HBox * hbox=new Gtk::HBox();
+
+      std::ostringstream o;
+      o << "NodeInput " << i+1 << ":";
+      label=new Gtk::Label(o.str());
+
+      nodemapcbts[i]=new Gtk::ComboBoxText();
+
+      hbox->pack_start(*label);
+      hbox->pack_start(*(nodemapcbts[i]));
+      pack_start(*hbox);
+    }
+
+  pack_start(*(new Gtk::HSeparator()));
+
+  edgemapcbts.resize(EDGE_INPUT_NUM);
+  for(int i=0;i<(int)edgemapcbts.size();i++)
+    {
+      Gtk::HBox * hbox=new Gtk::HBox();
+
+      std::ostringstream o;
+      o << "EdgeInput " << i+1 << ":";
+      label=new Gtk::Label(o.str());
+
+      edgemapcbts[i]=new Gtk::ComboBoxText();
+
+      hbox->pack_start(*label);
+      hbox->pack_start(*(edgemapcbts[i]));
+      pack_start(*hbox);
+    }
+
+  pack_start(*(new Gtk::HSeparator()));
+}
+
+sigc::signal<void, std::string> AlgoBox::signal_maplist_needed()
+{
+  return signal_maplist_need;
+}
+
+void AlgoBox::emit_tab_change()
+{
+  signal_maplist_need.emit(tabcbt.get_active_text());
+}
Index: algobox.h
===================================================================
--- algobox.h	(revision 103)
+++ algobox.h	(revision 106)
@@ -12,51 +12,30 @@
 class AlgoBox : public Gtk::VBox
 {
+  sigc::signal<void, std::string> signal_maplist_need;  
   
+  Gtk::ComboBoxText tabcbt;
+
+protected:
   Gtk::Label * label;
-  Gtk::ComboBoxText cbt;
+  std::vector<Gtk::ComboBoxText *> nodemapcbts;
+  std::vector<Gtk::ComboBoxText *> edgemapcbts;
   
- public:
-  AlgoBox(std::vector<std::string> tabnames)
-    {
-      update_tablist(tabnames);
+public:
+  AlgoBox(){};
+  AlgoBox(std::vector<std::string>, std::vector<std::string>, std::vector<std::string>);
 
-      label=new Gtk::Label("Haliho");
-      
-      pack_start(*label);
-      pack_start(cbt);
+  virtual void init(std::vector<std::string>, std::vector<std::string>, std::vector<std::string>);
 
-      show_all_children();
-    };
+  sigc::signal<void, std::string> signal_maplist_needed();  
+  void emit_tab_change();
 
-  void update_tablist( std::vector< std::string > tl )
-    {
-      std::string actname=cbt.get_active_text();
-      int prev_act=-1;
+  void update_tablist( std::vector< std::string > tl );
+  void update_maplist( std::vector< std::string >, std::vector< std::string >);
 
-      cbt.clear();
-      int actptr=0;
-
-      std::vector< std::string >::iterator emsi=tl.begin();
-      for(;emsi!=tl.end();emsi++)
-	{
-	  if(actname==*emsi)
-	    {
-	      prev_act=actptr;
-	    }
-
-	  cbt.append_text(*emsi);
-	  actptr++;
-	}
-
-      if(prev_act!=-1)
-	{
-	  cbt.set_active(prev_act);
-	}
-      else if(actptr>0) //so there is item in the list
-	{
-	  cbt.set_active(0);
-	}
-    }
-
+  void update_cbt( std::vector< std::string > tl, Gtk::ComboBoxText &);
+  
+  virtual void run();
+  
+  virtual void build_box();
 };
 #endif //ALGOBOX_H
Index: algowin.cc
===================================================================
--- algowin.cc	(revision 106)
+++ algowin.cc	(revision 106)
@@ -0,0 +1,88 @@
+#include <algowin.h>
+#include <kruskalbox.h>
+
+sigc::signal<void, AlgoWin *> AlgoWin::signal_closing()
+{
+  return signal_closed;
+}
+
+sigc::signal<void, AlgoWin *, std::string> AlgoWin::signal_maplist_needed()
+{
+  return signal_maplist_need;
+}
+
+bool AlgoWin::closeIfEscapeIsPressed(GdkEventKey* e)
+{
+  if(e->keyval==GDK_Escape)
+  {
+    on_hide();
+  }
+  return true;
+}
+
+AlgoWin::AlgoWin(int algoid, std::vector<std::string> tabnames, std::vector<std::string> nodemapnames,std::vector<std::string> edgemapnames)
+{
+  signal_key_press_event().connect(sigc::mem_fun(*this, &AlgoWin::closeIfEscapeIsPressed));
+
+  Gtk::VBox * vbox=new Gtk::VBox();
+  vbox->set_spacing(5);
+
+  Gtk::Label * label=new Gtk::Label("Select graph:");
+
+  switch(algoid)
+    {
+    case 0:
+      ab=new AlgoBox(tabnames, nodemapnames, edgemapnames);
+      set_title("Algo Win Demo");
+      break;
+    case 1:
+      ab=new KruskalBox(tabnames, nodemapnames, edgemapnames);
+      set_title("Kruskal Algorithm");
+      break;
+    default:
+      break;
+    }
+  ab->signal_maplist_needed().connect(sigc::mem_fun(*this, &AlgoWin::emit_tab_change));
+
+  runbutton=new Gtk::Button("Run");
+  runbutton->signal_released().connect(sigc::mem_fun(*ab,&AlgoBox::run));
+  runbutton->signal_activate().connect(sigc::mem_fun(*ab,&AlgoBox::run));
+
+  closebutton=new Gtk::Button("Close");
+  closebutton->signal_released().connect(sigc::mem_fun(*this,&AlgoWin::on_hide));
+  closebutton->signal_activate().connect(sigc::mem_fun(*this,&AlgoWin::on_hide));
+      
+  Gtk::HBox * hbox=new Gtk::HBox();
+
+  hbox->pack_start(*runbutton);
+  hbox->pack_start(*closebutton);
+
+  vbox->pack_start(*label);
+  vbox->pack_start(*ab);
+  vbox->pack_start(*hbox);
+      
+  add(*vbox);
+
+  show_all_children();
+};
+
+void AlgoWin::update_tablist(std::vector<std::string> tabnames)
+{
+  ab->update_tablist(tabnames);
+}
+
+void AlgoWin::update_maplist(std::vector<std::string> nodemapnames, std::vector<std::string> edgemapnames)
+{
+  ab->update_maplist(nodemapnames, edgemapnames);
+}
+
+void AlgoWin::on_hide()
+{
+  signal_closed.emit(this);
+  Gtk::Window::on_hide();
+}
+
+void AlgoWin::emit_tab_change(std::string newtab)
+{
+  signal_maplist_need.emit(this, newtab);
+}
Index: algowin.h
===================================================================
--- algowin.h	(revision 103)
+++ algowin.h	(revision 106)
@@ -11,43 +11,31 @@
 #include <libgnomecanvasmm/polygon.h>
 
-enum {GENERAL, ALGO_NUM}; // algorithm IDs;
+enum {GENERAL, KRUSKAL, ALGO_NUM}; // algorithm IDs;
 
-class AlgoWin : public Gtk::Dialog
+class AlgoWin : public Gtk::Window
 {
 private:
   AlgoBox * ab;
+  Gtk::Button * runbutton;
+  Gtk::Button * closebutton;
 
 protected:
   sigc::signal<void, AlgoWin *> signal_closed;  
+  sigc::signal<void, AlgoWin *, std::string> signal_maplist_need;  
 
 public:
-  sigc::signal<void, AlgoWin *> signal_closing()
-  {
-    return signal_closed;
-  }
+  bool closeIfEscapeIsPressed(GdkEventKey* e);
 
-  AlgoWin(int algoid, std::vector<std::string> tabnames)
-    {
-      Gtk::VBox * vbox=get_vbox();
-      
-      ab=new AlgoBox(tabnames);
-      
-      vbox->pack_start(*ab);
-      
-      add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
-      
-      show_all_children();
-    };
+  sigc::signal<void, AlgoWin *> signal_closing();
+  sigc::signal<void, AlgoWin *, std::string> signal_maplist_needed();
 
-  void update_tablist(std::vector<std::string> tabnames)
-  {
-    ab->update_tablist(tabnames);
-  }
+  void emit_tab_change(std::string);
 
-  void on_hide()
-  {
-    signal_closed.emit(this);
-    Gtk::Dialog::on_hide();
-  }
+  AlgoWin(int, std::vector<std::string>, std::vector<std::string>, std::vector<std::string>);
+
+  void update_tablist(std::vector<std::string> tabnames);
+  void update_maplist(std::vector<std::string>, std::vector<std::string>);
+
+  void on_hide();
 };
 #endif //ALGOWIN_H
Index: kruskalbox.cc
===================================================================
--- kruskalbox.cc	(revision 106)
+++ kruskalbox.cc	(revision 106)
@@ -0,0 +1,27 @@
+#include <kruskalbox.h>
+
+KruskalBox::KruskalBox(std::vector<std::string> t, std::vector<std::string> nm, std::vector<std::string> em):AlgoBox()
+{
+  init(t, nm, em);
+}
+    
+void KruskalBox::run()
+{
+  std::cout << "Kruskal inditasa, de meg nincsen keszen." << std::endl;
+}
+    
+void KruskalBox::build_box()
+{
+  edgemapcbts.resize(1);
+  Gtk::HBox * hbox=new Gtk::HBox();
+
+  std::ostringstream o;
+  o << "Edgecosts: ";
+  label=new Gtk::Label(o.str());
+
+  edgemapcbts[0]=new Gtk::ComboBoxText();
+
+  hbox->pack_start(*label);
+  hbox->pack_start(*(edgemapcbts[0]));
+  pack_start(*hbox);
+}
Index: kruskalbox.h
===================================================================
--- kruskalbox.h	(revision 106)
+++ kruskalbox.h	(revision 106)
@@ -0,0 +1,23 @@
+// -*- C++ -*- //
+
+#ifndef KRUSKALBOX_H
+#define KRUSKALBOX_H
+
+class KruskalBox;
+
+#include <all_include.h>
+#include <algobox.h>
+#include <lemon/kruskal.h>
+#include <libgnomecanvasmm.h>
+#include <libgnomecanvasmm/polygon.h>
+
+class KruskalBox : public AlgoBox
+{
+public:
+  KruskalBox(std::vector<std::string> t, std::vector<std::string> nm, std::vector<std::string> em);
+    
+  void run();
+    
+  void build_box();
+};
+#endif //KRUSKALBOX_H
Index: main_win.cc
===================================================================
--- main_win.cc	(revision 104)
+++ main_win.cc	(revision 106)
@@ -105,4 +105,6 @@
   ag->add( Gtk::Action::create("AlgoGeneral", "_General"),
 	   sigc::bind( sigc::mem_fun ( *this, &MainWin::createAlgoWin ), 0) );
+  ag->add( Gtk::Action::create("AlgoKruskal", "_Kruskal"),
+	   sigc::bind( sigc::mem_fun ( *this, &MainWin::createAlgoWin ), 1) );
 
   Gtk::RadioAction::Group tool_group;
@@ -154,4 +156,5 @@
       "    <menu action='AlgoMenu'>"
       "      <menuitem action='AlgoGeneral'/>"
+      "      <menuitem action='AlgoKruskal'/>"
       "    </menu>"
       "  </menubar>"
@@ -225,5 +228,5 @@
   set_title(tabnames[active_tab] + " - " + prog_name);
   notebook.set_tab_label_text((Widget&)*(tabs[active_tab]), tabnames[active_tab]);
-  updateAlgoWins();
+  updateAlgoWinTabs();
 }
 
@@ -247,5 +250,5 @@
   notebook.set_current_page(size);
   set_tabtitle("unsaved file");
-  updateAlgoWins();
+  updateAlgoWinTabs();
 }
 
@@ -307,5 +310,5 @@
 	}
 
-      updateAlgoWins();
+      updateAlgoWinTabs();
     }
 }
@@ -405,10 +408,20 @@
 void MainWin::createAlgoWin(int algoid)
 {
-  AlgoWin * aw=new AlgoWin(algoid, tabnames);
+  AlgoWin * aw=new AlgoWin(algoid, tabnames, tabs[0]->mapstorage.getNodeMapList(),tabs[0]->mapstorage.getEdgeMapList());
   aw->signal_closing().connect(sigc::mem_fun(*this, &MainWin::deRegisterAlgoWin));
+  aw->signal_maplist_needed().connect(sigc::mem_fun(*this, &MainWin::updateAlgoWinMaps));
   aws.insert(aw);
   aw->show();
 }
 
+void MainWin::updateAlgoWinMaps(AlgoWin * awp, std::string tabname)
+{
+  int i=0;
+  for(;(i<(int)tabnames.size())&&(tabnames[i]!=tabname);i++)
+    {
+    }
+  awp->update_maplist(tabs[i]->mapstorage.getNodeMapList(),tabs[i]->mapstorage.getEdgeMapList());
+}
+
 void MainWin::deRegisterAlgoWin(AlgoWin * awp)
 {
@@ -416,5 +429,5 @@
 }
 
-void MainWin::updateAlgoWins()
+void MainWin::updateAlgoWinTabs()
 {
   std::set< AlgoWin* >::iterator awsi=aws.begin();
Index: main_win.h
===================================================================
--- main_win.h	(revision 104)
+++ main_win.h	(revision 106)
@@ -74,5 +74,6 @@
   virtual void createAlgoWin(int);
   virtual void deRegisterAlgoWin(AlgoWin *);
-  virtual void updateAlgoWins();
+  virtual void updateAlgoWinTabs();
+  virtual void updateAlgoWinMaps(AlgoWin *, std::string);
 
   virtual void changeEditorialTool(int);
