gui/main_win.h
changeset 1852 ffa7c6e96330
parent 1838 b61682f0ee96
child 1856 3f0558065bcd
equal deleted inserted replaced
15:b032dec465ae 16:5076027519e1
     1 // -*- C++ -*- //
     1 // -*- C++ -*- //
     2 
     2 
     3 #ifndef MAIN_WIN_H
     3 #ifndef MAIN_WIN_H
     4 #define MAIN_WIN_H
     4 #define MAIN_WIN_H
     5 
     5 
     6 class MainWin;
       
     7 
       
     8 #include "all_include.h"
     6 #include "all_include.h"
     9 #include "mapstorage.h"
       
    10 #include "map_win.h"
     7 #include "map_win.h"
    11 #include "new_map_win.h"
     8 #include "new_map_win.h"
    12 #include "graph_displayer_canvas.h"
     9 #include "nbtab.h"
    13 #include <libgnomecanvasmm.h>
    10 #include <libgnomecanvasmm.h>
    14 #include <libgnomecanvasmm/polygon.h>
    11 #include <libgnomecanvasmm/polygon.h>
       
    12 
    15 
    13 
    16 ///This class is the main window of GUI.
    14 ///This class is the main window of GUI.
    17 ///It has menus, but the main part of it is the canvas.
    15 ///It has menus, but the main part of it is the canvas.
    18 class MainWin : public Gtk::Window
    16 class MainWin : public Gtk::Window
    19 {
    17 {
       
    18   ///Container
       
    19   Gtk::VBox vbox;
       
    20 
       
    21   Gtk::Notebook notebook;
       
    22 
       
    23   int active_tool;
       
    24 
       
    25   int active_tab;
       
    26   std::vector<NoteBookTab *> tabs;
       
    27   std::vector<std::string> tabnames;
       
    28 
    20 public:
    29 public:
    21   ///Constructor of the \ref MainWin. It creates the menu and the \ref GraphDisplayerCanvas on which the graph will be drawn.
    30   
       
    31   ///Constructor of the \ref NoteBookTab. It creates the menu and the \ref GraphDisplayerCanvas on which the graph will be drawn.
    22   ///\param title is the title of the window
    32   ///\param title is the title of the window
    23   MainWin();
    33   MainWin();
    24 
    34 
    25   MapStorage mapstorage;
    35   void set_tabtitle(std::string);
    26 
       
    27   void readFile(const std::string &);
       
    28 
       
    29 protected:
       
    30   MapWin * mapwin;
       
    31   bool mapwinexists;
       
    32 
       
    33   ///The graph will be drawn on this \ref GraphDisplayerCanvas
       
    34   GraphDisplayerCanvas * gd_canvas;
       
    35 
    36 
    36   ///ActionGroup for menu
    37   ///ActionGroup for menu
    37   Glib::RefPtr<Gtk::ActionGroup> ag;
    38   Glib::RefPtr<Gtk::ActionGroup> ag;
    38 
    39 
    39   ///UIManager for menu
    40   ///UIManager for menu
    40   Glib::RefPtr<Gtk::UIManager> uim;
    41   Glib::RefPtr<Gtk::UIManager> uim;
    41 
    42 
    42   ///Container
    43   void readFile(const std::string &);
    43   Gtk::VBox vbox;
       
    44 
    44 
    45   ///Tooltips
    45   ///Tooltips
    46   Gtk::Tooltips tooltips;
    46   Gtk::Tooltips tooltips;
       
    47 
       
    48   //Call-backs of buttons
    47 
    49 
    48   ///Callback for 'FileNew' action.
    50   ///Callback for 'FileNew' action.
    49   virtual void newFile();
    51   virtual void newFile();
    50   ///Callback for 'FileOpen' action.
    52   ///Callback for 'FileOpen' action.
    51   virtual void openFile();
    53   virtual void openFile();
    54   ///Callback for 'FileSaveAs' action.
    56   ///Callback for 'FileSaveAs' action.
    55   virtual void saveFileAs();
    57   virtual void saveFileAs();
    56   ///Callback for 'Close' action.
    58   ///Callback for 'Close' action.
    57   virtual void close();
    59   virtual void close();
    58 
    60 
    59 public:
    61   //Toolbar
    60   void propertyChange(bool, int, std::string);
    62   virtual void zoomIn();
    61   void popupNewMapWin(bool, int);
    63   virtual void zoomOut();
       
    64   virtual void zoomFit();
       
    65   virtual void zoom100();
    62 
    66 
    63   std::string getActiveEdgeMap(int);
    67   virtual void createMapWin();
    64   std::string getActiveNodeMap(int);
       
    65 
    68 
    66   void registerNewEdgeMap(std::string);
    69   virtual void changeEditorialTool(int);
    67   void registerNewNodeMap(std::string);
       
    68 
    70 
    69   void createMapWin();
    71   virtual void createNewMapWinAfterSignal(NoteBookTab *, bool);
    70   void closeMapWin();
    72   virtual void createNewMapWin();
       
    73 
       
    74   //Notebook handlers
       
    75   ///Callback for 'FileNewTab' action.
       
    76   virtual void newTab();
       
    77   virtual void onChangeTab(GtkNotebookPage*, guint);
       
    78   virtual void onCloseTab();
       
    79 
       
    80 
    71 };
    81 };
    72 
    82 
    73 #endif //MAIN_WIN_H
    83 #endif //MAIN_WIN_H