gui/main_win.h
author deba
Thu, 01 Dec 2005 15:08:46 +0000
changeset 1842 8abf74160dc4
parent 1837 8dd6160ff699
child 1849 a4d1362397fe
permissions -rw-r--r--
NewEdgeSetAdaptor -> ListEdgeSet
and moved to edge_set.h
ladanyi@1442
     1
// -*- C++ -*- //
ladanyi@1442
     2
ladanyi@1442
     3
#ifndef MAIN_WIN_H
ladanyi@1442
     4
#define MAIN_WIN_H
ladanyi@1442
     5
hegyi@1837
     6
class MainWin;
hegyi@1837
     7
ladanyi@1606
     8
#include "all_include.h"
ladanyi@1606
     9
#include "mapstorage.h"
ladanyi@1606
    10
#include "map_win.h"
ladanyi@1606
    11
#include "new_map_win.h"
ladanyi@1606
    12
#include "graph_displayer_canvas.h"
ladanyi@1442
    13
#include <libgnomecanvasmm.h>
ladanyi@1442
    14
#include <libgnomecanvasmm/polygon.h>
ladanyi@1442
    15
ladanyi@1442
    16
///This class is the main window of GUI.
ladanyi@1442
    17
///It has menus, but the main part of it is the canvas.
ladanyi@1442
    18
class MainWin : public Gtk::Window
ladanyi@1442
    19
{
ladanyi@1442
    20
public:
ladanyi@1442
    21
  ///Constructor of the \ref MainWin. It creates the menu and the \ref GraphDisplayerCanvas on which the graph will be drawn.
ladanyi@1442
    22
  ///\param title is the title of the window
ladanyi@1650
    23
  MainWin();
ladanyi@1606
    24
ladanyi@1606
    25
  MapStorage mapstorage;
ladanyi@1442
    26
ladanyi@1616
    27
  void readFile(const std::string &);
ladanyi@1616
    28
ladanyi@1442
    29
protected:
hegyi@1837
    30
  MapWin * mapwin;
hegyi@1838
    31
  bool mapwinexists;
ladanyi@1442
    32
ladanyi@1442
    33
  ///The graph will be drawn on this \ref GraphDisplayerCanvas
hegyi@1837
    34
  GraphDisplayerCanvas * gd_canvas;
ladanyi@1442
    35
ladanyi@1442
    36
  ///ActionGroup for menu
ladanyi@1442
    37
  Glib::RefPtr<Gtk::ActionGroup> ag;
ladanyi@1442
    38
ladanyi@1442
    39
  ///UIManager for menu
ladanyi@1442
    40
  Glib::RefPtr<Gtk::UIManager> uim;
ladanyi@1442
    41
ladanyi@1442
    42
  ///Container
ladanyi@1442
    43
  Gtk::VBox vbox;
ladanyi@1442
    44
hegyi@1601
    45
  ///Tooltips
hegyi@1601
    46
  Gtk::Tooltips tooltips;
hegyi@1601
    47
ladanyi@1442
    48
  ///Callback for 'FileNew' action.
ladanyi@1442
    49
  virtual void newFile();
ladanyi@1442
    50
  ///Callback for 'FileOpen' action.
ladanyi@1442
    51
  virtual void openFile();
ladanyi@1442
    52
  ///Callback for 'FileSave' action.
ladanyi@1442
    53
  virtual void saveFile();
ladanyi@1442
    54
  ///Callback for 'FileSaveAs' action.
ladanyi@1442
    55
  virtual void saveFileAs();
ladanyi@1606
    56
  ///Callback for 'Close' action.
ladanyi@1606
    57
  virtual void close();
hegyi@1837
    58
hegyi@1837
    59
public:
hegyi@1837
    60
  void propertyChange(bool, int, std::string);
hegyi@1837
    61
  void popupNewMapWin(bool, int);
hegyi@1837
    62
hegyi@1837
    63
  std::string getActiveEdgeMap(int);
hegyi@1837
    64
  std::string getActiveNodeMap(int);
hegyi@1837
    65
hegyi@1837
    66
  void registerNewEdgeMap(std::string);
hegyi@1837
    67
  void registerNewNodeMap(std::string);
hegyi@1837
    68
hegyi@1838
    69
  void createMapWin();
hegyi@1838
    70
  void closeMapWin();
ladanyi@1442
    71
};
ladanyi@1442
    72
ladanyi@1442
    73
#endif //MAIN_WIN_H