gui/main_win.h
author ladanyi
Wed, 01 Jun 2005 23:30:13 +0000
changeset 1441 fd4b6f6d592a
parent 1440 3d2e3cfb2a6c
child 1442 1e3c69aa035b
permissions -rw-r--r--
- added toolbar
- added ScrolledWindow for the canvas
- zooming
ladanyi@1412
     1
// -*- C++ -*- //
ladanyi@1412
     2
ladanyi@1412
     3
#ifndef MAIN_WIN_H
ladanyi@1412
     4
#define MAIN_WIN_H
ladanyi@1412
     5
ladanyi@1412
     6
#include <all_include.h>
ladanyi@1412
     7
#include <mapstorage.h>
ladanyi@1412
     8
#include <map_win.h>
ladanyi@1412
     9
#include <libgnomecanvasmm.h>
ladanyi@1412
    10
#include <libgnomecanvasmm/polygon.h>
ladanyi@1412
    11
hegyi@1440
    12
///This class is the main window of GUI.
hegyi@1440
    13
///It has menus, but the main part of it is the canvas.
ladanyi@1412
    14
class MainWin : public Gtk::Window
ladanyi@1412
    15
{
ladanyi@1412
    16
public:
hegyi@1440
    17
  ///Constructor of the \ref MainWin. It creates the menu and the \ref GraphDisplayerCanvas on which the graph will be drawn.
hegyi@1440
    18
  ///\param title is the title of the window
hegyi@1440
    19
  ///\param graph is the graph that will be drawn here. It will be given further to the \ref GraphDisplayerCanvas
hegyi@1440
    20
  ///\param cm stores the coordinates of the nodes of the graph
hegyi@1440
    21
  ///\param ms is the \ref MapStorage in which the different visualizable maps are stored
ladanyi@1412
    22
  MainWin(const std::string& title, Graph &, CoordinatesMap &, MapStorage &);
ladanyi@1412
    23
ladanyi@1412
    24
protected:
hegyi@1440
    25
  ///Window of map-showing setup. Its type is \ref MapWin
ladanyi@1412
    26
  MapWin mapwin;
ladanyi@1412
    27
hegyi@1440
    28
  ///The graph will be drawn on this \ref GraphDisplayerCanvas
ladanyi@1412
    29
  GraphDisplayerCanvas gd_canvas;
ladanyi@1412
    30
hegyi@1440
    31
  ///ActionGroup for menu
ladanyi@1412
    32
  Glib::RefPtr<Gtk::ActionGroup> ag;
ladanyi@1412
    33
hegyi@1440
    34
  ///UIManager for menu
ladanyi@1412
    35
  Glib::RefPtr<Gtk::UIManager> uim;
ladanyi@1412
    36
hegyi@1440
    37
  ///Container
ladanyi@1412
    38
  Gtk::VBox vbox;
ladanyi@1412
    39
hegyi@1440
    40
  ///This function makes map-setup window popped up.
ladanyi@1412
    41
  virtual void showMaps();
ladanyi@1441
    42
  ///Callback for 'FileNew' action.
ladanyi@1441
    43
  virtual void newFile();
ladanyi@1441
    44
  ///Callback for 'FileOpen' action.
ladanyi@1441
    45
  virtual void openFile();
ladanyi@1441
    46
  ///Callback for 'FileSave' action.
ladanyi@1441
    47
  virtual void saveFile();
ladanyi@1441
    48
  ///Callback for 'FileSaveAs' action.
ladanyi@1441
    49
  virtual void saveFileAs();
ladanyi@1441
    50
  ///Callback for 'Quit' action.
ladanyi@1412
    51
  virtual void quit();
ladanyi@1412
    52
};
ladanyi@1412
    53
ladanyi@1412
    54
#endif //MAIN_WIN_H