COIN-OR::LEMON - Graph Library

Changeset 201:879e47e5b731 in glemon-0.x for nbtab.cc


Ignore:
Timestamp:
01/02/08 22:03:09 (16 years ago)
Author:
Akos Ladanyi
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@3431
Message:

Merge branches/akos to trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nbtab.cc

    r198 r201  
    3131
    3232  Gtk::ScrolledWindow *pScrolledWindow = manage(new Gtk::ScrolledWindow);
     33  pScrolledWindow->set_shadow_type(Gtk::SHADOW_ETCHED_IN);
    3334  gd_canvas=new GraphDisplayerCanvas(*this);
    3435  pScrolledWindow->add(*gd_canvas);
     
    4748{
    4849  mapstorage->readFromFile(file);
    49   mapstorage->file_name = file;
    50   mapstorage->modified = false;
     50  mapstorage->setFileName(file);
     51  mapstorage->setModified(false);
    5152  gd_canvas->drawGraph();
    5253  if(mapwinexists)
    5354    {
    54       mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList());
     55      mapwin->update(
     56          mapstorage->getEdgeMapList(NUM),
     57          mapstorage->getEdgeMapList(STR),
     58          mapstorage->getNodeMapList(NUM),
     59          mapstorage->getNodeMapList(STR));
    5560    }
    5661  title_changed(Glib::filename_display_basename(file));
     
    5964void NoteBookTab::newFile()
    6065{
    61   if (mapstorage->modified)
     66  if (mapstorage->getModified())
    6267  {
    6368    Gtk::MessageDialog mdialog("<b>Save changes before closing?</b>", true,
     
    8186  if(mapwinexists)
    8287    {
    83       mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList());
     88      mapwin->update(
     89          mapstorage->getEdgeMapList(NUM),
     90          mapstorage->getEdgeMapList(STR),
     91          mapstorage->getNodeMapList(NUM),
     92          mapstorage->getNodeMapList(STR));
    8493    }
    8594  title_changed("unsaved file");
     
    8897void NoteBookTab::openFile()
    8998{
    90   if (mapstorage->modified)
     99  if (mapstorage->getModified())
    91100  {
    92101    Gtk::MessageDialog mdialog("<b>Save changes before closing?</b>", true,
     
    116125    if (!mapstorage->readFromFile(filename))
    117126    {
    118       mapstorage->file_name = filename;
    119       mapstorage->modified = false;
     127      mapstorage->setFileName(filename);
     128      mapstorage->setModified(false);
    120129      gd_canvas->drawGraph();
    121130      if(mapwinexists)
    122131        {
    123           mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList());
     132          mapwin->update(
     133              mapstorage->getEdgeMapList(NUM),
     134              mapstorage->getEdgeMapList(STR),
     135              mapstorage->getNodeMapList(NUM),
     136              mapstorage->getNodeMapList(STR));
    124137        }
    125138      title_changed(Glib::filename_display_basename(filename));
     
    130143void NoteBookTab::saveFile()
    131144{
    132   if (mapstorage->file_name == "") {
     145  if (mapstorage->getFileName() == "") {
    133146    saveFileAs();
    134147  }
    135148  else
    136149  {
    137     mapstorage->writeToFile(mapstorage->file_name);
    138     mapstorage->modified = false;
    139     title_changed(Glib::filename_display_basename(mapstorage->file_name));
     150    mapstorage->writeToFile(mapstorage->getFileName());
     151    mapstorage->setModified(false);
     152    title_changed(Glib::filename_display_basename(mapstorage->getFileName()));
    140153  }
    141154}
     
    149162  {
    150163    Glib::ustring filename = fcdialog.get_filename();
    151     mapstorage->file_name = filename;
     164    mapstorage->setFileName(filename);
    152165    mapstorage->writeToFile(filename);
    153     mapstorage->modified = false;
     166    mapstorage->setModified(false);
    154167    title_changed(Glib::filename_display_basename(filename));
    155168  }
     
    158171void NoteBookTab::close()
    159172{
    160   if (mapstorage->modified)
     173  if (mapstorage->getModified())
    161174  {
    162175    Gtk::MessageDialog mdialog("<b>Save changes before closing?</b>", true,
     
    180193  if(mapwinexists)
    181194    {
    182       mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList());
     195      mapwin->update(
     196          mapstorage->getEdgeMapList(NUM),
     197          mapstorage->getEdgeMapList(STR),
     198          mapstorage->getNodeMapList(NUM),
     199          mapstorage->getNodeMapList(STR));
    183200    }
    184201  title_changed("unsaved file");
     
    210227}
    211228
    212 void NoteBookTab::registerNewEdgeMap(std::string mapname)
    213 {
    214   if(mapwinexists)
    215     {
    216       mapwin->registerNewEdgeMap(mapname);
    217     }
    218 }
    219 
    220 void NoteBookTab::registerNewNodeMap(std::string mapname)
    221 {
    222   if(mapwinexists)
    223     {
    224       mapwin->registerNewNodeMap(mapname);
     229void NoteBookTab::registerNewEdgeMap(std::string mapname, MapValue::Type type)
     230{
     231  if(mapwinexists)
     232    {
     233      mapwin->registerNewEdgeMap(mapname, type);
     234    }
     235}
     236
     237void NoteBookTab::registerNewNodeMap(std::string mapname, MapValue::Type type)
     238{
     239  if(mapwinexists)
     240    {
     241      mapwin->registerNewNodeMap(mapname, type);
    225242    }
    226243  if(epswinexists)
    227244    {
    228       epswin->registerNewNodeMap(mapname);
     245      epswin->registerNewNodeMap(mapname, type);
    229246    }
    230247}
     
    234251  if(!mapwinexists)
    235252    {
    236       mapwin=new MapWin("Map Setup - "+name, mapstorage->getEdgeMapList(), mapstorage->getNodeMapList(), *this);
     253      mapwin=new MapWin("Map Setup - "+name,
     254          mapstorage->getEdgeMapList(NUM),
     255          mapstorage->getEdgeMapList(STR),
     256          mapstorage->getNodeMapList(NUM),
     257          mapstorage->getNodeMapList(STR),
     258          *this);
    237259      mapst2mapwin=mapstorage->signal_map_win_ch().connect(sigc::mem_fun(*mapwin, &MapWin::changeEntry));
    238260      mapwin->show();
     
    245267  if(!epswinexists)
    246268    {
    247       epswin=new EpsWin("Export to EPS - "+name, mapstorage->getNodeMapList());
     269      epswin=new EpsWin("Export to EPS - "+name, mapstorage->getNodeMapList(NUM), mapstorage->getNodeMapList(STR));
    248270      epswin->show();
    249271      epswinexists=true;
     
    264286      designwin=new DesignWin("Design Setup - "+name, attraction, propulsation, iterations);
    265287
    266       designwin->signal_attraction().connect(sigc::mem_fun(mapstorage, &MapStorage::set_attraction));
    267       designwin->signal_propulsation().connect(sigc::mem_fun(mapstorage, &MapStorage::set_propulsation));
    268       designwin->signal_iteration().connect(sigc::mem_fun(mapstorage, &MapStorage::set_iteration));
     288      designwin->signal_attraction().connect(sigc::mem_fun(*mapstorage, &MapStorage::set_attraction));
     289      designwin->signal_propulsation().connect(sigc::mem_fun(*mapstorage, &MapStorage::set_propulsation));
     290      designwin->signal_iteration().connect(sigc::mem_fun(*mapstorage, &MapStorage::set_iteration));
    269291      designwin->close_run().connect(sigc::mem_fun(*gd_canvas, &GraphDisplayerCanvas::reDesignGraph));
    270292
Note: See TracChangeset for help on using the changeset viewer.