main_win.cc
changeset 156 c5cdf6690cdf
parent 155 74065e83844d
child 157 7e6ad28aeb9e
equal deleted inserted replaced
43:25d2727b01a5 44:bff37a44a21b
   197     //hbox.pack_start(*toolbar, Gtk::PACK_EXPAND_WIDGET);
   197     //hbox.pack_start(*toolbar, Gtk::PACK_EXPAND_WIDGET);
   198 
   198 
   199     table.attach(*toolbar, 0, 1, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
   199     table.attach(*toolbar, 0, 1, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
   200 
   200 
   201   }
   201   }
   202 
   202  
   203   auto_scale= new Gtk::CheckButton("Autoscale");
   203   table2.set_row_spacings(10);
       
   204   table2.set_col_spacings(5);
       
   205 
       
   206   auto_scale = new Gtk::CheckButton("Autoscale");
   204   auto_scale->set_active(false);
   207   auto_scale->set_active(false);
   205   auto_scale->signal_toggled().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
   208   auto_scale->signal_toggled().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
   206 
       
   207   table2.set_row_spacings(10);
       
   208   table2.set_col_spacings(5);
       
   209 
       
   210   table2.attach(*auto_scale, 0,2,0,1);
   209   table2.attach(*auto_scale, 0,2,0,1);
   211  
   210 
   212   Gtk::Label * unit_label= new Gtk::Label("Unit:");
   211   Gtk::Label * unit_label= new Gtk::Label("Unit:");
   213 //   table2.attach(*unit_label, 2,3,0,1);
   212 //   table2.attach(*unit_label, 2,3,0,1);
   214   
   213   
   215   Gtk::Adjustment * adjustment_unit=new Gtk::Adjustment(20, 5, 200, 5, 10);
   214   Gtk::Adjustment * adjustment_unit=new Gtk::Adjustment(20, 5, 200, 5, 10);
   216 
   215 
   233   Gtk::Adjustment * adjustment_max=new Gtk::Adjustment(20, 0, 200, 5, 10);
   232   Gtk::Adjustment * adjustment_max=new Gtk::Adjustment(20, 0, 200, 5, 10);
   234 
   233 
   235   radius_max = new Gtk::SpinButton(*adjustment_max, 5,0);
   234   radius_max = new Gtk::SpinButton(*adjustment_max, 5,0);
   236   radius_max->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
   235   radius_max->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
   237   table2.attach(*radius_max, 3,4,1,2);
   236   table2.attach(*radius_max, 3,4,1,2);
       
   237 
       
   238   zoom_track = new Gtk::CheckButton("Zoom tracking");
       
   239   zoom_track->set_active(false);
       
   240   zoom_track->signal_toggled().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged));
       
   241   table2.attach(*zoom_track, 2,4,0,1);
       
   242 
   238 
   243 
   239   //vbox.pack_start(hbox, Gtk::PACK_SHRINK);
   244   //vbox.pack_start(hbox, Gtk::PACK_SHRINK);
   240   table.attach(table2, 1, 2, 0, 2, Gtk::SHRINK, Gtk::SHRINK);
   245   table.attach(table2, 1, 2, 0, 2, Gtk::SHRINK, Gtk::SHRINK);
   241 
   246 
   242   tooltips.set_tip(*(uim->get_widget("/ToolBar/CreateNode")),"Create Node");
   247   tooltips.set_tip(*(uim->get_widget("/ToolBar/CreateNode")),"Create Node");
   360   page=page;
   365   page=page;
   361   active_tab=page_num;
   366   active_tab=page_num;
   362   tabs[active_tab]->gd_canvas->changeEditorialTool(active_tool);
   367   tabs[active_tab]->gd_canvas->changeEditorialTool(active_tool);
   363   set_title(tabnames[active_tab]);
   368   set_title(tabnames[active_tab]);
   364   bool autoscale;
   369   bool autoscale;
       
   370   bool zoomtrack;
   365   double min;
   371   double min;
   366   double max;
   372   double max;
   367   double unit;
   373   double unit;
   368   tabs[active_tab]->getNodeView(autoscale, min, max, unit);
   374   tabs[active_tab]->getNodeView(autoscale, zoomtrack, min, max, unit);
   369   radius_min->set_value(min);
   375   radius_min->set_value(min);
   370   radius_max->set_value(max);
   376   radius_max->set_value(max);
   371   radius_unit->set_value(unit);
   377   radius_unit->set_value(unit);
       
   378   zoom_track->set_active(zoomtrack);
   372   auto_scale->set_active(autoscale);
   379   auto_scale->set_active(autoscale);
   373 
   380 
   374 }
   381 }
   375 
   382 
   376 void MainWin::newFile()
   383 void MainWin::newFile()
   537 void MainWin::nodeViewChanged()
   544 void MainWin::nodeViewChanged()
   538 {
   545 {
   539   double min=radius_min->get_value();
   546   double min=radius_min->get_value();
   540   double max=radius_max->get_value();
   547   double max=radius_max->get_value();
   541   double unit=radius_unit->get_value();
   548   double unit=radius_unit->get_value();
       
   549   bool zoomtrack=zoom_track->get_active();
   542   bool autoscale=auto_scale->get_active();
   550   bool autoscale=auto_scale->get_active();
   543   tabs[active_tab]->setNodeView(autoscale, min, max, unit);
   551   tabs[active_tab]->setNodeView(autoscale, zoomtrack, min, max, unit);
   544 }
   552 }