gui/main_win.h
author marci
Wed, 30 Nov 2005 17:00:17 +0000
changeset 1840 173b53b28d7c
parent 1837 8dd6160ff699
child 1849 a4d1362397fe
permissions -rw-r--r--
max flow with lp column generation
     1 // -*- C++ -*- //
     2 
     3 #ifndef MAIN_WIN_H
     4 #define MAIN_WIN_H
     5 
     6 class MainWin;
     7 
     8 #include "all_include.h"
     9 #include "mapstorage.h"
    10 #include "map_win.h"
    11 #include "new_map_win.h"
    12 #include "graph_displayer_canvas.h"
    13 #include <libgnomecanvasmm.h>
    14 #include <libgnomecanvasmm/polygon.h>
    15 
    16 ///This class is the main window of GUI.
    17 ///It has menus, but the main part of it is the canvas.
    18 class MainWin : public Gtk::Window
    19 {
    20 public:
    21   ///Constructor of the \ref MainWin. It creates the menu and the \ref GraphDisplayerCanvas on which the graph will be drawn.
    22   ///\param title is the title of the window
    23   MainWin();
    24 
    25   MapStorage mapstorage;
    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   ///ActionGroup for menu
    37   Glib::RefPtr<Gtk::ActionGroup> ag;
    38 
    39   ///UIManager for menu
    40   Glib::RefPtr<Gtk::UIManager> uim;
    41 
    42   ///Container
    43   Gtk::VBox vbox;
    44 
    45   ///Tooltips
    46   Gtk::Tooltips tooltips;
    47 
    48   ///Callback for 'FileNew' action.
    49   virtual void newFile();
    50   ///Callback for 'FileOpen' action.
    51   virtual void openFile();
    52   ///Callback for 'FileSave' action.
    53   virtual void saveFile();
    54   ///Callback for 'FileSaveAs' action.
    55   virtual void saveFileAs();
    56   ///Callback for 'Close' action.
    57   virtual void close();
    58 
    59 public:
    60   void propertyChange(bool, int, std::string);
    61   void popupNewMapWin(bool, int);
    62 
    63   std::string getActiveEdgeMap(int);
    64   std::string getActiveNodeMap(int);
    65 
    66   void registerNewEdgeMap(std::string);
    67   void registerNewNodeMap(std::string);
    68 
    69   void createMapWin();
    70   void closeMapWin();
    71 };
    72 
    73 #endif //MAIN_WIN_H