8 #include <all_include.h> |
8 #include <all_include.h> |
9 #include <algobox.h> |
9 #include <algobox.h> |
10 #include <libgnomecanvasmm.h> |
10 #include <libgnomecanvasmm.h> |
11 #include <libgnomecanvasmm/polygon.h> |
11 #include <libgnomecanvasmm/polygon.h> |
12 |
12 |
13 enum {GENERAL, ALGO_NUM}; // algorithm IDs; |
13 enum {GENERAL, KRUSKAL, ALGO_NUM}; // algorithm IDs; |
14 |
14 |
15 class AlgoWin : public Gtk::Dialog |
15 class AlgoWin : public Gtk::Window |
16 { |
16 { |
17 private: |
17 private: |
18 AlgoBox * ab; |
18 AlgoBox * ab; |
|
19 Gtk::Button * runbutton; |
|
20 Gtk::Button * closebutton; |
19 |
21 |
20 protected: |
22 protected: |
21 sigc::signal<void, AlgoWin *> signal_closed; |
23 sigc::signal<void, AlgoWin *> signal_closed; |
|
24 sigc::signal<void, AlgoWin *, std::string> signal_maplist_need; |
22 |
25 |
23 public: |
26 public: |
24 sigc::signal<void, AlgoWin *> signal_closing() |
27 bool closeIfEscapeIsPressed(GdkEventKey* e); |
25 { |
|
26 return signal_closed; |
|
27 } |
|
28 |
28 |
29 AlgoWin(int algoid, std::vector<std::string> tabnames) |
29 sigc::signal<void, AlgoWin *> signal_closing(); |
30 { |
30 sigc::signal<void, AlgoWin *, std::string> signal_maplist_needed(); |
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 |
31 |
42 void update_tablist(std::vector<std::string> tabnames) |
32 void emit_tab_change(std::string); |
43 { |
|
44 ab->update_tablist(tabnames); |
|
45 } |
|
46 |
33 |
47 void on_hide() |
34 AlgoWin(int, std::vector<std::string>, std::vector<std::string>, std::vector<std::string>); |
48 { |
35 |
49 signal_closed.emit(this); |
36 void update_tablist(std::vector<std::string> tabnames); |
50 Gtk::Dialog::on_hide(); |
37 void update_maplist(std::vector<std::string>, std::vector<std::string>); |
51 } |
38 |
|
39 void on_hide(); |
52 }; |
40 }; |
53 #endif //ALGOWIN_H |
41 #endif //ALGOWIN_H |