COIN-OR::LEMON - Graph Library

Changeset 68:1a27576aa199 in glemon-0.x


Ignore:
Timestamp:
08/26/05 13:03:59 (19 years ago)
Author:
Akos Ladanyi
Branch:
gui
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk/gui@2163
Message:

display file name in window title

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • all_include.h

    r62 r68  
    4545typedef Graph::NodeIt NodeIt;
    4646
     47const std::string prog_name = "LEMON Graph Editor";
     48
    4749#endif // ALL_INCLUDE_H
  • graph-displayer.cc

    r57 r68  
    4343  Gtk::Main app(argc, argv);
    4444
    45   MainWin mainwin("Displayed Graph");
     45  MainWin mainwin;
    4646
    4747  if ((argc == 2) && (Glib::file_test(argv[1], Glib::FILE_TEST_IS_REGULAR)))
  • main_win.cc

    r63 r68  
    22#include "guipixbufs.h"
    33
    4 MainWin::MainWin(const std::string& title) :
     4MainWin::MainWin() :
    55  mapwin("Map Setup", mapstorage, gd_canvas),
    66  newmapwin("Creating new map", gd_canvas), gd_canvas(mapstorage, mapwin, (Gtk::Window *)this)
    77{
    8   set_title (title);
     8  set_title ("unsaved file - " + prog_name);
    99  set_default_size(WIN_WIDTH,WIN_HEIGHT);
    1010  add(vbox);
     
    210210  gd_canvas.drawGraph();
    211211  mapwin.update();
     212  set_title(Glib::filename_display_basename(file) + " - " + prog_name);
    212213}
    213214
     
    235236  mapstorage.clear();
    236237  mapwin.update();
     238  set_title("unsaved file - " + prog_name);
    237239}
    238240
     
    257259    }
    258260  }
    259   gd_canvas.clear();
    260   mapstorage.clear();
    261261  Gtk::FileChooserDialog fcdialog("Open File");
    262262  fcdialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
     
    264264  if (fcdialog.run() == Gtk::RESPONSE_ACCEPT)
    265265  {
     266    gd_canvas.clear();
     267    mapstorage.clear();
    266268    Glib::ustring filename = fcdialog.get_filename();
    267269    if (!mapstorage.readFromFile(filename))
     
    271273      gd_canvas.drawGraph();
    272274      mapwin.update();
     275      set_title(Glib::filename_display_basename(filename) + " - " + prog_name);
    273276    }
    274277  }
     
    284287    mapstorage.writeToFile(mapstorage.file_name);
    285288    mapstorage.modified = false;
     289    set_title(Glib::filename_display_basename(mapstorage.file_name) + " - " +
     290        prog_name);
    286291  }
    287292}
     
    298303    mapstorage.writeToFile(filename);
    299304    mapstorage.modified = false;
     305    set_title(Glib::filename_display_basename(filename) + " - " + prog_name);
    300306  }
    301307}
     
    324330  mapstorage.clear();
    325331  mapwin.update();
    326 }
     332  set_title("unsaved file - " + prog_name);
     333}
  • main_win.h

    r57 r68  
    1919  ///Constructor of the \ref MainWin. It creates the menu and the \ref GraphDisplayerCanvas on which the graph will be drawn.
    2020  ///\param title is the title of the window
    21   MainWin(const std::string& title);
     21  MainWin();
    2222
    2323  MapStorage mapstorage;
Note: See TracChangeset for help on using the changeset viewer.