COIN-OR::LEMON - Graph Library

Changeset 196:c220f9de6545 in glemon-0.x


Ignore:
Timestamp:
03/01/07 14:33:46 (12 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@3207
Message:

EpsWin? and DesignWin? does not need to know NoteBookTab?.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • design_win.cc

    r194 r196  
    1717 */
    1818
    19 #include <nbtab.h>
    2019#include <design_win.h>
    2120
     
    2928}
    3029
    31 DesignWin::DesignWin(const std::string& title, double attraction_v, double propulsation_v, int iterations_v, NoteBookTab & mw):mytab(mw)
     30DesignWin::DesignWin(const std::string& title, double attraction_v, double propulsation_v, int iterations_v)
    3231{
    3332  set_title(title);
    3433
    35   mytab.signal_title_ch().connect(sigc::mem_fun(*this, &DesignWin::set_title));
     34  //mytab.signal_title_ch().connect(sigc::mem_fun(*this, &DesignWin::set_title));
    3635
    3736  signal_key_press_event().connect(sigc::mem_fun(*this, &DesignWin::closeIfEscapeIsPressed));
  • design_win.h

    r194 r196  
    2020#define DESWIN_H
    2121
    22 class NoteBookTab;
    23 
    2422#include <all_include.h>
    2523#include <libgnomecanvasmm.h>
     
    2927{
    3028private:
    31   ///\ref NoteBookTab to that the \ref MapWin belongs to.
    32   NoteBookTab & mytab;
    33 
    3429  Gtk::SpinButton * attraction;
    3530  Gtk::SpinButton * propulsation;
     
    5550
    5651  ///It builds the window.
    57   DesignWin(const std::string&, double, double, int, NoteBookTab & mw);
     52  DesignWin(const std::string&, double, double, int);
    5853
    5954  sigc::signal<void, double> signal_attraction(){return signal_attraction_ch;};
  • eps_win.cc

    r194 r196  
    1717 */
    1818
    19 #include <nbtab.h>
    2019#include <eps_win.h>
    2120#include <set>
     
    3029}
    3130
    32 EpsWin::EpsWin(const std::string& title, NoteBookTab & mw):Gtk::Dialog(title, true, true),mytab(mw)
     31EpsWin::EpsWin(const std::string& title):Gtk::Dialog(title, true, true)
    3332{
    3433  set_default_size(200, 50);
     
    3736
    3837  signal_key_press_event().connect(sigc::mem_fun(*this, &EpsWin::closeIfEscapeIsPressed));
    39 
    40   mytab.signal_title_ch().connect(sigc::mem_fun(*this, &EpsWin::set_title));
    4138
    4239  table=new Gtk::Table(EPS_PROPERTY_NUM, 1, false);
     
    7774{
    7875  event=event;
    79   mytab.closeEpsWin();
     76  signal_eps_close.emit();
    8077  return true;
    8178}
     
    9188          values[i]=options[i]->get_active();
    9289        }
    93       mytab.exportGraphToEPS(values, name.get_text());
     90      signal_eps_details.emit(values, name.get_text());
    9491    }
    9592  on_delete_event(NULL);
  • eps_win.h

    r194 r196  
    2020#define EPS_WIN_H
    2121
    22 class NoteBookTab;
    23 
    2422#include <all_include.h>
    2523#include <libgnomecanvasmm.h>
     
    3432{
    3533protected:
    36   ///\ref NoteBookTab to that the \ref EpsWin belongs to.
    37   NoteBookTab & mytab;
    38 
    3934  ///Designing element
    4035  Gtk::Table * table;
     
    6459  ///\param nml nodemap list
    6560  ///\param mw the owner \ref NoteBookTab (\ref mytab)
    66   EpsWin(const std::string& title, NoteBookTab & mw);
     61  EpsWin(const std::string& title);
    6762
    6863  ///Deregistrates \ref EpsWin in its \ref NoteBookTab (\ref mytab)
     
    8075  virtual void on_response(int response_id);
    8176
     77  ///indicates that user is ready to export EPS file
     78  sigc::signal<void, std::vector<bool>, std::string > signal_eps_details;
     79
     80  ///returns \ref signal_eps_details
     81  sigc::signal<void, std::vector<bool>, std::string > signal_eps_details_ch(){return signal_eps_details;};
     82
     83  ///indicates that the windows can be closed
     84  sigc::signal<void> signal_eps_close;
     85
     86  ///returns \ref signal_eps_close
     87  sigc::signal<void> signal_eps_close_ch(){return signal_eps_close;};
     88 
     89
    8290};
    8391
  • nbtab.cc

    r195 r196  
    5454      mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList());
    5555    }
    56   signal_title.emit(Glib::filename_display_basename(file));
     56  title_changed(Glib::filename_display_basename(file));
    5757}
    5858
     
    8383      mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList());
    8484    }
    85   signal_title.emit("unsaved file");
     85  title_changed("unsaved file");
    8686}
    8787
     
    123123          mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList());
    124124        }
    125       signal_title.emit(Glib::filename_display_basename(filename));
     125      title_changed(Glib::filename_display_basename(filename));
    126126    }
    127127  }
     
    137137    mapstorage->writeToFile(mapstorage->file_name);
    138138    mapstorage->modified = false;
    139     signal_title.emit(Glib::filename_display_basename(mapstorage->file_name));
     139    title_changed(Glib::filename_display_basename(mapstorage->file_name));
    140140  }
    141141}
     
    152152    mapstorage->writeToFile(filename);
    153153    mapstorage->modified = false;
    154     signal_title.emit(Glib::filename_display_basename(filename));
     154    title_changed(Glib::filename_display_basename(filename));
    155155  }
    156156}
     
    182182      mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList());
    183183    }
    184   signal_title.emit("unsaved file");
     184  title_changed("unsaved file");
    185185}
    186186
     
    241241  if(!epswinexists)
    242242    {
    243       epswin=new EpsWin("Export to EPS - "+name, *this);
     243      epswin=new EpsWin("Export to EPS - "+name);
    244244      epswin->show();
    245245      epswinexists=true;
     246      epswin->signal_eps_details_ch().connect(sigc::mem_fun(*this, &NoteBookTab::exportGraphToEPS));
     247      epswin->signal_eps_close_ch().connect(sigc::mem_fun(*this, &NoteBookTab::closeEpsWin));
    246248    }
    247249}
     
    255257      int iterations;
    256258      mapstorage->get_design_data(attraction, propulsation, iterations);
    257       designwin=new DesignWin("Design Setup - "+name, attraction, propulsation, iterations, *this);
     259      designwin=new DesignWin("Design Setup - "+name, attraction, propulsation, iterations);
    258260
    259261      designwin->signal_attraction().connect(sigc::mem_fun(mapstorage, &MapStorage::set_attraction));
     
    323325  mapstorage->exportGraphToEPS(options, filename);
    324326}
     327
     328void NoteBookTab::title_changed(std::string newtitle)
     329{
     330  signal_title.emit(newtitle);
     331  if(epswinexists)
     332    {
     333      epswin->set_title(newtitle);
     334    }
     335  if(designwinexists)
     336    {
     337      designwin->set_title(newtitle);
     338    }
     339}
  • nbtab.h

    r194 r196  
    235235
    236236private:
     237  ///Called when title of tab has changed
     238  void title_changed(std::string);
     239
    237240  ///Signal connection from \ref MapStorage to \ref MapWin
    238241
Note: See TracChangeset for help on using the changeset viewer.