main_win.cc
changeset 157 7e6ad28aeb9e
parent 156 c5cdf6690cdf
child 158 aa50a64b3a6e
equal deleted inserted replaced
44:bff37a44a21b 45:5a447597312e
   206   auto_scale = new Gtk::CheckButton("Autoscale");
   206   auto_scale = new Gtk::CheckButton("Autoscale");
   207   auto_scale->set_active(false);
   207   auto_scale->set_active(false);
   208   auto_scale->signal_toggled().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
   208   auto_scale->signal_toggled().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
   209   table2.attach(*auto_scale, 0,2,0,1);
   209   table2.attach(*auto_scale, 0,2,0,1);
   210 
   210 
   211   Gtk::Label * unit_label= new Gtk::Label("Unit:");
   211   Gtk::Label * width_label= new Gtk::Label("Edge Width:");
   212 //   table2.attach(*unit_label, 2,3,0,1);
   212   table2.attach(*width_label, 0,1,1,2);
   213   
   213   
   214   Gtk::Adjustment * adjustment_unit=new Gtk::Adjustment(20, 5, 200, 5, 10);
   214   Gtk::Adjustment * adjustment_width=new Gtk::Adjustment(20, 1, 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);
       
   222   
   215   
   223   Gtk::Adjustment * adjustment_min=new Gtk::Adjustment(20, 5, 200, 5, 10);
   216   edge_width = new Gtk::SpinButton(*adjustment_width, 5,0);
   224 
   217   edge_width->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
   225   radius_min = new Gtk::SpinButton(*adjustment_min, 5,0);
   218   table2.attach(*edge_width, 1,2,1,2);
   226   radius_min->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
   219 
   227 //   table2.attach(*radius_min, 1,2,1,2);
   220   Gtk::Label * radius_label= new Gtk::Label("Node Radius:");
   228 
   221   table2.attach(*radius_label, 2,3,1,2);
   229   Gtk::Label * max_label= new Gtk::Label("Size:");
       
   230   table2.attach(*max_label, 2,3,1,2);
       
   231   
   222   
   232   Gtk::Adjustment * adjustment_max=new Gtk::Adjustment(20, 0, 200, 5, 10);
   223   Gtk::Adjustment * adjustment_radius=new Gtk::Adjustment(20, 0, 500, 5, 10);
   233 
   224 
   234   radius_max = new Gtk::SpinButton(*adjustment_max, 5,0);
   225   radius_size = new Gtk::SpinButton(*adjustment_radius, 5,0);
   235   radius_max->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
   226   radius_size->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
   236   table2.attach(*radius_max, 3,4,1,2);
   227   table2.attach(*radius_size, 3,4,1,2);
   237 
   228 
   238   zoom_track = new Gtk::CheckButton("Zoom tracking");
   229   zoom_track = new Gtk::CheckButton("Zoom tracking");
   239   zoom_track->set_active(false);
   230   zoom_track->set_active(false);
   240   zoom_track->signal_toggled().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
   231   zoom_track->signal_toggled().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
   241   table2.attach(*zoom_track, 2,4,0,1);
   232   table2.attach(*zoom_track, 2,4,0,1);
   242 
   233 
   243 
   234 
   244   //vbox.pack_start(hbox, Gtk::PACK_SHRINK);
       
   245   table.attach(table2, 1, 2, 0, 2, Gtk::SHRINK, Gtk::SHRINK);
   235   table.attach(table2, 1, 2, 0, 2, Gtk::SHRINK, Gtk::SHRINK);
   246 
   236 
   247   tooltips.set_tip(*(uim->get_widget("/ToolBar/CreateNode")),"Create Node");
   237   tooltips.set_tip(*(uim->get_widget("/ToolBar/CreateNode")),"Create Node");
   248   tooltips.enable();
   238   tooltips.enable();
   249 
   239 
   250   active_tab=-1;
   240   active_tab=-1;
   251   notebook.signal_switch_page().connect(sigc::mem_fun(*this, &MainWin::onChangeTab));
   241   notebook.signal_switch_page().connect(sigc::mem_fun(*this, &MainWin::onChangeTab));
   252 
   242 
   253   active_tool = MOVE;
   243   active_tool = MOVE;
   254 
   244 
   255   //vbox.pack_start(notebook);
       
   256   table.attach(notebook,0,2,2,3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL);
   245   table.attach(notebook,0,2,2,3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL);
   257   
   246   
   258   show_all_children();
   247   show_all_children();
   259 }
   248 }
   260 
   249 
   366   active_tab=page_num;
   355   active_tab=page_num;
   367   tabs[active_tab]->gd_canvas->changeEditorialTool(active_tool);
   356   tabs[active_tab]->gd_canvas->changeEditorialTool(active_tool);
   368   set_title(tabnames[active_tab]);
   357   set_title(tabnames[active_tab]);
   369   bool autoscale;
   358   bool autoscale;
   370   bool zoomtrack;
   359   bool zoomtrack;
   371   double min;
   360   double width;
   372   double max;
   361   double radius;
   373   double unit;
   362   double unit;
   374   tabs[active_tab]->getNodeView(autoscale, zoomtrack, min, max, unit);
   363   tabs[active_tab]->getView(autoscale, zoomtrack, width, radius);
   375   radius_min->set_value(min);
   364   edge_width->set_value(width);
   376   radius_max->set_value(max);
   365   radius_size->set_value(radius);
   377   radius_unit->set_value(unit);
       
   378   zoom_track->set_active(zoomtrack);
   366   zoom_track->set_active(zoomtrack);
   379   auto_scale->set_active(autoscale);
   367   auto_scale->set_active(autoscale);
   380 
   368 
   381 }
   369 }
   382 
   370 
   541 }
   529 }
   542 
   530 
   543 
   531 
   544 void MainWin::nodeViewChanged()
   532 void MainWin::nodeViewChanged()
   545 {
   533 {
   546   double min=radius_min->get_value();
   534   double width=edge_width->get_value();
   547   double max=radius_max->get_value();
   535   double radius=radius_size->get_value();
   548   double unit=radius_unit->get_value();
   536   double unit;
   549   bool zoomtrack=zoom_track->get_active();
   537   bool zoomtrack=zoom_track->get_active();
   550   bool autoscale=auto_scale->get_active();
   538   bool autoscale=auto_scale->get_active();
   551   tabs[active_tab]->setNodeView(autoscale, zoomtrack, min, max, unit);
   539   tabs[active_tab]->setView(autoscale, zoomtrack, width, radius);
   552 }
   540 }