Changeset 154:65c1b103443d in glemon-0.x for main_win.cc
- Timestamp:
- 09/25/06 17:30:04 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@2958
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main_win.cc
r149 r154 12 12 set_title ("no file"); 13 13 set_default_size(WIN_WIDTH,WIN_HEIGHT); 14 add(vbox); 14 //add(vbox); 15 add(table); 15 16 16 17 // custom icons for the toolbar … … 186 187 Gtk::Widget* menubar = uim->get_widget("/MenuBar"); 187 188 if (menubar){ 188 vbox.pack_start(*menubar, Gtk::PACK_SHRINK); 189 //vbox.pack_start(*menubar, Gtk::PACK_SHRINK); 190 table.attach(*menubar, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); 189 191 } 190 192 … … 193 195 { 194 196 static_cast<Gtk::Toolbar*>(toolbar)->set_toolbar_style(Gtk::TOOLBAR_ICONS); 195 vbox.pack_start(*toolbar, Gtk::PACK_SHRINK); 197 //hbox.pack_start(*toolbar, Gtk::PACK_EXPAND_WIDGET); 198 199 table.attach(*toolbar, 0, 1, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); 200 196 201 } 202 203 auto_scale= new Gtk::CheckButton("Autoscale"); 204 auto_scale->set_active(false); 205 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); 211 212 Gtk::Label * unit_label= new Gtk::Label("Unit:"); 213 table2.attach(*unit_label, 2,3,0,1); 214 215 Gtk::Adjustment * adjustment_unit=new Gtk::Adjustment(20, 5, 200, 5, 10); 216 217 radius_unit = new Gtk::SpinButton(*adjustment_unit, 5,0); 218 radius_unit->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged)); 219 table2.attach(*radius_unit, 3,4,0,1); 220 221 Gtk::Label * min_label= new Gtk::Label("Min:"); 222 table2.attach(*min_label, 0,1,1,2); 223 224 Gtk::Adjustment * adjustment_min=new Gtk::Adjustment(20, 5, 200, 5, 10); 225 226 radius_min = new Gtk::SpinButton(*adjustment_min, 5,0); 227 radius_min->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged)); 228 table2.attach(*radius_min, 1,2,1,2); 229 230 Gtk::Label * max_label= new Gtk::Label("Max:"); 231 table2.attach(*max_label, 2,3,1,2); 232 233 Gtk::Adjustment * adjustment_max=new Gtk::Adjustment(20, 5, 200, 5, 10); 234 235 radius_max = new Gtk::SpinButton(*adjustment_max, 5,0); 236 radius_max->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged)); 237 table2.attach(*radius_max, 3,4,1,2); 238 239 //vbox.pack_start(hbox, Gtk::PACK_SHRINK); 240 table.attach(table2, 1, 2, 0, 2, Gtk::SHRINK, Gtk::SHRINK); 197 241 198 242 tooltips.set_tip(*(uim->get_widget("/ToolBar/CreateNode")),"Create Node"); … … 204 248 active_tool = MOVE; 205 249 206 vbox.pack_start(notebook); 250 //vbox.pack_start(notebook); 251 table.attach(notebook,0,2,2,3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL); 207 252 208 253 show_all_children(); … … 317 362 tabs[active_tab]->gd_canvas->changeEditorialTool(active_tool); 318 363 set_title(tabnames[active_tab]); 364 bool autoscale; 365 double min; 366 double max; 367 double unit; 368 tabs[active_tab]->getNodeView(autoscale, min, max, unit); 369 radius_min->set_value(min); 370 radius_max->set_value(max); 371 radius_unit->set_value(unit); 372 auto_scale->set_active(autoscale); 373 319 374 } 320 375 … … 478 533 nmw->run(); 479 534 } 535 536 537 void MainWin::nodeViewChanged() 538 { 539 double min=radius_min->get_value(); 540 double max=radius_max->get_value(); 541 double unit=radius_unit->get_value(); 542 bool autoscale=auto_scale->get_active(); 543 tabs[active_tab]->setNodeView(autoscale, min, max, unit); 544 }
Note: See TracChangeset
for help on using the changeset viewer.