algowin.h
author hegyi
Tue, 03 Jan 2006 17:30:22 +0000
branchgui
changeset 103 3a263e57e1d9
child 106 853dd852abc7
permissions -rw-r--r--
Coding of Algorithms has begun, but code is really-really ugly yet.
     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