COIN-OR::LEMON - Graph Library

Changeset 157:7e6ad28aeb9e in glemon-0.x for main_win.cc


Ignore:
Timestamp:
10/02/06 20:52:00 (18 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@2970
Message:

View settings also for edges.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main_win.cc

    r156 r157  
    209209  table2.attach(*auto_scale, 0,2,0,1);
    210210
    211   Gtk::Label * unit_label= new Gtk::Label("Unit:");
    212 //   table2.attach(*unit_label, 2,3,0,1);
     211  Gtk::Label * width_label= new Gtk::Label("Edge Width:");
     212  table2.attach(*width_label, 0,1,1,2);
    213213 
    214   Gtk::Adjustment * adjustment_unit=new Gtk::Adjustment(20, 5, 200, 5, 10);
    215 
    216   radius_unit = new Gtk::SpinButton(*adjustment_unit, 5,0);
    217   radius_unit->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
    218 //   table2.attach(*radius_unit, 3,4,0,1);
    219 
    220   Gtk::Label * min_label= new Gtk::Label("Min:");
    221 //   table2.attach(*min_label, 0,1,1,2);
     214  Gtk::Adjustment * adjustment_width=new Gtk::Adjustment(20, 1, 200, 5, 10);
    222215 
    223   Gtk::Adjustment * adjustment_min=new Gtk::Adjustment(20, 5, 200, 5, 10);
    224 
    225   radius_min = new Gtk::SpinButton(*adjustment_min, 5,0);
    226   radius_min->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
    227 //   table2.attach(*radius_min, 1,2,1,2);
    228 
    229   Gtk::Label * max_label= new Gtk::Label("Size:");
    230   table2.attach(*max_label, 2,3,1,2);
     216  edge_width = new Gtk::SpinButton(*adjustment_width, 5,0);
     217  edge_width->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
     218  table2.attach(*edge_width, 1,2,1,2);
     219
     220  Gtk::Label * radius_label= new Gtk::Label("Node Radius:");
     221  table2.attach(*radius_label, 2,3,1,2);
    231222 
    232   Gtk::Adjustment * adjustment_max=new Gtk::Adjustment(20, 0, 200, 5, 10);
    233 
    234   radius_max = new Gtk::SpinButton(*adjustment_max, 5,0);
    235   radius_max->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
    236   table2.attach(*radius_max, 3,4,1,2);
     223  Gtk::Adjustment * adjustment_radius=new Gtk::Adjustment(20, 0, 500, 5, 10);
     224
     225  radius_size = new Gtk::SpinButton(*adjustment_radius, 5,0);
     226  radius_size->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
     227  table2.attach(*radius_size, 3,4,1,2);
    237228
    238229  zoom_track = new Gtk::CheckButton("Zoom tracking");
     
    242233
    243234
    244   //vbox.pack_start(hbox, Gtk::PACK_SHRINK);
    245235  table.attach(table2, 1, 2, 0, 2, Gtk::SHRINK, Gtk::SHRINK);
    246236
     
    253243  active_tool = MOVE;
    254244
    255   //vbox.pack_start(notebook);
    256245  table.attach(notebook,0,2,2,3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL);
    257246 
     
    369358  bool autoscale;
    370359  bool zoomtrack;
    371   double min;
    372   double max;
     360  double width;
     361  double radius;
    373362  double unit;
    374   tabs[active_tab]->getNodeView(autoscale, zoomtrack, min, max, unit);
    375   radius_min->set_value(min);
    376   radius_max->set_value(max);
    377   radius_unit->set_value(unit);
     363  tabs[active_tab]->getView(autoscale, zoomtrack, width, radius);
     364  edge_width->set_value(width);
     365  radius_size->set_value(radius);
    378366  zoom_track->set_active(zoomtrack);
    379367  auto_scale->set_active(autoscale);
     
    544532void MainWin::nodeViewChanged()
    545533{
    546   double min=radius_min->get_value();
    547   double max=radius_max->get_value();
    548   double unit=radius_unit->get_value();
     534  double width=edge_width->get_value();
     535  double radius=radius_size->get_value();
     536  double unit;
    549537  bool zoomtrack=zoom_track->get_active();
    550538  bool autoscale=auto_scale->get_active();
    551   tabs[active_tab]->setNodeView(autoscale, zoomtrack, min, max, unit);
    552 }
     539  tabs[active_tab]->setView(autoscale, zoomtrack, width, radius);
     540}
Note: See TracChangeset for help on using the changeset viewer.