diff -r d79a71382836 -r 65c1b103443d main_win.cc --- a/main_win.cc Mon Sep 25 12:08:35 2006 +0000 +++ b/main_win.cc Mon Sep 25 15:30:04 2006 +0000 @@ -11,7 +11,8 @@ { set_title ("no file"); set_default_size(WIN_WIDTH,WIN_HEIGHT); - add(vbox); + //add(vbox); + add(table); // custom icons for the toolbar Glib::RefPtr p_icon_factory = Gtk::IconFactory::create(); @@ -185,16 +186,59 @@ Gtk::Widget* menubar = uim->get_widget("/MenuBar"); if (menubar){ - vbox.pack_start(*menubar, Gtk::PACK_SHRINK); + //vbox.pack_start(*menubar, Gtk::PACK_SHRINK); + table.attach(*menubar, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); } Gtk::Widget* toolbar = uim->get_widget("/ToolBar"); if (toolbar) { static_cast(toolbar)->set_toolbar_style(Gtk::TOOLBAR_ICONS); - vbox.pack_start(*toolbar, Gtk::PACK_SHRINK); + //hbox.pack_start(*toolbar, Gtk::PACK_EXPAND_WIDGET); + + table.attach(*toolbar, 0, 1, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); + } + auto_scale= new Gtk::CheckButton("Autoscale"); + auto_scale->set_active(false); + auto_scale->signal_toggled().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged)); + + table2.set_row_spacings(10); + table2.set_col_spacings(5); + + table2.attach(*auto_scale, 0,2,0,1); + + Gtk::Label * unit_label= new Gtk::Label("Unit:"); + table2.attach(*unit_label, 2,3,0,1); + + Gtk::Adjustment * adjustment_unit=new Gtk::Adjustment(20, 5, 200, 5, 10); + + radius_unit = new Gtk::SpinButton(*adjustment_unit, 5,0); + radius_unit->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged)); + table2.attach(*radius_unit, 3,4,0,1); + + Gtk::Label * min_label= new Gtk::Label("Min:"); + table2.attach(*min_label, 0,1,1,2); + + Gtk::Adjustment * adjustment_min=new Gtk::Adjustment(20, 5, 200, 5, 10); + + radius_min = new Gtk::SpinButton(*adjustment_min, 5,0); + radius_min->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged)); + table2.attach(*radius_min, 1,2,1,2); + + Gtk::Label * max_label= new Gtk::Label("Max:"); + table2.attach(*max_label, 2,3,1,2); + + Gtk::Adjustment * adjustment_max=new Gtk::Adjustment(20, 5, 200, 5, 10); + + radius_max = new Gtk::SpinButton(*adjustment_max, 5,0); + radius_max->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged)); + table2.attach(*radius_max, 3,4,1,2); + + //vbox.pack_start(hbox, Gtk::PACK_SHRINK); + table.attach(table2, 1, 2, 0, 2, Gtk::SHRINK, Gtk::SHRINK); + tooltips.set_tip(*(uim->get_widget("/ToolBar/CreateNode")),"Create Node"); tooltips.enable(); @@ -203,7 +247,8 @@ active_tool = MOVE; - vbox.pack_start(notebook); + //vbox.pack_start(notebook); + table.attach(notebook,0,2,2,3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL); show_all_children(); } @@ -316,6 +361,16 @@ active_tab=page_num; tabs[active_tab]->gd_canvas->changeEditorialTool(active_tool); set_title(tabnames[active_tab]); + bool autoscale; + double min; + double max; + double unit; + tabs[active_tab]->getNodeView(autoscale, min, max, unit); + radius_min->set_value(min); + radius_max->set_value(max); + radius_unit->set_value(unit); + auto_scale->set_active(autoscale); + } void MainWin::newFile() @@ -477,3 +532,13 @@ NewMapWin * nmw=new NewMapWin(_("Create New Map - ")+tabnames[i], *nbt, itisedge, false); nmw->run(); } + + +void MainWin::nodeViewChanged() +{ + double min=radius_min->get_value(); + double max=radius_max->get_value(); + double unit=radius_unit->get_value(); + bool autoscale=auto_scale->get_active(); + tabs[active_tab]->setNodeView(autoscale, min, max, unit); +}