COIN-OR::LEMON - Graph Library

Changeset 1733:5e0d97823ba2 in lemon-0.x for gui


Ignore:
Timestamp:
10/21/05 15:32:12 (14 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2260
Message:

MapSelector? widget is able to pop up NewMap? window. At the moment I hope MapSelector? widget is done.

Location:
gui
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • gui/main_win.cc

    r1659 r1733  
    33
    44MainWin::MainWin() :
    5   mapwin("Map Setup", mapstorage, gd_canvas),
    6   newmapwin("Creating new map", gd_canvas), gd_canvas(mapstorage, mapwin, (Gtk::Window *)this)
     5  newmapwin("Creating new map", gd_canvas),
     6  mapwin("Map Setup", mapstorage, gd_canvas, newmapwin),
     7  gd_canvas(mapstorage, mapwin, (Gtk::Window *)this)
    78{
    89  set_title ("unsaved file - " + prog_name);
  • gui/main_win.h

    r1650 r1733  
    2626
    2727protected:
     28  ///We need to store newmapwin, to be able to set the appropriate values for properties of new map.
     29  NewMapWin newmapwin;
     30
    2831  ///Window of map-showing setup. Its type is \ref MapWin
    2932  MapWin mapwin;
    30 
    31   ///We need to store newmapwin, to be able to set the appropriate values for properties of new map.
    32   NewMapWin newmapwin;
    3333
    3434  ///The graph will be drawn on this \ref GraphDisplayerCanvas
  • gui/map_win.cc

    r1731 r1733  
    1111}
    1212
    13 MapWin::MapWin(const std::string& title, MapStorage & mapst, GraphDisplayerCanvas & grdispc):gdc(grdispc),ms(mapst)
     13MapWin::MapWin(const std::string& title, MapStorage & mapst, GraphDisplayerCanvas & grdispc, NewMapWin & newmapwin):gdc(grdispc),ms(mapst), nmw(newmapwin)
    1414{
    1515  set_title(title);
     
    2424  for(int i=0;i<EDGE_PROPERTY_NUM;i++)
    2525  {
    26     e_combo_array[i]=new MapSelector(gdc, ms, *this, i, true);
     26    e_combo_array[i]=new MapSelector(gdc, ms, nmw, i, true);
    2727
    2828    (*table).attach((*(e_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
     
    4141  for(int i=0;i<NODE_PROPERTY_NUM;i++)
    4242  {
    43     n_combo_array[i]=new MapSelector(gdc, ms, *this, i, false);
     43    n_combo_array[i]=new MapSelector(gdc, ms, nmw, i, false);
    4444
    4545    (*table).attach((*(n_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
     
    102102  {
    103103    //filling in combo box with choices
    104     e_combo_array[i]->append_text((Glib::ustring)newmapname);
     104    n_combo_array[i]->append_text((Glib::ustring)newmapname);
    105105  }
    106106  //setting text property for the new map
  • gui/map_win.h

    r1731 r1733  
    99#include "graph_displayer_canvas.h"
    1010#include "mapstorage.h"
     11#include "new_map_win.h"
    1112#include "mapselector.h"
    1213#include <libgnomecanvasmm.h>
     
    2829  MapStorage & ms;
    2930
     31  NewMapWin & nmw;
     32
    3033  Gtk::Table * table;
    3134 
     
    3841public:
    3942  ///Constructor of MapWin creates the widgets shown in MapWin.
    40   MapWin(const std::string& title, MapStorage &, GraphDisplayerCanvas &);
     43  MapWin(const std::string& title, MapStorage &, GraphDisplayerCanvas &, NewMapWin &);
    4144
    4245  ///This function is created to set the appropriate maps on the newly created node
  • gui/mapselector.cc

    r1731 r1733  
    11#include "mapselector.h"
    22
    3 MapSelector::MapSelector(GraphDisplayerCanvas & grdispc, MapStorage & mapst, MapWin & mapw, int identifier, bool edge):gdc(grdispc),ms(mapst),mw(mapw),id(identifier),itisedge(edge),default_state(true),node_to_update(INVALID),edge_to_update(INVALID)
     3MapSelector::MapSelector(GraphDisplayerCanvas & grdispc, MapStorage & mapst, NewMapWin & newmapw, int identifier, bool edge):gdc(grdispc),ms(mapst),nmw(newmapw),id(identifier),itisedge(edge),default_state(true),node_to_update(INVALID),edge_to_update(INVALID)
    44{
    55  update_list();
     
    3434
    3535  newbut=new Gtk::Button(Gtk::Stock::NEW);
     36
     37  newbut->signal_pressed().connect
     38    (
     39     sigc::mem_fun(nmw, &NewMapWin::show)
     40     );
    3641
    3742  add(*label);
  • gui/mapselector.h

    r1731 r1733  
    88#include "all_include.h"
    99#include "mapstorage.h"
    10 #include "map_win.h"
     10#include "new_map_win.h"
    1111#include "graph_displayer_canvas.h"
    1212#include <libgnomecanvasmm.h>
     
    1919  ///The \ref MapStorage in which the visualizable maps are stored
    2020  MapStorage & ms;
    21   MapWin & mw;
     21  NewMapWin & nmw;
    2222
    2323  int id;
     
    4141public:
    4242
    43   MapSelector(GraphDisplayerCanvas &, MapStorage &, MapWin &, int, bool);
     43  MapSelector(GraphDisplayerCanvas &, MapStorage &, NewMapWin &, int, bool);
    4444
    4545  void update_list();
Note: See TracChangeset for help on using the changeset viewer.