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