COIN-OR::LEMON - Graph Library

Changeset 1634:910b1bcb7d05 in lemon-0.x for gui


Ignore:
Timestamp:
08/17/05 14:35:43 (14 years ago)
Author:
Akos Ladanyi
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2144
Message:

Toolbar has custom icons now. Works only when installed.

Location:
gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • gui/Makefile.am

    r1606 r1634  
    11AM_CPPFLAGS = -I$(top_srcdir)
    22LDADD = $(top_builddir)/lemon/libemon.la
    3 
    4 
    5 noinst_DATA = guipixbufs.h
    6 CLEANFILES = $(noinst_DATA)
    73
    84bin_PROGRAMS = gd
     
    3127gd_CXXFLAGS = $(GTK_CFLAGS)
    3228gd_LDFLAGS = $(GTK_LIBS)
     29gd_CPPFLAGS = -DDATADIR=\"$(datadir)\"
    3330
    34 IMAGES = addlink.png addnode.png delete.png \
    35         editlink.png editnode.png move.png newmap.png
     31pixmapdir = $(datadir)/pixmaps/gd
    3632
    37 VARIABLES = \
    38         gui_icons_addlink $(srcdir)/addlink.png \
    39         gui_icons_addnode $(srcdir)/addnode.png \
    40         gui_icons_delete $(srcdir)/delete.png \
    41         gui_icons_editlink $(srcdir)/editlink.png \
    42         gui_icons_editnode $(srcdir)/editnode.png \
    43         gui_icons_move $(srcdir)/move.png \
    44         gui_icons_newmap $(srcdir)/newmap.png
    45 
    46 
    47 guipixbufs.h: $(IMAGES)
    48         gdk-pixbuf-csource \
    49         --raw --build-list $(VARIABLES) > guipixbufs.h ||  \
    50         ( rm -f guipixbufs.h && false )
    51 
    52 EXTRA_DIST = $(IMAGES) guipixbufs.h
     33pixmap_DATA =
     34        addlink.png \
     35        addnode.png \
     36        delete.png \
     37        editlink.png \
     38        editnode.png \
     39        move.png \
     40        newmap.png
  • gui/main_win.cc

    r1616 r1634  
    88  set_default_size(WIN_WIDTH,WIN_HEIGHT);
    99  add(vbox);
     10
     11
     12  // custom icons for the toolbar
     13
     14  Glib::RefPtr<Gtk::IconFactory> p_icon_factory = Gtk::IconFactory::create();
     15 
     16  std::vector<std::string> icon_path;
     17  icon_path.push_back(DATADIR);
     18  icon_path.push_back("pixmaps");
     19  icon_path.push_back("gd");
     20
     21  std::vector<std::string> move_icon_path(icon_path);
     22  move_icon_path.push_back("move.png");
     23  Gtk::IconSource move_icon_source;
     24  move_icon_source.set_filename(Glib::build_filename(move_icon_path));
     25  Gtk::IconSet move_icon_set;
     26  move_icon_set.add_source(move_icon_source);
     27  p_icon_factory->add(Gtk::StockID("gd-move"), move_icon_set);
     28
     29  std::vector<std::string> addnode_icon_path(icon_path);
     30  addnode_icon_path.push_back("addnode.png");
     31  Gtk::IconSource addnode_icon_source;
     32  addnode_icon_source.set_filename(Glib::build_filename(addnode_icon_path));
     33  Gtk::IconSet addnode_icon_set;
     34  addnode_icon_set.add_source(addnode_icon_source);
     35  p_icon_factory->add(Gtk::StockID("gd-addnode"), addnode_icon_set);
     36
     37  std::vector<std::string> addlink_icon_path(icon_path);
     38  addlink_icon_path.push_back("addlink.png");
     39  Gtk::IconSource addlink_icon_source;
     40  addlink_icon_source.set_filename(Glib::build_filename(addlink_icon_path));
     41  Gtk::IconSet addlink_icon_set;
     42  addlink_icon_set.add_source(addlink_icon_source);
     43  p_icon_factory->add(Gtk::StockID("gd-addlink"), addlink_icon_set);
     44
     45  std::vector<std::string> delete_icon_path(icon_path);
     46  delete_icon_path.push_back("delete.png");
     47  Gtk::IconSource delete_icon_source;
     48  delete_icon_source.set_filename(Glib::build_filename(delete_icon_path));
     49  Gtk::IconSet delete_icon_set;
     50  delete_icon_set.add_source(delete_icon_source);
     51  p_icon_factory->add(Gtk::StockID("gd-delete"), delete_icon_set);
     52
     53  std::vector<std::string> editlink_icon_path(icon_path);
     54  editlink_icon_path.push_back("editlink.png");
     55  Gtk::IconSource editlink_icon_source;
     56  editlink_icon_source.set_filename(Glib::build_filename(editlink_icon_path));
     57  Gtk::IconSet editlink_icon_set;
     58  editlink_icon_set.add_source(editlink_icon_source);
     59  p_icon_factory->add(Gtk::StockID("gd-editlink"), editlink_icon_set);
     60
     61  std::vector<std::string> editnode_icon_path(icon_path);
     62  editnode_icon_path.push_back("editnode.png");
     63  Gtk::IconSource editnode_icon_source;
     64  editnode_icon_source.set_filename(Glib::build_filename(editnode_icon_path));
     65  Gtk::IconSet editnode_icon_set;
     66  editnode_icon_set.add_source(editnode_icon_source);
     67  p_icon_factory->add(Gtk::StockID("gd-editnode"), editnode_icon_set);
     68
     69  std::vector<std::string> newmap_icon_path(icon_path);
     70  newmap_icon_path.push_back("newmap.png");
     71  Gtk::IconSource newmap_icon_source;
     72  newmap_icon_source.set_filename(Glib::build_filename(newmap_icon_path));
     73  Gtk::IconSet newmap_icon_set;
     74  newmap_icon_set.add_source(newmap_icon_source);
     75  p_icon_factory->add(Gtk::StockID("gd-newmap"), newmap_icon_set);
     76
     77  p_icon_factory->add_default();
     78 
    1079
    1180  ag=Gtk::ActionGroup::create();
     
    40109
    41110  Gtk::RadioAction::Group tool_group;
    42   ag->add( Gtk::RadioAction::create(tool_group, "MoveItem", Gtk::Stock::CONVERT, "Move"),
     111  ag->add( Gtk::RadioAction::create(tool_group, "MoveItem", Gtk::StockID("gd-move"), "Move"),
    43112      sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 0) );
    44   ag->add( Gtk::RadioAction::create(tool_group, "CreateNode", Gtk::Stock::NO, "Create node"),
     113  ag->add( Gtk::RadioAction::create(tool_group, "CreateNode", Gtk::StockID("gd-addnode"), "Create node"),
    45114      sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 1) );
    46   ag->add( Gtk::RadioAction::create(tool_group, "CreateEdge", Gtk::Stock::REMOVE, "Create edge"),
     115  ag->add( Gtk::RadioAction::create(tool_group, "CreateEdge", Gtk::StockID("gd-addlink"), "Create edge"),
    47116      sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 2) );
    48   ag->add( Gtk::RadioAction::create(tool_group, "EraseItem", Gtk::Stock::DELETE, "Delete"),
     117  ag->add( Gtk::RadioAction::create(tool_group, "EraseItem", Gtk::StockID("gd-delete"), "Delete"),
    49118      sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 3) );
    50   ag->add( Gtk::Action::create("EditEdgeMap", Gtk::Stock::PROPERTIES),
     119
     120  ag->add( Gtk::RadioAction::create(tool_group, "EditEdgeMap", Gtk::StockID("gd-editlink"), "Edit edge map"),
    51121      sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 4) );
    52   ag->add( Gtk::Action::create("EditNodeMap", Gtk::Stock::PREFERENCES),
     122  ag->add( Gtk::RadioAction::create(tool_group, "EditNodeMap", Gtk::StockID("gd-editnode"), "Edit node map"),
    53123      sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 5) );
    54   ag->add( Gtk::Action::create("AddMap", Gtk::Stock::NEW),
     124
     125  ag->add( Gtk::Action::create("AddMap", Gtk::StockID("gd-newmap")),
    55126      sigc::mem_fun ( this->newmapwin, &NewMapWin::show ) );
    56127
     
    100171      "    <toolitem action='EditEdgeMap' />"
    101172      "    <toolitem action='EditNodeMap' />"
     173      "    <separator />"
    102174      "    <toolitem action='AddMap' />"
    103175      "  </toolbar>"
  • gui/mapstorage.cc

    r1617 r1634  
    11#include "mapstorage.h"
     2#include <cmath>
    23
    34MapStorage::MapStorage() : modified(false), file_name("")
Note: See TracChangeset for help on using the changeset viewer.