- rows->start_row();
- add(*(lbl1 = new GLtk::Label("Number")));
- rows->add_constraint(*lbl1, GLtk::Layout::COPY_WIDTH, *lbl2);
- add(*(ent_number = new GLtk::Entry(lexical_cast<string>(zone.get_number()))));
- ent_number->set_edit_size(4, 1);
+ {
+ GLtk::Row row(*layout);
+ add(*(lbl2 = new GLtk::Label("Up towards")));
+ layout->add_constraint(*lbl1, GLtk::Layout::COPY_WIDTH, *lbl2);
+ add(*(drp_up_direction = new GLtk::Dropdown(up_directions)));
+
+ up_directions.append(0);
+
+ Track *up = zone.get_end(TrackChain::UP).next().track();
+ if(!up)
+ drp_up_direction->set_selected_index(0);
+
+ for(unsigned i=0; i<2; ++i)
+ if(TrackIter iter = zone.get_end(i).next())
+ {
+ up_directions.append(iter.track());
+ if(iter.track()==up)
+ drp_up_direction->set_selected_index(up_directions.size()-1);
+ }
+ }
+
+ {
+ 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<string> &data = dynamic_cast<GLtk::ListDataStore<string> &>(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);
+ }
+ }