gui/algowin.h
author hegyi
Wed, 04 Jan 2006 11:41:58 +0000
changeset 1872 3b7694cf0a08
child 1876 5ad84ad1b68f
permissions -rw-r--r--
Best feature ever\! Name of tabs are different from now on\!
     1 // -*- C++ -*- //
     2 
     3 #ifndef ALGOWIN_H
     4 #define ALGOWIN_H
     5 
     6 class AlgoWin;
     7 
     8 #include <all_include.h>
     9 #include <algobox.h>
    10 #include <libgnomecanvasmm.h>
    11 #include <libgnomecanvasmm/polygon.h>
    12 
    13 enum {GENERAL, ALGO_NUM}; // algorithm IDs;
    14 
    15 class AlgoWin : public Gtk::Dialog
    16 {
    17 private:
    18   AlgoBox * ab;
    19 
    20 protected:
    21   sigc::signal<void, AlgoWin *> signal_closed;  
    22 
    23 public:
    24   sigc::signal<void, AlgoWin *> signal_closing()
    25   {
    26     return signal_closed;
    27   }
    28 
    29   AlgoWin(int algoid, std::vector<std::string> tabnames)
    30     {
    31       Gtk::VBox * vbox=get_vbox();
    32       
    33       ab=new AlgoBox(tabnames);
    34       
    35       vbox->pack_start(*ab);
    36       
    37       add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
    38       
    39       show_all_children();
    40     };
    41 
    42   void update_tablist(std::vector<std::string> tabnames)
    43   {
    44     ab->update_tablist(tabnames);
    45   }
    46 
    47   void on_hide()
    48   {
    49     signal_closed.emit(this);
    50     Gtk::Dialog::on_hide();
    51   }
    52 };
    53 #endif //ALGOWIN_H