//! evaluate attribs button
void Menu::evaluateAttribs(Gui::GuiElement* elem){
  Model* mdl = Graphic::instance()->getCurrModel();
  if (!mdl)
    return;
  Dialog* dia = dynamic_cast<Dialog*>(elem->getParent());
  InputField* in = dynamic_cast<InputField*>(dia->getElement(1));
  int att = Editor::instance()->attribValue(in->getText());
  mdl->setAttrib(0,att);
  in = dynamic_cast<InputField*>(dia->getElement(2));
  att = Editor::instance()->attribValue(in->getText());
  mdl->setAttrib(1,att);
  in = dynamic_cast<InputField*>(dia->getElement(3));
  att = Editor::instance()->attribValue(in->getText());
  mdl->setAttrib(2,att);
  in = dynamic_cast<InputField*>(dia->getElement(4));
  att = Editor::instance()->attribValue(in->getText());
  mdl->setAttrib(3,att);
  in = dynamic_cast<InputField*>(dia->getElement(5));
  att = Editor::instance()->attribValue(in->getText());
  mdl->setAttrib(4,att);
  in = dynamic_cast<InputField*>(dia->getElement(6));
  att = Editor::instance()->attribValue(in->getText());
  mdl->setAttrib(5,att);
  in = dynamic_cast<InputField*>(dia->getElement(7));
  att = Editor::instance()->attribValue(in->getText());
  mdl->setAttrib(6,att);
  in = dynamic_cast<InputField*>(dia->getElement(8));
  att = Editor::instance()->attribValue(in->getText());
  mdl->setAttrib(7,att);
}
void Menu::changeOptions(Gui::GuiElement* elem){
  Dialog* dia = dynamic_cast<Dialog*>(elem->getParent());
  //The edit plane
  DropDownButton* dd = dynamic_cast<DropDownButton*>(dia->getElement(0));
  Editor::Plane plane = (Editor::Plane)dd->getSelection();
  Editor::instance()->setEditPlane(plane);
  //The translation step
  InputField* input = dynamic_cast<InputField*>(dia->getElement(1));
  float step = toFloat(input->getText());
  Editor::instance()->setGridStep(step);
}
//! Get the relative path to the file
std::string FileDialog::getRelFile() const{
  InputField* inp = dynamic_cast<InputField*>(getElement(2));
  return path_+SEPARATOR+inp->getText();
}