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