Changeset 201:879e47e5b731 in glemon-0.x for nbtab.cc
- Timestamp:
- 01/02/08 22:03:09 (16 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@3431
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nbtab.cc
r198 r201 31 31 32 32 Gtk::ScrolledWindow *pScrolledWindow = manage(new Gtk::ScrolledWindow); 33 pScrolledWindow->set_shadow_type(Gtk::SHADOW_ETCHED_IN); 33 34 gd_canvas=new GraphDisplayerCanvas(*this); 34 35 pScrolledWindow->add(*gd_canvas); … … 47 48 { 48 49 mapstorage->readFromFile(file); 49 mapstorage-> file_name = file;50 mapstorage-> modified = false;50 mapstorage->setFileName(file); 51 mapstorage->setModified(false); 51 52 gd_canvas->drawGraph(); 52 53 if(mapwinexists) 53 54 { 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)); 55 60 } 56 61 title_changed(Glib::filename_display_basename(file)); … … 59 64 void NoteBookTab::newFile() 60 65 { 61 if (mapstorage-> modified)66 if (mapstorage->getModified()) 62 67 { 63 68 Gtk::MessageDialog mdialog("<b>Save changes before closing?</b>", true, … … 81 86 if(mapwinexists) 82 87 { 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)); 84 93 } 85 94 title_changed("unsaved file"); … … 88 97 void NoteBookTab::openFile() 89 98 { 90 if (mapstorage-> modified)99 if (mapstorage->getModified()) 91 100 { 92 101 Gtk::MessageDialog mdialog("<b>Save changes before closing?</b>", true, … … 116 125 if (!mapstorage->readFromFile(filename)) 117 126 { 118 mapstorage-> file_name = filename;119 mapstorage-> modified = false;127 mapstorage->setFileName(filename); 128 mapstorage->setModified(false); 120 129 gd_canvas->drawGraph(); 121 130 if(mapwinexists) 122 131 { 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)); 124 137 } 125 138 title_changed(Glib::filename_display_basename(filename)); … … 130 143 void NoteBookTab::saveFile() 131 144 { 132 if (mapstorage-> file_name== "") {145 if (mapstorage->getFileName() == "") { 133 146 saveFileAs(); 134 147 } 135 148 else 136 149 { 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())); 140 153 } 141 154 } … … 149 162 { 150 163 Glib::ustring filename = fcdialog.get_filename(); 151 mapstorage-> file_name = filename;164 mapstorage->setFileName(filename); 152 165 mapstorage->writeToFile(filename); 153 mapstorage-> modified = false;166 mapstorage->setModified(false); 154 167 title_changed(Glib::filename_display_basename(filename)); 155 168 } … … 158 171 void NoteBookTab::close() 159 172 { 160 if (mapstorage-> modified)173 if (mapstorage->getModified()) 161 174 { 162 175 Gtk::MessageDialog mdialog("<b>Save changes before closing?</b>", true, … … 180 193 if(mapwinexists) 181 194 { 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)); 183 200 } 184 201 title_changed("unsaved file"); … … 210 227 } 211 228 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 );229 void NoteBookTab::registerNewEdgeMap(std::string mapname, MapValue::Type type) 230 { 231 if(mapwinexists) 232 { 233 mapwin->registerNewEdgeMap(mapname, type); 234 } 235 } 236 237 void NoteBookTab::registerNewNodeMap(std::string mapname, MapValue::Type type) 238 { 239 if(mapwinexists) 240 { 241 mapwin->registerNewNodeMap(mapname, type); 225 242 } 226 243 if(epswinexists) 227 244 { 228 epswin->registerNewNodeMap(mapname );245 epswin->registerNewNodeMap(mapname, type); 229 246 } 230 247 } … … 234 251 if(!mapwinexists) 235 252 { 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); 237 259 mapst2mapwin=mapstorage->signal_map_win_ch().connect(sigc::mem_fun(*mapwin, &MapWin::changeEntry)); 238 260 mapwin->show(); … … 245 267 if(!epswinexists) 246 268 { 247 epswin=new EpsWin("Export to EPS - "+name, mapstorage->getNodeMapList( ));269 epswin=new EpsWin("Export to EPS - "+name, mapstorage->getNodeMapList(NUM), mapstorage->getNodeMapList(STR)); 248 270 epswin->show(); 249 271 epswinexists=true; … … 264 286 designwin=new DesignWin("Design Setup - "+name, attraction, propulsation, iterations); 265 287 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)); 269 291 designwin->close_run().connect(sigc::mem_fun(*gd_canvas, &GraphDisplayerCanvas::reDesignGraph)); 270 292
Note: See TracChangeset
for help on using the changeset viewer.