X-Git-Url: http://git.tdb.fi/?p=r2c2.git;a=blobdiff_plain;f=source%2Fdesigner%2Fzoneproperties.cpp;h=b1380c5d25f779de3ee627ea4225c2843995ae17;hp=38d9cc792bc9e7f37da6943dc808b3e8a7ee10bd;hb=9a2fd67cec715e371e293be638b126e0d1b2148d;hpb=3907520897611cb1b5f2f938c60d3eaff34477a5 diff --git a/source/designer/zoneproperties.cpp b/source/designer/zoneproperties.cpp index 38d9cc7..b1380c5 100644 --- a/source/designer/zoneproperties.cpp +++ b/source/designer/zoneproperties.cpp @@ -82,6 +82,22 @@ ZoneProperties::ZoneProperties(Zone &z): } } + { + GLtk::Row row(*layout); + add(*(lbl1 = new GLtk::Label("Direction"))); + layout->add_constraint(*lbl1, GLtk::Layout::COPY_WIDTH, *lbl2); + + add(*(drp_preferred_dir = new GLtk::Dropdown)); + GLtk::ListDataStore &data = dynamic_cast &>(drp_preferred_dir->get_data()); + const char *directions[] = { "either", "up", "down", 0 }; + for(unsigned i=0; directions[i]; ++i) + { + data.append(directions[i]); + if(zone.get_preferred_direction()==i) + drp_preferred_dir->set_selected_index(i); + } + } + GLtk::Button *btn; { @@ -111,5 +127,11 @@ void ZoneProperties::on_response(int code) zone.clear_direction(); else zone.set_direction_towards(*up_directions.get(sel), TrackChain::UP); + + if(zone.has_direction()) + { + sel = drp_preferred_dir->get_selected_index(); + zone.set_preferred_direction(static_cast(sel)); + } } }