[6] | 1 | // -*- C++ -*- // |
---|
| 2 | |
---|
| 3 | #ifndef MAIN_WIN_H |
---|
| 4 | #define MAIN_WIN_H |
---|
| 5 | |
---|
[53] | 6 | #include "all_include.h" |
---|
[103] | 7 | #include "algowin.h" |
---|
[53] | 8 | #include "map_win.h" |
---|
| 9 | #include "new_map_win.h" |
---|
[96] | 10 | #include "nbtab.h" |
---|
[6] | 11 | #include <libgnomecanvasmm.h> |
---|
| 12 | #include <libgnomecanvasmm/polygon.h> |
---|
| 13 | |
---|
[96] | 14 | |
---|
[6] | 15 | ///This class is the main window of GUI. |
---|
| 16 | ///It has menus, but the main part of it is the canvas. |
---|
| 17 | class MainWin : public Gtk::Window |
---|
| 18 | { |
---|
[96] | 19 | ///Container |
---|
| 20 | Gtk::VBox vbox; |
---|
| 21 | |
---|
| 22 | Gtk::Notebook notebook; |
---|
| 23 | |
---|
| 24 | int active_tool; |
---|
| 25 | |
---|
| 26 | int active_tab; |
---|
| 27 | std::vector<NoteBookTab *> tabs; |
---|
| 28 | std::vector<std::string> tabnames; |
---|
| 29 | |
---|
[104] | 30 | std::map<std::string, int> strinst; |
---|
| 31 | |
---|
[103] | 32 | std::set< AlgoWin* > aws; |
---|
| 33 | |
---|
[6] | 34 | public: |
---|
[96] | 35 | |
---|
| 36 | ///Constructor of the \ref NoteBookTab. It creates the menu and the \ref GraphDisplayerCanvas on which the graph will be drawn. |
---|
[6] | 37 | ///\param title is the title of the window |
---|
[68] | 38 | MainWin(); |
---|
[53] | 39 | |
---|
[96] | 40 | void set_tabtitle(std::string); |
---|
[6] | 41 | |
---|
| 42 | ///ActionGroup for menu |
---|
| 43 | Glib::RefPtr<Gtk::ActionGroup> ag; |
---|
| 44 | |
---|
| 45 | ///UIManager for menu |
---|
| 46 | Glib::RefPtr<Gtk::UIManager> uim; |
---|
| 47 | |
---|
[96] | 48 | void readFile(const std::string &); |
---|
[6] | 49 | |
---|
[50] | 50 | ///Tooltips |
---|
| 51 | Gtk::Tooltips tooltips; |
---|
| 52 | |
---|
[96] | 53 | //Call-backs of buttons |
---|
| 54 | |
---|
[6] | 55 | ///Callback for 'FileNew' action. |
---|
| 56 | virtual void newFile(); |
---|
| 57 | ///Callback for 'FileOpen' action. |
---|
| 58 | virtual void openFile(); |
---|
| 59 | ///Callback for 'FileSave' action. |
---|
| 60 | virtual void saveFile(); |
---|
| 61 | ///Callback for 'FileSaveAs' action. |
---|
| 62 | virtual void saveFileAs(); |
---|
[53] | 63 | ///Callback for 'Close' action. |
---|
| 64 | virtual void close(); |
---|
[94] | 65 | |
---|
[96] | 66 | //Toolbar |
---|
| 67 | virtual void zoomIn(); |
---|
| 68 | virtual void zoomOut(); |
---|
| 69 | virtual void zoomFit(); |
---|
| 70 | virtual void zoom100(); |
---|
[94] | 71 | |
---|
[96] | 72 | virtual void createMapWin(); |
---|
[94] | 73 | |
---|
[103] | 74 | virtual void createAlgoWin(int); |
---|
| 75 | virtual void deRegisterAlgoWin(AlgoWin *); |
---|
| 76 | virtual void updateAlgoWins(); |
---|
| 77 | |
---|
[96] | 78 | virtual void changeEditorialTool(int); |
---|
[94] | 79 | |
---|
[96] | 80 | virtual void createNewMapWinAfterSignal(NoteBookTab *, bool); |
---|
| 81 | virtual void createNewMapWin(); |
---|
| 82 | |
---|
| 83 | //Notebook handlers |
---|
| 84 | ///Callback for 'FileNewTab' action. |
---|
| 85 | virtual void newTab(); |
---|
[97] | 86 | virtual void closeTab(); |
---|
[96] | 87 | virtual void onChangeTab(GtkNotebookPage*, guint); |
---|
| 88 | virtual void onCloseTab(); |
---|
| 89 | |
---|
| 90 | |
---|
[6] | 91 | }; |
---|
| 92 | |
---|
| 93 | #endif //MAIN_WIN_H |
---|