}
}
-void DeparturesDialog::group_selected(unsigned index)
+void DeparturesDialog::set_group(const string &group)
{
- const string &group = groups.get(index);
+ int index = groups.find(group);
+ if(index<0)
+ throw key_error(group);
+ drp_groups->set_selected_index(index);
+
lbl_title->set_text("Departures from "+group);
for(vector<Row>::iterator i=rows.begin(); i!=rows.end(); ++i)
update_rows();
}
+void DeparturesDialog::group_selected(unsigned index)
+{
+ set_group(groups.get(index));
+}
+
void DeparturesDialog::update_rows()
{
const list<Departures::Departure> &deps = departures->get_departures();
public:
DeparturesDialog(const R2C2::Layout &, const std::string & = std::string());
+ void set_group(const std::string &);
+
private:
void group_selected(unsigned);
void update_rows();
void TrainDialog::expand_clicked()
{
- pnl_expander->set_visible(!pnl_expander->is_visible());
- btn_expand->set_style(pnl_expander->is_visible() ? "arrow_up" : "arrow_down");
+ set_expanded(!pnl_expander->is_visible());
+}
+
+void TrainDialog::set_expanded(bool e)
+{
+ pnl_expander->set_visible(e);
+ btn_expand->set_style(e ? "arrow_up" : "arrow_down");
signal_autosize_changed.emit();
find_ancestor<GLtk::Root>()->get_layout()->update();
}
void update_forward(bool);
void ui_forward_toggled(bool);
void expand_clicked();
+ void set_expanded(bool);
void toggle_panel(bool, Msp::GLtk::Panel *);
};