main_win.cc
changeset 192 9d7489e8921e
parent 190 2cac5b936a2b
child 194 6b2b718420eb
equal deleted inserted replaced
52:3a1f5b02edef 53:d825ce8c08d2
    46       2328, gui_icons_delete);
    46       2328, gui_icons_delete);
    47   Glib::RefPtr<Gdk::Pixbuf> p_editlink_pixbuf = Gdk::Pixbuf::create_from_inline(
    47   Glib::RefPtr<Gdk::Pixbuf> p_editlink_pixbuf = Gdk::Pixbuf::create_from_inline(
    48       2328, gui_icons_editlink);
    48       2328, gui_icons_editlink);
    49   Glib::RefPtr<Gdk::Pixbuf> p_newmap_pixbuf = Gdk::Pixbuf::create_from_inline(
    49   Glib::RefPtr<Gdk::Pixbuf> p_newmap_pixbuf = Gdk::Pixbuf::create_from_inline(
    50       2328, gui_icons_newmap);
    50       2328, gui_icons_newmap);
       
    51   Glib::RefPtr<Gdk::Pixbuf> p_eps_pixbuf = Gdk::Pixbuf::create_from_inline(
       
    52       2328, gui_icons_eps);
    51 
    53 
    52   Gtk::IconSource move_icon_source;
    54   Gtk::IconSource move_icon_source;
    53   move_icon_source.set_pixbuf(p_move_pixbuf);
    55   move_icon_source.set_pixbuf(p_move_pixbuf);
    54   Gtk::IconSet move_icon_set;
    56   Gtk::IconSet move_icon_set;
    55   move_icon_set.add_source(move_icon_source);
    57   move_icon_set.add_source(move_icon_source);
    82   Gtk::IconSource newmap_icon_source;
    84   Gtk::IconSource newmap_icon_source;
    83   newmap_icon_source.set_pixbuf(p_newmap_pixbuf);
    85   newmap_icon_source.set_pixbuf(p_newmap_pixbuf);
    84   Gtk::IconSet newmap_icon_set;
    86   Gtk::IconSet newmap_icon_set;
    85   newmap_icon_set.add_source(newmap_icon_source);
    87   newmap_icon_set.add_source(newmap_icon_source);
    86   p_icon_factory->add(Gtk::StockID("gd-newmap"), newmap_icon_set);
    88   p_icon_factory->add(Gtk::StockID("gd-newmap"), newmap_icon_set);
       
    89 
       
    90   Gtk::IconSource eps_icon_source;
       
    91   eps_icon_source.set_pixbuf(p_eps_pixbuf);
       
    92   Gtk::IconSet eps_icon_set;
       
    93   eps_icon_set.add_source(eps_icon_source);
       
    94   p_icon_factory->add(Gtk::StockID("gd-eps"), eps_icon_set);
    87 
    95 
    88   p_icon_factory->add_default();
    96   p_icon_factory->add_default();
    89   
    97   
    90   ag=Gtk::ActionGroup::create();
    98   ag=Gtk::ActionGroup::create();
    91 
    99 
   149   ag->add( Gtk::Action::create("AddMap", Gtk::StockID("gd-newmap")),
   157   ag->add( Gtk::Action::create("AddMap", Gtk::StockID("gd-newmap")),
   150       sigc::mem_fun ( *this , &MainWin::createNewMapWin ) );
   158       sigc::mem_fun ( *this , &MainWin::createNewMapWin ) );
   151 
   159 
   152   ag->add( Gtk::Action::create("DesignGraph", Gtk::Stock::REFRESH),
   160   ag->add( Gtk::Action::create("DesignGraph", Gtk::Stock::REFRESH),
   153       sigc::mem_fun ( *this , &MainWin::reDesignGraph ) );
   161       sigc::mem_fun ( *this , &MainWin::reDesignGraph ) );
       
   162 
       
   163   ag->add( Gtk::Action::create("Eps", Gtk::StockID("gd-eps")),
       
   164       sigc::mem_fun ( *this , &MainWin::exportToEPS ) );
   154 
   165 
   155   uim=Gtk::UIManager::create();
   166   uim=Gtk::UIManager::create();
   156   uim->insert_action_group(ag);
   167   uim->insert_action_group(ag);
   157   add_accel_group(uim->get_accel_group());
   168   add_accel_group(uim->get_accel_group());
   158 
   169 
   206       "    <toolitem action='EraseItem' />"
   217       "    <toolitem action='EraseItem' />"
   207       "    <toolitem action='EditEdgeMap' />"
   218       "    <toolitem action='EditEdgeMap' />"
   208       "    <separator />"
   219       "    <separator />"
   209       "    <toolitem action='AddMap' />"
   220       "    <toolitem action='AddMap' />"
   210       "    <toolitem action='DesignGraph' />"
   221       "    <toolitem action='DesignGraph' />"
       
   222       "    <toolitem action='Eps' />"
   211       "  </toolbar>"
   223       "  </toolbar>"
   212       "</ui>";
   224       "</ui>";
   213 
   225 
   214     uim->add_ui_from_string(ui_info);
   226     uim->add_ui_from_string(ui_info);
   215 
   227 
   608 void MainWin::reDesignGraph()
   620 void MainWin::reDesignGraph()
   609 {
   621 {
   610   tabs[active_tab]->reDesignGraph();
   622   tabs[active_tab]->reDesignGraph();
   611 }
   623 }
   612 
   624 
       
   625 void MainWin::exportToEPS()
       
   626 {
       
   627   if(active_tab!=-1)
       
   628     {
       
   629       tabs[active_tab]->createExportToEPSWin(tabnames[active_tab]);
       
   630     }
       
   631 }
       
   632 
   613 void MainWin::createBackgroundChooser()
   633 void MainWin::createBackgroundChooser()
   614 {
   634 {
   615   BackgroundChooserDialog dialog(&(tabs[active_tab]->mapstorage));
   635   BackgroundChooserDialog dialog(&(tabs[active_tab]->mapstorage));
   616   dialog.run();
   636   dialog.run();
   617 }
   637 }