main_win.cc
changeset 157 7e6ad28aeb9e
parent 156 c5cdf6690cdf
child 158 aa50a64b3a6e
     1.1 --- a/main_win.cc	Thu Sep 28 14:32:40 2006 +0000
     1.2 +++ b/main_win.cc	Mon Oct 02 18:52:00 2006 +0000
     1.3 @@ -208,32 +208,23 @@
     1.4    auto_scale->signal_toggled().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
     1.5    table2.attach(*auto_scale, 0,2,0,1);
     1.6  
     1.7 -  Gtk::Label * unit_label= new Gtk::Label("Unit:");
     1.8 -//   table2.attach(*unit_label, 2,3,0,1);
     1.9 +  Gtk::Label * width_label= new Gtk::Label("Edge Width:");
    1.10 +  table2.attach(*width_label, 0,1,1,2);
    1.11    
    1.12 -  Gtk::Adjustment * adjustment_unit=new Gtk::Adjustment(20, 5, 200, 5, 10);
    1.13 +  Gtk::Adjustment * adjustment_width=new Gtk::Adjustment(20, 1, 200, 5, 10);
    1.14 +  
    1.15 +  edge_width = new Gtk::SpinButton(*adjustment_width, 5,0);
    1.16 +  edge_width->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
    1.17 +  table2.attach(*edge_width, 1,2,1,2);
    1.18  
    1.19 -  radius_unit = new Gtk::SpinButton(*adjustment_unit, 5,0);
    1.20 -  radius_unit->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
    1.21 -//   table2.attach(*radius_unit, 3,4,0,1);
    1.22 +  Gtk::Label * radius_label= new Gtk::Label("Node Radius:");
    1.23 +  table2.attach(*radius_label, 2,3,1,2);
    1.24 +  
    1.25 +  Gtk::Adjustment * adjustment_radius=new Gtk::Adjustment(20, 0, 500, 5, 10);
    1.26  
    1.27 -  Gtk::Label * min_label= new Gtk::Label("Min:");
    1.28 -//   table2.attach(*min_label, 0,1,1,2);
    1.29 -  
    1.30 -  Gtk::Adjustment * adjustment_min=new Gtk::Adjustment(20, 5, 200, 5, 10);
    1.31 -
    1.32 -  radius_min = new Gtk::SpinButton(*adjustment_min, 5,0);
    1.33 -  radius_min->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
    1.34 -//   table2.attach(*radius_min, 1,2,1,2);
    1.35 -
    1.36 -  Gtk::Label * max_label= new Gtk::Label("Size:");
    1.37 -  table2.attach(*max_label, 2,3,1,2);
    1.38 -  
    1.39 -  Gtk::Adjustment * adjustment_max=new Gtk::Adjustment(20, 0, 200, 5, 10);
    1.40 -
    1.41 -  radius_max = new Gtk::SpinButton(*adjustment_max, 5,0);
    1.42 -  radius_max->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
    1.43 -  table2.attach(*radius_max, 3,4,1,2);
    1.44 +  radius_size = new Gtk::SpinButton(*adjustment_radius, 5,0);
    1.45 +  radius_size->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
    1.46 +  table2.attach(*radius_size, 3,4,1,2);
    1.47  
    1.48    zoom_track = new Gtk::CheckButton("Zoom tracking");
    1.49    zoom_track->set_active(false);
    1.50 @@ -241,7 +232,6 @@
    1.51    table2.attach(*zoom_track, 2,4,0,1);
    1.52  
    1.53  
    1.54 -  //vbox.pack_start(hbox, Gtk::PACK_SHRINK);
    1.55    table.attach(table2, 1, 2, 0, 2, Gtk::SHRINK, Gtk::SHRINK);
    1.56  
    1.57    tooltips.set_tip(*(uim->get_widget("/ToolBar/CreateNode")),"Create Node");
    1.58 @@ -252,7 +242,6 @@
    1.59  
    1.60    active_tool = MOVE;
    1.61  
    1.62 -  //vbox.pack_start(notebook);
    1.63    table.attach(notebook,0,2,2,3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL);
    1.64    
    1.65    show_all_children();
    1.66 @@ -368,13 +357,12 @@
    1.67    set_title(tabnames[active_tab]);
    1.68    bool autoscale;
    1.69    bool zoomtrack;
    1.70 -  double min;
    1.71 -  double max;
    1.72 +  double width;
    1.73 +  double radius;
    1.74    double unit;
    1.75 -  tabs[active_tab]->getNodeView(autoscale, zoomtrack, min, max, unit);
    1.76 -  radius_min->set_value(min);
    1.77 -  radius_max->set_value(max);
    1.78 -  radius_unit->set_value(unit);
    1.79 +  tabs[active_tab]->getView(autoscale, zoomtrack, width, radius);
    1.80 +  edge_width->set_value(width);
    1.81 +  radius_size->set_value(radius);
    1.82    zoom_track->set_active(zoomtrack);
    1.83    auto_scale->set_active(autoscale);
    1.84  
    1.85 @@ -543,10 +531,10 @@
    1.86  
    1.87  void MainWin::nodeViewChanged()
    1.88  {
    1.89 -  double min=radius_min->get_value();
    1.90 -  double max=radius_max->get_value();
    1.91 -  double unit=radius_unit->get_value();
    1.92 +  double width=edge_width->get_value();
    1.93 +  double radius=radius_size->get_value();
    1.94 +  double unit;
    1.95    bool zoomtrack=zoom_track->get_active();
    1.96    bool autoscale=auto_scale->get_active();
    1.97 -  tabs[active_tab]->setNodeView(autoscale, zoomtrack, min, max, unit);
    1.98 +  tabs[active_tab]->setView(autoscale, zoomtrack, width, radius);
    1.99  }