gui/main_win.cc
changeset 1473 876c7b7f4dae
parent 1442 1e3c69aa035b
child 1502 371aba7d61ca
equal deleted inserted replaced
2:cbbe06378553 3:aa041f6ba788
     1 #include <main_win.h>
     1 #include <main_win.h>
     2 
     2 
     3 MainWin::MainWin(const std::string& title, Graph & graph, CoordinatesMap & cm,
     3 MainWin::MainWin(const std::string& title, Graph & graph, CoordinatesMap & cm,
     4     MapStorage & ms):mapwin("Map Setup", ms, gd_canvas),gd_canvas(graph, cm, ms)
     4     MapStorage & ms):mapwin("Map Setup", ms, gd_canvas),editwin("Editorial Window", gd_canvas),gd_canvas(graph, cm, ms)
     5 {
     5 {
     6   set_title (title);
     6   set_title (title);
     7   set_default_size(WIN_WIDTH,WIN_HEIGHT);
     7   set_default_size(WIN_WIDTH,WIN_HEIGHT);
     8   add(vbox);
     8   add(vbox);
     9 
     9 
    32       sigc::mem_fun(this->gd_canvas, &GraphDisplayerCanvas::zoom100));
    32       sigc::mem_fun(this->gd_canvas, &GraphDisplayerCanvas::zoom100));
    33   
    33   
    34   ag->add( Gtk::Action::create("ShowMenu", "_Show") );
    34   ag->add( Gtk::Action::create("ShowMenu", "_Show") );
    35   ag->add( Gtk::Action::create("ShowMaps", "_Maps"),
    35   ag->add( Gtk::Action::create("ShowMaps", "_Maps"),
    36       sigc::mem_fun(*this, &MainWin::showMaps));
    36       sigc::mem_fun(*this, &MainWin::showMaps));
       
    37   ag->add( Gtk::Action::create("ShowEditorials", "_Editorials"),
       
    38       sigc::mem_fun(*this, &MainWin::showEditorials));
    37 
    39 
    38   uim=Gtk::UIManager::create();
    40   uim=Gtk::UIManager::create();
    39   uim->insert_action_group(ag);
    41   uim->insert_action_group(ag);
    40   add_accel_group(uim->get_accel_group());
    42   add_accel_group(uim->get_accel_group());
    41 
    43 
    58       "      <menuitem action='ViewZoomFit' />"
    60       "      <menuitem action='ViewZoomFit' />"
    59       "      <menuitem action='ViewZoom100' />"
    61       "      <menuitem action='ViewZoom100' />"
    60       "    </menu>"
    62       "    </menu>"
    61       "    <menu action='ShowMenu'>"
    63       "    <menu action='ShowMenu'>"
    62       "      <menuitem action='ShowMaps'/>"
    64       "      <menuitem action='ShowMaps'/>"
       
    65       "      <menuitem action='ShowEditorials'/>"
    63       "    </menu>"
    66       "    </menu>"
    64       "  </menubar>"
    67       "  </menubar>"
    65       "  <toolbar name='ToolBar'>"
    68       "  <toolbar name='ToolBar'>"
    66       "    <toolitem action='FileNew' />"
    69       "    <toolitem action='FileNew' />"
    67       "    <toolitem action='FileOpen' />"
    70       "    <toolitem action='FileOpen' />"
   105 void MainWin::showMaps()
   108 void MainWin::showMaps()
   106 {
   109 {
   107   mapwin.show();
   110   mapwin.show();
   108 }
   111 }
   109 
   112 
       
   113 void MainWin::showEditorials()
       
   114 {
       
   115   editwin.show();
       
   116 }
       
   117 
   110 void MainWin::quit()
   118 void MainWin::quit()
   111 {
   119 {
   112   hide();
   120   hide();
   113 }
   121 }
   114 
   122